@memberjunction/ng-ai-test-harness 5.43.0 → 5.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ai-test-harness.component.js","sourceRoot":"","sources":["../../src/lib/ai-test-harness.component.ts","../../src/lib/ai-test-harness.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAA+C,SAAS,EAAgC,eAAe,EAAqB,MAAM,eAAe,CAAC;AACjM,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAIrE,OAAO,EAAY,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAoB,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;ICJ5E,0BAAsF;;;IAAtD,AAA3B,iEAA0B,yCAAkC;;;IAEjE,oBAAsC;;;IAAnC,0CAA8B;;;IAK/B,yBAAG;IAAA,YAAwB;IAAA,iBAAI;;;IAA5B,cAAwB;IAAxB,+CAAwB;;;;IATjC,AADF,8BAAwB,cACK;IAGvB,AAFF,qHAAuB,6FAEd;IAIP,AADF,2BAAK,SACC;IAAA,YAAqB;IAAA,iBAAK;IAC9B,+GAA0B;IAI9B,AADE,iBAAM,EACF;IAEJ,AADF,+BAA4B,iBAKG;IAF3B,yMAAS,0BAAmB,KAAC;IAG7B,yBAAiC;IACjC,wBACF;IAAA,iBAAS;IACT,mCAI4B;IAF1B,0MAAS,yBAAkB,KAAC;IAG5B,yBAAg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C;YAGD,cA0BC;YA1BD,6CA0BC;YAGD,cAoBC;YApBD,oDAoBC;YAGD,cAaC;YAbD,6CAaC;;;iFD5vBY,sBAAsB;cANlC,SAAS;6BACI,KAAK,YACL,oBAAoB;;kBAiB7B,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAiBL,KAAK;;kBAaL,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAGN,SAAS;mBAAC,mBAAmB;;kBAG7B,SAAS;mBAAC,WAAW;;kBAGrB,SAAS;mBAAC,cAAc;;kBAGxB,SAAS;mBAAC,iBAAiB;;kFAnFnB,sBAAsB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, ViewChild, ElementRef, AfterViewChecked, SecurityContext, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { MJAIAgentEntityExtended, MJAIPromptEntityExtended, MJAIAgentRunEntityExtended, MJAIAgentRunStepEntityExtended, MJAIPromptRunEntityExtended } from \"@memberjunction/ai-core-plus\";\nimport { MJTemplateParamEntity, MJAIConfigurationEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, CompositeKey } from '@memberjunction/core';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { SharedService } from '@memberjunction/ng-shared';\nimport { ChatMessage } from '@memberjunction/ai';\nimport { Subject, Subscription } from 'rxjs';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { ParseJSONRecursive, ParseJSONOptions, UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Supported modes for the test harness\n */\nexport type TestHarnessMode = 'agent' | 'prompt';\n\n/**\n * Result interface for AI agent execution operations.\n * Contains comprehensive information about the execution outcome, timing, and data.\n */\n\n/**\n * Represents a variable in the data context or template data for agent execution.\n * Used to pass dynamic data to agents during testing and execution.\n */\nexport interface DataContextVariable {\n /** Variable name used in agent prompts and templates */\n name: string;\n /** String representation of the variable value */\n value: string;\n /** Data type for proper conversion during execution */\n type: 'string' | 'number' | 'boolean' | 'object';\n}\n\n/**\n * Enhanced chat message interface extending the base ChatMessage from @memberjunction/ai.\n * Includes additional properties for streaming, timing, error handling, and content management.\n */\nexport interface ConversationMessage extends ChatMessage {\n /** Unique identifier for this message */\n id: string;\n /** Timestamp when the message was created */\n timestamp: Date;\n /** Whether this message is currently being streamed */\n isStreaming?: boolean;\n /** Accumulated content during streaming (temporary) */\n streamingContent?: string;\n /** Total execution time for AI-generated messages */\n executionTime?: number;\n /** Associated agent run ID for tracking */\n agentRunId?: string;\n /** Error message if processing failed */\n error?: string;\n /** Original unprocessed content from the AI model */\n rawContent?: string;\n /** Whether to display raw content instead of processed content */\n showRaw?: boolean;\n /** Timestamp when streaming started (for elapsed time calculation) */\n streamingStartTime?: number;\n /** Current elapsed time during streaming */\n elapsedTime?: number;\n /** Whether JSON raw section is expanded in collapsible view */\n showJsonRaw?: boolean;\n /** Payload data from agent execution to display separately */\n payload?: any;\n /** Whether the payload section is collapsed */\n payloadCollapsed?: boolean;\n /** Execution data for agent runs */\n executionData?: any;\n}\n\n/**\n * Represents a saved conversation session with complete state information.\n * Includes all messages, context data, and metadata for restoration.\n */\nexport interface SavedConversation {\n /** Unique identifier for the saved conversation */\n id: string;\n /** User-provided name for the conversation */\n name: string;\n /** ID of the agent used in this conversation */\n agentId: string;\n /** Name of the agent for display purposes */\n agentName: string;\n /** Complete message history */\n messages: ConversationMessage[];\n /** Data context variables used during the conversation */\n dataContext: Record<string, any>;\n /** Template data variables used during the conversation (agent mode) */\n templateData: Record<string, any>;\n /** Template variables used during the conversation (prompt mode) */\n templateVariables?: Record<string, any>;\n /** Advanced parameters used during the conversation (prompt mode) */\n advancedParams?: any;\n /** Selected model ID (prompt mode) */\n selectedModelId?: string;\n /** Selected vendor ID (prompt mode) */\n selectedVendorId?: string;\n /** Selected configuration ID (prompt mode) */\n selectedConfigurationId?: string;\n /** Skip validation setting (prompt mode) */\n skipValidation?: boolean;\n /** Selected configuration ID (agent mode) */\n agentConfigurationId?: string;\n /** When the conversation was first created */\n createdAt: Date;\n /** When the conversation was last modified */\n updatedAt: Date;\n}\n\n/**\n * Comprehensive test harness component for AI Agent development and testing.\n * Provides a full-featured chat interface with conversation management, data context configuration,\n * template data management, streaming responses, conversation persistence, and import/export capabilities.\n * \n * ## Key Features:\n * - **Interactive Chat**: Real-time conversation with AI agents\n * - **Streaming Support**: Live streaming of agent responses with elapsed time tracking\n * - **Data Context Management**: Configure variables passed to agent during execution\n * - **Template Data Management**: Manage template variables for agent prompts\n * - **Conversation Persistence**: Save/load conversations with full state restoration\n * - **Import/Export**: JSON-based conversation backup and sharing\n * - **Content Formatting**: Automatic detection and rendering of Markdown, JSON, and plain text\n * - **Raw Content Toggle**: View both processed and raw AI responses\n * - **Error Handling**: Comprehensive error display and user feedback\n * \n * ## Usage:\n * ```html\n * <mj-ai-agent-test-harness \n * [aiAgent]=\"myAgent\"\n * [isVisible]=\"true\"\n * (visibilityChange)=\"onVisibilityChanged($event)\">\n * </mj-ai-agent-test-harness>\n * ```\n * \n * @example\n * ```typescript\n * // Using with agent entity\n * const agent = await metadata.GetEntityObject<MJAIAgentEntityExtended>('MJ: AI Agents');\n * await agent.Load('agent-id');\n * this.testHarness.aiAgent = agent;\n * this.testHarness.isVisible = true;\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-test-harness',\n templateUrl: './ai-test-harness.component.html',\n styleUrls: ['./ai-test-harness.component.css']\n})\nexport class AITestHarnessComponent extends BaseAngularComponent implements OnInit, OnDestroy, OnChanges, AfterViewChecked {\n /**\n * Creates a new AI Test Harness component instance.\n * @param sanitizer - Angular DomSanitizer for safe HTML rendering of formatted content\n * @param cdr - Angular ChangeDetectorRef for managing change detection\n */\n constructor(\n private sanitizer: DomSanitizer,\n private cdr: ChangeDetectorRef\n ) {\n super();}\n \n /** The mode of operation - either 'agent' or 'prompt' */\n @Input() mode: TestHarnessMode = 'agent';\n \n /** The entity to test - either an AI Agent or AI Prompt */\n @Input() entity: MJAIAgentEntityExtended | MJAIPromptEntityExtended | null = null;\n \n /** The original prompt run ID when re-running a previous prompt execution */\n @Input() originalPromptRunId: string | null = null;\n \n /** The system prompt override to use instead of rendering from template */\n @Input() systemPromptOverride: string | null = null;\n \n /** Whether a re-run has been executed (shows Reset button instead of Re-Run) */\n public hasExecutedRerun: boolean = false;\n \n /** Original messages from the prompt run for reset functionality */\n private originalPromptRunMessages: ConversationMessage[] = [];\n \n /** @deprecated Use 'entity' instead. Kept for backward compatibility. */\n @Input() \n get aiAgent(): MJAIAgentEntityExtended | null {\n return this.isAgentEntity(this.entity) ? this.entity : null;\n }\n set aiAgent(value: MJAIAgentEntityExtended | null) {\n this.entity = value;\n if (value) {\n this.mode = 'agent';\n }\n }\n \n private _isVisible: boolean = false;\n \n /**\n * Controls the visibility of the test harness. When set to true, automatically resets the harness state.\n * This property is typically controlled by parent components or dialog wrappers.\n */\n @Input() \n get isVisible(): boolean {\n return this._isVisible;\n }\n set isVisible(value: boolean) {\n const wasVisible = this._isVisible;\n this._isVisible = value;\n if (value && !wasVisible) {\n this.resetHarness();\n }\n }\n\n /** Event emitted when the visibility state changes, allowing parent components to react */\n @Output() visibilityChange = new EventEmitter<boolean>();\n \n /**\n * Emitted when the user navigates to view a run (agent or prompt)\n */\n @Output() runOpened = new EventEmitter<{ runId: string; runType: 'agent' | 'prompt' }>();\n \n /**\n * Event emitted when the component requests to be minimized (e.g., when navigating to a run)\n */\n @Output() minimizeRequested = new EventEmitter<void>();\n \n /** Reference to the scrollable messages container for auto-scrolling functionality */\n @ViewChild('messagesContainer') private messagesContainer!: ElementRef;\n \n /** Reference to the hidden file input element for conversation import functionality */\n @ViewChild('fileInput') private fileInput!: ElementRef;\n \n /** Reference to the message input textarea */\n @ViewChild('messageInput') private messageInput!: ElementRef<HTMLTextAreaElement>;\n \n /** Reference to the save dialog input */\n @ViewChild('saveDialogInput') private saveDialogInput?: ElementRef;\n\n // === Conversation State ===\n /** Complete array of all messages in the current conversation session */\n public conversationMessages: ConversationMessage[] = [];\n \n /** Current text input by the user (bound to textarea) */\n public currentUserMessage: string = '';\n \n /** Whether an agent execution is currently in progress */\n public isExecuting = false;\n \n // === Data Context Management ===\n /** Unified variables for agent execution (combines data context and template data) */\n public agentVariables: DataContextVariable[] = [];\n \n // === Prompt-specific properties ===\n /** Variables for prompt template rendering */\n public templateVariables: DataContextVariable[] = [];\n \n /** Selected AI model for prompt execution */\n public selectedModelId: string = '';\n \n /** Selected AI vendor for prompt execution */\n public selectedVendorId: string = '';\n \n /** Available AI vendors for the selected model */\n public availableVendors: any[] = [];\n \n /** Selected AI configuration for prompt execution */\n public selectedConfigurationId: string = '';\n \n /** Available AI configurations */\n public availableConfigurations: MJAIConfigurationEntity[] = [];\n \n /** Default model for the prompt (cached for display) */\n private defaultModelName: string = '';\n \n /** Maximum tokens for prompt execution */\n public maxTokens: number | null = null;\n \n /** Whether to skip validation when running prompts */\n public skipValidation: boolean = false;\n \n /** Selected AI configuration for agent execution */\n public agentConfigurationId: string = '';\n \n /** Advanced LLM Parameters */\n public advancedParams = {\n temperature: null as number | null,\n topP: null as number | null,\n topK: null as number | null,\n minP: null as number | null,\n frequencyPenalty: null as number | null,\n presencePenalty: null as number | null,\n seed: null as number | null,\n stopSequences: [] as string[],\n includeLogProbs: false,\n topLogProbs: 2\n };\n \n /** Raw stop sequences input for textarea */\n public stopSequencesText: string = '';\n \n /** Whether advanced parameters panel is expanded */\n public advancedParamsExpanded: boolean = false;\n \n /** Available AI models for prompt execution */\n public availableModels: any[] = [];\n \n /** Available response format options */\n protected responseFormatOptions = [\n { text: 'Any', value: 'Any' },\n { text: 'Text', value: 'Text' },\n { text: 'Markdown', value: 'Markdown' },\n { text: 'JSON', value: 'JSON' },\n { text: 'Model Specific', value: 'ModelSpecific' }\n ];\n\n /** Selected response format for prompt execution */\n public selectedResponseFormat = this.responseFormatOptions[0];\n \n // === UI State Management ===\n /** Whether the configuration sidebar is currently visible */\n public showSidebar = true;\n \n /** Currently active tab in the sidebar */\n public activeTab: 'agentVariables' | 'executionMonitor' | 'agentSettings' | 'templateVariables' | 'modelSettings' | 'savedConversations' = 'agentVariables';\n \n /** Array of saved conversation sessions loaded from localStorage */\n public savedConversations: SavedConversation[] = [];\n \n /** ID of the currently active/loaded conversation, if any */\n public currentConversationId: string | null = null;\n \n /** Flag to control JSON dialog visibility */\n public showJsonDialog: boolean = false;\n \n /** Current JSON content to display in the dialog */\n public currentJsonContent: string = '';\n \n /** Whether the JSON viewer window is visible */\n public showJsonWindow = false;\n \n // === Execution Monitor Properties ===\n /** Mode for the execution monitor component */\n public executionMonitorMode: 'live' | 'historical' = 'historical';\n \n /** Current agent run being displayed in execution monitor */\n public currentAgentRun: MJAIAgentRunEntityExtended | null = null;\n \n /**\n * Tracks agent steps during live execution (deprecated - now using agent run's Steps directly)\n */\n public liveAgentSteps: MJAIAgentRunStepEntityExtended[] = [];\n \n /** Track the last processed run ID to avoid reprocessing same data */\n private lastProcessedRunId: string | null = null;\n \n /** Track the last agent run ID for run chaining */\n private lastAgentRunId: string | null = null;\n \n /** Agent conversation state tracking */\n private agentConversationState: any = null;\n private lastAgentPayload: any = null;\n private subAgentHistory: any[] = [];\n \n /** Whether to show the save conversation dialog */\n public showSaveDialog: boolean = false;\n \n /** Name for the new conversation being saved */\n public newConversationName: string = '';\n \n /** Temporary name for the dialog input to avoid binding conflicts */\n public tempConversationName: string = '';\n \n /** Whether to show the load confirmation dialog */\n public showLoadConfirmDialog: boolean = false;\n \n /** Conversation pending to be loaded */\n private pendingLoadConversation: SavedConversation | null = null;\n \n /** Reference to the current message for JSON display */\n private currentJsonMessage: ConversationMessage | null = null;\n \n // === Private State & Intervals ===\n /** Subject for component destruction cleanup */\n private destroy$ = new Subject<void>();\n \n /** Flag indicating that auto-scroll is needed on next view check */\n private scrollNeeded = false;\n \n \n /** Interval handle for elapsed time counter during streaming */\n private elapsedTimeInterval: any;\n \n /** MemberJunction metadata instance for entity operations */\n private _metadata = this.ProviderToUse;\n \n /** Track if input has been focused to prevent repeated focusing */\n private _hasFocused = false;\n \n /** Subscription to MJGlobal events for streaming updates */\n private _mjGlobalEventSub: Subscription | undefined;\n \n /** Direct GraphQL subscription for agent execution streaming */\n private _agentStreamSub: Subscription | undefined;\n\n /**\n * Component initialization. Loads saved conversations, sets up event subscriptions,\n * and initializes the harness to a clean state.\n */\n async ngOnInit() {\n console.log('🚀 AITestHarnessComponent.ngOnInit');\n console.log('📌 originalPromptRunId:', this.originalPromptRunId);\n console.log('🎯 entity:', this.entity);\n console.log('📊 mode:', this.mode);\n \n // Ensure we have an entity\n if (!this.entity && this.aiAgent) {\n // Handle backward compatibility\n this.entity = this.aiAgent;\n this.mode = 'agent';\n }\n \n this.loadSavedConversations();\n this.subscribeToEvents();\n this.resetHarness();\n \n // Load configurations for both modes\n this.loadAvailableConfigurations();\n \n // If we have a prompt run ID, load the conversation history\n if (this.originalPromptRunId && this.mode === 'prompt') {\n console.log('🔄 Loading from prompt run in ngOnInit');\n await this.loadFromPromptRun(this.originalPromptRunId);\n }\n \n // Load models if in prompt mode\n if (this.mode === 'prompt') {\n this.loadAvailableModels();\n this.loadPromptDefaults();\n this.loadTemplateParameters(); // Load template parameters for pre-population\n }\n }\n\n /**\n * Responds to input property changes, particularly when entity is set/changed\n */\n ngOnChanges(changes: SimpleChanges) {\n if (changes['entity']) {\n if (changes['entity'].currentValue) {\n this.loadSavedConversations();\n }\n }\n \n if (changes['aiAgent']) {\n if (!this.entity && this.aiAgent) {\n this.entity = this.aiAgent;\n this.mode = 'agent';\n this.loadSavedConversations();\n }\n }\n \n if (changes['isVisible']) {\n if (changes['isVisible'].currentValue) {\n // Reset focus flag when dialog becomes visible\n this._hasFocused = false;\n }\n }\n }\n\n /**\n * Component cleanup. Destroys subscriptions and clears any active intervals\n * to prevent memory leaks.\n */\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n }\n if (this._mjGlobalEventSub) {\n this._mjGlobalEventSub.unsubscribe();\n }\n if (this._agentStreamSub) {\n this._agentStreamSub.unsubscribe();\n }\n }\n\n /**\n * Post-view check hook that handles auto-scrolling to the bottom of the message container\n * when new content is added.\n */\n ngAfterViewChecked() {\n if (this.scrollNeeded) {\n this.scrollToBottom();\n this.scrollNeeded = false;\n }\n \n // Auto-focus message input when dialog first becomes visible\n // Use Promise.resolve to schedule this after current change detection cycle\n if (this.isVisible && !this._hasFocused && this.messageInput) {\n this._hasFocused = true;\n Promise.resolve().then(() => {\n this.messageInput?.nativeElement?.focus();\n });\n }\n }\n\n private subscribeToEvents() {\n // Set up direct GraphQL subscription for agent execution stream\n const dataProvider = this.ProviderToUse as GraphQLDataProvider;\n const _providerPushStatusSub = dataProvider.PushStatusUpdates().subscribe(async (status: any) => {\n const message = JSON.parse(status.message || '{}');\n if (message?.resolver === 'RunAIAgentResolver') {\n // Handle different types of streaming messages\n if (message?.type === 'ExecutionProgress' && message.data?.agentRun) {\n // The server should be sending the full serialized agent run\n const serializedAgentRun = message.data.agentRun;\n \n // Update streaming message content if available\n if (message.data.progress?.message) {\n const streamingMessage = this.conversationMessages.find(m => m.isStreaming);\n if (streamingMessage) {\n // Clear any typing animation interval\n const typingInterval = (streamingMessage as any)._typingInterval;\n if (typingInterval) {\n clearInterval(typingInterval);\n delete (streamingMessage as any)._typingInterval;\n }\n \n // Update the streaming content with the status message\n streamingMessage.streamingContent = message.data.progress.message;\n this.scrollNeeded = true;\n }\n }\n \n // Update or create the agent run entity from the serialized data\n if (!this.currentAgentRun) {\n // First time - create the entity\n const md = this.ProviderToUse;\n this.currentAgentRun = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n }\n \n // Load the serialized data into our entity\n await this.currentAgentRun.LoadFromData(serializedAgentRun);\n \n // Update assistant message with agent run ID if available\n const streamingMessage = this.conversationMessages.find(m => m.isStreaming);\n if (streamingMessage && this.currentAgentRun.ID) {\n streamingMessage.agentRunId = this.currentAgentRun.ID;\n }\n \n // We're in live mode during streaming\n this.executionMonitorMode = 'live';\n \n // Pass the steps from the agent run to the execution monitor for live display\n this.liveAgentSteps = this.currentAgentRun.Steps || [];\n \n console.log('📊 Agent run update:', {\n id: this.currentAgentRun.ID,\n status: this.currentAgentRun.Status,\n stepCount: this.currentAgentRun.Steps?.length || 0,\n executionMonitorMode: this.executionMonitorMode,\n steps: this.currentAgentRun.Steps?.map(s => ({\n id: s.ID,\n type: s.StepType,\n status: s.Status,\n hasSubAgentRun: !!s.SubAgentRun,\n subStepCount: s.SubAgentRun?.Steps?.length || 0\n }))\n });\n \n // Force change detection\n this.cdr.detectChanges();\n }\n else if (message?.type === 'StreamingContent' && message.data?.streaming) {\n \n const streamingMessage = this.conversationMessages.find(m => m.isStreaming);\n if (streamingMessage) {\n // Append streaming content\n if (!streamingMessage.streamingContent) {\n streamingMessage.streamingContent = '';\n }\n streamingMessage.streamingContent = message.data.streaming.content;\n this.scrollNeeded = true;\n }\n }\n else if (message?.type === 'partial_result' && message.data?.partialResult) {\n // Could update execution monitor with partial results\n }\n else if (message?.type === 'complete') {\n // Switch execution monitor to historical mode with final data\n this.executionMonitorMode = 'historical';\n }\n }\n });\n }\n \n \n /**\n * Loads available AI models for prompt execution.\n * Only called when the harness is in prompt mode.\n */\n private async loadAvailableModels() {\n await AIEngineBase.Instance.Config(false);\n \n // Filter models by the prompt's AIModelTypeID if it exists\n let filteredModels: any[] = [];\n if (this.entity && 'AIModelTypeID' in this.entity) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n if (prompt.AIModelTypeID) {\n filteredModels = AIEngineBase.Instance.Models.filter(\n model => UUIDsEqual(model.AIModelTypeID, prompt.AIModelTypeID) && model.IsActive\n );\n } else {\n // No model type restriction, show all active models\n filteredModels = AIEngineBase.Instance.Models.filter(model => model.IsActive);\n }\n \n // Set default response format from prompt with slight delay for Kendo dropdown\n setTimeout(() => {\n const format = this.responseFormatOptions.find(f => f.value.trim().toLowerCase() === prompt.ResponseFormat.trim().toLowerCase());\n if (format) {\n this.selectedResponseFormat = format;\n }\n else {\n this.selectedResponseFormat = this.responseFormatOptions[0]; // Default to 'Any'\n }\n }, 0);\n } else {\n // Not a prompt entity, show all active models\n filteredModels = AIEngineBase.Instance.Models.filter(model => model.IsActive);\n }\n \n // Sort models by name\n filteredModels.sort((a, b) => a.Name.localeCompare(b.Name));\n \n // Determine the default model for this prompt\n if (this.entity && 'AIModelTypeID' in this.entity) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n this.defaultModelName = await this.getDefaultModelName(prompt);\n }\n \n // Add a blank option at the beginning with the default model name\n this.availableModels = [\n { ID: '', Name: this.defaultModelName ? `-- Default: ${this.defaultModelName} --` : '-- Use Default Model --' },\n ...filteredModels\n ];\n \n // Don't auto-select a model - let the dropdown show the blank option\n this.selectedModelId = '';\n \n // If we have a default model, load its default vendor\n if (this.defaultModelName) {\n await this.loadDefaultVendor();\n } else {\n this.selectedVendorId = '';\n this.availableVendors = [];\n }\n }\n \n /** Default model object for the prompt (cached for vendor lookup) */\n private defaultModel: any = null;\n \n /**\n * Gets the default model name for a prompt based on its configuration\n */\n private async getDefaultModelName(prompt: MJAIPromptEntityExtended): Promise<string> {\n try {\n // Get prompt-specific model associations\n const promptModels = AIEngineBase.Instance.PromptModels.filter(\n pm => UUIDsEqual(pm.PromptID, prompt.ID) &&\n (pm.Status === 'Active' || pm.Status === 'Preview')\n );\n \n let defaultModel: any = null;\n \n if (promptModels.length > 0) {\n // Sort by priority (higher priority first)\n promptModels.sort((a, b) => (b.Priority || 0) - (a.Priority || 0));\n \n // Find the first active model\n for (const pm of promptModels) {\n const model = AIEngineBase.Instance.Models.find(m => UUIDsEqual(m.ID, pm.ModelID) && m.IsActive);\n if (model) {\n defaultModel = model;\n break;\n }\n }\n }\n \n // If no prompt-specific model, use selection strategy\n if (!defaultModel) {\n const candidates = AIEngineBase.Instance.Models.filter(\n m => m.IsActive && \n (!prompt.AIModelTypeID || UUIDsEqual(m.AIModelTypeID, prompt.AIModelTypeID))\n );\n \n if (candidates.length > 0) {\n // Apply selection strategy\n if (prompt.SelectionStrategy === 'ByPower') {\n candidates.sort((a, b) => {\n switch (prompt.PowerPreference) {\n case 'Lowest':\n return (a.PowerRank || 0) - (b.PowerRank || 0);\n case 'Highest':\n case 'Balanced':\n default:\n return (b.PowerRank || 0) - (a.PowerRank || 0);\n }\n });\n }\n defaultModel = candidates[0];\n }\n }\n \n // Cache the default model object for vendor lookup\n this.defaultModel = defaultModel;\n \n return defaultModel ? defaultModel.Name : '';\n } catch (error) {\n console.error('Error getting default model name:', error);\n return '';\n }\n }\n \n /**\n * Loads the vendors for the default model\n */\n private async loadDefaultVendor() {\n try {\n if (!this.defaultModel) {\n this.availableVendors = [];\n return;\n }\n \n // Get vendors that offer this model - same logic as loadVendorsForModel\n const modelVendors = AIEngineBase.Instance.ModelVendors.filter(\n mv => UUIDsEqual(mv.ModelID, this.defaultModel.ID) &&\n mv.Status === 'Active' &&\n mv.Type?.trim().toLowerCase() === 'inference provider'\n );\n \n // Map to vendor objects with priority from ModelVendor\n const vendorObjects: any[] = [];\n for (const mv of modelVendors) {\n const vendor = AIEngineBase.Instance.Vendors.find(v => UUIDsEqual(v.ID, mv.VendorID));\n if (vendor) {\n vendorObjects.push({\n ID: vendor.ID,\n Name: vendor.Name,\n Priority: mv.Priority || 999 // Use ModelVendor priority\n });\n }\n }\n\n // Sort by priority (lower number = higher priority)\n vendorObjects.sort((a, b) => a.Priority - b.Priority);\n\n this.availableVendors = vendorObjects;\n \n // Select the highest priority vendor\n if (vendorObjects.length > 0) {\n this.selectedVendorId = vendorObjects[0].ID;\n }\n } catch (error) {\n console.error('Error loading default vendor:', error);\n this.availableVendors = [];\n }\n }\n \n /**\n * Loads available AI configurations from the database\n * Only configurations with 'Active' or 'Preview' status are shown\n */\n private async loadAvailableConfigurations() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJAIConfigurationEntity>({\n EntityName: 'MJ: AI Configurations',\n ExtraFilter: `Status IN ('Active', 'Preview')`,\n OrderBy: 'IsDefault DESC, Name',\n ResultType: 'entity_object'\n });\n \n if (result.Success && result.Results) {\n this.availableConfigurations = result.Results;\n \n // Auto-select the default configuration if one exists\n const defaultConfig = this.availableConfigurations.find(c => c.IsDefault);\n if (defaultConfig) {\n this.selectedConfigurationId = defaultConfig.ID;\n }\n } else {\n console.error('Failed to load AI configurations:', result.ErrorMessage);\n this.availableConfigurations = [];\n }\n } catch (error) {\n console.error('Error loading AI configurations:', error);\n this.availableConfigurations = [];\n }\n }\n \n /**\n * Handles model selection change and loads available vendors for the selected model\n */\n public onModelSelectionChange() {\n this.selectedVendorId = '';\n this.availableVendors = [];\n \n if (!this.selectedModelId) {\n // When default model is selected, load default vendor\n if (this.defaultModelName) {\n this.loadDefaultVendor();\n }\n return;\n }\n \n // Ensure AIEngineBase is configured\n if (!AIEngineBase.Instance.Models || AIEngineBase.Instance.Models.length === 0) {\n AIEngineBase.Instance.Config(false).then(() => {\n this.loadVendorsForModel();\n });\n } else {\n this.loadVendorsForModel();\n }\n }\n \n /**\n * Loads available vendors for the selected model\n */\n private loadVendorsForModel() {\n if (!this.selectedModelId) {\n return;\n }\n \n // Get model-specific vendors\n const modelVendors = AIEngineBase.Instance.ModelVendors.filter(\n mv => UUIDsEqual(mv.ModelID, this.selectedModelId) &&\n mv.Status === 'Active' &&\n mv.Type?.trim().toLowerCase() === 'inference provider'\n );\n \n // Map to vendor objects with priority from ModelVendor\n const vendorObjects: any[] = [];\n for (const mv of modelVendors) {\n const vendor = AIEngineBase.Instance.Vendors.find(v => UUIDsEqual(v.ID, mv.VendorID));\n if (vendor) {\n // For now, include all vendors. TODO: Filter by vendor type when available\n vendorObjects.push({\n ID: vendor.ID,\n Name: vendor.Name,\n Priority: mv.Priority || 999 // Use ModelVendor priority\n });\n }\n }\n \n // Sort by priority (lower number = higher priority)\n vendorObjects.sort((a, b) => a.Priority - b.Priority);\n \n this.availableVendors = vendorObjects;\n \n // Auto-select the highest priority vendor if only one or set default\n if (vendorObjects.length === 1) {\n this.selectedVendorId = vendorObjects[0].ID;\n } else if (vendorObjects.length > 1) {\n // Select the highest priority (lowest priority number)\n this.selectedVendorId = vendorObjects[0].ID;\n }\n }\n \n /**\n * Loads default parameter values from the AI prompt entity\n */\n private loadPromptDefaults() {\n if (this.mode === 'prompt' && this.entity && this.isPromptEntity(this.entity)) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n \n // Load default values from prompt entity\n if (prompt.Temperature != null) this.advancedParams.temperature = prompt.Temperature;\n if (prompt.TopP != null) this.advancedParams.topP = prompt.TopP;\n if (prompt.TopK != null) this.advancedParams.topK = prompt.TopK;\n if (prompt.MinP != null) this.advancedParams.minP = prompt.MinP;\n if (prompt.FrequencyPenalty != null) this.advancedParams.frequencyPenalty = prompt.FrequencyPenalty;\n if (prompt.PresencePenalty != null) this.advancedParams.presencePenalty = prompt.PresencePenalty;\n if (prompt.Seed != null) this.advancedParams.seed = prompt.Seed;\n if (prompt.StopSequences) {\n this.stopSequencesText = prompt.StopSequences;\n this.advancedParams.stopSequences = prompt.StopSequences.split(',').map((s: string) => s.trim()).filter((s: string) => s.length > 0);\n }\n if (prompt.IncludeLogProbs != null) this.advancedParams.includeLogProbs = prompt.IncludeLogProbs;\n if (prompt.TopLogProbs != null) this.advancedParams.topLogProbs = prompt.TopLogProbs;\n }\n }\n\n /**\n * Loads template parameters from the prompt's template and pre-populates\n * the template variables with their default values\n */\n private async loadTemplateParameters() {\n if (this.mode === 'prompt' && this.entity && this.isPromptEntity(this.entity)) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n \n if (!prompt.TemplateID) {\n return; // No template to load parameters from\n }\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJTemplateParamEntity>({\n EntityName: 'MJ: Template Params',\n ExtraFilter: `TemplateID='${prompt.TemplateID}'`,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n });\n\n if (result.Success && result.Results && result.Results.length > 0) {\n // Clear existing template variables\n this.templateVariables = [];\n \n // Add each template parameter as a variable with its default value\n for (const param of result.Results) {\n this.templateVariables.push({\n name: param.Name,\n value: param.DefaultValue || '',\n type: this.getVariableTypeFromParamType(param.Type)\n });\n }\n \n // If no parameters found, add one empty variable to start\n if (this.templateVariables.length === 0) {\n this.templateVariables.push({ name: '', value: '', type: 'string' });\n }\n }\n } catch (error) {\n console.error('Error loading template parameters:', error);\n // Add one empty variable on error\n this.templateVariables = [{ name: '', value: '', type: 'string' }];\n }\n }\n }\n\n /**\n * Maps template parameter types to variable types\n */\n private getVariableTypeFromParamType(paramType: string): 'string' | 'number' | 'boolean' | 'object' {\n switch (paramType?.toLowerCase()) {\n case 'number':\n case 'integer':\n case 'float':\n case 'decimal':\n return 'number';\n case 'boolean':\n case 'bool':\n return 'boolean';\n case 'object':\n case 'json':\n case 'array':\n return 'object';\n default:\n return 'string';\n }\n }\n\n \n /**\n * Resets all model settings to the prompt defaults\n */\n public resetToPromptDefaults() {\n if (this.mode === 'prompt' && this.entity && this.isPromptEntity(this.entity)) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n \n // Reset model selection to default\n this.selectedModelId = '';\n \n // Reset vendor - will be loaded by loadDefaultVendor\n this.selectedVendorId = '';\n \n // Reset response format to prompt's setting\n const format = this.responseFormatOptions.find(f => \n f.value.trim().toLowerCase() === prompt.ResponseFormat.trim().toLowerCase()\n );\n this.selectedResponseFormat = format || this.responseFormatOptions[0];\n \n // Reset max tokens\n this.maxTokens = null;\n \n // Reset skip validation\n this.skipValidation = false;\n \n // Reset configuration to default\n const defaultConfig = this.availableConfigurations.find(c => c.IsDefault);\n if (defaultConfig) {\n this.selectedConfigurationId = defaultConfig.ID;\n } else {\n this.selectedConfigurationId = '';\n }\n \n // Reset advanced parameters\n this.advancedParams = {\n temperature: null,\n topP: null,\n topK: null,\n minP: null,\n frequencyPenalty: null,\n presencePenalty: null,\n seed: null,\n stopSequences: [],\n includeLogProbs: false,\n topLogProbs: 2\n };\n this.stopSequencesText = '';\n \n // Reload prompt defaults for advanced params\n this.loadPromptDefaults();\n \n // Reload default vendor for the default model\n if (this.defaultModelName) {\n this.loadDefaultVendor();\n }\n }\n }\n\n /**\n * Resets the test harness to its initial state, clearing all conversations,\n * variables, and UI state. Called automatically when the harness becomes visible.\n */\n public resetHarness() {\n this.conversationMessages = [];\n this.currentUserMessage = '';\n this.isExecuting = false;\n this.agentVariables = [{ name: '', value: '', type: 'string' }];\n this.templateVariables = [];\n this.currentConversationId = null;\n this.showSidebar = true;\n // Clear execution data and tracking when explicitly resetting\n this.currentAgentRun = null;\n this.lastProcessedRunId = null;\n this.lastAgentRunId = null; // Clear run chaining\n this.executionMonitorMode = 'historical';\n // Reset conversation state\n this.agentConversationState = null;\n this.lastAgentPayload = null;\n this.subAgentHistory = [];\n // Set default tab based on mode\n this.activeTab = this.mode === 'agent' ? 'agentVariables' : 'modelSettings';\n // Reset advanced parameters\n this.advancedParams = {\n temperature: null,\n topP: null,\n topK: null,\n minP: null,\n frequencyPenalty: null,\n presencePenalty: null,\n seed: null,\n stopSequences: [],\n includeLogProbs: false,\n topLogProbs: 2\n };\n this.stopSequencesText = '';\n this.advancedParamsExpanded = false;\n this.skipValidation = false;\n // Reset agent configuration to default\n if (this.mode === 'agent') {\n const defaultConfig = this.availableConfigurations.find(c => c.IsDefault);\n this.agentConfigurationId = defaultConfig?.ID || '';\n }\n }\n \n /**\n * Starts a new conversation\n */\n public newConversation() {\n if (this.conversationMessages.length > 0 && !this.currentConversationId) {\n // Unsaved conversation exists - use our custom dialog\n if (confirm('You have an unsaved conversation. Would you like to save it first?')) {\n this.saveConversation();\n return;\n }\n }\n \n // Clear execution data when explicitly starting a new conversation\n this.currentAgentRun = null;\n this.lastProcessedRunId = null;\n this.lastAgentRunId = null; // Clear run chaining\n \n this.resetHarness();\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Started new conversation',\n 'info',\n 2000\n );\n }\n\n /**\n * Closes the test harness by setting visibility to false and emitting the change event.\n * Used by dialog implementations and close buttons.\n */\n public close() {\n this._isVisible = false;\n this.visibilityChange.emit(false);\n }\n\n /**\n * Toggles the visibility of the configuration sidebar.\n * Allows users to show/hide the data context and conversation management panels.\n */\n public toggleSidebar() {\n this.showSidebar = !this.showSidebar;\n }\n\n /**\n * Switches to the specified tab in the configuration sidebar.\n * @param tab - The tab to activate\n */\n public selectTab(tab: 'agentVariables' | 'executionMonitor' | 'agentSettings' | 'templateVariables' | 'modelSettings' | 'savedConversations') {\n console.log('🔄 Switching to tab:', tab, {\n currentAgentRun: !!this.currentAgentRun,\n agentRunStatus: this.currentAgentRun?.Status || 'none',\n conversationMessages: this.conversationMessages.length,\n executionMonitorMode: this.executionMonitorMode\n });\n \n this.activeTab = tab;\n \n // If switching to execution monitor tab, ensure it has the latest data\n if (tab === 'executionMonitor') {\n console.log('📊 Switching to execution monitor tab');\n \n // Always ensure we have the latest execution data when switching to monitor\n if (this.conversationMessages.length > 0) {\n const lastAssistantMessage = this.conversationMessages\n .filter(m => m.role === 'assistant' && m.agentRunId)\n .pop();\n \n console.log('🔍 Last assistant message with agent run:', {\n found: !!lastAssistantMessage,\n hasAgentRunId: !!lastAssistantMessage?.agentRunId,\n agentRunId: lastAssistantMessage?.agentRunId\n });\n \n if (lastAssistantMessage && lastAssistantMessage.agentRunId) {\n // Always update agent run to ensure it's fresh\n const messageRunId = lastAssistantMessage.agentRunId;\n \n // Load the agent run\n this.loadAgentRun(messageRunId);\n this.executionMonitorMode = 'historical';\n this.lastProcessedRunId = messageRunId;\n \n console.log('✅ Loading agent run:', {\n mode: this.executionMonitorMode,\n runId: this.lastProcessedRunId\n });\n \n // Trigger change detection to ensure the execution monitor updates\n setTimeout(() => {\n this.cdr.detectChanges();\n }, 50);\n } else {\n console.log('❌ No agent run ID found in messages');\n }\n } else {\n console.log('❌ No conversation messages found');\n }\n } else {\n console.log('📄 Switching away from execution monitor, preserving data:', {\n currentAgentRunExists: !!this.currentAgentRun\n });\n // Don't clear currentAgentRun when switching away from execution monitor\n // This preserves the state for when the user switches back\n }\n }\n\n /**\n * Shows the execution history for a specific message\n * @param message - The message to show execution history for\n */\n public async showMessageExecutionHistory(message: ConversationMessage) {\n if (message.agentRunId && this.mode === 'agent') {\n // Load the agent run entity\n await this.loadAgentRun(message.agentRunId);\n this.executionMonitorMode = 'historical';\n // Switch to execution monitor tab if not already there\n if (this.activeTab !== 'executionMonitor') {\n this.selectTab('executionMonitor');\n }\n }\n }\n \n /**\n * Loads an agent run entity by ID\n * @param runId - The ID of the agent run to load\n */\n private async loadAgentRun(runId: string): Promise<void> {\n const md = this.ProviderToUse;\n const agentRunEntity = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n await agentRunEntity.Load(runId);\n await this.internalLoadAgenRun(agentRunEntity);\n }\n\n private async loadAgentRunFromData(agentRunData: any): Promise<void> {\n const md = this.ProviderToUse;\n const agentRunEntity = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n await agentRunEntity.LoadFromData(agentRunData);\n await this.internalLoadAgenRun(agentRunEntity);\n }\n\n private async internalLoadAgenRun(agentRunEntity: MJAIAgentRunEntityExtended): Promise<void> {\n try {\n this.currentAgentRun = agentRunEntity;\n // The Load method automatically loads related steps through InnerLoad override\n // No need to call LoadRelatedData explicitly as it's protected\n \n // Set execution monitor mode\n this.executionMonitorMode = 'historical';\n \n console.log('✅ Loaded agent run:', {\n id: agentRunEntity.ID,\n stepCount: this.currentAgentRun.Steps?.length || 0\n });\n \n // Force change detection to update the execution monitor\n this.cdr.detectChanges();\n } catch (error) {\n console.error('❌ Failed to load agent run:', error);\n this.currentAgentRun = null;\n }\n }\n \n\n /**\n * Sends the current user message to the AI agent and initiates execution.\n * Handles message validation, conversation updates, UI state management, and agent execution.\n * Automatically clears the input field and triggers auto-scroll after sending.\n * \n * @example\n * ```typescript\n * // Called when user presses Enter or clicks Send button\n * await this.sendMessage();\n * ```\n */\n /**\n * Executes a re-run of a previously loaded prompt run.\n * This bypasses the need for a new user message since we're re-running with existing messages.\n */\n public async executeRerun() {\n if (this.mode === 'prompt' && this.conversationMessages.length > 0) {\n // Mark that we've executed a re-run\n this.hasExecutedRerun = true;\n \n // For prompt re-runs, we need to execute the prompt with the loaded messages\n await this.executePrompt(''); // Empty message since we're using loaded conversation\n }\n }\n \n /**\n * Resets the conversation back to the original messages from the prompt run.\n * This is available after a re-run has been executed.\n */\n public resetToOriginalMessages() {\n if (this.originalPromptRunMessages.length > 0) {\n // Reset messages to the original state\n this.conversationMessages = [...this.originalPromptRunMessages];\n \n // Reset the execution flag so Re-Run button shows again\n this.hasExecutedRerun = false;\n \n // Trigger change detection\n this.cdr.detectChanges();\n \n console.log('🔄 Reset to original messages from prompt run');\n }\n }\n \n public async sendMessage() {\n if (!this.currentUserMessage.trim() || !this.entity) {\n return;\n }\n\n // Add user message to conversation\n const userMessage: ConversationMessage = {\n id: this.generateMessageId(),\n role: 'user',\n content: this.currentUserMessage.trim(),\n timestamp: new Date()\n };\n this.conversationMessages.push(userMessage);\n \n // Clear input and update change detection\n const messageToSend = this.currentUserMessage;\n this.currentUserMessage = '';\n \n // Use Promise.resolve to defer the change detection to the next microtask\n // This prevents ExpressionChangedAfterItHasBeenCheckedError\n Promise.resolve().then(() => {\n this.cdr.detectChanges();\n });\n \n // Scroll to bottom\n this.scrollNeeded = true;\n\n // Auto-switch to execution monitor tab if in agent mode\n if (this.mode === 'agent' && this.activeTab !== 'executionMonitor') {\n this.selectTab('executionMonitor');\n }\n \n // Clear previous execution data when starting a new execution\n this.currentAgentRun = null;\n this.lastProcessedRunId = null;\n \n // Execute based on mode\n if (this.mode === 'agent') {\n await this.executeAgent(messageToSend);\n } else {\n await this.executePrompt(messageToSend);\n }\n }\n\n private async executeAgent(userMessage: string) {\n if (!this.entity || !this.isAgentEntity(this.entity)) return;\n\n this.isExecuting = true;\n\n // Clear previous execution data when starting a new run\n // Create a proper agent run entity for live tracking\n const md = this.ProviderToUse;\n this.currentAgentRun = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n this.currentAgentRun.ID = `temp-${Date.now()}`;\n this.currentAgentRun.Status = 'Running';\n this.currentAgentRun.StartedAt = new Date();\n // Steps will be populated by the agent updates\n this.liveAgentSteps = [];\n this.executionMonitorMode = 'live';\n\n // Add placeholder assistant message for streaming\n const assistantMessage: ConversationMessage = {\n id: this.generateMessageId(),\n role: 'assistant',\n content: '',\n timestamp: new Date(),\n isStreaming: true,\n streamingContent: this.mode === 'agent' ? 'Running agent...' : 'Running prompt...',\n agentRunId: '',\n streamingStartTime: Date.now(),\n elapsedTime: 0\n };\n this.conversationMessages.push(assistantMessage);\n this.scrollNeeded = true;\n \n // Start elapsed time counter\n this.startElapsedTimeCounter(assistantMessage);\n \n // Initialize execution monitor for live mode - already created above\n \n\n try {\n // Get GraphQL data provider\n const dataProvider = this.ProviderToUse as GraphQLDataProvider;\n \n // Build data context - include conversation state if available\n const dataContext = this.buildDataContext();\n const templateData = this.buildTemplateData();\n \n // Add conversation state to data context if we have it\n if (this.agentConversationState) {\n dataContext._conversationState = this.agentConversationState;\n }\n if (this.lastAgentPayload) {\n dataContext._lastPayload = this.lastAgentPayload;\n }\n if (this.subAgentHistory.length > 0) {\n dataContext._subAgentHistory = this.subAgentHistory;\n }\n \n // Execute the agent using the new AI client\n // Start typing animation while we wait for the first real stream\n this.startTypingAnimation(assistantMessage);\n\n const executionResult = await dataProvider.AI.RunAIAgent({\n agent: this.entity as MJAIAgentEntityExtended,\n conversationMessages: this.conversationMessages, \n data: Object.keys(dataContext).length > 0 ? dataContext : undefined, \n lastRunId: this.lastAgentRunId || undefined,\n autoPopulateLastRunPayload: this.lastAgentRunId ? true : false,\n configurationId: this.agentConfigurationId || undefined\n });\n\n // Stop elapsed time counter\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n\n // Update assistant message with result\n assistantMessage.isStreaming = false;\n\n if (executionResult?.success) {\n // executionResult is now an ExecuteAgentResult from the GraphQL client\n // It has already been parsed and contains: success, payload, agentRun, etc.\n const parseOptions: ParseJSONOptions = {\n extractInlineJson: true,\n maxDepth: 100,\n debug: false\n };\n\n // Apply recursive JSON parsing to extract any nested JSON strings\n const fullResult = ParseJSONRecursive(executionResult, parseOptions);\n\n // Store agent run ID with the message\n if (fullResult && fullResult.agentRun?.ID) {\n assistantMessage.agentRunId = fullResult.agentRun.ID;\n }\n\n // Load the agent run for display\n if (fullResult && fullResult.agentRun) {\n await this.loadAgentRunFromData(fullResult.agentRun);\n // Only switch to historical mode after successfully loading\n this.executionMonitorMode = 'historical';\n // Clear live steps only after we have the historical data\n this.liveAgentSteps = [];\n } else {\n // If no agent run ID, keep showing live steps\n console.log('⚠️ No agent run ID in result, keeping live mode');\n }\n\n // Auto-expand all monitoring nodes once execution is complete\n setTimeout(() => {\n this.expandAllMonitoringNodes();\n }, 100);\n\n // Preserve conversation state from the result\n if (fullResult.payload) {\n this.lastAgentPayload = fullResult.payload;\n\n // Extract conversation state if present\n if (fullResult.payload.conversationState) {\n this.agentConversationState = fullResult.payload.conversationState;\n }\n }\n\n // Extract the user message from the nested payload structure\n let displayContent = 'No response generated';\n let payloadData = fullResult.payload;\n\n if (fullResult.agentRun?.Message?.length > 0) {\n displayContent = fullResult.agentRun.Message;\n }\n\n assistantMessage.content = displayContent;\n assistantMessage.payload = payloadData; // Store the payload if present\n const startedAt = executionResult.agentRun?.StartedAt ? new Date(executionResult.agentRun.StartedAt).getTime() : 0;\n const completedAt = executionResult.agentRun?.CompletedAt ? new Date(executionResult.agentRun.CompletedAt).getTime() : 0;\n const executionTime = (startedAt && completedAt) ? (completedAt - startedAt) : 0;\n assistantMessage.executionTime = executionTime;\n assistantMessage.agentRunId = fullResult.agentRun?.ID || assistantMessage.agentRunId;\n\n // Update the tracking ID when we set new execution data\n this.lastProcessedRunId = assistantMessage.agentRunId || null;\n\n // Update the last agent run ID for run chaining\n if (fullResult.agentRun?.ID) {\n this.lastAgentRunId = fullResult.agentRun.ID;\n }\n\n // Store the full result as raw content for debugging/inspection\n assistantMessage.rawContent = JSON.stringify(fullResult, null, 2);\n\n // Force change detection to update the execution monitor\n this.cdr.detectChanges();\n } else {\n console.error('❌ AI Test Harness: Execution failed', {\n success: executionResult?.success,\n errorMessage: executionResult?.agentRun?.ErrorMessage,\n hasPayload: !!executionResult?.payload\n });\n assistantMessage.content = 'I encountered an error processing your request.';\n assistantMessage.error = executionResult?.agentRun?.ErrorMessage || 'Unknown error occurred';\n\n // On failure, clear live steps and switch to historical mode\n if (this.currentAgentRun) {\n this.executionMonitorMode = 'historical';\n this.liveAgentSteps = [];\n }\n\n // Store the error result as raw content\n if (executionResult) {\n assistantMessage.rawContent = JSON.stringify(executionResult, null, 2);\n }\n }\n\n delete assistantMessage.streamingContent;\n this.scrollNeeded = true;\n\n // Auto-save conversation\n this.autoSaveConversation();\n \n // Auto-expand all monitoring nodes once execution is complete (for prompt mode)\n if (this.mode === 'prompt') {\n setTimeout(() => {\n this.expandAllMonitoringNodes();\n }, 100);\n }\n\n } catch (error) {\n console.error('❌ AI Test Harness: Caught error during agent execution', {\n error: error,\n message: (error as any)?.message,\n stack: (error as any)?.stack,\n type: (error as any)?.constructor?.name\n });\n \n // Update assistant message with error\n const lastMessage = this.conversationMessages[this.conversationMessages.length - 1];\n if (lastMessage && lastMessage.role === 'assistant') {\n lastMessage.isStreaming = false;\n lastMessage.content = 'I encountered an error processing your request.';\n lastMessage.error = (error as Error).message;\n delete lastMessage.streamingContent;\n }\n \n // On error, clear live steps and switch to historical mode\n if (this.currentAgentRun) {\n this.executionMonitorMode = 'historical';\n this.liveAgentSteps = [];\n }\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to execute agent: ' + (error as Error).message,\n 'error',\n 6000\n );\n } finally {\n this.isExecuting = false;\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n \n // Focus back on the input\n this.focusMessageInput();\n }\n }\n\n private async executePrompt(userMessage: string) {\n if (!this.entity || !this.isPromptEntity(this.entity)) return;\n\n this.isExecuting = true;\n\n // Add placeholder assistant message for streaming\n const assistantMessage: ConversationMessage = {\n id: this.generateMessageId(),\n role: 'assistant',\n content: '',\n timestamp: new Date(),\n isStreaming: true,\n streamingContent: this.mode === 'agent' ? 'Running agent...' : 'Running prompt...',\n agentRunId: '',\n streamingStartTime: Date.now(),\n elapsedTime: 0\n };\n this.conversationMessages.push(assistantMessage);\n this.scrollNeeded = true;\n \n // Start elapsed time counter\n this.startElapsedTimeCounter(assistantMessage);\n\n try {\n // Get GraphQL data provider\n const dataProvider = this.ProviderToUse as GraphQLDataProvider;\n\n // Build template variables from user input\n const templateVariables = this.buildTemplateVariables();\n \n // Prepare data context (template variables + user message)\n const dataContext = {\n ...templateVariables,\n userMessage: userMessage\n };\n \n // Build conversation messages\n const messages = this.conversationMessages\n .filter(m => !m.isStreaming && m.content) // Only include non-streaming messages with content\n .map(m => ({\n role: m.role as string,\n content: m.content as string\n }));\n \n // Execute the prompt using the new AI client\n const executionResult = await dataProvider.AI.RunAIPrompt({\n promptId: (this.entity as MJAIPromptEntityExtended).ID,\n data: dataContext,\n overrideModelId: this.selectedModelId || undefined,\n overrideVendorId: this.selectedVendorId || undefined,\n configurationId: this.selectedConfigurationId || undefined,\n skipValidation: this.skipValidation,\n templateData: undefined, // Additional template context if needed\n responseFormat: this.selectedResponseFormat?.value,\n temperature: this.advancedParams.temperature ?? undefined,\n topP: this.advancedParams.topP ?? undefined,\n topK: this.advancedParams.topK ?? undefined,\n minP: this.advancedParams.minP ?? undefined,\n frequencyPenalty: this.advancedParams.frequencyPenalty ?? undefined,\n presencePenalty: this.advancedParams.presencePenalty ?? undefined,\n seed: this.advancedParams.seed ?? undefined,\n stopSequences: this.advancedParams.stopSequences.length > 0 ? this.advancedParams.stopSequences : undefined,\n includeLogProbs: this.advancedParams.includeLogProbs,\n topLogProbs: this.advancedParams.includeLogProbs ? this.advancedParams.topLogProbs : undefined,\n messages: messages.length > 0 ? messages : undefined,\n rerunFromPromptRunID: this.originalPromptRunId || undefined,\n systemPromptOverride: this.systemPromptOverride || undefined\n });\n\n // Stop elapsed time counter\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n\n // Update assistant message with result\n assistantMessage.isStreaming = false;\n \n // Define parse options for both success and error cases\n const parseOptions: ParseJSONOptions = {\n extractInlineJson: true,\n maxDepth: 100,\n debug: false\n };\n\n if (executionResult?.success) {\n // Use parsedResult if available, otherwise fall back to output\n // Handle case where parsedResult is already an object (from GraphQL client)\n const contentToDisplay = executionResult.parsedResult\n ? (typeof executionResult.parsedResult === 'object'\n ? JSON.stringify(executionResult.parsedResult, null, 2)\n : executionResult.parsedResult)\n : (executionResult.output || 'No response generated');\n assistantMessage.content = contentToDisplay;\n assistantMessage.executionTime = executionResult.executionTimeMs;\n \n // Store the complete execution result for JSON display\n // If chatResult is provided, parse it and include it in the display\n const resultForDisplay: any = { ...executionResult };\n if (executionResult.chatResult) {\n try {\n resultForDisplay.chatResult = JSON.parse(executionResult.chatResult);\n } catch {\n // If parsing fails, keep it as a string\n }\n }\n \n // Apply recursive JSON parsing to the entire result\n const recursivelyParsed = ParseJSONRecursive(resultForDisplay, parseOptions);\n assistantMessage.rawContent = JSON.stringify(recursivelyParsed, null, 2);\n \n // Store execution metadata\n if (executionResult.promptRunId) {\n assistantMessage.agentRunId = executionResult.promptRunId;\n // Update the tracking ID when we set new execution data\n this.lastProcessedRunId = assistantMessage.agentRunId || null;\n }\n } else {\n assistantMessage.content = 'I encountered an error processing your request.';\n assistantMessage.error = executionResult?.error || 'Unknown error occurred';\n \n // Include chatResult in error case too\n if (executionResult) {\n const errorResult: any = { ...executionResult };\n if (executionResult.chatResult) {\n try {\n errorResult.chatResult = JSON.parse(executionResult.chatResult);\n } catch {\n // If parsing fails, keep it as a string\n }\n }\n \n // Apply recursive JSON parsing to the error result\n const recursivelyParsed = ParseJSONRecursive(errorResult, parseOptions);\n assistantMessage.rawContent = JSON.stringify(recursivelyParsed, null, 2);\n }\n }\n \n delete assistantMessage.streamingContent;\n this.scrollNeeded = true;\n\n // Auto-save conversation\n this.autoSaveConversation();\n \n // Focus back on input\n this.focusMessageInput();\n\n } catch (error) {\n // Update assistant message with error\n const lastMessage = this.conversationMessages[this.conversationMessages.length - 1];\n if (lastMessage && lastMessage.role === 'assistant') {\n lastMessage.isStreaming = false;\n lastMessage.content = 'I encountered an error processing your request.';\n lastMessage.error = (error as Error).message;\n delete lastMessage.streamingContent;\n }\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to execute prompt: ' + (error as Error).message,\n 'error',\n 6000\n );\n } finally {\n this.isExecuting = false;\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n \n // Focus back on the input\n this.focusMessageInput();\n }\n }\n \n\n private startTypingAnimation(message: ConversationMessage) {\n const initialMessages = [\n \"I'm processing your request...\",\n \"Let me think about that...\",\n \"Working on your request...\",\n \"Analyzing your question...\",\n \"Processing...\"\n ];\n \n const selectedMessage = initialMessages[Math.floor(Math.random() * initialMessages.length)];\n let index = 0;\n \n // Store the interval handle on the message itself so we can cancel it when real streaming starts\n const typingInterval = setInterval(() => {\n if (index < selectedMessage.length && message.isStreaming) {\n message.streamingContent = selectedMessage.substring(0, index + 1);\n index++;\n this.scrollNeeded = true;\n } else {\n clearInterval(typingInterval);\n }\n }, 50);\n \n // Store interval reference in case we need to clear it\n (message as any)._typingInterval = typingInterval;\n }\n\n private buildDataContext(): Record<string, any> {\n const context: Record<string, any> = {};\n \n // Use unified agent variables\n for (const variable of this.agentVariables) {\n if (variable.name.trim()) {\n context[variable.name] = this.convertVariableValue(variable.value, variable.type);\n }\n }\n \n return context;\n }\n\n private buildTemplateData(): Record<string, any> {\n // For backward compatibility, return the same data as buildDataContext\n // since we've unified the variables\n return this.buildDataContext();\n }\n\n private buildTemplateVariables(): Record<string, any> {\n const variables: Record<string, any> = {};\n \n for (const variable of this.templateVariables) {\n if (variable.name.trim()) {\n variables[variable.name] = this.convertVariableValue(variable.value, variable.type);\n }\n }\n \n return variables;\n }\n\n private convertVariableValue(value: string, type: string): any {\n switch (type) {\n case 'number':\n return parseFloat(value) || 0;\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'object':\n try {\n return JSON.parse(value);\n } catch {\n return value;\n }\n default:\n return value;\n }\n }\n\n /**\n * Adds a new empty agent variable to the collection.\n * Agent variables are passed to the agent during execution for dynamic content and template rendering.\n */\n public addAgentVariable() {\n this.agentVariables.push({\n name: '',\n value: '',\n type: 'string'\n });\n }\n\n /**\n * Removes an agent variable at the specified index.\n * @param index - Zero-based index of the variable to remove\n */\n public removeAgentVariable(index: number) {\n this.agentVariables.splice(index, 1);\n }\n\n /**\n * Adds a new empty template variable to the collection (prompt mode only).\n * Template variables are used for prompt template rendering.\n */\n public addTemplateVariable() {\n this.templateVariables.push({\n name: '',\n value: '',\n type: 'string'\n });\n }\n\n /**\n * Removes a template variable at the specified index (prompt mode only).\n * @param index - Zero-based index of the variable to remove\n */\n public removeTemplateVariable(index: number) {\n this.templateVariables.splice(index, 1);\n }\n\n /**\n * Clears the current conversation after user confirmation.\n * Resets both the message history and the current conversation ID.\n */\n public clearConversation() {\n if (this.conversationMessages.length > 0) {\n if (confirm('Are you sure you want to clear the conversation?')) {\n this.conversationMessages = [];\n this.currentConversationId = null;\n }\n }\n }\n\n private scrollToBottom(): void {\n try {\n if (this.messagesContainer) {\n this.messagesContainer.nativeElement.scrollTop = this.messagesContainer.nativeElement.scrollHeight;\n }\n } catch(err) {\n // Error scrolling to bottom\n }\n }\n\n private generateMessageId(): string {\n return `msg_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n }\n\n // Saved conversations functionality\n private loadSavedConversations() {\n try {\n const storageKey = this.getStorageKey();\n const saved = localStorage.getItem(storageKey);\n \n if (saved) {\n const parsedData = JSON.parse(saved);\n this.savedConversations = parsedData || [];\n \n // Convert date strings back to Date objects\n this.savedConversations.forEach(conv => {\n conv.createdAt = new Date(conv.createdAt);\n conv.updatedAt = new Date(conv.updatedAt);\n conv.messages.forEach(msg => {\n msg.timestamp = new Date(msg.timestamp);\n });\n });\n } else {\n this.savedConversations = [];\n }\n } catch (error) {\n // Error loading saved conversations\n this.savedConversations = [];\n }\n }\n \n /**\n * Gets the storage key for saved conversations based on entity type and ID\n */\n private getStorageKey(): string {\n if (!this.entity) {\n return '';\n }\n \n const entityType = this.mode === 'agent' ? 'agent' : 'prompt';\n const entityId = this.entity.ID || 'unknown';\n return `mj_test_harness_${entityType}_${entityId}_conversations`;\n }\n\n /**\n * Saves the current conversation to localStorage with user-provided name.\n * Handles both creating new conversations and updating existing ones.\n * Automatically limits storage to 50 conversations to prevent excessive memory usage.\n * \n * @example\n * ```typescript\n * // User clicks save button\n * this.saveConversation(); // Prompts for name and saves\n * ```\n */\n public saveConversation() {\n if (this.conversationMessages.length === 0) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'No messages to save',\n 'warning',\n 3000\n );\n return;\n }\n\n // If updating existing conversation, pre-fill the name\n if (this.currentConversationId) {\n const currentConv = this.savedConversations.find(c => c.id === this.currentConversationId);\n this.tempConversationName = currentConv ? currentConv.name : '';\n } else {\n this.tempConversationName = '';\n }\n \n this.showSaveDialog = true;\n // Focus on input after dialog renders\n setTimeout(() => {\n if (this.saveDialogInput && this.saveDialogInput.nativeElement) {\n const input = this.saveDialogInput.nativeElement;\n input.focus();\n input.select();\n }\n }, 100);\n }\n \n\n public updateTempConversation() {\n this.tempConversationName = this.saveDialogInput?.nativeElement.value.trim() || ''; \n }\n\n /**\n * Handles the save dialog confirmation\n */\n public confirmSaveConversation() {\n // Use the temp name from the input\n const convoName = this.saveDialogInput?.nativeElement.value;\n const trimmedName = convoName?.trim() || '';\n \n if (!trimmedName) {\n return;\n }\n \n this.newConversationName = trimmedName;\n \n const conversation: SavedConversation = {\n id: this.generateMessageId(),\n name: this.newConversationName.trim(),\n agentId: this.entity?.ID || '',\n agentName: this.getEntityName() || '',\n messages: [...this.conversationMessages],\n dataContext: this.buildDataContext(),\n templateData: this.mode === 'agent' ? this.buildTemplateData() : {},\n templateVariables: this.mode === 'prompt' ? this.buildTemplateVariables() : {},\n advancedParams: this.mode === 'prompt' ? this.advancedParams : undefined,\n selectedModelId: this.mode === 'prompt' ? this.selectedModelId : undefined,\n selectedVendorId: this.mode === 'prompt' ? this.selectedVendorId : undefined,\n selectedConfigurationId: this.mode === 'prompt' ? this.selectedConfigurationId : undefined,\n skipValidation: this.mode === 'prompt' ? this.skipValidation : undefined,\n agentConfigurationId: this.mode === 'agent' ? this.agentConfigurationId : undefined,\n createdAt: new Date(),\n updatedAt: new Date()\n };\n\n if (this.currentConversationId) {\n // Update existing conversation\n const index = this.savedConversations.findIndex(c => c.id === this.currentConversationId);\n if (index >= 0) {\n conversation.id = this.currentConversationId;\n conversation.createdAt = this.savedConversations[index].createdAt;\n conversation.name = this.newConversationName.trim(); // Use the edited name\n this.savedConversations[index] = conversation;\n } else {\n // Current ID not found, treat as new\n this.savedConversations.unshift(conversation);\n this.currentConversationId = conversation.id;\n }\n } else {\n // Add new conversation\n this.savedConversations.unshift(conversation);\n this.currentConversationId = conversation.id;\n }\n\n // Limit to 50 saved conversations\n if (this.savedConversations.length > 50) {\n this.savedConversations = this.savedConversations.slice(0, 50);\n }\n\n // Save to localStorage\n this.saveConversationsToStorage();\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation saved successfully',\n 'success',\n 3000\n );\n \n this.showSaveDialog = false;\n this.newConversationName = '';\n this.tempConversationName = '';\n }\n \n /**\n * Cancels the save dialog\n */\n public cancelSaveDialog() {\n this.showSaveDialog = false;\n this.newConversationName = '';\n this.tempConversationName = '';\n }\n \n // Removed debug methods - no longer needed with ngModel binding\n \n /**\n * Saves conversations to localStorage\n */\n private saveConversationsToStorage() {\n try {\n const storageKey = this.getStorageKey();\n localStorage.setItem(storageKey, JSON.stringify(this.savedConversations));\n } catch (error) {\n // Error saving conversations\n throw error;\n }\n }\n\n private autoSaveConversation() {\n if (this.currentConversationId && this.conversationMessages.length > 0) {\n const index = this.savedConversations.findIndex(c => c.id === this.currentConversationId);\n if (index >= 0) {\n this.savedConversations[index].messages = [...this.conversationMessages];\n this.savedConversations[index].dataContext = this.buildDataContext();\n if (this.mode === 'agent') {\n this.savedConversations[index].templateData = this.buildTemplateData();\n this.savedConversations[index].agentConfigurationId = this.agentConfigurationId;\n } else {\n this.savedConversations[index].templateVariables = this.buildTemplateVariables();\n this.savedConversations[index].advancedParams = this.advancedParams;\n this.savedConversations[index].selectedModelId = this.selectedModelId;\n this.savedConversations[index].selectedVendorId = this.selectedVendorId;\n this.savedConversations[index].selectedConfigurationId = this.selectedConfigurationId;\n this.savedConversations[index].skipValidation = this.skipValidation;\n }\n this.savedConversations[index].updatedAt = new Date();\n \n // Save to localStorage\n try {\n this.saveConversationsToStorage();\n } catch (error) {\n // Error auto-saving conversation\n }\n }\n }\n }\n\n public loadConversation(conversation: SavedConversation) {\n if (this.conversationMessages.length > 0) {\n this.pendingLoadConversation = conversation;\n this.showLoadConfirmDialog = true;\n return;\n }\n\n this.doLoadConversation(conversation);\n }\n \n /**\n * Confirms loading a conversation after dialog confirmation\n */\n public confirmLoadConversation() {\n if (this.pendingLoadConversation) {\n this.doLoadConversation(this.pendingLoadConversation);\n this.showLoadConfirmDialog = false;\n this.pendingLoadConversation = null;\n }\n }\n \n /**\n * Cancels loading a conversation\n */\n public cancelLoadConversation() {\n this.showLoadConfirmDialog = false;\n this.pendingLoadConversation = null;\n }\n \n /**\n * Actually loads the conversation\n */\n private doLoadConversation(conversation: SavedConversation) {\n this.conversationMessages = [...conversation.messages];\n this.currentConversationId = conversation.id;\n \n // Restore agent variables (unified from dataContext and templateData)\n this.agentVariables = [];\n const allVariables = { ...conversation.dataContext, ...(conversation.templateData || {}) };\n for (const [key, value] of Object.entries(allVariables)) {\n this.agentVariables.push({\n name: key,\n value: typeof value === 'object' ? JSON.stringify(value) : String(value),\n type: typeof value === 'boolean' ? 'boolean' : \n typeof value === 'number' ? 'number' :\n typeof value === 'object' ? 'object' : 'string'\n });\n }\n \n // Restore configuration for agent mode\n if (this.mode === 'agent') {\n if (conversation.agentConfigurationId !== undefined) {\n this.agentConfigurationId = conversation.agentConfigurationId;\n }\n }\n \n // Restore template variables for prompt mode\n if (this.mode === 'prompt') {\n this.templateVariables = [];\n for (const [key, value] of Object.entries(conversation.templateVariables || {})) {\n this.templateVariables.push({\n name: key,\n value: typeof value === 'object' ? JSON.stringify(value) : String(value),\n type: typeof value === 'boolean' ? 'boolean' : \n typeof value === 'number' ? 'number' :\n typeof value === 'object' ? 'object' : 'string'\n });\n }\n \n // Restore advanced parameters\n if (conversation.advancedParams) {\n this.advancedParams = { ...this.advancedParams, ...conversation.advancedParams };\n // Restore stop sequences text\n this.stopSequencesText = this.advancedParams.stopSequences?.join(', ') || '';\n }\n \n // Restore model and vendor selection\n if (conversation.selectedModelId !== undefined) {\n this.selectedModelId = conversation.selectedModelId;\n // Trigger vendor loading if model is selected\n if (this.selectedModelId) {\n this.onModelSelectionChange();\n // After vendors load, restore vendor selection\n setTimeout(() => {\n if (conversation.selectedVendorId !== undefined) {\n this.selectedVendorId = conversation.selectedVendorId;\n }\n }, 100);\n }\n }\n if (conversation.selectedVendorId !== undefined && !this.selectedModelId) {\n this.selectedVendorId = conversation.selectedVendorId;\n }\n \n // Restore configuration selection\n if (conversation.selectedConfigurationId !== undefined) {\n this.selectedConfigurationId = conversation.selectedConfigurationId;\n }\n \n // Restore skip validation setting\n if (conversation.skipValidation !== undefined) {\n this.skipValidation = conversation.skipValidation;\n }\n }\n \n // Load agent run from the last assistant message if available\n const lastAssistantMessage = this.conversationMessages\n .filter(m => m.role === 'assistant' && m.agentRunId)\n .pop();\n \n if (lastAssistantMessage && lastAssistantMessage.agentRunId) {\n \n this.loadAgentRun(lastAssistantMessage.agentRunId);\n this.executionMonitorMode = 'historical';\n this.lastProcessedRunId = lastAssistantMessage.agentRunId;\n \n } else {\n // Clear agent run if no execution found\n this.currentAgentRun = null;\n this.executionMonitorMode = 'historical';\n this.lastProcessedRunId = null;\n }\n\n this.scrollNeeded = true;\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation loaded',\n 'info',\n 3000\n );\n }\n\n public async deleteConversation(conversation: SavedConversation, event: Event) {\n event.stopPropagation();\n \n if (confirm(`Delete conversation \"${conversation.name}\"?`)) {\n const index = this.savedConversations.findIndex(c => c.id === conversation.id);\n if (index >= 0) {\n this.savedConversations.splice(index, 1);\n \n // Save to localStorage\n this.saveConversationsToStorage();\n \n if (this.currentConversationId === conversation.id) {\n this.currentConversationId = null;\n }\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation deleted',\n 'info',\n 3000\n );\n }\n }\n }\n\n public exportConversation() {\n if (this.conversationMessages.length === 0) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'No messages to export',\n 'warning',\n 3000\n );\n return;\n }\n\n const exportData: any = {\n entity: {\n id: this.entity?.ID,\n name: this.getEntityName(),\n type: this.mode\n },\n messages: this.conversationMessages,\n dataContext: this.buildDataContext(),\n exportedAt: new Date().toISOString()\n };\n \n // Add mode-specific data\n if (this.mode === 'agent') {\n exportData.templateData = this.buildTemplateData();\n exportData.agentSettings = {\n configurationId: this.agentConfigurationId\n };\n } else {\n exportData.templateVariables = this.buildTemplateVariables();\n exportData.modelSettings = {\n modelId: this.selectedModelId,\n vendorId: this.selectedVendorId,\n configurationId: this.selectedConfigurationId,\n maxTokens: this.maxTokens,\n skipValidation: this.skipValidation\n };\n exportData.advancedParams = this.advancedParams;\n }\n\n const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n const entityName = this.getEntityName()?.replace(/[^a-zA-Z0-9]/g, '-') || 'conversation';\n link.download = `${this.mode}-conversation-${entityName}-${new Date().toISOString().slice(0, 10)}.json`;\n link.click();\n window.URL.revokeObjectURL(url);\n }\n\n public importConversation() {\n this.fileInput.nativeElement.click();\n }\n\n public onFileSelected(event: Event) {\n const input = event.target as HTMLInputElement;\n if (input.files && input.files[0]) {\n const file = input.files[0];\n const reader = new FileReader();\n \n reader.onload = (e) => {\n try {\n const data = JSON.parse(e.target?.result as string);\n \n // Validate and import\n if (data.messages && Array.isArray(data.messages)) {\n if (this.conversationMessages.length > 0) {\n if (!confirm('Importing will replace the current conversation. Continue?')) {\n return;\n }\n }\n \n this.conversationMessages = data.messages.map((msg: any) => ({\n ...msg,\n timestamp: new Date(msg.timestamp)\n }));\n \n // Import agent variables (unified from dataContext and templateData)\n this.agentVariables = [];\n const importedVariables = { ...(data.dataContext || {}), ...(data.templateData || {}) };\n for (const [key, value] of Object.entries(importedVariables)) {\n this.agentVariables.push({\n name: key,\n value: typeof value === 'object' ? JSON.stringify(value) : String(value),\n type: typeof value === 'boolean' ? 'boolean' : \n typeof value === 'number' ? 'number' :\n typeof value === 'object' ? 'object' : 'string'\n });\n }\n \n // Template data is already imported into agentVariables above\n \n // Import advanced parameters if in prompt mode\n if (this.mode === 'prompt' && data.advancedParams) {\n this.advancedParams = { ...this.advancedParams, ...data.advancedParams };\n this.stopSequencesText = this.advancedParams.stopSequences?.join(', ') || '';\n }\n \n // Import agent settings if in agent mode\n if (this.mode === 'agent' && data.agentSettings) {\n if (data.agentSettings.configurationId !== undefined) {\n this.agentConfigurationId = data.agentSettings.configurationId;\n }\n }\n \n // Import model settings if in prompt mode\n if (this.mode === 'prompt' && data.modelSettings) {\n if (data.modelSettings.modelId !== undefined) {\n this.selectedModelId = data.modelSettings.modelId;\n // Trigger vendor loading if model is selected\n if (this.selectedModelId) {\n this.onModelSelectionChange();\n // After vendors load, restore vendor selection\n setTimeout(() => {\n if (data.modelSettings.vendorId !== undefined) {\n this.selectedVendorId = data.modelSettings.vendorId;\n }\n }, 100);\n }\n }\n if (data.modelSettings.vendorId !== undefined && !this.selectedModelId) {\n this.selectedVendorId = data.modelSettings.vendorId;\n }\n if (data.modelSettings.configurationId !== undefined) {\n this.selectedConfigurationId = data.modelSettings.configurationId;\n }\n if (data.modelSettings.maxTokens !== undefined) {\n this.maxTokens = data.modelSettings.maxTokens;\n }\n if (data.modelSettings.skipValidation !== undefined) {\n this.skipValidation = data.modelSettings.skipValidation;\n }\n }\n \n this.currentConversationId = null;\n this.scrollNeeded = true;\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation imported successfully',\n 'success',\n 3000\n );\n } else {\n throw new Error('Invalid conversation format');\n }\n } catch (error) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to import conversation: ' + (error as Error).message,\n 'error',\n 5000\n );\n }\n \n // Reset file input\n input.value = '';\n };\n \n reader.readAsText(file);\n }\n }\n\n /**\n * Handles keyboard input in the message textarea.\n * Sends message on Enter (without Shift) and allows multi-line input with Shift+Enter.\n * @param event - Keyboard event from the textarea\n */\n public handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n this.sendMessage();\n }\n }\n\n /**\n * Generates CSS class names for message display based on message properties.\n * @param message - The conversation message to generate classes for\n * @returns Space-separated CSS class string for styling\n */\n public getMessageClass(message: ConversationMessage): string {\n return `message message-${message.role}${message.isStreaming ? ' streaming' : ''}${message.error ? ' error' : ''}`;\n }\n\n /**\n * Formats a Date object into a user-friendly time string.\n * @param date - Date object to format\n * @returns Formatted time string in HH:MM format\n */\n public formatTimestamp(date: Date): string {\n return date.toLocaleTimeString('en-US', { \n hour: '2-digit', \n minute: '2-digit' \n });\n }\n\n /**\n * Formats execution time from milliseconds into a human-readable string.\n * Automatically selects appropriate units (minutes, seconds, or milliseconds).\n * @param milliseconds - Execution time in milliseconds\n * @returns Formatted time string (e.g., \"2m 30.5s\", \"1.23s\", \"500ms\")\n */\n public formatExecutionTime(milliseconds: number): string {\n if (milliseconds >= 60000) {\n const minutes = Math.floor(milliseconds / 60000);\n const seconds = ((milliseconds % 60000) / 1000).toFixed(2);\n return `${minutes}m ${seconds}s`;\n } else if (milliseconds >= 1000) {\n return `${(milliseconds / 1000).toFixed(2)}s`;\n } else {\n return `${milliseconds}ms`;\n }\n }\n\n public formatElapsedTime(milliseconds: number): string {\n const seconds = Math.floor(milliseconds / 1000);\n const ms = milliseconds % 1000;\n if (seconds > 0) {\n return `${seconds}.${Math.floor(ms / 100)}s`;\n } else {\n return `${ms}ms`;\n }\n }\n\n private startElapsedTimeCounter(message: ConversationMessage) {\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n }\n \n this.elapsedTimeInterval = setInterval(() => {\n if (message.streamingStartTime && message.isStreaming) {\n message.elapsedTime = Date.now() - message.streamingStartTime;\n } else {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n }, 100); // Update every 100ms for smooth counter\n }\n\n /**\n * Shows the raw JSON dialog for a specific message\n * @param message - The message to show raw JSON for\n */\n public showRawJsonDialog(message: ConversationMessage) {\n if (message.rawContent) {\n try {\n const parsed = JSON.parse(message.rawContent);\n if (parsed.agentRunID) {\n const enhancedParsed = { ...parsed, _agentRunID: parsed.agentRunID };\n this.currentJsonContent = this.formatJson(enhancedParsed);\n } else {\n this.currentJsonContent = this.formatJson(parsed);\n }\n } catch {\n this.currentJsonContent = message.rawContent;\n }\n this.showJsonWindow = true;\n }\n }\n\n /** Closes the JSON viewer window */\n public closeJsonWindow(): void {\n this.showJsonWindow = false;\n this.currentJsonContent = '';\n }\n \n /**\n * Get the last run ID from conversation messages\n */\n getLastRunId(): string | null {\n const lastAssistantMessage = this.conversationMessages\n .filter(m => m.role === 'assistant' && m.agentRunId)\n .pop();\n return lastAssistantMessage?.agentRunId || null;\n }\n \n /**\n * Expands all nodes in the execution monitor\n * Called automatically when execution completes\n */\n private expandAllMonitoringNodes(): void {\n if (this.currentAgentRun && this.executionMonitorMode === 'historical') {\n // Force refresh the execution monitor by reassigning the entity\n this.currentAgentRun = this.currentAgentRun;\n // Note: The execution monitor component should handle auto-expansion internally\n }\n }\n \n \n /**\n * Navigate to the run details form\n */\n navigateToRun(event: { runId: string; runType: 'agent' | 'prompt' }) {\n if (event.runType === 'agent') {\n SharedService.Instance.OpenEntityRecord('MJ: AI Agent Runs', CompositeKey.FromID(event.runId));\n } else {\n SharedService.Instance.OpenEntityRecord('MJ: AI Prompt Runs', CompositeKey.FromID(event.runId));\n }\n \n // Emit event so parent window can minimize\n this.runOpened.emit(event);\n }\n \n /**\n * Copies the message content to clipboard.\n * @param message - The message to copy\n */\n public async copyMessage(message: ConversationMessage) {\n try {\n // Convert content to string if needed\n const content = typeof message.content === 'string' \n ? message.content \n : JSON.stringify(message.content);\n \n await navigator.clipboard.writeText(content);\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Message copied to clipboard',\n 'success',\n 2000\n );\n } catch (error) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to copy message',\n 'error',\n 3000\n );\n }\n }\n \n\n /**\n * Focuses the message input textarea.\n */\n private focusMessageInput(): void {\n if (this.messageInput) {\n setTimeout(() => {\n this.messageInput.nativeElement.focus();\n }, 100);\n }\n }\n\n /**\n * Determines if the provided content is valid JSON.\n * @param content - String content to test\n * @returns True if content can be parsed as JSON, false otherwise\n */\n public isJsonContent(content: string): boolean {\n if (!content) return false;\n try {\n JSON.parse(content);\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Formats JSON content with proper indentation for display.\n * Also recursively parses any nested JSON strings.\n * @param content - JSON string to format\n * @returns Formatted JSON string or original content if parsing fails\n */\n public formatJson(content: any): string {\n const parseOptions: ParseJSONOptions = {\n extractInlineJson: true,\n maxDepth: 100,\n debug: false\n };\n\n try {\n let parsed: any;\n if (typeof content === 'string') {\n parsed = JSON.parse(content);\n } else {\n parsed = content;\n }\n \n // Apply recursive JSON parsing\n const recursivelyParsed = ParseJSONRecursive(parsed, parseOptions);\n return JSON.stringify(recursivelyParsed, null, 2);\n } catch {\n return typeof content === 'string' ? content : JSON.stringify(content);\n }\n }\n\n /**\n * Checks if the payload should be displayed (not null, undefined, or empty object)\n * @param payload - The payload to check\n * @returns true if the payload has content, false otherwise\n */\n public hasPayload(payload: any): boolean {\n if (!payload) {\n return false;\n }\n \n // Check if it's an empty object\n if (typeof payload === 'object' && Object.keys(payload).length === 0) {\n return false;\n }\n \n return true;\n }\n\n /**\n * Toggles the collapsed state of a message's payload section\n * @param message - The message to toggle payload visibility for\n */\n public togglePayloadCollapse(message: ConversationMessage): void {\n message.payloadCollapsed = !message.payloadCollapsed;\n }\n\n /**\n * Formats streaming content with markdown rendering\n * @param message - The message containing streaming content\n * @returns SafeHtml formatted content\n */\n public getFormattedStreamingContent(message: ConversationMessage): SafeHtml {\n if (!message.streamingContent) {\n return this.sanitizer.sanitize(SecurityContext.HTML, '') || '';\n }\n \n const trimmedContent = message.streamingContent.trim();\n \n // Check if content type is markdown before applying markdown rendering\n const contentType = this.detectContentType(trimmedContent);\n if (contentType === 'markdown') {\n return this.renderMarkdown(trimmedContent);\n } else {\n // For plain text, just sanitize and return without extra processing\n return this.sanitizer.sanitize(SecurityContext.HTML, trimmedContent) || '';\n }\n }\n\n /**\n * Automatically detects the content type of a message for appropriate rendering.\n * Uses pattern matching to identify JSON, Markdown, or plain text content.\n * @param content - Content string to analyze\n * @returns Detected content type ('markdown', 'json', or 'text')\n */\n public detectContentType(content: string): 'markdown' | 'json' | 'text' {\n if (!content) return 'text';\n \n // Check if it's JSON\n if (this.isJsonContent(content)) {\n return 'json';\n }\n \n // Check for markdown indicators\n const markdownPatterns = [\n /^#{1,6}\\s/m, // Headers\n /\\*\\*[^*]+\\*\\*/, // Bold\n /\\*[^*]+\\*/, // Italic\n /\\[([^\\]]+)\\]\\(([^)]+)\\)/, // Links\n /```[\\s\\S]*?```/, // Code blocks\n /`[^`]+`/, // Inline code\n /^[-*+]\\s/m, // Lists\n /^\\d+\\.\\s/m // Numbered lists\n ];\n \n if (markdownPatterns.some(pattern => pattern.test(content))) {\n return 'markdown';\n }\n \n return 'text';\n }\n\n public renderMarkdown(content: string): SafeHtml {\n // Basic markdown to HTML conversion with improved formatting\n let html = content;\n \n // Escape HTML first\n html = html.replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n \n // Code blocks with language support\n html = html.replace(/```(\\w+)?\\n([\\s\\S]*?)```/g, (match, lang, code) => {\n const language = lang || '';\n const className = language ? ` class=\"language-${language}\"` : '';\n return `<pre class=\"code-block\"><code${className}>${code.trim()}</code></pre>`;\n });\n \n // Regular code blocks without language\n html = html.replace(/```([\\s\\S]*?)```/g, '<pre class=\"code-block\"><code>$1</code></pre>');\n \n // Inline code\n html = html.replace(/`([^`]+)`/g, '<code class=\"inline-code\">$1</code>');\n \n // Headers\n html = html.replace(/^### (.+)$/gm, '<h3 class=\"markdown-h3\">$1</h3>');\n html = html.replace(/^## (.+)$/gm, '<h2 class=\"markdown-h2\">$1</h2>');\n html = html.replace(/^# (.+)$/gm, '<h1 class=\"markdown-h1\">$1</h1>');\n \n // Bold\n html = html.replace(/\\*\\*([^*]+)\\*\\*/g, '<strong>$1</strong>');\n \n // Italic\n html = html.replace(/\\*([^*]+)\\*/g, '<em>$1</em>');\n \n // Links\n html = html.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, '<a href=\"$2\" target=\"_blank\" class=\"markdown-link\">$1</a>');\n \n // Unordered lists\n html = html.replace(/^[*-+] (.+)$/gm, '<li>$1</li>');\n html = html.replace(/((?:<li>.*<\\/li>\\s*)+)/g, '<ul class=\"markdown-list\">$1</ul>');\n \n // Numbered lists\n html = html.replace(/^\\d+\\. (.+)$/gm, '<li>$1</li>');\n html = html.replace(/((?:<li>.*<\\/li>\\s*)+)/g, '<ol class=\"markdown-list\">$1</ol>');\n \n // Paragraphs and line breaks - improved handling\n html = html.replace(/\\n\\s*\\n/g, '</p><p class=\"markdown-paragraph\">');\n html = html.replace(/\\n/g, '<br>');\n html = `<p class=\"markdown-paragraph\">${html}</p>`;\n \n // Clean up empty paragraphs\n html = html.replace(/<p class=\"markdown-paragraph\"><\\/p>/g, '');\n \n return this.sanitizer.bypassSecurityTrustHtml(`<div class=\"markdown-content\">${html}</div>`);\n }\n\n public getFormattedContent(message: ConversationMessage): SafeHtml {\n const content = message.content;\n const contentStr = typeof content === 'string' ? content : String(content);\n const contentType = this.detectContentType(contentStr);\n \n if (contentType === 'json') {\n // Try to extract human-readable content from JSON\n const extractedContent = this.extractHumanReadableContent(contentStr);\n if (extractedContent) {\n // Just render the extracted content\n return this.renderMarkdown(extractedContent);\n } else {\n // Fallback to inline code editor for JSON display\n return this.renderJsonWithCodeEditor(contentStr);\n }\n } else if (contentType === 'markdown') {\n return this.renderMarkdown(contentStr);\n } else {\n // Convert plain text to markdown for consistent formatting\n return this.renderMarkdown(contentStr);\n }\n }\n\n /**\n * Renders JSON content using an inline code editor component\n */\n private renderJsonWithCodeEditor(jsonStr: string): SafeHtml {\n try {\n // Format the JSON for display\n const formattedJson = this.formatJson(jsonStr);\n \n // Generate a unique ID for this editor instance\n const editorId = `json-editor-${this.generateMessageId()}`;\n \n // Create the HTML with a placeholder div that we'll replace with the code editor\n const html = `\n <div class=\"inline-json-editor\" data-editor-id=\"${editorId}\" data-json-content=\"${this.escapeHtmlAttribute(formattedJson)}\">\n <div class=\"json-editor-container\" style=\"height: 300px; width: 100%; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden;\">\n <pre style=\"margin: 0; padding: 12px; font-family: 'Fira Code', 'Consolas', monospace; font-size: 13px; overflow: auto; height: 100%;\">${this.escapeHtml(formattedJson)}</pre>\n </div>\n </div>\n `;\n \n // Note: In a real implementation, we would need to dynamically create the code editor component\n // For now, we'll use a styled pre tag as a fallback\n return this.sanitizer.bypassSecurityTrustHtml(html);\n } catch {\n // If JSON parsing fails, show as plain text\n const html = `<pre style=\"margin: 0; padding: 12px; font-family: 'Fira Code', 'Consolas', monospace; font-size: 13px; overflow: auto; background: var(--mj-bg-surface-card); border-radius: 4px;\">${this.escapeHtml(jsonStr)}</pre>`;\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n }\n \n /**\n * Escapes HTML content for use in attributes\n */\n private escapeHtmlAttribute(text: string): string {\n return text\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n }\n\n /**\n * Renders JSON content with human-readable content prominently displayed\n * and raw JSON in a collapsible section below with proper text wrapping.\n */\n \n /**\n * Gets a summary of the execution for tooltip display\n * @param message - The message to get execution summary for\n * @returns A brief summary of the execution steps\n */\n public getExecutionSummary(message: ConversationMessage): string {\n if (!message.rawContent) return '';\n \n try {\n const parsed = JSON.parse(message.rawContent);\n if (parsed.agentRunID) {\n return `Agent run ID: ${parsed.agentRunID}`;\n }\n } catch {\n // Ignore parse errors\n }\n \n return '';\n }\n\n /**\n * Closes the JSON dialog\n */\n public closeJsonDialog() {\n this.showJsonWindow = false;\n this.currentJsonContent = '';\n }\n \n /**\n * Copies the JSON content to clipboard\n */\n public copyJsonContent() {\n if (this.currentJsonContent) {\n navigator.clipboard.writeText(this.currentJsonContent).then(() => {\n // Success - JSON copied\n }).catch((err) => {\n // Error copying\n });\n }\n }\n\n /**\n * Extracts human-readable content from JSON responses.\n * Prioritizes userMessage field first, then checks other common fields.\n * @param jsonStr - JSON string to extract content from\n * @returns Extracted human-readable content or null if none found\n */\n private extractHumanReadableContent(jsonStr: string): string | null {\n try {\n const parsed = JSON.parse(jsonStr);\n \n // Priority 1: Always check userMessage first, regardless of taskComplete status\n if (parsed.userMessage && typeof parsed.userMessage === 'string' && parsed.userMessage.trim()) {\n return parsed.userMessage;\n }\n \n // Priority 2: Check for nested userMessage in nextStep or other objects\n if (parsed.nextStep && parsed.nextStep.userMessage && \n typeof parsed.nextStep.userMessage === 'string' && parsed.nextStep.userMessage.trim()) {\n return parsed.nextStep.userMessage;\n }\n \n // Priority 3: Other common human-readable fields\n const contentFields = [\n 'message', 'content', 'response', 'text', 'output',\n 'result', 'answer', 'reply', 'description', 'summary'\n ];\n \n for (const field of contentFields) {\n if (parsed[field] && typeof parsed[field] === 'string' && parsed[field].trim()) {\n return parsed[field];\n }\n }\n \n // Priority 4: Check nested objects for content\n for (const key of Object.keys(parsed)) {\n if (typeof parsed[key] === 'object' && parsed[key] !== null) {\n for (const field of ['userMessage', 'message', 'content']) {\n if (parsed[key][field] && typeof parsed[key][field] === 'string' && parsed[key][field].trim()) {\n return parsed[key][field];\n }\n }\n }\n }\n \n // Priority 5: If it's a simple string value, return it\n if (typeof parsed === 'string' && parsed.trim()) {\n return parsed;\n }\n \n // Priority 6: If it's an object with a single string property, consider returning it\n const keys = Object.keys(parsed);\n if (keys.length === 1 && typeof parsed[keys[0]] === 'string' && parsed[keys[0]].trim()) {\n return parsed[keys[0]];\n }\n \n return null;\n } catch {\n return null;\n }\n }\n\n /**\n * Checks if a message contains JSON content that has extractable human-readable content.\n * Used to determine if the raw toggle should be shown.\n * @param message - The conversation message to check\n * @returns True if the message has extractable content different from raw JSON\n */\n public hasExtractableContent(message: ConversationMessage): boolean {\n if (!message.content || message.role === 'user') {\n return false;\n }\n \n const contentStr = typeof message.content === 'string' ? message.content : String(message.content);\n if (!this.isJsonContent(contentStr)) {\n return false;\n }\n \n const extractedContent = this.extractHumanReadableContent(contentStr);\n return extractedContent !== null && extractedContent !== contentStr;\n }\n\n /**\n * Determines whether to show the raw toggle button for a message.\n * Combines the logic for raw content availability and extractable content.\n * @param message - The conversation message to check\n * @returns True if the raw toggle should be displayed\n */\n public showRawToggle(message: ConversationMessage): boolean {\n return (message.rawContent && !message.isStreaming) || this.hasExtractableContent(message);\n }\n\n private escapeHtml(text: string): string {\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n }\n\n /**\n * Formats JSON for proper display with text wrapping instead of wide code blocks.\n * Creates a structured, readable format that respects container width.\n */\n private formatJsonForDisplay(jsonStr: string): string {\n try {\n const parsed = JSON.parse(jsonStr);\n return this.createJsonDisplayHtml(parsed, 0);\n } catch {\n // If JSON parsing fails, escape and display as-is with wrapping\n return `<div class=\"json-fallback\">${this.escapeHtml(jsonStr)}</div>`;\n }\n }\n\n /**\n * Creates formatted HTML for JSON display with proper indentation and wrapping.\n */\n private createJsonDisplayHtml(obj: any, depth: number = 0): string {\n const indent = ' '.repeat(depth);\n const nextIndent = ' '.repeat(depth + 1);\n \n if (obj === null) return `<span class=\"json-null\">null</span>`;\n if (typeof obj === 'boolean') return `<span class=\"json-boolean\">${obj}</span>`;\n if (typeof obj === 'number') return `<span class=\"json-number\">${obj}</span>`;\n if (typeof obj === 'string') {\n const escaped = this.escapeHtml(obj);\n return `<span class=\"json-string\">\"<span class=\"json-string-content\">${escaped}</span>\"</span>`;\n }\n \n if (Array.isArray(obj)) {\n if (obj.length === 0) return '<span class=\"json-bracket\">[]</span>';\n \n const items = obj.map(item => \n `<div class=\"json-array-item\">${nextIndent}${this.createJsonDisplayHtml(item, depth + 1)}</div>`\n ).join(',\\n');\n \n return `<span class=\"json-bracket\">[</span>\\n${items}\\n<div class=\"json-indent\">${indent}</div><span class=\"json-bracket\">]</span>`;\n }\n \n if (typeof obj === 'object') {\n const keys = Object.keys(obj);\n if (keys.length === 0) return '<span class=\"json-bracket\">{}</span>';\n \n const properties = keys.map(key => {\n const escapedKey = this.escapeHtml(key);\n const value = this.createJsonDisplayHtml(obj[key], depth + 1);\n return `<div class=\"json-property\">${nextIndent}<span class=\"json-key\">\"${escapedKey}\"</span><span class=\"json-colon\">:</span> ${value}</div>`;\n }).join(',\\n');\n \n return `<span class=\"json-bracket\">{</span>\\n${properties}\\n<div class=\"json-indent\">${indent}</div><span class=\"json-bracket\">}</span>`;\n }\n \n return String(obj);\n }\n \n /**\n * Type guard to check if entity is an AI Agent\n */\n private isAgentEntity(entity: any): entity is MJAIAgentEntityExtended {\n // Check using the EntityInfo property from BaseEntity\n return entity && entity.EntityInfo && entity.EntityInfo.Name === 'MJ: AI Agents';\n }\n \n /**\n * Type guard to check if entity is an AI Prompt\n */\n private isPromptEntity(entity: any): entity is MJAIPromptEntityExtended {\n // Check using the EntityInfo property from BaseEntity\n const result = entity && entity.EntityInfo && entity.EntityInfo.Name === 'MJ: AI Prompts';\n \n return result;\n }\n \n /**\n * Gets the display name of the current entity\n */\n public getEntityName(): string {\n if (!this.entity) return '';\n return this.entity.Name || 'Untitled';\n }\n \n /**\n * Gets the icon class for the current entity\n */\n public getEntityIconClass(): string {\n if (!this.entity) {\n return this.mode === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-comment-dots';\n }\n \n if (this.isAgentEntity(this.entity)) {\n // Agent entity - check for IconClass\n return (this.entity as any).IconClass || 'fa-solid fa-robot';\n }\n \n // Prompt entity - use default prompt icon\n return 'fa-solid fa-comment-dots';\n }\n \n /**\n * Checks if the entity has a logo URL\n */\n public hasEntityLogo(): boolean {\n if (!this.entity || !this.isAgentEntity(this.entity)) {\n return false;\n }\n return !!(this.entity as any).LogoURL;\n }\n \n /**\n * Gets the logo URL for the entity (agent only)\n */\n public getEntityLogoURL(): string {\n if (!this.entity || !this.isAgentEntity(this.entity)) {\n return '';\n }\n return (this.entity as any).LogoURL || '';\n }\n \n /**\n * Updates stop sequences from the textarea input\n */\n public updateStopSequences() {\n if (this.stopSequencesText.trim() === '') {\n this.advancedParams.stopSequences = [];\n } else {\n // Split by comma and trim each sequence\n this.advancedParams.stopSequences = this.stopSequencesText\n .split(',')\n .map(s => s.trim())\n .filter(s => s.length > 0);\n }\n }\n \n /**\n * Toggles the advanced parameters expansion panel\n */\n public toggleAdvancedParams() {\n this.advancedParamsExpanded = !this.advancedParamsExpanded;\n }\n \n /**\n * Navigates to the AI Agent Run form to view detailed execution information\n * @param agentRunId - The ID of the agent run to view\n */\n public navigateToAgentRun({runId, runType}: {runId: string, runType: 'agent' | 'prompt'}) {\n if (runId && runType==='agent') {\n SharedService.Instance.OpenEntityRecord('MJ: AI Agent Runs', CompositeKey.FromID(runId));\n // Request minimization from our container\n this.minimizeRequested.emit();\n }\n }\n \n /**\n * Loads data from an existing prompt run to pre-populate the test harness\n * @param promptRunId - The ID of the prompt run to load\n */\n private async loadFromPromptRun(promptRunId: string): Promise<void> {\n console.log('🔄 Loading from prompt run:', promptRunId);\n const md = this.ProviderToUse;\n const promptRun = await md.GetEntityObject<MJAIPromptRunEntityExtended>('MJ: AI Prompt Runs');\n \n if (await promptRun.Load(promptRunId)) {\n console.log('✅ Prompt run loaded successfully');\n console.log('📝 Raw Messages field:', promptRun.Messages);\n \n // Set the model/vendor/configuration\n if (promptRun.ModelID) {\n this.selectedModelId = promptRun.ModelID;\n }\n if (promptRun.VendorID) {\n this.selectedVendorId = promptRun.VendorID;\n }\n if (promptRun.ConfigurationID) {\n this.selectedConfigurationId = promptRun.ConfigurationID;\n }\n \n // Set advanced parameters\n if (promptRun.Temperature != null) {\n this.advancedParams.temperature = promptRun.Temperature;\n }\n if (promptRun.TopP != null) {\n this.advancedParams.topP = promptRun.TopP;\n }\n if (promptRun.TopK != null) {\n this.advancedParams.topK = promptRun.TopK;\n }\n if (promptRun.MinP != null) {\n this.advancedParams.minP = promptRun.MinP;\n }\n if (promptRun.FrequencyPenalty != null) {\n this.advancedParams.frequencyPenalty = promptRun.FrequencyPenalty;\n }\n if (promptRun.PresencePenalty != null) {\n this.advancedParams.presencePenalty = promptRun.PresencePenalty;\n }\n if (promptRun.Seed != null) {\n this.advancedParams.seed = promptRun.Seed;\n }\n \n // Use the extended entity methods to get conversation messages\n const parsedData = promptRun.ParseMessagesData();\n console.log('🔍 Parsed messages data:', parsedData);\n \n const chatMessages = promptRun.GetChatMessages();\n console.log('💬 Extracted chat messages:', chatMessages);\n \n if (chatMessages.length > 0) {\n // Convert messages to the format expected by the test harness\n const convertedMessages = chatMessages.map((msg, index) => ({\n id: `msg-${Date.now()}-${index}`,\n role: msg.role,\n content: typeof msg.content === 'string' ? msg.content : \n Array.isArray(msg.content) ? \n msg.content.filter(block => block.type === 'text').map(block => block.content).join('\\n') : \n '',\n timestamp: new Date(),\n isStreaming: false\n }));\n \n console.log('🎯 Converted messages for test harness:', convertedMessages);\n this.conversationMessages = convertedMessages;\n \n // Store original messages for reset functionality\n this.originalPromptRunMessages = [...convertedMessages];\n \n // Reset re-run execution state\n this.hasExecutedRerun = false;\n \n console.log('✅ conversationMessages set:', this.conversationMessages);\n \n // Trigger change detection\n this.cdr.detectChanges();\n } else {\n console.log('⚠️ No chat messages found in prompt run');\n }\n \n // Extract and store the system prompt for re-run\n const systemPrompt = promptRun.GetSystemPrompt();\n if (systemPrompt) {\n this.systemPromptOverride = systemPrompt;\n console.log('📋 System prompt override set');\n }\n \n // Switch to model settings tab for prompt re-runs\n if (this.activeTab !== 'modelSettings') {\n this.selectTab('modelSettings');\n }\n } else {\n console.error('❌ Failed to load prompt run:', promptRunId);\n }\n }\n\n /** Case-insensitive UUID comparison for configuration ID matching in templates. */\n public IsConfigMatchById(config: MJAIConfigurationEntity, id: string | undefined): boolean {\n return UUIDsEqual(config.ID, id);\n }\n}","@if (isVisible) {\n <div class=\"harness-container\">\n <!-- Header -->\n <div class=\"harness-header\">\n @if (entity) {\n <div class=\"agent-info\">\n <div class=\"agent-details\">\n @if (hasEntityLogo()) {\n <img [src]=\"getEntityLogoURL()\" [alt]=\"getEntityName() + ' logo'\" class=\"entity-logo\">\n } @else {\n <i [class]=\"getEntityIconClass()\"></i>\n }\n <div>\n <h3>{{ getEntityName() }}</h3>\n @if (entity.Description) {\n <p>{{ entity.Description }}</p>\n }\n </div>\n </div>\n <div class=\"header-actions\">\n <button\n class=\"custom-button\"\n (click)=\"clearConversation()\"\n [disabled]=\"isExecuting || conversationMessages.length === 0\"\n title=\"Clear conversation\">\n <i class=\"fa-solid fa-broom\"></i>\n Clear\n </button>\n <button\n class=\"custom-button\"\n (click)=\"saveConversation()\"\n [disabled]=\"conversationMessages.length === 0\"\n title=\"Save conversation\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n <button\n class=\"custom-button\"\n (click)=\"exportConversation()\"\n [disabled]=\"conversationMessages.length === 0\"\n title=\"Export conversation\">\n <i class=\"fa-solid fa-download\"></i>\n Export\n </button>\n <button\n class=\"custom-button\"\n (click)=\"importConversation()\"\n title=\"Import conversation\">\n <i class=\"fa-solid fa-upload\"></i>\n Import\n </button>\n <input\n #fileInput\n type=\"file\"\n accept=\".json\"\n style=\"display: none\"\n (change)=\"onFileSelected($event)\">\n <button\n class=\"custom-button icon-only\"\n (click)=\"toggleSidebar()\"\n title=\"Toggle sidebar\">\n <i class=\"fa-solid\" [class.fa-chevron-right]=\"!showSidebar\" [class.fa-chevron-left]=\"showSidebar\"></i>\n </button>\n </div>\n </div>\n }\n </div>\n <!-- Main Content Area with Splitter -->\n <div class=\"harness-body\">\n @if (showSidebar) {\n <as-split\n direction=\"horizontal\"\n style=\"height: 100%; width: 100%;\">\n <!-- Chat Area (Left Pane) -->\n <as-split-area\n [size]=\"70\">\n <div class=\"chat-area\">\n <!-- Messages Container -->\n <div class=\"messages-container\" #messagesContainer>\n @if (conversationMessages.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-comments\"></i>\n <h4>Start a conversation</h4>\n <p>Send a message to begin testing the AI agent</p>\n </div>\n }\n @for (message of conversationMessages; track message.id) {\n <div [ngClass]=\"getMessageClass(message)\">\n <div class=\"message-header\">\n <span class=\"message-role\">\n @if (message.role === 'user') {\n <i class=\"fa-solid fa-user\"></i> You\n } @else {\n @if (hasEntityLogo()) {\n <img [src]=\"getEntityLogoURL()\" [alt]=\"getEntityName() + ' logo'\" class=\"message-role-logo\">\n } @else {\n <i [class]=\"getEntityIconClass()\"></i>\n }\n {{ getEntityName() || 'Assistant' }}\n }\n </span>\n <span class=\"message-time\">{{ formatTimestamp(message.timestamp) }}</span>\n @if (message.isStreaming && message.elapsedTime !== undefined) {\n <span class=\"execution-time streaming\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i> {{ formatElapsedTime(message.elapsedTime) }}\n </span>\n } @else if (message.executionTime) {\n <span class=\"execution-time\" [title]=\"getExecutionSummary(message)\">{{ formatExecutionTime(message.executionTime) }}</span>\n }\n @if (showRawToggle(message)) {\n <button class=\"raw-toggle\" (click)=\"showRawJsonDialog(message)\" title=\"View raw JSON response\">\n <i class=\"fa-solid fa-code\"></i>\n </button>\n }\n </div>\n <div class=\"message-content\">\n <button class=\"copy-button-in-bubble\" (click)=\"copyMessage(message)\" title=\"Copy message\">\n <i class=\"fa-solid fa-copy\"></i>\n </button>\n @if (message.isStreaming) {\n <div class=\"streaming-wrapper\">\n <span class=\"streaming-content\" [innerHTML]=\"getFormattedStreamingContent(message)\"></span>\n <span class=\"cursor\">|</span>\n </div>\n } @else {\n <div [innerHTML]=\"getFormattedContent(message)\"></div>\n }\n @if (message.error) {\n <div class=\"error-details\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ message.error }}\n </div>\n }\n @if (hasPayload(message.payload) && mode === 'agent' && message.role === 'assistant') {\n <div class=\"payload-section\" [class.collapsed]=\"message.payloadCollapsed\">\n <div class=\"payload-header\" (click)=\"togglePayloadCollapse(message)\">\n <span class=\"payload-label\">\n <i class=\"fa-solid fa-code\"></i> Payload\n </span>\n <button class=\"payload-toggle\" type=\"button\">\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!message.payloadCollapsed\" [class.fa-chevron-right]=\"message.payloadCollapsed\"></i>\n </button>\n </div>\n @if (!message.payloadCollapsed) {\n <div class=\"payload-content\">\n <mj-code-editor\n [ngModel]=\"formatJson(message.payload)\"\n [language]=\"'json'\"\n [readonly]=\"true\"\n style=\"height: 300px; width: 100%;\">\n </mj-code-editor>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n <!-- Input Area -->\n <div class=\"input-area\">\n @if (originalPromptRunId && conversationMessages.length > 0) {\n <!-- Re-run mode - show loaded message -->\n <div class=\"rerun-mode-container\">\n <div class=\"rerun-message\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n <span>Messages from Prompt Run <strong>{{ originalPromptRunId.substring(0, 8) }}</strong> loaded above</span>\n </div>\n <div class=\"rerun-buttons\">\n @if (!hasExecutedRerun) {\n <!-- Show Re-Run button if we haven't executed yet -->\n <button\n class=\"send-button rerun-button\"\n (click)=\"executeRerun()\"\n [disabled]=\"isExecuting\"\n title=\"Re-run with loaded messages\">\n @if (isExecuting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Running...</span>\n } @else {\n <i class=\"fa-solid fa-play\"></i>\n <span>Re-Run</span>\n }\n </button>\n } @else {\n <!-- Show only Reset button after execution -->\n <button\n class=\"send-button reset-button\"\n (click)=\"resetToOriginalMessages()\"\n [disabled]=\"isExecuting\"\n title=\"Reset conversation messages to the original state from the prompt run. Model settings and parameters will be preserved.\">\n <i class=\"fa-solid fa-rotate-left\"></i>\n <span>Reset Messages</span>\n </button>\n }\n </div>\n </div>\n } @else {\n <!-- Normal mode - show text input -->\n <div class=\"input-container\">\n <textarea\n #messageInput\n class=\"mj-textarea message-input\"\n [(ngModel)]=\"currentUserMessage\"\n [rows]=\"3\"\n placeholder=\"Type your message here... (Press Enter to send, Shift+Enter for new line)\"\n (keypress)=\"handleKeyPress($event)\"\n [disabled]=\"isExecuting\"></textarea>\n <button\n class=\"send-button\"\n (click)=\"sendMessage()\"\n [disabled]=\"isExecuting || !currentUserMessage.trim()\"\n title=\"Send message\">\n @if (isExecuting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-paper-plane\"></i>\n }\n </button>\n </div>\n }\n </div>\n </div>\n </as-split-area>\n <!-- Sidebar (Right Pane) -->\n <as-split-area\n [size]=\"30\">\n <div class=\"sidebar\">\n <!-- Tab Navigation -->\n <div class=\"sidebar-tabs\">\n @if (mode === 'agent') {\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'agentVariables'\"\n [disabled]=\"executionMonitorMode === 'live' && activeTab !== 'agentVariables'\"\n (click)=\"selectTab('agentVariables')\">\n <i class=\"fa-solid fa-code\"></i>\n Agent Variables\n </button>\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'executionMonitor'\"\n (click)=\"selectTab('executionMonitor')\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n Execution Monitor\n </button>\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'agentSettings'\"\n [disabled]=\"executionMonitorMode === 'live' && activeTab !== 'agentSettings'\"\n (click)=\"selectTab('agentSettings')\">\n <i class=\"fa-solid fa-sliders\"></i>\n Settings\n </button>\n } @else {\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'templateVariables'\"\n (click)=\"selectTab('templateVariables')\">\n <i class=\"fa-solid fa-code\"></i>\n Template Variables\n </button>\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'modelSettings'\"\n (click)=\"selectTab('modelSettings')\">\n <i class=\"fa-solid fa-sliders\"></i>\n Model Settings\n </button>\n }\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'savedConversations'\"\n [disabled]=\"executionMonitorMode === 'live' && activeTab !== 'savedConversations'\"\n (click)=\"selectTab('savedConversations')\">\n <i class=\"fa-solid fa-history\"></i>\n Saved\n @if (savedConversations.length > 0) {\n <span class=\"badge\">{{ savedConversations.length }}</span>\n }\n </button>\n </div>\n <!-- Tab Content -->\n <div class=\"sidebar-content\">\n <!-- Agent Variables Tab (Unified) -->\n @if (activeTab === 'agentVariables') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Agent Variables</h4>\n <p>Variables available during agent execution and template rendering</p>\n </div>\n <div class=\"variables-list\">\n @if (agentVariables.length === 0) {\n <div class=\"empty-variables\">\n <p>No variables defined. Click \"Add Variable\" to get started.</p>\n </div>\n }\n @for (variable of agentVariables; track $index) {\n <div class=\"variable-item\">\n <input type=\"text\"\n class=\"mj-input variable-name\"\n [(ngModel)]=\"variable.name\"\n placeholder=\"Variable name\"\n [disabled]=\"isExecuting\" />\n <mj-dropdown\n [(ngModel)]=\"variable.type\"\n [Data]=\"[\n {text: 'String', value: 'string'},\n {text: 'Number', value: 'number'},\n {text: 'Boolean', value: 'boolean'},\n {text: 'Object', value: 'object'}\n ]\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [Disabled]=\"isExecuting\"\n class=\"variable-type\">\n </mj-dropdown>\n <input type=\"text\"\n class=\"mj-input variable-value\"\n [(ngModel)]=\"variable.value\"\n [placeholder]=\"variable.type === 'object' ? 'JSON value' : 'Value'\"\n [disabled]=\"isExecuting\" />\n <button\n class=\"remove-button\"\n (click)=\"removeAgentVariable($index)\"\n [disabled]=\"isExecuting\"\n title=\"Remove variable\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n }\n </div>\n <button\n class=\"add-button\"\n (click)=\"addAgentVariable()\"\n [disabled]=\"isExecuting\">\n <i class=\"fa-solid fa-plus\"></i> Add Variable\n </button>\n </div>\n }\n <!-- Execution Monitor Tab -->\n @if (activeTab === 'executionMonitor') {\n <div class=\"tab-content\" style=\"padding: 0; height: 100%;\">\n <mj-agent-execution-monitor\n [mode]=\"executionMonitorMode\"\n [agentRun]=\"currentAgentRun\"\n [liveSteps]=\"liveAgentSteps\"\n [autoExpand]=\"true\"\n (viewRunClick)=\"navigateToAgentRun($event)\"\n [runId]=\"getLastRunId()\"\n [runType]=\"mode\">\n </mj-agent-execution-monitor>\n </div>\n }\n <!-- Agent Settings Tab -->\n @if (activeTab === 'agentSettings') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Agent Settings</h4>\n <p>Configure agent execution parameters</p>\n </div>\n <div class=\"model-settings\">\n <div class=\"setting-group\">\n <label>AI Configuration</label>\n <mj-dropdown\n [(ngModel)]=\"agentConfigurationId\"\n [Data]=\"availableConfigurations\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select a configuration...\"\n class=\"configuration-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n @if (agentConfigurationId) {\n @for (config of availableConfigurations; track config.ID) {\n @if (IsConfigMatchById(config, agentConfigurationId) && config.Description) {\n {{ config.Description }}\n }\n }\n } @else {\n Using default configuration\n }\n </div>\n </div>\n </div>\n </div>\n }\n <!-- Template Variables Tab (Prompt Mode) -->\n @if (activeTab === 'templateVariables') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Template Variables</h4>\n <p>Variables for prompt template rendering</p>\n </div>\n <div class=\"variables-list\">\n @for (variable of templateVariables; track $index) {\n <div class=\"variable-item\">\n <input type=\"text\"\n class=\"mj-input variable-name\"\n [(ngModel)]=\"variable.name\"\n placeholder=\"Variable name\"\n [disabled]=\"isExecuting\" />\n <mj-dropdown\n [(ngModel)]=\"variable.type\"\n [Data]=\"[\n {text: 'String', value: 'string'},\n {text: 'Number', value: 'number'},\n {text: 'Boolean', value: 'boolean'},\n {text: 'Object', value: 'object'}\n ]\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [Disabled]=\"isExecuting\"\n class=\"variable-type\">\n </mj-dropdown>\n <input type=\"text\"\n class=\"mj-input variable-value\"\n [(ngModel)]=\"variable.value\"\n [placeholder]=\"variable.type === 'object' ? 'JSON value' : 'Value'\"\n [disabled]=\"isExecuting\" />\n <button\n class=\"remove-button\"\n (click)=\"removeTemplateVariable($index)\"\n title=\"Remove variable\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n }\n </div>\n <button\n class=\"add-button\"\n (click)=\"addTemplateVariable()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Variable\n </button>\n </div>\n }\n <!-- Model Settings Tab (Prompt Mode) -->\n @if (activeTab === 'modelSettings') {\n <div class=\"tab-content\" style=\"overflow-y: auto;\">\n <div class=\"tab-header\">\n <h4>Model Settings</h4>\n <p>Configure AI model parameters</p>\n <button class=\"custom-button icon-only\" (click)=\"resetToPromptDefaults()\" title=\"Reset to Prompt Settings\">\n <i class=\"fa-solid fa-undo\"></i>\n </button>\n </div>\n <div class=\"model-settings\">\n <div class=\"setting-group\">\n <label>AI Model</label>\n <mj-dropdown\n [(ngModel)]=\"selectedModelId\"\n (ngModelChange)=\"onModelSelectionChange()\"\n [Data]=\"availableModels\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select a model...\"\n class=\"model-selector\">\n </mj-dropdown>\n </div>\n <div class=\"setting-group\">\n <label>AI Vendor</label>\n <mj-dropdown\n [(ngModel)]=\"selectedVendorId\"\n [Data]=\"availableVendors\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n [Disabled]=\"availableVendors.length <= 1 || !selectedModelId\"\n Placeholder=\"Select a vendor...\"\n class=\"vendor-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n @if (!selectedModelId) {\n Using default vendor for the default model\n } @else if (availableVendors.length <= 1) {\n Only one vendor available for this model\n } @else {\n Select the inference provider for this model\n }\n </div>\n </div>\n <div class=\"setting-group\">\n <label>AI Configuration</label>\n <mj-dropdown\n [(ngModel)]=\"selectedConfigurationId\"\n [Data]=\"availableConfigurations\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select a configuration...\"\n class=\"configuration-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n @if (selectedConfigurationId) {\n @for (config of availableConfigurations; track config.ID) {\n @if (IsConfigMatchById(config, selectedConfigurationId) && config.Description) {\n {{ config.Description }}\n }\n }\n } @else {\n Using default configuration\n }\n </div>\n </div>\n <div class=\"setting-group\">\n <label>Response Format</label>\n <mj-dropdown\n [(ngModel)]=\"selectedResponseFormat\"\n [Data]=\"responseFormatOptions\"\n TextField=\"text\"\n ValueField=\"value\"\n Placeholder=\"Select format...\"\n class=\"format-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n Expected format for AI response (defaults to prompt setting)\n </div>\n </div>\n <div class=\"setting-group\">\n <label>Max Tokens</label>\n <mj-numeric-input\n [(ngModel)]=\"maxTokens\"\n [Min]=\"100\"\n [Max]=\"8000\"\n [Step]=\"100\"\n Placeholder=\"Max tokens...\"\n class=\"max-tokens-input\">\n </mj-numeric-input>\n <div class=\"setting-help\">\n Maximum length of generated response\n </div>\n </div>\n <div class=\"setting-group\">\n <label class=\"checkbox-label\">\n <input type=\"checkbox\"\n [(ngModel)]=\"skipValidation\"\n class=\"skip-validation-checkbox\">\n Skip Validation\n </label>\n <div class=\"setting-help\">\n Skip output validation during testing\n </div>\n </div>\n <!-- Advanced Parameters Expansion Panel -->\n <mj-accordion-panel\n [Title]=\"'Advanced Parameters'\"\n [Expanded]=\"advancedParamsExpanded\"\n class=\"advanced-params-panel\">\n <div class=\"advanced-settings\">\n <div class=\"setting-group\">\n <label title=\"Controls randomness: 0 = more focused and deterministic, 2 = more random and creative\">\n Temperature\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.temperature\"\n [Min]=\"0\"\n [Max]=\"2\"\n [Step]=\"0.1\"\n [Format]=\"'n1'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Nucleus sampling: only consider tokens with cumulative probability up to this value. 1 = consider all tokens\">\n Top P\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.topP\"\n [Min]=\"0\"\n [Max]=\"1\"\n [Step]=\"0.01\"\n [Format]=\"'n2'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Only sample from the top K tokens. Lower values reduce randomness\">\n Top K\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.topK\"\n [Min]=\"1\"\n [Max]=\"100\"\n [Step]=\"1\"\n [Format]=\"'n0'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Minimum probability for token selection. Filters out low-probability tokens\">\n Min P\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.minP\"\n [Min]=\"0\"\n [Max]=\"1\"\n [Step]=\"0.01\"\n [Format]=\"'n2'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Penalizes tokens based on their frequency in the text. Positive values reduce repetition\">\n Frequency Penalty\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.frequencyPenalty\"\n [Min]=\"-2\"\n [Max]=\"2\"\n [Step]=\"0.1\"\n [Format]=\"'n1'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Penalizes tokens that have appeared in the text. Positive values increase topic diversity\">\n Presence Penalty\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.presencePenalty\"\n [Min]=\"-2\"\n [Max]=\"2\"\n [Step]=\"0.1\"\n [Format]=\"'n1'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Random seed for deterministic generation. Same seed produces same output\">\n Seed\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.seed\"\n [Format]=\"'n0'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Sequences that will stop generation when encountered. Enter comma-separated values\">\n Stop Sequences\n </label>\n <textarea\n class=\"mj-textarea advanced-param-input\"\n [(ngModel)]=\"stopSequencesText\"\n (ngModelChange)=\"updateStopSequences()\"\n [rows]=\"2\"\n placeholder=\"Enter comma-separated sequences\"></textarea>\n <div class=\"setting-help\">\n Separate multiple sequences with commas\n </div>\n </div>\n <div class=\"setting-group\">\n <label title=\"Include log probabilities of the output tokens in the response\">\n Include Log Probs\n </label>\n <mj-switch\n [(ngModel)]=\"advancedParams.includeLogProbs\"\n class=\"advanced-param-switch\">\n </mj-switch>\n </div>\n @if (advancedParams.includeLogProbs) {\n <div class=\"setting-group\">\n <label title=\"Number of top log probabilities to include for each token\">\n Top Log Probs\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.topLogProbs\"\n [Min]=\"2\"\n [Max]=\"20\"\n [Step]=\"1\"\n [Format]=\"'n0'\"\n Placeholder=\"2\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n }\n </div>\n </mj-accordion-panel>\n </div>\n </div>\n }\n <!-- Saved Conversations Tab -->\n @if (activeTab === 'savedConversations') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Saved Conversations</h4>\n <p>Previously saved test sessions</p>\n @if (currentConversationId) {\n <button class=\"custom-button small primary\" (click)=\"newConversation()\" title=\"Start a new conversation\">\n <i class=\"fa-solid fa-plus\"></i>\n New\n </button>\n }\n </div>\n <div class=\"saved-list\">\n @if (savedConversations.length === 0) {\n <div class=\"empty-saved\">\n <i class=\"fa-solid fa-folder-open\"></i>\n <p>No saved conversations</p>\n </div>\n }\n @for (conv of savedConversations; track conv.id) {\n <div class=\"saved-item\"\n [class.current]=\"conv.id === currentConversationId\"\n (click)=\"loadConversation(conv)\">\n <div class=\"saved-info\">\n <h5>{{ conv.name }}</h5>\n <p>{{ conv.messages.length }} messages</p>\n <span class=\"saved-date\">{{ conv.updatedAt | date:'short' }}</span>\n </div>\n <button\n class=\"delete-button\"\n (click)=\"deleteConversation(conv, $event)\"\n title=\"Delete conversation\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n </as-split-area>\n </as-split>\n } @else {\n <!-- No sidebar - full width chat -->\n <div class=\"chat-area\">\n <!-- Messages Container -->\n <div class=\"messages-container\" #messagesContainer>\n @if (conversationMessages.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-comments\"></i>\n <h4>Start a conversation</h4>\n <p>Send a message to begin testing the AI agent</p>\n </div>\n }\n @for (message of conversationMessages; track message.id) {\n <div [ngClass]=\"getMessageClass(message)\">\n <div class=\"message-header\">\n <span class=\"message-role\">\n @if (message.role === 'user') {\n <i class=\"fa-solid fa-user\"></i> You\n } @else {\n <i class=\"fa-solid fa-robot\"></i> {{ getEntityName() || 'Assistant' }}\n }\n </span>\n <span class=\"message-time\">{{ formatTimestamp(message.timestamp) }}</span>\n @if (message.isStreaming && message.elapsedTime !== undefined) {\n <span class=\"execution-time streaming\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i> {{ formatElapsedTime(message.elapsedTime) }}\n </span>\n } @else if (message.executionTime) {\n <span class=\"execution-time\" [title]=\"getExecutionSummary(message)\">{{ formatExecutionTime(message.executionTime) }}</span>\n }\n @if (showRawToggle(message)) {\n <button class=\"raw-toggle\" (click)=\"showRawJsonDialog(message)\" title=\"View raw JSON response\">\n <i class=\"fa-solid fa-code\"></i>\n </button>\n }\n @if (message.executionData && mode === 'agent' && message.role === 'assistant') {\n <button class=\"execution-history-toggle\" (click)=\"showMessageExecutionHistory(message)\" title=\"View execution details\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n </button>\n }\n @if (message.agentRunId && mode === 'agent' && message.role === 'assistant') {\n <button class=\"execution-history-toggle\" (click)=\"navigateToAgentRun({runId: message.agentRunId, runType: 'agent'})\" title=\"View full run details\">\n <i class=\"fa-solid fa-external-link-alt\"></i>\n </button>\n }\n </div>\n <div class=\"message-content\">\n <button class=\"copy-button-in-bubble\" (click)=\"copyMessage(message)\" title=\"Copy message\">\n <i class=\"fa-solid fa-copy\"></i>\n </button>\n @if (message.isStreaming) {\n <div class=\"streaming-wrapper\">\n <span class=\"streaming-content\">{{ message.streamingContent }}<span class=\"cursor\">|</span></span>\n </div>\n } @else {\n <div [innerHTML]=\"getFormattedContent(message)\"></div>\n }\n @if (message.error) {\n <div class=\"error-details\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ message.error }}\n </div>\n }\n @if (hasPayload(message.payload) && mode === 'agent' && message.role === 'assistant') {\n <div class=\"payload-section\" [class.collapsed]=\"message.payloadCollapsed\">\n <div class=\"payload-header\" (click)=\"togglePayloadCollapse(message)\">\n <span class=\"payload-label\">\n <i class=\"fa-solid fa-code\"></i> Payload\n </span>\n <button class=\"payload-toggle\" type=\"button\">\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!message.payloadCollapsed\" [class.fa-chevron-right]=\"message.payloadCollapsed\"></i>\n </button>\n </div>\n @if (!message.payloadCollapsed) {\n <div class=\"payload-content\">\n <pre>{{ formatJson(message.payload) }}</pre>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n <!-- Input Area -->\n <div class=\"input-area\">\n <div class=\"input-container\">\n <textarea\n #messageInput\n class=\"mj-textarea message-input\"\n [(ngModel)]=\"currentUserMessage\"\n [rows]=\"3\"\n placeholder=\"Type your message here... (Press Enter to send, Shift+Enter for new line)\"\n (keypress)=\"handleKeyPress($event)\"\n [disabled]=\"isExecuting\"></textarea>\n <button\n class=\"send-button\"\n (click)=\"sendMessage()\"\n [disabled]=\"isExecuting || !currentUserMessage.trim()\"\n title=\"Send message\">\n @if (isExecuting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-paper-plane\"></i>\n }\n </button>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n}\n\n<!-- Save Conversation Dialog -->\n@if (showSaveDialog) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"400\"\n (Close)=\"cancelSaveDialog()\"\n class=\"save-dialog\">\n <mj-dialog-titlebar>Save Conversation</mj-dialog-titlebar>\n <div class=\"dialog-content\">\n <p>Enter a name for this conversation:</p>\n <input\n #saveDialogInput\n type=\"text\"\n (keyup)=\"updateTempConversation()\"\n placeholder=\"Conversation name\"\n class=\"mj-input full-width\" />\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"cancelSaveDialog()\">Cancel</button>\n <button mjButton\n variant=\"primary\"\n (click)=\"confirmSaveConversation()\"\n [disabled]=\"tempConversationName === ''\">\n Save\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n\n<!-- Load Confirmation Dialog -->\n@if (showLoadConfirmDialog) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"400\"\n (Close)=\"cancelLoadConversation()\"\n class=\"confirm-dialog\">\n <mj-dialog-titlebar>Replace Current Conversation?</mj-dialog-titlebar>\n <div class=\"dialog-content\">\n <p>Loading this conversation will replace the current one. Any unsaved changes will be lost.</p>\n <p>Do you want to continue?</p>\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"cancelLoadConversation()\">Cancel</button>\n <button mjButton\n variant=\"primary\"\n (click)=\"confirmLoadConversation()\">\n Load Conversation\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n\n<!-- JSON Viewer Window -->\n@if (showJsonWindow) {\n <mj-window\n [Visible]=\"true\"\n Title=\"Raw JSON Response\"\n [Width]=\"900\"\n [Height]=\"700\"\n [MinWidth]=\"600\"\n [MinHeight]=\"400\"\n [Draggable]=\"true\"\n [Resizable]=\"true\"\n (Close)=\"closeJsonWindow()\">\n <mj-json-viewer-window [jsonContent]=\"currentJsonContent\"></mj-json-viewer-window>\n </mj-window>\n}\n\n"]}
1
+ {"version":3,"file":"ai-test-harness.component.js","sourceRoot":"","sources":["../../src/lib/ai-test-harness.component.ts","../../src/lib/ai-test-harness.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAA+C,SAAS,EAAgC,eAAe,EAAqB,MAAM,eAAe,CAAC;AACjM,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAIrE,OAAO,EAAY,OAAO,EAAE,YAAY,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,IAAI,IAAI,CAAC,SAAS,KAAK,eAAe,EAAE,CAAC;gBACrC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;YACpC,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;QAC/D,CAAC;IACL,CAAC;IAED,mFAAmF;IAC5E,iBAAiB,CAAC,MAA+B,EAAE,EAAsB;QAC5E,OAAO,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;uHAr+FQ,sBAAsB;oEAAtB,sBAAsB;;;;;;;;;YC1JnC,wFAAiB;YAo1BjB,+FAAsB;YA6BtB,+FAA6B;YAuB7B,8FAAsB;;YAx4BtB,wCAi1BC;YAGD,cA0BC;YA1BD,6CA0BC;YAGD,cAoBC;YApBD,oDAoBC;YAGD,cAaC;YAbD,6CAaC;;;iFD3vBY,sBAAsB;cANlC,SAAS;6BACI,KAAK,YACL,oBAAoB;;kBAkB7B,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAiBL,KAAK;;kBAaL,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAGN,SAAS;mBAAC,mBAAmB;;kBAG7B,SAAS;mBAAC,WAAW;;kBAGrB,SAAS;mBAAC,cAAc;;kBAGxB,SAAS;mBAAC,iBAAiB;;kFApFnB,sBAAsB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, ViewChild, ElementRef, AfterViewChecked, SecurityContext, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { MJAIAgentEntityExtended, MJAIPromptEntityExtended, MJAIAgentRunEntityExtended, MJAIAgentRunStepEntityExtended, MJAIPromptRunEntityExtended } from \"@memberjunction/ai-core-plus\";\nimport { MJTemplateParamEntity, MJAIConfigurationEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, CompositeKey } from '@memberjunction/core';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { SharedService } from '@memberjunction/ng-shared';\nimport { ChatMessage } from '@memberjunction/ai';\nimport { Subject, Subscription } from 'rxjs';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { ParseJSONRecursive, ParseJSONOptions, UUIDsEqual, EscapeHTML } from '@memberjunction/global';\n\n/**\n * Supported modes for the test harness\n */\nexport type TestHarnessMode = 'agent' | 'prompt';\n\n/**\n * Result interface for AI agent execution operations.\n * Contains comprehensive information about the execution outcome, timing, and data.\n */\n\n/**\n * Represents a variable in the data context or template data for agent execution.\n * Used to pass dynamic data to agents during testing and execution.\n */\nexport interface DataContextVariable {\n /** Variable name used in agent prompts and templates */\n name: string;\n /** String representation of the variable value */\n value: string;\n /** Data type for proper conversion during execution */\n type: 'string' | 'number' | 'boolean' | 'object';\n}\n\n/**\n * Enhanced chat message interface extending the base ChatMessage from @memberjunction/ai.\n * Includes additional properties for streaming, timing, error handling, and content management.\n */\nexport interface ConversationMessage extends ChatMessage {\n /** Unique identifier for this message */\n id: string;\n /** Timestamp when the message was created */\n timestamp: Date;\n /** Whether this message is currently being streamed */\n isStreaming?: boolean;\n /** Accumulated content during streaming (temporary) */\n streamingContent?: string;\n /** Total execution time for AI-generated messages */\n executionTime?: number;\n /** Associated agent run ID for tracking */\n agentRunId?: string;\n /** Error message if processing failed */\n error?: string;\n /** Original unprocessed content from the AI model */\n rawContent?: string;\n /** Whether to display raw content instead of processed content */\n showRaw?: boolean;\n /** Timestamp when streaming started (for elapsed time calculation) */\n streamingStartTime?: number;\n /** Current elapsed time during streaming */\n elapsedTime?: number;\n /** Whether JSON raw section is expanded in collapsible view */\n showJsonRaw?: boolean;\n /** Payload data from agent execution to display separately */\n payload?: any;\n /** Whether the payload section is collapsed */\n payloadCollapsed?: boolean;\n /** Execution data for agent runs */\n executionData?: any;\n}\n\n/**\n * Represents a saved conversation session with complete state information.\n * Includes all messages, context data, and metadata for restoration.\n */\nexport interface SavedConversation {\n /** Unique identifier for the saved conversation */\n id: string;\n /** User-provided name for the conversation */\n name: string;\n /** ID of the agent used in this conversation */\n agentId: string;\n /** Name of the agent for display purposes */\n agentName: string;\n /** Complete message history */\n messages: ConversationMessage[];\n /** Data context variables used during the conversation */\n dataContext: Record<string, any>;\n /** Template data variables used during the conversation (agent mode) */\n templateData: Record<string, any>;\n /** Template variables used during the conversation (prompt mode) */\n templateVariables?: Record<string, any>;\n /** Advanced parameters used during the conversation (prompt mode) */\n advancedParams?: any;\n /** Selected model ID (prompt mode) */\n selectedModelId?: string;\n /** Selected vendor ID (prompt mode) */\n selectedVendorId?: string;\n /** Selected configuration ID (prompt mode) */\n selectedConfigurationId?: string;\n /** Skip validation setting (prompt mode) */\n skipValidation?: boolean;\n /** Selected configuration ID (agent mode) */\n agentConfigurationId?: string;\n /** When the conversation was first created */\n createdAt: Date;\n /** When the conversation was last modified */\n updatedAt: Date;\n}\n\n/**\n * Comprehensive test harness component for AI Agent development and testing.\n * Provides a full-featured chat interface with conversation management, data context configuration,\n * template data management, streaming responses, conversation persistence, and import/export capabilities.\n * \n * ## Key Features:\n * - **Interactive Chat**: Real-time conversation with AI agents\n * - **Streaming Support**: Live streaming of agent responses with elapsed time tracking\n * - **Data Context Management**: Configure variables passed to agent during execution\n * - **Template Data Management**: Manage template variables for agent prompts\n * - **Conversation Persistence**: Save/load conversations with full state restoration\n * - **Import/Export**: JSON-based conversation backup and sharing\n * - **Content Formatting**: Automatic detection and rendering of Markdown, JSON, and plain text\n * - **Raw Content Toggle**: View both processed and raw AI responses\n * - **Error Handling**: Comprehensive error display and user feedback\n * \n * ## Usage:\n * ```html\n * <mj-ai-agent-test-harness \n * [aiAgent]=\"myAgent\"\n * [isVisible]=\"true\"\n * (visibilityChange)=\"onVisibilityChanged($event)\">\n * </mj-ai-agent-test-harness>\n * ```\n * \n * @example\n * ```typescript\n * // Using with agent entity\n * const agent = await metadata.GetEntityObject<MJAIAgentEntityExtended>('MJ: AI Agents');\n * await agent.Load('agent-id');\n * this.testHarness.aiAgent = agent;\n * this.testHarness.isVisible = true;\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-test-harness',\n templateUrl: './ai-test-harness.component.html',\n styleUrls: ['./ai-test-harness.component.css']\n})\nexport class AITestHarnessComponent extends BaseAngularComponent implements OnInit, OnDestroy, OnChanges, AfterViewChecked {\n /**\n * Creates a new AI Test Harness component instance.\n * @param sanitizer - Angular DomSanitizer for safe HTML rendering of formatted content\n * @param cdr - Angular ChangeDetectorRef for managing change detection\n */\n constructor(\n private sanitizer: DomSanitizer,\n private cdr: ChangeDetectorRef,\n private confirmService: MJConfirmService\n ) {\n super();}\n \n /** The mode of operation - either 'agent' or 'prompt' */\n @Input() mode: TestHarnessMode = 'agent';\n \n /** The entity to test - either an AI Agent or AI Prompt */\n @Input() entity: MJAIAgentEntityExtended | MJAIPromptEntityExtended | null = null;\n \n /** The original prompt run ID when re-running a previous prompt execution */\n @Input() originalPromptRunId: string | null = null;\n \n /** The system prompt override to use instead of rendering from template */\n @Input() systemPromptOverride: string | null = null;\n \n /** Whether a re-run has been executed (shows Reset button instead of Re-Run) */\n public hasExecutedRerun: boolean = false;\n \n /** Original messages from the prompt run for reset functionality */\n private originalPromptRunMessages: ConversationMessage[] = [];\n \n /** @deprecated Use 'entity' instead. Kept for backward compatibility. */\n @Input() \n get aiAgent(): MJAIAgentEntityExtended | null {\n return this.isAgentEntity(this.entity) ? this.entity : null;\n }\n set aiAgent(value: MJAIAgentEntityExtended | null) {\n this.entity = value;\n if (value) {\n this.mode = 'agent';\n }\n }\n \n private _isVisible: boolean = false;\n \n /**\n * Controls the visibility of the test harness. When set to true, automatically resets the harness state.\n * This property is typically controlled by parent components or dialog wrappers.\n */\n @Input() \n get isVisible(): boolean {\n return this._isVisible;\n }\n set isVisible(value: boolean) {\n const wasVisible = this._isVisible;\n this._isVisible = value;\n if (value && !wasVisible) {\n this.resetHarness();\n }\n }\n\n /** Event emitted when the visibility state changes, allowing parent components to react */\n @Output() visibilityChange = new EventEmitter<boolean>();\n \n /**\n * Emitted when the user navigates to view a run (agent or prompt)\n */\n @Output() runOpened = new EventEmitter<{ runId: string; runType: 'agent' | 'prompt' }>();\n \n /**\n * Event emitted when the component requests to be minimized (e.g., when navigating to a run)\n */\n @Output() minimizeRequested = new EventEmitter<void>();\n \n /** Reference to the scrollable messages container for auto-scrolling functionality */\n @ViewChild('messagesContainer') private messagesContainer!: ElementRef;\n \n /** Reference to the hidden file input element for conversation import functionality */\n @ViewChild('fileInput') private fileInput!: ElementRef;\n \n /** Reference to the message input textarea */\n @ViewChild('messageInput') private messageInput!: ElementRef<HTMLTextAreaElement>;\n \n /** Reference to the save dialog input */\n @ViewChild('saveDialogInput') private saveDialogInput?: ElementRef;\n\n // === Conversation State ===\n /** Complete array of all messages in the current conversation session */\n public conversationMessages: ConversationMessage[] = [];\n \n /** Current text input by the user (bound to textarea) */\n public currentUserMessage: string = '';\n \n /** Whether an agent execution is currently in progress */\n public isExecuting = false;\n \n // === Data Context Management ===\n /** Unified variables for agent execution (combines data context and template data) */\n public agentVariables: DataContextVariable[] = [];\n \n // === Prompt-specific properties ===\n /** Variables for prompt template rendering */\n public templateVariables: DataContextVariable[] = [];\n \n /** Selected AI model for prompt execution */\n public selectedModelId: string = '';\n \n /** Selected AI vendor for prompt execution */\n public selectedVendorId: string = '';\n \n /** Available AI vendors for the selected model */\n public availableVendors: any[] = [];\n \n /** Selected AI configuration for prompt execution */\n public selectedConfigurationId: string = '';\n \n /** Available AI configurations */\n public availableConfigurations: MJAIConfigurationEntity[] = [];\n \n /** Default model for the prompt (cached for display) */\n private defaultModelName: string = '';\n \n /** Maximum tokens for prompt execution */\n public maxTokens: number | null = null;\n \n /** Whether to skip validation when running prompts */\n public skipValidation: boolean = false;\n \n /** Selected AI configuration for agent execution */\n public agentConfigurationId: string = '';\n \n /** Advanced LLM Parameters */\n public advancedParams = {\n temperature: null as number | null,\n topP: null as number | null,\n topK: null as number | null,\n minP: null as number | null,\n frequencyPenalty: null as number | null,\n presencePenalty: null as number | null,\n seed: null as number | null,\n stopSequences: [] as string[],\n includeLogProbs: false,\n topLogProbs: 2\n };\n \n /** Raw stop sequences input for textarea */\n public stopSequencesText: string = '';\n \n /** Whether advanced parameters panel is expanded */\n public advancedParamsExpanded: boolean = false;\n \n /** Available AI models for prompt execution */\n public availableModels: any[] = [];\n \n /** Available response format options */\n protected responseFormatOptions = [\n { text: 'Any', value: 'Any' },\n { text: 'Text', value: 'Text' },\n { text: 'Markdown', value: 'Markdown' },\n { text: 'JSON', value: 'JSON' },\n { text: 'Model Specific', value: 'ModelSpecific' }\n ];\n\n /** Selected response format for prompt execution */\n public selectedResponseFormat = this.responseFormatOptions[0];\n \n // === UI State Management ===\n /** Whether the configuration sidebar is currently visible */\n public showSidebar = true;\n \n /** Currently active tab in the sidebar */\n public activeTab: 'agentVariables' | 'executionMonitor' | 'agentSettings' | 'templateVariables' | 'modelSettings' | 'savedConversations' = 'agentVariables';\n \n /** Array of saved conversation sessions loaded from localStorage */\n public savedConversations: SavedConversation[] = [];\n \n /** ID of the currently active/loaded conversation, if any */\n public currentConversationId: string | null = null;\n \n /** Flag to control JSON dialog visibility */\n public showJsonDialog: boolean = false;\n \n /** Current JSON content to display in the dialog */\n public currentJsonContent: string = '';\n \n /** Whether the JSON viewer window is visible */\n public showJsonWindow = false;\n \n // === Execution Monitor Properties ===\n /** Mode for the execution monitor component */\n public executionMonitorMode: 'live' | 'historical' = 'historical';\n \n /** Current agent run being displayed in execution monitor */\n public currentAgentRun: MJAIAgentRunEntityExtended | null = null;\n \n /**\n * Tracks agent steps during live execution (deprecated - now using agent run's Steps directly)\n */\n public liveAgentSteps: MJAIAgentRunStepEntityExtended[] = [];\n \n /** Track the last processed run ID to avoid reprocessing same data */\n private lastProcessedRunId: string | null = null;\n \n /** Track the last agent run ID for run chaining */\n private lastAgentRunId: string | null = null;\n \n /** Agent conversation state tracking */\n private agentConversationState: any = null;\n private lastAgentPayload: any = null;\n private subAgentHistory: any[] = [];\n \n /** Whether to show the save conversation dialog */\n public showSaveDialog: boolean = false;\n \n /** Name for the new conversation being saved */\n public newConversationName: string = '';\n \n /** Temporary name for the dialog input to avoid binding conflicts */\n public tempConversationName: string = '';\n \n /** Whether to show the load confirmation dialog */\n public showLoadConfirmDialog: boolean = false;\n \n /** Conversation pending to be loaded */\n private pendingLoadConversation: SavedConversation | null = null;\n \n /** Reference to the current message for JSON display */\n private currentJsonMessage: ConversationMessage | null = null;\n \n // === Private State & Intervals ===\n /** Subject for component destruction cleanup */\n private destroy$ = new Subject<void>();\n \n /** Flag indicating that auto-scroll is needed on next view check */\n private scrollNeeded = false;\n \n \n /** Interval handle for elapsed time counter during streaming */\n private elapsedTimeInterval: any;\n \n /** MemberJunction metadata instance for entity operations */\n private _metadata = this.ProviderToUse;\n \n /** Track if input has been focused to prevent repeated focusing */\n private _hasFocused = false;\n \n /** Subscription to MJGlobal events for streaming updates */\n private _mjGlobalEventSub: Subscription | undefined;\n \n /** Direct GraphQL subscription for agent execution streaming */\n private _agentStreamSub: Subscription | undefined;\n\n /**\n * Component initialization. Loads saved conversations, sets up event subscriptions,\n * and initializes the harness to a clean state.\n */\n async ngOnInit() {\n console.log('🚀 AITestHarnessComponent.ngOnInit');\n console.log('📌 originalPromptRunId:', this.originalPromptRunId);\n console.log('🎯 entity:', this.entity);\n console.log('📊 mode:', this.mode);\n \n // Ensure we have an entity\n if (!this.entity && this.aiAgent) {\n // Handle backward compatibility\n this.entity = this.aiAgent;\n this.mode = 'agent';\n }\n \n this.loadSavedConversations();\n this.subscribeToEvents();\n this.resetHarness();\n \n // Load configurations for both modes\n this.loadAvailableConfigurations();\n \n // If we have a prompt run ID, load the conversation history\n if (this.originalPromptRunId && this.mode === 'prompt') {\n console.log('🔄 Loading from prompt run in ngOnInit');\n await this.loadFromPromptRun(this.originalPromptRunId);\n }\n \n // Load models if in prompt mode\n if (this.mode === 'prompt') {\n this.loadAvailableModels();\n this.loadPromptDefaults();\n this.loadTemplateParameters(); // Load template parameters for pre-population\n }\n }\n\n /**\n * Responds to input property changes, particularly when entity is set/changed\n */\n ngOnChanges(changes: SimpleChanges) {\n if (changes['entity']) {\n if (changes['entity'].currentValue) {\n this.loadSavedConversations();\n }\n }\n \n if (changes['aiAgent']) {\n if (!this.entity && this.aiAgent) {\n this.entity = this.aiAgent;\n this.mode = 'agent';\n this.loadSavedConversations();\n }\n }\n \n if (changes['isVisible']) {\n if (changes['isVisible'].currentValue) {\n // Reset focus flag when dialog becomes visible\n this._hasFocused = false;\n }\n }\n }\n\n /**\n * Component cleanup. Destroys subscriptions and clears any active intervals\n * to prevent memory leaks.\n */\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n }\n if (this._mjGlobalEventSub) {\n this._mjGlobalEventSub.unsubscribe();\n }\n if (this._agentStreamSub) {\n this._agentStreamSub.unsubscribe();\n }\n }\n\n /**\n * Post-view check hook that handles auto-scrolling to the bottom of the message container\n * when new content is added.\n */\n ngAfterViewChecked() {\n if (this.scrollNeeded) {\n this.scrollToBottom();\n this.scrollNeeded = false;\n }\n \n // Auto-focus message input when dialog first becomes visible\n // Use Promise.resolve to schedule this after current change detection cycle\n if (this.isVisible && !this._hasFocused && this.messageInput) {\n this._hasFocused = true;\n Promise.resolve().then(() => {\n this.messageInput?.nativeElement?.focus();\n });\n }\n }\n\n private subscribeToEvents() {\n // Set up direct GraphQL subscription for agent execution stream\n const dataProvider = this.ProviderToUse as GraphQLDataProvider;\n const _providerPushStatusSub = dataProvider.PushStatusUpdates().subscribe(async (status: any) => {\n const message = JSON.parse(status.message || '{}');\n if (message?.resolver === 'RunAIAgentResolver') {\n // Handle different types of streaming messages\n if (message?.type === 'ExecutionProgress' && message.data?.agentRun) {\n // The server should be sending the full serialized agent run\n const serializedAgentRun = message.data.agentRun;\n \n // Update streaming message content if available\n if (message.data.progress?.message) {\n const streamingMessage = this.conversationMessages.find(m => m.isStreaming);\n if (streamingMessage) {\n // Clear any typing animation interval\n const typingInterval = (streamingMessage as any)._typingInterval;\n if (typingInterval) {\n clearInterval(typingInterval);\n delete (streamingMessage as any)._typingInterval;\n }\n \n // Update the streaming content with the status message\n streamingMessage.streamingContent = message.data.progress.message;\n this.scrollNeeded = true;\n }\n }\n \n // Update or create the agent run entity from the serialized data\n if (!this.currentAgentRun) {\n // First time - create the entity\n const md = this.ProviderToUse;\n this.currentAgentRun = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n }\n \n // Load the serialized data into our entity\n await this.currentAgentRun.LoadFromData(serializedAgentRun);\n \n // Update assistant message with agent run ID if available\n const streamingMessage = this.conversationMessages.find(m => m.isStreaming);\n if (streamingMessage && this.currentAgentRun.ID) {\n streamingMessage.agentRunId = this.currentAgentRun.ID;\n }\n \n // We're in live mode during streaming\n this.executionMonitorMode = 'live';\n \n // Pass the steps from the agent run to the execution monitor for live display\n this.liveAgentSteps = this.currentAgentRun.Steps || [];\n \n console.log('📊 Agent run update:', {\n id: this.currentAgentRun.ID,\n status: this.currentAgentRun.Status,\n stepCount: this.currentAgentRun.Steps?.length || 0,\n executionMonitorMode: this.executionMonitorMode,\n steps: this.currentAgentRun.Steps?.map(s => ({\n id: s.ID,\n type: s.StepType,\n status: s.Status,\n hasSubAgentRun: !!s.SubAgentRun,\n subStepCount: s.SubAgentRun?.Steps?.length || 0\n }))\n });\n \n // Force change detection\n this.cdr.detectChanges();\n }\n else if (message?.type === 'StreamingContent' && message.data?.streaming) {\n \n const streamingMessage = this.conversationMessages.find(m => m.isStreaming);\n if (streamingMessage) {\n // Append streaming content\n if (!streamingMessage.streamingContent) {\n streamingMessage.streamingContent = '';\n }\n streamingMessage.streamingContent = message.data.streaming.content;\n this.scrollNeeded = true;\n }\n }\n else if (message?.type === 'partial_result' && message.data?.partialResult) {\n // Could update execution monitor with partial results\n }\n else if (message?.type === 'complete') {\n // Switch execution monitor to historical mode with final data\n this.executionMonitorMode = 'historical';\n }\n }\n });\n }\n \n \n /**\n * Loads available AI models for prompt execution.\n * Only called when the harness is in prompt mode.\n */\n private async loadAvailableModels() {\n await AIEngineBase.Instance.Config(false);\n \n // Filter models by the prompt's AIModelTypeID if it exists\n let filteredModels: any[] = [];\n if (this.entity && 'AIModelTypeID' in this.entity) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n if (prompt.AIModelTypeID) {\n filteredModels = AIEngineBase.Instance.Models.filter(\n model => UUIDsEqual(model.AIModelTypeID, prompt.AIModelTypeID) && model.IsActive\n );\n } else {\n // No model type restriction, show all active models\n filteredModels = AIEngineBase.Instance.Models.filter(model => model.IsActive);\n }\n \n // Set default response format from prompt with slight delay for Kendo dropdown\n setTimeout(() => {\n const format = this.responseFormatOptions.find(f => f.value.trim().toLowerCase() === prompt.ResponseFormat.trim().toLowerCase());\n if (format) {\n this.selectedResponseFormat = format;\n }\n else {\n this.selectedResponseFormat = this.responseFormatOptions[0]; // Default to 'Any'\n }\n }, 0);\n } else {\n // Not a prompt entity, show all active models\n filteredModels = AIEngineBase.Instance.Models.filter(model => model.IsActive);\n }\n \n // Sort models by name\n filteredModels.sort((a, b) => a.Name.localeCompare(b.Name));\n \n // Determine the default model for this prompt\n if (this.entity && 'AIModelTypeID' in this.entity) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n this.defaultModelName = await this.getDefaultModelName(prompt);\n }\n \n // Add a blank option at the beginning with the default model name\n this.availableModels = [\n { ID: '', Name: this.defaultModelName ? `-- Default: ${this.defaultModelName} --` : '-- Use Default Model --' },\n ...filteredModels\n ];\n \n // Don't auto-select a model - let the dropdown show the blank option\n this.selectedModelId = '';\n \n // If we have a default model, load its default vendor\n if (this.defaultModelName) {\n await this.loadDefaultVendor();\n } else {\n this.selectedVendorId = '';\n this.availableVendors = [];\n }\n }\n \n /** Default model object for the prompt (cached for vendor lookup) */\n private defaultModel: any = null;\n \n /**\n * Gets the default model name for a prompt based on its configuration\n */\n private async getDefaultModelName(prompt: MJAIPromptEntityExtended): Promise<string> {\n try {\n // Get prompt-specific model associations\n const promptModels = AIEngineBase.Instance.PromptModels.filter(\n pm => UUIDsEqual(pm.PromptID, prompt.ID) &&\n (pm.Status === 'Active' || pm.Status === 'Preview')\n );\n \n let defaultModel: any = null;\n \n if (promptModels.length > 0) {\n // Sort by priority (higher priority first)\n promptModels.sort((a, b) => (b.Priority || 0) - (a.Priority || 0));\n \n // Find the first active model\n for (const pm of promptModels) {\n const model = AIEngineBase.Instance.Models.find(m => UUIDsEqual(m.ID, pm.ModelID) && m.IsActive);\n if (model) {\n defaultModel = model;\n break;\n }\n }\n }\n \n // If no prompt-specific model, use selection strategy\n if (!defaultModel) {\n const candidates = AIEngineBase.Instance.Models.filter(\n m => m.IsActive && \n (!prompt.AIModelTypeID || UUIDsEqual(m.AIModelTypeID, prompt.AIModelTypeID))\n );\n \n if (candidates.length > 0) {\n // Apply selection strategy\n if (prompt.SelectionStrategy === 'ByPower') {\n candidates.sort((a, b) => {\n switch (prompt.PowerPreference) {\n case 'Lowest':\n return (a.PowerRank || 0) - (b.PowerRank || 0);\n case 'Highest':\n case 'Balanced':\n default:\n return (b.PowerRank || 0) - (a.PowerRank || 0);\n }\n });\n }\n defaultModel = candidates[0];\n }\n }\n \n // Cache the default model object for vendor lookup\n this.defaultModel = defaultModel;\n \n return defaultModel ? defaultModel.Name : '';\n } catch (error) {\n console.error('Error getting default model name:', error);\n return '';\n }\n }\n \n /**\n * Loads the vendors for the default model\n */\n private async loadDefaultVendor() {\n try {\n if (!this.defaultModel) {\n this.availableVendors = [];\n return;\n }\n \n // Get vendors that offer this model - same logic as loadVendorsForModel\n const modelVendors = AIEngineBase.Instance.ModelVendors.filter(\n mv => UUIDsEqual(mv.ModelID, this.defaultModel.ID) &&\n mv.Status === 'Active' &&\n mv.Type?.trim().toLowerCase() === 'inference provider'\n );\n \n // Map to vendor objects with priority from ModelVendor\n const vendorObjects: any[] = [];\n for (const mv of modelVendors) {\n const vendor = AIEngineBase.Instance.Vendors.find(v => UUIDsEqual(v.ID, mv.VendorID));\n if (vendor) {\n vendorObjects.push({\n ID: vendor.ID,\n Name: vendor.Name,\n Priority: mv.Priority || 999 // Use ModelVendor priority\n });\n }\n }\n\n // Sort by priority (lower number = higher priority)\n vendorObjects.sort((a, b) => a.Priority - b.Priority);\n\n this.availableVendors = vendorObjects;\n \n // Select the highest priority vendor\n if (vendorObjects.length > 0) {\n this.selectedVendorId = vendorObjects[0].ID;\n }\n } catch (error) {\n console.error('Error loading default vendor:', error);\n this.availableVendors = [];\n }\n }\n \n /**\n * Loads available AI configurations from the database\n * Only configurations with 'Active' or 'Preview' status are shown\n */\n private async loadAvailableConfigurations() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJAIConfigurationEntity>({\n EntityName: 'MJ: AI Configurations',\n ExtraFilter: `Status IN ('Active', 'Preview')`,\n OrderBy: 'IsDefault DESC, Name',\n ResultType: 'entity_object'\n });\n \n if (result.Success && result.Results) {\n this.availableConfigurations = result.Results;\n \n // Auto-select the default configuration if one exists\n const defaultConfig = this.availableConfigurations.find(c => c.IsDefault);\n if (defaultConfig) {\n this.selectedConfigurationId = defaultConfig.ID;\n }\n } else {\n console.error('Failed to load AI configurations:', result.ErrorMessage);\n this.availableConfigurations = [];\n }\n } catch (error) {\n console.error('Error loading AI configurations:', error);\n this.availableConfigurations = [];\n }\n }\n \n /**\n * Handles model selection change and loads available vendors for the selected model\n */\n public onModelSelectionChange() {\n this.selectedVendorId = '';\n this.availableVendors = [];\n \n if (!this.selectedModelId) {\n // When default model is selected, load default vendor\n if (this.defaultModelName) {\n this.loadDefaultVendor();\n }\n return;\n }\n \n // Ensure AIEngineBase is configured\n if (!AIEngineBase.Instance.Models || AIEngineBase.Instance.Models.length === 0) {\n AIEngineBase.Instance.Config(false).then(() => {\n this.loadVendorsForModel();\n });\n } else {\n this.loadVendorsForModel();\n }\n }\n \n /**\n * Loads available vendors for the selected model\n */\n private loadVendorsForModel() {\n if (!this.selectedModelId) {\n return;\n }\n \n // Get model-specific vendors\n const modelVendors = AIEngineBase.Instance.ModelVendors.filter(\n mv => UUIDsEqual(mv.ModelID, this.selectedModelId) &&\n mv.Status === 'Active' &&\n mv.Type?.trim().toLowerCase() === 'inference provider'\n );\n \n // Map to vendor objects with priority from ModelVendor\n const vendorObjects: any[] = [];\n for (const mv of modelVendors) {\n const vendor = AIEngineBase.Instance.Vendors.find(v => UUIDsEqual(v.ID, mv.VendorID));\n if (vendor) {\n // For now, include all vendors. TODO: Filter by vendor type when available\n vendorObjects.push({\n ID: vendor.ID,\n Name: vendor.Name,\n Priority: mv.Priority || 999 // Use ModelVendor priority\n });\n }\n }\n \n // Sort by priority (lower number = higher priority)\n vendorObjects.sort((a, b) => a.Priority - b.Priority);\n \n this.availableVendors = vendorObjects;\n \n // Auto-select the highest priority vendor if only one or set default\n if (vendorObjects.length === 1) {\n this.selectedVendorId = vendorObjects[0].ID;\n } else if (vendorObjects.length > 1) {\n // Select the highest priority (lowest priority number)\n this.selectedVendorId = vendorObjects[0].ID;\n }\n }\n \n /**\n * Loads default parameter values from the AI prompt entity\n */\n private loadPromptDefaults() {\n if (this.mode === 'prompt' && this.entity && this.isPromptEntity(this.entity)) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n \n // Load default values from prompt entity\n if (prompt.Temperature != null) this.advancedParams.temperature = prompt.Temperature;\n if (prompt.TopP != null) this.advancedParams.topP = prompt.TopP;\n if (prompt.TopK != null) this.advancedParams.topK = prompt.TopK;\n if (prompt.MinP != null) this.advancedParams.minP = prompt.MinP;\n if (prompt.FrequencyPenalty != null) this.advancedParams.frequencyPenalty = prompt.FrequencyPenalty;\n if (prompt.PresencePenalty != null) this.advancedParams.presencePenalty = prompt.PresencePenalty;\n if (prompt.Seed != null) this.advancedParams.seed = prompt.Seed;\n if (prompt.StopSequences) {\n this.stopSequencesText = prompt.StopSequences;\n this.advancedParams.stopSequences = prompt.StopSequences.split(',').map((s: string) => s.trim()).filter((s: string) => s.length > 0);\n }\n if (prompt.IncludeLogProbs != null) this.advancedParams.includeLogProbs = prompt.IncludeLogProbs;\n if (prompt.TopLogProbs != null) this.advancedParams.topLogProbs = prompt.TopLogProbs;\n }\n }\n\n /**\n * Loads template parameters from the prompt's template and pre-populates\n * the template variables with their default values\n */\n private async loadTemplateParameters() {\n if (this.mode === 'prompt' && this.entity && this.isPromptEntity(this.entity)) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n \n if (!prompt.TemplateID) {\n return; // No template to load parameters from\n }\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJTemplateParamEntity>({\n EntityName: 'MJ: Template Params',\n ExtraFilter: `TemplateID='${prompt.TemplateID}'`,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n });\n\n if (result.Success && result.Results && result.Results.length > 0) {\n // Clear existing template variables\n this.templateVariables = [];\n \n // Add each template parameter as a variable with its default value\n for (const param of result.Results) {\n this.templateVariables.push({\n name: param.Name,\n value: param.DefaultValue || '',\n type: this.getVariableTypeFromParamType(param.Type)\n });\n }\n \n // If no parameters found, add one empty variable to start\n if (this.templateVariables.length === 0) {\n this.templateVariables.push({ name: '', value: '', type: 'string' });\n }\n }\n } catch (error) {\n console.error('Error loading template parameters:', error);\n // Add one empty variable on error\n this.templateVariables = [{ name: '', value: '', type: 'string' }];\n }\n }\n }\n\n /**\n * Maps template parameter types to variable types\n */\n private getVariableTypeFromParamType(paramType: string): 'string' | 'number' | 'boolean' | 'object' {\n switch (paramType?.toLowerCase()) {\n case 'number':\n case 'integer':\n case 'float':\n case 'decimal':\n return 'number';\n case 'boolean':\n case 'bool':\n return 'boolean';\n case 'object':\n case 'json':\n case 'array':\n return 'object';\n default:\n return 'string';\n }\n }\n\n \n /**\n * Resets all model settings to the prompt defaults\n */\n public resetToPromptDefaults() {\n if (this.mode === 'prompt' && this.entity && this.isPromptEntity(this.entity)) {\n const prompt = this.entity as MJAIPromptEntityExtended;\n \n // Reset model selection to default\n this.selectedModelId = '';\n \n // Reset vendor - will be loaded by loadDefaultVendor\n this.selectedVendorId = '';\n \n // Reset response format to prompt's setting\n const format = this.responseFormatOptions.find(f => \n f.value.trim().toLowerCase() === prompt.ResponseFormat.trim().toLowerCase()\n );\n this.selectedResponseFormat = format || this.responseFormatOptions[0];\n \n // Reset max tokens\n this.maxTokens = null;\n \n // Reset skip validation\n this.skipValidation = false;\n \n // Reset configuration to default\n const defaultConfig = this.availableConfigurations.find(c => c.IsDefault);\n if (defaultConfig) {\n this.selectedConfigurationId = defaultConfig.ID;\n } else {\n this.selectedConfigurationId = '';\n }\n \n // Reset advanced parameters\n this.advancedParams = {\n temperature: null,\n topP: null,\n topK: null,\n minP: null,\n frequencyPenalty: null,\n presencePenalty: null,\n seed: null,\n stopSequences: [],\n includeLogProbs: false,\n topLogProbs: 2\n };\n this.stopSequencesText = '';\n \n // Reload prompt defaults for advanced params\n this.loadPromptDefaults();\n \n // Reload default vendor for the default model\n if (this.defaultModelName) {\n this.loadDefaultVendor();\n }\n }\n }\n\n /**\n * Resets the test harness to its initial state, clearing all conversations,\n * variables, and UI state. Called automatically when the harness becomes visible.\n */\n public resetHarness() {\n this.conversationMessages = [];\n this.currentUserMessage = '';\n this.isExecuting = false;\n this.agentVariables = [{ name: '', value: '', type: 'string' }];\n this.templateVariables = [];\n this.currentConversationId = null;\n this.showSidebar = true;\n // Clear execution data and tracking when explicitly resetting\n this.currentAgentRun = null;\n this.lastProcessedRunId = null;\n this.lastAgentRunId = null; // Clear run chaining\n this.executionMonitorMode = 'historical';\n // Reset conversation state\n this.agentConversationState = null;\n this.lastAgentPayload = null;\n this.subAgentHistory = [];\n // Set default tab based on mode\n this.activeTab = this.mode === 'agent' ? 'agentVariables' : 'modelSettings';\n // Reset advanced parameters\n this.advancedParams = {\n temperature: null,\n topP: null,\n topK: null,\n minP: null,\n frequencyPenalty: null,\n presencePenalty: null,\n seed: null,\n stopSequences: [],\n includeLogProbs: false,\n topLogProbs: 2\n };\n this.stopSequencesText = '';\n this.advancedParamsExpanded = false;\n this.skipValidation = false;\n // Reset agent configuration to default\n if (this.mode === 'agent') {\n const defaultConfig = this.availableConfigurations.find(c => c.IsDefault);\n this.agentConfigurationId = defaultConfig?.ID || '';\n }\n }\n \n /**\n * Starts a new conversation\n */\n public async newConversation() {\n if (this.conversationMessages.length > 0 && !this.currentConversationId) {\n // Unsaved conversation exists - use our custom dialog\n if (await this.confirmService.Confirm({ title: 'Unsaved conversation', message: 'You have an unsaved conversation. Would you like to save it first?', confirmText: 'Save' })) {\n this.saveConversation();\n return;\n }\n }\n \n // Clear execution data when explicitly starting a new conversation\n this.currentAgentRun = null;\n this.lastProcessedRunId = null;\n this.lastAgentRunId = null; // Clear run chaining\n \n this.resetHarness();\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Started new conversation',\n 'info',\n 2000\n );\n }\n\n /**\n * Closes the test harness by setting visibility to false and emitting the change event.\n * Used by dialog implementations and close buttons.\n */\n public close() {\n this._isVisible = false;\n this.visibilityChange.emit(false);\n }\n\n /**\n * Toggles the visibility of the configuration sidebar.\n * Allows users to show/hide the data context and conversation management panels.\n */\n public toggleSidebar() {\n this.showSidebar = !this.showSidebar;\n }\n\n /**\n * Switches to the specified tab in the configuration sidebar.\n * @param tab - The tab to activate\n */\n public selectTab(tab: 'agentVariables' | 'executionMonitor' | 'agentSettings' | 'templateVariables' | 'modelSettings' | 'savedConversations') {\n console.log('🔄 Switching to tab:', tab, {\n currentAgentRun: !!this.currentAgentRun,\n agentRunStatus: this.currentAgentRun?.Status || 'none',\n conversationMessages: this.conversationMessages.length,\n executionMonitorMode: this.executionMonitorMode\n });\n \n this.activeTab = tab;\n \n // If switching to execution monitor tab, ensure it has the latest data\n if (tab === 'executionMonitor') {\n console.log('📊 Switching to execution monitor tab');\n \n // Always ensure we have the latest execution data when switching to monitor\n if (this.conversationMessages.length > 0) {\n const lastAssistantMessage = this.conversationMessages\n .filter(m => m.role === 'assistant' && m.agentRunId)\n .pop();\n \n console.log('🔍 Last assistant message with agent run:', {\n found: !!lastAssistantMessage,\n hasAgentRunId: !!lastAssistantMessage?.agentRunId,\n agentRunId: lastAssistantMessage?.agentRunId\n });\n \n if (lastAssistantMessage && lastAssistantMessage.agentRunId) {\n // Always update agent run to ensure it's fresh\n const messageRunId = lastAssistantMessage.agentRunId;\n \n // Load the agent run\n this.loadAgentRun(messageRunId);\n this.executionMonitorMode = 'historical';\n this.lastProcessedRunId = messageRunId;\n \n console.log('✅ Loading agent run:', {\n mode: this.executionMonitorMode,\n runId: this.lastProcessedRunId\n });\n \n // Trigger change detection to ensure the execution monitor updates\n setTimeout(() => {\n this.cdr.detectChanges();\n }, 50);\n } else {\n console.log('❌ No agent run ID found in messages');\n }\n } else {\n console.log('❌ No conversation messages found');\n }\n } else {\n console.log('📄 Switching away from execution monitor, preserving data:', {\n currentAgentRunExists: !!this.currentAgentRun\n });\n // Don't clear currentAgentRun when switching away from execution monitor\n // This preserves the state for when the user switches back\n }\n }\n\n /**\n * Shows the execution history for a specific message\n * @param message - The message to show execution history for\n */\n public async showMessageExecutionHistory(message: ConversationMessage) {\n if (message.agentRunId && this.mode === 'agent') {\n // Load the agent run entity\n await this.loadAgentRun(message.agentRunId);\n this.executionMonitorMode = 'historical';\n // Switch to execution monitor tab if not already there\n if (this.activeTab !== 'executionMonitor') {\n this.selectTab('executionMonitor');\n }\n }\n }\n \n /**\n * Loads an agent run entity by ID\n * @param runId - The ID of the agent run to load\n */\n private async loadAgentRun(runId: string): Promise<void> {\n const md = this.ProviderToUse;\n const agentRunEntity = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n await agentRunEntity.Load(runId);\n await this.internalLoadAgenRun(agentRunEntity);\n }\n\n private async loadAgentRunFromData(agentRunData: any): Promise<void> {\n const md = this.ProviderToUse;\n const agentRunEntity = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n await agentRunEntity.LoadFromData(agentRunData);\n await this.internalLoadAgenRun(agentRunEntity);\n }\n\n private async internalLoadAgenRun(agentRunEntity: MJAIAgentRunEntityExtended): Promise<void> {\n try {\n this.currentAgentRun = agentRunEntity;\n // The Load method automatically loads related steps through InnerLoad override\n // No need to call LoadRelatedData explicitly as it's protected\n \n // Set execution monitor mode\n this.executionMonitorMode = 'historical';\n \n console.log('✅ Loaded agent run:', {\n id: agentRunEntity.ID,\n stepCount: this.currentAgentRun.Steps?.length || 0\n });\n \n // Force change detection to update the execution monitor\n this.cdr.detectChanges();\n } catch (error) {\n console.error('❌ Failed to load agent run:', error);\n this.currentAgentRun = null;\n }\n }\n \n\n /**\n * Sends the current user message to the AI agent and initiates execution.\n * Handles message validation, conversation updates, UI state management, and agent execution.\n * Automatically clears the input field and triggers auto-scroll after sending.\n * \n * @example\n * ```typescript\n * // Called when user presses Enter or clicks Send button\n * await this.sendMessage();\n * ```\n */\n /**\n * Executes a re-run of a previously loaded prompt run.\n * This bypasses the need for a new user message since we're re-running with existing messages.\n */\n public async executeRerun() {\n if (this.mode === 'prompt' && this.conversationMessages.length > 0) {\n // Mark that we've executed a re-run\n this.hasExecutedRerun = true;\n \n // For prompt re-runs, we need to execute the prompt with the loaded messages\n await this.executePrompt(''); // Empty message since we're using loaded conversation\n }\n }\n \n /**\n * Resets the conversation back to the original messages from the prompt run.\n * This is available after a re-run has been executed.\n */\n public resetToOriginalMessages() {\n if (this.originalPromptRunMessages.length > 0) {\n // Reset messages to the original state\n this.conversationMessages = [...this.originalPromptRunMessages];\n \n // Reset the execution flag so Re-Run button shows again\n this.hasExecutedRerun = false;\n \n // Trigger change detection\n this.cdr.detectChanges();\n \n console.log('🔄 Reset to original messages from prompt run');\n }\n }\n \n public async sendMessage() {\n if (!this.currentUserMessage.trim() || !this.entity) {\n return;\n }\n\n // Add user message to conversation\n const userMessage: ConversationMessage = {\n id: this.generateMessageId(),\n role: 'user',\n content: this.currentUserMessage.trim(),\n timestamp: new Date()\n };\n this.conversationMessages.push(userMessage);\n \n // Clear input and update change detection\n const messageToSend = this.currentUserMessage;\n this.currentUserMessage = '';\n \n // Use Promise.resolve to defer the change detection to the next microtask\n // This prevents ExpressionChangedAfterItHasBeenCheckedError\n Promise.resolve().then(() => {\n this.cdr.detectChanges();\n });\n \n // Scroll to bottom\n this.scrollNeeded = true;\n\n // Auto-switch to execution monitor tab if in agent mode\n if (this.mode === 'agent' && this.activeTab !== 'executionMonitor') {\n this.selectTab('executionMonitor');\n }\n \n // Clear previous execution data when starting a new execution\n this.currentAgentRun = null;\n this.lastProcessedRunId = null;\n \n // Execute based on mode\n if (this.mode === 'agent') {\n await this.executeAgent(messageToSend);\n } else {\n await this.executePrompt(messageToSend);\n }\n }\n\n private async executeAgent(userMessage: string) {\n if (!this.entity || !this.isAgentEntity(this.entity)) return;\n\n this.isExecuting = true;\n\n // Clear previous execution data when starting a new run\n // Create a proper agent run entity for live tracking\n const md = this.ProviderToUse;\n this.currentAgentRun = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n this.currentAgentRun.ID = `temp-${Date.now()}`;\n this.currentAgentRun.Status = 'Running';\n this.currentAgentRun.StartedAt = new Date();\n // Steps will be populated by the agent updates\n this.liveAgentSteps = [];\n this.executionMonitorMode = 'live';\n\n // Add placeholder assistant message for streaming\n const assistantMessage: ConversationMessage = {\n id: this.generateMessageId(),\n role: 'assistant',\n content: '',\n timestamp: new Date(),\n isStreaming: true,\n streamingContent: this.mode === 'agent' ? 'Running agent...' : 'Running prompt...',\n agentRunId: '',\n streamingStartTime: Date.now(),\n elapsedTime: 0\n };\n this.conversationMessages.push(assistantMessage);\n this.scrollNeeded = true;\n \n // Start elapsed time counter\n this.startElapsedTimeCounter(assistantMessage);\n \n // Initialize execution monitor for live mode - already created above\n \n\n try {\n // Get GraphQL data provider\n const dataProvider = this.ProviderToUse as GraphQLDataProvider;\n \n // Build data context - include conversation state if available\n const dataContext = this.buildDataContext();\n const templateData = this.buildTemplateData();\n \n // Add conversation state to data context if we have it\n if (this.agentConversationState) {\n dataContext._conversationState = this.agentConversationState;\n }\n if (this.lastAgentPayload) {\n dataContext._lastPayload = this.lastAgentPayload;\n }\n if (this.subAgentHistory.length > 0) {\n dataContext._subAgentHistory = this.subAgentHistory;\n }\n \n // Execute the agent using the new AI client\n // Start typing animation while we wait for the first real stream\n this.startTypingAnimation(assistantMessage);\n\n const executionResult = await dataProvider.AI.RunAIAgent({\n agent: this.entity as MJAIAgentEntityExtended,\n conversationMessages: this.conversationMessages, \n data: Object.keys(dataContext).length > 0 ? dataContext : undefined, \n lastRunId: this.lastAgentRunId || undefined,\n autoPopulateLastRunPayload: this.lastAgentRunId ? true : false,\n configurationId: this.agentConfigurationId || undefined\n });\n\n // Stop elapsed time counter\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n\n // Update assistant message with result\n assistantMessage.isStreaming = false;\n\n if (executionResult?.success) {\n // executionResult is now an ExecuteAgentResult from the GraphQL client\n // It has already been parsed and contains: success, payload, agentRun, etc.\n const parseOptions: ParseJSONOptions = {\n extractInlineJson: true,\n maxDepth: 100,\n debug: false\n };\n\n // Apply recursive JSON parsing to extract any nested JSON strings\n const fullResult = ParseJSONRecursive(executionResult, parseOptions);\n\n // Store agent run ID with the message\n if (fullResult && fullResult.agentRun?.ID) {\n assistantMessage.agentRunId = fullResult.agentRun.ID;\n }\n\n // Load the agent run for display\n if (fullResult && fullResult.agentRun) {\n await this.loadAgentRunFromData(fullResult.agentRun);\n // Only switch to historical mode after successfully loading\n this.executionMonitorMode = 'historical';\n // Clear live steps only after we have the historical data\n this.liveAgentSteps = [];\n } else {\n // If no agent run ID, keep showing live steps\n console.log('⚠️ No agent run ID in result, keeping live mode');\n }\n\n // Auto-expand all monitoring nodes once execution is complete\n setTimeout(() => {\n this.expandAllMonitoringNodes();\n }, 100);\n\n // Preserve conversation state from the result\n if (fullResult.payload) {\n this.lastAgentPayload = fullResult.payload;\n\n // Extract conversation state if present\n if (fullResult.payload.conversationState) {\n this.agentConversationState = fullResult.payload.conversationState;\n }\n }\n\n // Extract the user message from the nested payload structure\n let displayContent = 'No response generated';\n let payloadData = fullResult.payload;\n\n if (fullResult.agentRun?.Message?.length > 0) {\n displayContent = fullResult.agentRun.Message;\n }\n\n assistantMessage.content = displayContent;\n assistantMessage.payload = payloadData; // Store the payload if present\n const startedAt = executionResult.agentRun?.StartedAt ? new Date(executionResult.agentRun.StartedAt).getTime() : 0;\n const completedAt = executionResult.agentRun?.CompletedAt ? new Date(executionResult.agentRun.CompletedAt).getTime() : 0;\n const executionTime = (startedAt && completedAt) ? (completedAt - startedAt) : 0;\n assistantMessage.executionTime = executionTime;\n assistantMessage.agentRunId = fullResult.agentRun?.ID || assistantMessage.agentRunId;\n\n // Update the tracking ID when we set new execution data\n this.lastProcessedRunId = assistantMessage.agentRunId || null;\n\n // Update the last agent run ID for run chaining\n if (fullResult.agentRun?.ID) {\n this.lastAgentRunId = fullResult.agentRun.ID;\n }\n\n // Store the full result as raw content for debugging/inspection\n assistantMessage.rawContent = JSON.stringify(fullResult, null, 2);\n\n // Force change detection to update the execution monitor\n this.cdr.detectChanges();\n } else {\n console.error('❌ AI Test Harness: Execution failed', {\n success: executionResult?.success,\n errorMessage: executionResult?.agentRun?.ErrorMessage,\n hasPayload: !!executionResult?.payload\n });\n assistantMessage.content = 'I encountered an error processing your request.';\n assistantMessage.error = executionResult?.agentRun?.ErrorMessage || 'Unknown error occurred';\n\n // On failure, clear live steps and switch to historical mode\n if (this.currentAgentRun) {\n this.executionMonitorMode = 'historical';\n this.liveAgentSteps = [];\n }\n\n // Store the error result as raw content\n if (executionResult) {\n assistantMessage.rawContent = JSON.stringify(executionResult, null, 2);\n }\n }\n\n delete assistantMessage.streamingContent;\n this.scrollNeeded = true;\n\n // Auto-save conversation\n this.autoSaveConversation();\n \n // Auto-expand all monitoring nodes once execution is complete (for prompt mode)\n if (this.mode === 'prompt') {\n setTimeout(() => {\n this.expandAllMonitoringNodes();\n }, 100);\n }\n\n } catch (error) {\n console.error('❌ AI Test Harness: Caught error during agent execution', {\n error: error,\n message: (error as any)?.message,\n stack: (error as any)?.stack,\n type: (error as any)?.constructor?.name\n });\n \n // Update assistant message with error\n const lastMessage = this.conversationMessages[this.conversationMessages.length - 1];\n if (lastMessage && lastMessage.role === 'assistant') {\n lastMessage.isStreaming = false;\n lastMessage.content = 'I encountered an error processing your request.';\n lastMessage.error = (error as Error).message;\n delete lastMessage.streamingContent;\n }\n \n // On error, clear live steps and switch to historical mode\n if (this.currentAgentRun) {\n this.executionMonitorMode = 'historical';\n this.liveAgentSteps = [];\n }\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to execute agent: ' + (error as Error).message,\n 'error',\n 6000\n );\n } finally {\n this.isExecuting = false;\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n \n // Focus back on the input\n this.focusMessageInput();\n }\n }\n\n private async executePrompt(userMessage: string) {\n if (!this.entity || !this.isPromptEntity(this.entity)) return;\n\n this.isExecuting = true;\n\n // Add placeholder assistant message for streaming\n const assistantMessage: ConversationMessage = {\n id: this.generateMessageId(),\n role: 'assistant',\n content: '',\n timestamp: new Date(),\n isStreaming: true,\n streamingContent: this.mode === 'agent' ? 'Running agent...' : 'Running prompt...',\n agentRunId: '',\n streamingStartTime: Date.now(),\n elapsedTime: 0\n };\n this.conversationMessages.push(assistantMessage);\n this.scrollNeeded = true;\n \n // Start elapsed time counter\n this.startElapsedTimeCounter(assistantMessage);\n\n try {\n // Get GraphQL data provider\n const dataProvider = this.ProviderToUse as GraphQLDataProvider;\n\n // Build template variables from user input\n const templateVariables = this.buildTemplateVariables();\n \n // Prepare data context (template variables + user message)\n const dataContext = {\n ...templateVariables,\n userMessage: userMessage\n };\n \n // Build conversation messages\n const messages = this.conversationMessages\n .filter(m => !m.isStreaming && m.content) // Only include non-streaming messages with content\n .map(m => ({\n role: m.role as string,\n content: m.content as string\n }));\n \n // Execute the prompt using the new AI client\n const executionResult = await dataProvider.AI.RunAIPrompt({\n promptId: (this.entity as MJAIPromptEntityExtended).ID,\n data: dataContext,\n overrideModelId: this.selectedModelId || undefined,\n overrideVendorId: this.selectedVendorId || undefined,\n configurationId: this.selectedConfigurationId || undefined,\n skipValidation: this.skipValidation,\n templateData: undefined, // Additional template context if needed\n responseFormat: this.selectedResponseFormat?.value,\n temperature: this.advancedParams.temperature ?? undefined,\n topP: this.advancedParams.topP ?? undefined,\n topK: this.advancedParams.topK ?? undefined,\n minP: this.advancedParams.minP ?? undefined,\n frequencyPenalty: this.advancedParams.frequencyPenalty ?? undefined,\n presencePenalty: this.advancedParams.presencePenalty ?? undefined,\n seed: this.advancedParams.seed ?? undefined,\n stopSequences: this.advancedParams.stopSequences.length > 0 ? this.advancedParams.stopSequences : undefined,\n includeLogProbs: this.advancedParams.includeLogProbs,\n topLogProbs: this.advancedParams.includeLogProbs ? this.advancedParams.topLogProbs : undefined,\n messages: messages.length > 0 ? messages : undefined,\n rerunFromPromptRunID: this.originalPromptRunId || undefined,\n systemPromptOverride: this.systemPromptOverride || undefined\n });\n\n // Stop elapsed time counter\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n\n // Update assistant message with result\n assistantMessage.isStreaming = false;\n \n // Define parse options for both success and error cases\n const parseOptions: ParseJSONOptions = {\n extractInlineJson: true,\n maxDepth: 100,\n debug: false\n };\n\n if (executionResult?.success) {\n // Use parsedResult if available, otherwise fall back to output\n // Handle case where parsedResult is already an object (from GraphQL client)\n const contentToDisplay = executionResult.parsedResult\n ? (typeof executionResult.parsedResult === 'object'\n ? JSON.stringify(executionResult.parsedResult, null, 2)\n : executionResult.parsedResult)\n : (executionResult.output || 'No response generated');\n assistantMessage.content = contentToDisplay;\n assistantMessage.executionTime = executionResult.executionTimeMs;\n \n // Store the complete execution result for JSON display\n // If chatResult is provided, parse it and include it in the display\n const resultForDisplay: any = { ...executionResult };\n if (executionResult.chatResult) {\n try {\n resultForDisplay.chatResult = JSON.parse(executionResult.chatResult);\n } catch {\n // If parsing fails, keep it as a string\n }\n }\n \n // Apply recursive JSON parsing to the entire result\n const recursivelyParsed = ParseJSONRecursive(resultForDisplay, parseOptions);\n assistantMessage.rawContent = JSON.stringify(recursivelyParsed, null, 2);\n \n // Store execution metadata\n if (executionResult.promptRunId) {\n assistantMessage.agentRunId = executionResult.promptRunId;\n // Update the tracking ID when we set new execution data\n this.lastProcessedRunId = assistantMessage.agentRunId || null;\n }\n } else {\n assistantMessage.content = 'I encountered an error processing your request.';\n assistantMessage.error = executionResult?.error || 'Unknown error occurred';\n \n // Include chatResult in error case too\n if (executionResult) {\n const errorResult: any = { ...executionResult };\n if (executionResult.chatResult) {\n try {\n errorResult.chatResult = JSON.parse(executionResult.chatResult);\n } catch {\n // If parsing fails, keep it as a string\n }\n }\n \n // Apply recursive JSON parsing to the error result\n const recursivelyParsed = ParseJSONRecursive(errorResult, parseOptions);\n assistantMessage.rawContent = JSON.stringify(recursivelyParsed, null, 2);\n }\n }\n \n delete assistantMessage.streamingContent;\n this.scrollNeeded = true;\n\n // Auto-save conversation\n this.autoSaveConversation();\n \n // Focus back on input\n this.focusMessageInput();\n\n } catch (error) {\n // Update assistant message with error\n const lastMessage = this.conversationMessages[this.conversationMessages.length - 1];\n if (lastMessage && lastMessage.role === 'assistant') {\n lastMessage.isStreaming = false;\n lastMessage.content = 'I encountered an error processing your request.';\n lastMessage.error = (error as Error).message;\n delete lastMessage.streamingContent;\n }\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to execute prompt: ' + (error as Error).message,\n 'error',\n 6000\n );\n } finally {\n this.isExecuting = false;\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n \n // Focus back on the input\n this.focusMessageInput();\n }\n }\n \n\n private startTypingAnimation(message: ConversationMessage) {\n const initialMessages = [\n \"I'm processing your request...\",\n \"Let me think about that...\",\n \"Working on your request...\",\n \"Analyzing your question...\",\n \"Processing...\"\n ];\n \n const selectedMessage = initialMessages[Math.floor(Math.random() * initialMessages.length)];\n let index = 0;\n \n // Store the interval handle on the message itself so we can cancel it when real streaming starts\n const typingInterval = setInterval(() => {\n if (index < selectedMessage.length && message.isStreaming) {\n message.streamingContent = selectedMessage.substring(0, index + 1);\n index++;\n this.scrollNeeded = true;\n } else {\n clearInterval(typingInterval);\n }\n }, 50);\n \n // Store interval reference in case we need to clear it\n (message as any)._typingInterval = typingInterval;\n }\n\n private buildDataContext(): Record<string, any> {\n const context: Record<string, any> = {};\n \n // Use unified agent variables\n for (const variable of this.agentVariables) {\n if (variable.name.trim()) {\n context[variable.name] = this.convertVariableValue(variable.value, variable.type);\n }\n }\n \n return context;\n }\n\n private buildTemplateData(): Record<string, any> {\n // For backward compatibility, return the same data as buildDataContext\n // since we've unified the variables\n return this.buildDataContext();\n }\n\n private buildTemplateVariables(): Record<string, any> {\n const variables: Record<string, any> = {};\n \n for (const variable of this.templateVariables) {\n if (variable.name.trim()) {\n variables[variable.name] = this.convertVariableValue(variable.value, variable.type);\n }\n }\n \n return variables;\n }\n\n private convertVariableValue(value: string, type: string): any {\n switch (type) {\n case 'number':\n return parseFloat(value) || 0;\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'object':\n try {\n return JSON.parse(value);\n } catch {\n return value;\n }\n default:\n return value;\n }\n }\n\n /**\n * Adds a new empty agent variable to the collection.\n * Agent variables are passed to the agent during execution for dynamic content and template rendering.\n */\n public addAgentVariable() {\n this.agentVariables.push({\n name: '',\n value: '',\n type: 'string'\n });\n }\n\n /**\n * Removes an agent variable at the specified index.\n * @param index - Zero-based index of the variable to remove\n */\n public removeAgentVariable(index: number) {\n this.agentVariables.splice(index, 1);\n }\n\n /**\n * Adds a new empty template variable to the collection (prompt mode only).\n * Template variables are used for prompt template rendering.\n */\n public addTemplateVariable() {\n this.templateVariables.push({\n name: '',\n value: '',\n type: 'string'\n });\n }\n\n /**\n * Removes a template variable at the specified index (prompt mode only).\n * @param index - Zero-based index of the variable to remove\n */\n public removeTemplateVariable(index: number) {\n this.templateVariables.splice(index, 1);\n }\n\n /**\n * Clears the current conversation after user confirmation.\n * Resets both the message history and the current conversation ID.\n */\n public async clearConversation() {\n if (this.conversationMessages.length > 0) {\n if (await this.confirmService.Confirm({ title: 'Clear conversation', message: 'Are you sure you want to clear the conversation?' })) {\n this.conversationMessages = [];\n this.currentConversationId = null;\n }\n }\n }\n\n private scrollToBottom(): void {\n try {\n if (this.messagesContainer) {\n this.messagesContainer.nativeElement.scrollTop = this.messagesContainer.nativeElement.scrollHeight;\n }\n } catch(err) {\n // Error scrolling to bottom\n }\n }\n\n private generateMessageId(): string {\n return `msg_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n }\n\n // Saved conversations functionality\n private loadSavedConversations() {\n try {\n const storageKey = this.getStorageKey();\n const saved = localStorage.getItem(storageKey);\n \n if (saved) {\n const parsedData = JSON.parse(saved);\n this.savedConversations = parsedData || [];\n \n // Convert date strings back to Date objects\n this.savedConversations.forEach(conv => {\n conv.createdAt = new Date(conv.createdAt);\n conv.updatedAt = new Date(conv.updatedAt);\n conv.messages.forEach(msg => {\n msg.timestamp = new Date(msg.timestamp);\n });\n });\n } else {\n this.savedConversations = [];\n }\n } catch (error) {\n // Error loading saved conversations\n this.savedConversations = [];\n }\n }\n \n /**\n * Gets the storage key for saved conversations based on entity type and ID\n */\n private getStorageKey(): string {\n if (!this.entity) {\n return '';\n }\n \n const entityType = this.mode === 'agent' ? 'agent' : 'prompt';\n const entityId = this.entity.ID || 'unknown';\n return `mj_test_harness_${entityType}_${entityId}_conversations`;\n }\n\n /**\n * Saves the current conversation to localStorage with user-provided name.\n * Handles both creating new conversations and updating existing ones.\n * Automatically limits storage to 50 conversations to prevent excessive memory usage.\n * \n * @example\n * ```typescript\n * // User clicks save button\n * this.saveConversation(); // Prompts for name and saves\n * ```\n */\n public saveConversation() {\n if (this.conversationMessages.length === 0) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'No messages to save',\n 'warning',\n 3000\n );\n return;\n }\n\n // If updating existing conversation, pre-fill the name\n if (this.currentConversationId) {\n const currentConv = this.savedConversations.find(c => c.id === this.currentConversationId);\n this.tempConversationName = currentConv ? currentConv.name : '';\n } else {\n this.tempConversationName = '';\n }\n \n this.showSaveDialog = true;\n // Focus on input after dialog renders\n setTimeout(() => {\n if (this.saveDialogInput && this.saveDialogInput.nativeElement) {\n const input = this.saveDialogInput.nativeElement;\n input.focus();\n input.select();\n }\n }, 100);\n }\n \n\n public updateTempConversation() {\n this.tempConversationName = this.saveDialogInput?.nativeElement.value.trim() || ''; \n }\n\n /**\n * Handles the save dialog confirmation\n */\n public confirmSaveConversation() {\n // Use the temp name from the input\n const convoName = this.saveDialogInput?.nativeElement.value;\n const trimmedName = convoName?.trim() || '';\n \n if (!trimmedName) {\n return;\n }\n \n this.newConversationName = trimmedName;\n \n const conversation: SavedConversation = {\n id: this.generateMessageId(),\n name: this.newConversationName.trim(),\n agentId: this.entity?.ID || '',\n agentName: this.getEntityName() || '',\n messages: [...this.conversationMessages],\n dataContext: this.buildDataContext(),\n templateData: this.mode === 'agent' ? this.buildTemplateData() : {},\n templateVariables: this.mode === 'prompt' ? this.buildTemplateVariables() : {},\n advancedParams: this.mode === 'prompt' ? this.advancedParams : undefined,\n selectedModelId: this.mode === 'prompt' ? this.selectedModelId : undefined,\n selectedVendorId: this.mode === 'prompt' ? this.selectedVendorId : undefined,\n selectedConfigurationId: this.mode === 'prompt' ? this.selectedConfigurationId : undefined,\n skipValidation: this.mode === 'prompt' ? this.skipValidation : undefined,\n agentConfigurationId: this.mode === 'agent' ? this.agentConfigurationId : undefined,\n createdAt: new Date(),\n updatedAt: new Date()\n };\n\n if (this.currentConversationId) {\n // Update existing conversation\n const index = this.savedConversations.findIndex(c => c.id === this.currentConversationId);\n if (index >= 0) {\n conversation.id = this.currentConversationId;\n conversation.createdAt = this.savedConversations[index].createdAt;\n conversation.name = this.newConversationName.trim(); // Use the edited name\n this.savedConversations[index] = conversation;\n } else {\n // Current ID not found, treat as new\n this.savedConversations.unshift(conversation);\n this.currentConversationId = conversation.id;\n }\n } else {\n // Add new conversation\n this.savedConversations.unshift(conversation);\n this.currentConversationId = conversation.id;\n }\n\n // Limit to 50 saved conversations\n if (this.savedConversations.length > 50) {\n this.savedConversations = this.savedConversations.slice(0, 50);\n }\n\n // Save to localStorage\n this.saveConversationsToStorage();\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation saved successfully',\n 'success',\n 3000\n );\n \n this.showSaveDialog = false;\n this.newConversationName = '';\n this.tempConversationName = '';\n }\n \n /**\n * Cancels the save dialog\n */\n public cancelSaveDialog() {\n this.showSaveDialog = false;\n this.newConversationName = '';\n this.tempConversationName = '';\n }\n \n // Removed debug methods - no longer needed with ngModel binding\n \n /**\n * Saves conversations to localStorage\n */\n private saveConversationsToStorage() {\n try {\n const storageKey = this.getStorageKey();\n localStorage.setItem(storageKey, JSON.stringify(this.savedConversations));\n } catch (error) {\n // Error saving conversations\n throw error;\n }\n }\n\n private autoSaveConversation() {\n if (this.currentConversationId && this.conversationMessages.length > 0) {\n const index = this.savedConversations.findIndex(c => c.id === this.currentConversationId);\n if (index >= 0) {\n this.savedConversations[index].messages = [...this.conversationMessages];\n this.savedConversations[index].dataContext = this.buildDataContext();\n if (this.mode === 'agent') {\n this.savedConversations[index].templateData = this.buildTemplateData();\n this.savedConversations[index].agentConfigurationId = this.agentConfigurationId;\n } else {\n this.savedConversations[index].templateVariables = this.buildTemplateVariables();\n this.savedConversations[index].advancedParams = this.advancedParams;\n this.savedConversations[index].selectedModelId = this.selectedModelId;\n this.savedConversations[index].selectedVendorId = this.selectedVendorId;\n this.savedConversations[index].selectedConfigurationId = this.selectedConfigurationId;\n this.savedConversations[index].skipValidation = this.skipValidation;\n }\n this.savedConversations[index].updatedAt = new Date();\n \n // Save to localStorage\n try {\n this.saveConversationsToStorage();\n } catch (error) {\n // Error auto-saving conversation\n }\n }\n }\n }\n\n public loadConversation(conversation: SavedConversation) {\n if (this.conversationMessages.length > 0) {\n this.pendingLoadConversation = conversation;\n this.showLoadConfirmDialog = true;\n return;\n }\n\n this.doLoadConversation(conversation);\n }\n \n /**\n * Confirms loading a conversation after dialog confirmation\n */\n public confirmLoadConversation() {\n if (this.pendingLoadConversation) {\n this.doLoadConversation(this.pendingLoadConversation);\n this.showLoadConfirmDialog = false;\n this.pendingLoadConversation = null;\n }\n }\n \n /**\n * Cancels loading a conversation\n */\n public cancelLoadConversation() {\n this.showLoadConfirmDialog = false;\n this.pendingLoadConversation = null;\n }\n \n /**\n * Actually loads the conversation\n */\n private doLoadConversation(conversation: SavedConversation) {\n this.conversationMessages = [...conversation.messages];\n this.currentConversationId = conversation.id;\n \n // Restore agent variables (unified from dataContext and templateData)\n this.agentVariables = [];\n const allVariables = { ...conversation.dataContext, ...(conversation.templateData || {}) };\n for (const [key, value] of Object.entries(allVariables)) {\n this.agentVariables.push({\n name: key,\n value: typeof value === 'object' ? JSON.stringify(value) : String(value),\n type: typeof value === 'boolean' ? 'boolean' : \n typeof value === 'number' ? 'number' :\n typeof value === 'object' ? 'object' : 'string'\n });\n }\n \n // Restore configuration for agent mode\n if (this.mode === 'agent') {\n if (conversation.agentConfigurationId !== undefined) {\n this.agentConfigurationId = conversation.agentConfigurationId;\n }\n }\n \n // Restore template variables for prompt mode\n if (this.mode === 'prompt') {\n this.templateVariables = [];\n for (const [key, value] of Object.entries(conversation.templateVariables || {})) {\n this.templateVariables.push({\n name: key,\n value: typeof value === 'object' ? JSON.stringify(value) : String(value),\n type: typeof value === 'boolean' ? 'boolean' : \n typeof value === 'number' ? 'number' :\n typeof value === 'object' ? 'object' : 'string'\n });\n }\n \n // Restore advanced parameters\n if (conversation.advancedParams) {\n this.advancedParams = { ...this.advancedParams, ...conversation.advancedParams };\n // Restore stop sequences text\n this.stopSequencesText = this.advancedParams.stopSequences?.join(', ') || '';\n }\n \n // Restore model and vendor selection\n if (conversation.selectedModelId !== undefined) {\n this.selectedModelId = conversation.selectedModelId;\n // Trigger vendor loading if model is selected\n if (this.selectedModelId) {\n this.onModelSelectionChange();\n // After vendors load, restore vendor selection\n setTimeout(() => {\n if (conversation.selectedVendorId !== undefined) {\n this.selectedVendorId = conversation.selectedVendorId;\n }\n }, 100);\n }\n }\n if (conversation.selectedVendorId !== undefined && !this.selectedModelId) {\n this.selectedVendorId = conversation.selectedVendorId;\n }\n \n // Restore configuration selection\n if (conversation.selectedConfigurationId !== undefined) {\n this.selectedConfigurationId = conversation.selectedConfigurationId;\n }\n \n // Restore skip validation setting\n if (conversation.skipValidation !== undefined) {\n this.skipValidation = conversation.skipValidation;\n }\n }\n \n // Load agent run from the last assistant message if available\n const lastAssistantMessage = this.conversationMessages\n .filter(m => m.role === 'assistant' && m.agentRunId)\n .pop();\n \n if (lastAssistantMessage && lastAssistantMessage.agentRunId) {\n \n this.loadAgentRun(lastAssistantMessage.agentRunId);\n this.executionMonitorMode = 'historical';\n this.lastProcessedRunId = lastAssistantMessage.agentRunId;\n \n } else {\n // Clear agent run if no execution found\n this.currentAgentRun = null;\n this.executionMonitorMode = 'historical';\n this.lastProcessedRunId = null;\n }\n\n this.scrollNeeded = true;\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation loaded',\n 'info',\n 3000\n );\n }\n\n public async deleteConversation(conversation: SavedConversation, event: Event) {\n event.stopPropagation();\n \n if (await this.confirmService.ConfirmDelete({ title: 'Delete Conversation', message: `Delete conversation \"${conversation.name}\"?` })) {\n const index = this.savedConversations.findIndex(c => c.id === conversation.id);\n if (index >= 0) {\n this.savedConversations.splice(index, 1);\n \n // Save to localStorage\n this.saveConversationsToStorage();\n \n if (this.currentConversationId === conversation.id) {\n this.currentConversationId = null;\n }\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation deleted',\n 'info',\n 3000\n );\n }\n }\n }\n\n public exportConversation() {\n if (this.conversationMessages.length === 0) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'No messages to export',\n 'warning',\n 3000\n );\n return;\n }\n\n const exportData: any = {\n entity: {\n id: this.entity?.ID,\n name: this.getEntityName(),\n type: this.mode\n },\n messages: this.conversationMessages,\n dataContext: this.buildDataContext(),\n exportedAt: new Date().toISOString()\n };\n \n // Add mode-specific data\n if (this.mode === 'agent') {\n exportData.templateData = this.buildTemplateData();\n exportData.agentSettings = {\n configurationId: this.agentConfigurationId\n };\n } else {\n exportData.templateVariables = this.buildTemplateVariables();\n exportData.modelSettings = {\n modelId: this.selectedModelId,\n vendorId: this.selectedVendorId,\n configurationId: this.selectedConfigurationId,\n maxTokens: this.maxTokens,\n skipValidation: this.skipValidation\n };\n exportData.advancedParams = this.advancedParams;\n }\n\n const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n const entityName = this.getEntityName()?.replace(/[^a-zA-Z0-9]/g, '-') || 'conversation';\n link.download = `${this.mode}-conversation-${entityName}-${new Date().toISOString().slice(0, 10)}.json`;\n link.click();\n window.URL.revokeObjectURL(url);\n }\n\n public importConversation() {\n this.fileInput.nativeElement.click();\n }\n\n public onFileSelected(event: Event) {\n const input = event.target as HTMLInputElement;\n if (input.files && input.files[0]) {\n const file = input.files[0];\n const reader = new FileReader();\n \n reader.onload = async (e) => {\n try {\n const data = JSON.parse(e.target?.result as string);\n\n // Validate and import\n if (data.messages && Array.isArray(data.messages)) {\n if (this.conversationMessages.length > 0) {\n if (!(await this.confirmService.Confirm({ title: 'Import conversation', message: 'Importing will replace the current conversation. Continue?' }))) {\n return;\n }\n }\n \n this.conversationMessages = data.messages.map((msg: any) => ({\n ...msg,\n timestamp: new Date(msg.timestamp)\n }));\n \n // Import agent variables (unified from dataContext and templateData)\n this.agentVariables = [];\n const importedVariables = { ...(data.dataContext || {}), ...(data.templateData || {}) };\n for (const [key, value] of Object.entries(importedVariables)) {\n this.agentVariables.push({\n name: key,\n value: typeof value === 'object' ? JSON.stringify(value) : String(value),\n type: typeof value === 'boolean' ? 'boolean' : \n typeof value === 'number' ? 'number' :\n typeof value === 'object' ? 'object' : 'string'\n });\n }\n \n // Template data is already imported into agentVariables above\n \n // Import advanced parameters if in prompt mode\n if (this.mode === 'prompt' && data.advancedParams) {\n this.advancedParams = { ...this.advancedParams, ...data.advancedParams };\n this.stopSequencesText = this.advancedParams.stopSequences?.join(', ') || '';\n }\n \n // Import agent settings if in agent mode\n if (this.mode === 'agent' && data.agentSettings) {\n if (data.agentSettings.configurationId !== undefined) {\n this.agentConfigurationId = data.agentSettings.configurationId;\n }\n }\n \n // Import model settings if in prompt mode\n if (this.mode === 'prompt' && data.modelSettings) {\n if (data.modelSettings.modelId !== undefined) {\n this.selectedModelId = data.modelSettings.modelId;\n // Trigger vendor loading if model is selected\n if (this.selectedModelId) {\n this.onModelSelectionChange();\n // After vendors load, restore vendor selection\n setTimeout(() => {\n if (data.modelSettings.vendorId !== undefined) {\n this.selectedVendorId = data.modelSettings.vendorId;\n }\n }, 100);\n }\n }\n if (data.modelSettings.vendorId !== undefined && !this.selectedModelId) {\n this.selectedVendorId = data.modelSettings.vendorId;\n }\n if (data.modelSettings.configurationId !== undefined) {\n this.selectedConfigurationId = data.modelSettings.configurationId;\n }\n if (data.modelSettings.maxTokens !== undefined) {\n this.maxTokens = data.modelSettings.maxTokens;\n }\n if (data.modelSettings.skipValidation !== undefined) {\n this.skipValidation = data.modelSettings.skipValidation;\n }\n }\n \n this.currentConversationId = null;\n this.scrollNeeded = true;\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Conversation imported successfully',\n 'success',\n 3000\n );\n } else {\n throw new Error('Invalid conversation format');\n }\n } catch (error) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to import conversation: ' + (error as Error).message,\n 'error',\n 5000\n );\n }\n \n // Reset file input\n input.value = '';\n };\n \n reader.readAsText(file);\n }\n }\n\n /**\n * Handles keyboard input in the message textarea.\n * Sends message on Enter (without Shift) and allows multi-line input with Shift+Enter.\n * @param event - Keyboard event from the textarea\n */\n public handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n this.sendMessage();\n }\n }\n\n /**\n * Generates CSS class names for message display based on message properties.\n * @param message - The conversation message to generate classes for\n * @returns Space-separated CSS class string for styling\n */\n public getMessageClass(message: ConversationMessage): string {\n return `message message-${message.role}${message.isStreaming ? ' streaming' : ''}${message.error ? ' error' : ''}`;\n }\n\n /**\n * Formats a Date object into a user-friendly time string.\n * @param date - Date object to format\n * @returns Formatted time string in HH:MM format\n */\n public formatTimestamp(date: Date): string {\n return date.toLocaleTimeString('en-US', { \n hour: '2-digit', \n minute: '2-digit' \n });\n }\n\n /**\n * Formats execution time from milliseconds into a human-readable string.\n * Automatically selects appropriate units (minutes, seconds, or milliseconds).\n * @param milliseconds - Execution time in milliseconds\n * @returns Formatted time string (e.g., \"2m 30.5s\", \"1.23s\", \"500ms\")\n */\n public formatExecutionTime(milliseconds: number): string {\n if (milliseconds >= 60000) {\n const minutes = Math.floor(milliseconds / 60000);\n const seconds = ((milliseconds % 60000) / 1000).toFixed(2);\n return `${minutes}m ${seconds}s`;\n } else if (milliseconds >= 1000) {\n return `${(milliseconds / 1000).toFixed(2)}s`;\n } else {\n return `${milliseconds}ms`;\n }\n }\n\n public formatElapsedTime(milliseconds: number): string {\n const seconds = Math.floor(milliseconds / 1000);\n const ms = milliseconds % 1000;\n if (seconds > 0) {\n return `${seconds}.${Math.floor(ms / 100)}s`;\n } else {\n return `${ms}ms`;\n }\n }\n\n private startElapsedTimeCounter(message: ConversationMessage) {\n if (this.elapsedTimeInterval) {\n clearInterval(this.elapsedTimeInterval);\n }\n \n this.elapsedTimeInterval = setInterval(() => {\n if (message.streamingStartTime && message.isStreaming) {\n message.elapsedTime = Date.now() - message.streamingStartTime;\n } else {\n clearInterval(this.elapsedTimeInterval);\n this.elapsedTimeInterval = null;\n }\n }, 100); // Update every 100ms for smooth counter\n }\n\n /**\n * Shows the raw JSON dialog for a specific message\n * @param message - The message to show raw JSON for\n */\n public showRawJsonDialog(message: ConversationMessage) {\n if (message.rawContent) {\n try {\n const parsed = JSON.parse(message.rawContent);\n if (parsed.agentRunID) {\n const enhancedParsed = { ...parsed, _agentRunID: parsed.agentRunID };\n this.currentJsonContent = this.formatJson(enhancedParsed);\n } else {\n this.currentJsonContent = this.formatJson(parsed);\n }\n } catch {\n this.currentJsonContent = message.rawContent;\n }\n this.showJsonWindow = true;\n }\n }\n\n /** Closes the JSON viewer window */\n public closeJsonWindow(): void {\n this.showJsonWindow = false;\n this.currentJsonContent = '';\n }\n \n /**\n * Get the last run ID from conversation messages\n */\n getLastRunId(): string | null {\n const lastAssistantMessage = this.conversationMessages\n .filter(m => m.role === 'assistant' && m.agentRunId)\n .pop();\n return lastAssistantMessage?.agentRunId || null;\n }\n \n /**\n * Expands all nodes in the execution monitor\n * Called automatically when execution completes\n */\n private expandAllMonitoringNodes(): void {\n if (this.currentAgentRun && this.executionMonitorMode === 'historical') {\n // Force refresh the execution monitor by reassigning the entity\n this.currentAgentRun = this.currentAgentRun;\n // Note: The execution monitor component should handle auto-expansion internally\n }\n }\n \n \n /**\n * Navigate to the run details form\n */\n navigateToRun(event: { runId: string; runType: 'agent' | 'prompt' }) {\n if (event.runType === 'agent') {\n SharedService.Instance.OpenEntityRecord('MJ: AI Agent Runs', CompositeKey.FromID(event.runId));\n } else {\n SharedService.Instance.OpenEntityRecord('MJ: AI Prompt Runs', CompositeKey.FromID(event.runId));\n }\n \n // Emit event so parent window can minimize\n this.runOpened.emit(event);\n }\n \n /**\n * Copies the message content to clipboard.\n * @param message - The message to copy\n */\n public async copyMessage(message: ConversationMessage) {\n try {\n // Convert content to string if needed\n const content = typeof message.content === 'string' \n ? message.content \n : JSON.stringify(message.content);\n \n await navigator.clipboard.writeText(content);\n \n MJNotificationService.Instance.CreateSimpleNotification(\n 'Message copied to clipboard',\n 'success',\n 2000\n );\n } catch (error) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to copy message',\n 'error',\n 3000\n );\n }\n }\n \n\n /**\n * Focuses the message input textarea.\n */\n private focusMessageInput(): void {\n if (this.messageInput) {\n setTimeout(() => {\n this.messageInput.nativeElement.focus();\n }, 100);\n }\n }\n\n /**\n * Determines if the provided content is valid JSON.\n * @param content - String content to test\n * @returns True if content can be parsed as JSON, false otherwise\n */\n public isJsonContent(content: string): boolean {\n if (!content) return false;\n try {\n JSON.parse(content);\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Formats JSON content with proper indentation for display.\n * Also recursively parses any nested JSON strings.\n * @param content - JSON string to format\n * @returns Formatted JSON string or original content if parsing fails\n */\n public formatJson(content: any): string {\n const parseOptions: ParseJSONOptions = {\n extractInlineJson: true,\n maxDepth: 100,\n debug: false\n };\n\n try {\n let parsed: any;\n if (typeof content === 'string') {\n parsed = JSON.parse(content);\n } else {\n parsed = content;\n }\n \n // Apply recursive JSON parsing\n const recursivelyParsed = ParseJSONRecursive(parsed, parseOptions);\n return JSON.stringify(recursivelyParsed, null, 2);\n } catch {\n return typeof content === 'string' ? content : JSON.stringify(content);\n }\n }\n\n /**\n * Checks if the payload should be displayed (not null, undefined, or empty object)\n * @param payload - The payload to check\n * @returns true if the payload has content, false otherwise\n */\n public hasPayload(payload: any): boolean {\n if (!payload) {\n return false;\n }\n \n // Check if it's an empty object\n if (typeof payload === 'object' && Object.keys(payload).length === 0) {\n return false;\n }\n \n return true;\n }\n\n /**\n * Toggles the collapsed state of a message's payload section\n * @param message - The message to toggle payload visibility for\n */\n public togglePayloadCollapse(message: ConversationMessage): void {\n message.payloadCollapsed = !message.payloadCollapsed;\n }\n\n /**\n * Formats streaming content with markdown rendering\n * @param message - The message containing streaming content\n * @returns SafeHtml formatted content\n */\n public getFormattedStreamingContent(message: ConversationMessage): SafeHtml {\n if (!message.streamingContent) {\n return this.sanitizer.sanitize(SecurityContext.HTML, '') || '';\n }\n \n const trimmedContent = message.streamingContent.trim();\n \n // Check if content type is markdown before applying markdown rendering\n const contentType = this.detectContentType(trimmedContent);\n if (contentType === 'markdown') {\n return this.renderMarkdown(trimmedContent);\n } else {\n // For plain text, just sanitize and return without extra processing\n return this.sanitizer.sanitize(SecurityContext.HTML, trimmedContent) || '';\n }\n }\n\n /**\n * Automatically detects the content type of a message for appropriate rendering.\n * Uses pattern matching to identify JSON, Markdown, or plain text content.\n * @param content - Content string to analyze\n * @returns Detected content type ('markdown', 'json', or 'text')\n */\n public detectContentType(content: string): 'markdown' | 'json' | 'text' {\n if (!content) return 'text';\n \n // Check if it's JSON\n if (this.isJsonContent(content)) {\n return 'json';\n }\n \n // Check for markdown indicators\n const markdownPatterns = [\n /^#{1,6}\\s/m, // Headers\n /\\*\\*[^*]+\\*\\*/, // Bold\n /\\*[^*]+\\*/, // Italic\n /\\[([^\\]]+)\\]\\(([^)]+)\\)/, // Links\n /```[\\s\\S]*?```/, // Code blocks\n /`[^`]+`/, // Inline code\n /^[-*+]\\s/m, // Lists\n /^\\d+\\.\\s/m // Numbered lists\n ];\n \n if (markdownPatterns.some(pattern => pattern.test(content))) {\n return 'markdown';\n }\n \n return 'text';\n }\n\n public renderMarkdown(content: string): SafeHtml {\n // Basic markdown to HTML conversion with improved formatting\n let html = content;\n \n // Escape HTML first\n html = EscapeHTML(html);\n \n // Code blocks with language support\n html = html.replace(/```(\\w+)?\\n([\\s\\S]*?)```/g, (match, lang, code) => {\n const language = lang || '';\n const className = language ? ` class=\"language-${language}\"` : '';\n return `<pre class=\"code-block\"><code${className}>${code.trim()}</code></pre>`;\n });\n \n // Regular code blocks without language\n html = html.replace(/```([\\s\\S]*?)```/g, '<pre class=\"code-block\"><code>$1</code></pre>');\n \n // Inline code\n html = html.replace(/`([^`]+)`/g, '<code class=\"inline-code\">$1</code>');\n \n // Headers\n html = html.replace(/^### (.+)$/gm, '<h3 class=\"markdown-h3\">$1</h3>');\n html = html.replace(/^## (.+)$/gm, '<h2 class=\"markdown-h2\">$1</h2>');\n html = html.replace(/^# (.+)$/gm, '<h1 class=\"markdown-h1\">$1</h1>');\n \n // Bold\n html = html.replace(/\\*\\*([^*]+)\\*\\*/g, '<strong>$1</strong>');\n \n // Italic\n html = html.replace(/\\*([^*]+)\\*/g, '<em>$1</em>');\n \n // Links\n html = html.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, '<a href=\"$2\" target=\"_blank\" class=\"markdown-link\">$1</a>');\n \n // Unordered lists\n html = html.replace(/^[*-+] (.+)$/gm, '<li>$1</li>');\n html = html.replace(/((?:<li>.*<\\/li>\\s*)+)/g, '<ul class=\"markdown-list\">$1</ul>');\n \n // Numbered lists\n html = html.replace(/^\\d+\\. (.+)$/gm, '<li>$1</li>');\n html = html.replace(/((?:<li>.*<\\/li>\\s*)+)/g, '<ol class=\"markdown-list\">$1</ol>');\n \n // Paragraphs and line breaks - improved handling\n html = html.replace(/\\n\\s*\\n/g, '</p><p class=\"markdown-paragraph\">');\n html = html.replace(/\\n/g, '<br>');\n html = `<p class=\"markdown-paragraph\">${html}</p>`;\n \n // Clean up empty paragraphs\n html = html.replace(/<p class=\"markdown-paragraph\"><\\/p>/g, '');\n \n return this.sanitizer.bypassSecurityTrustHtml(`<div class=\"markdown-content\">${html}</div>`);\n }\n\n public getFormattedContent(message: ConversationMessage): SafeHtml {\n const content = message.content;\n const contentStr = typeof content === 'string' ? content : String(content);\n const contentType = this.detectContentType(contentStr);\n \n if (contentType === 'json') {\n // Try to extract human-readable content from JSON\n const extractedContent = this.extractHumanReadableContent(contentStr);\n if (extractedContent) {\n // Just render the extracted content\n return this.renderMarkdown(extractedContent);\n } else {\n // Fallback to inline code editor for JSON display\n return this.renderJsonWithCodeEditor(contentStr);\n }\n } else if (contentType === 'markdown') {\n return this.renderMarkdown(contentStr);\n } else {\n // Convert plain text to markdown for consistent formatting\n return this.renderMarkdown(contentStr);\n }\n }\n\n /**\n * Renders JSON content using an inline code editor component\n */\n private renderJsonWithCodeEditor(jsonStr: string): SafeHtml {\n try {\n // Format the JSON for display\n const formattedJson = this.formatJson(jsonStr);\n \n // Generate a unique ID for this editor instance\n const editorId = `json-editor-${this.generateMessageId()}`;\n \n // Create the HTML with a placeholder div that we'll replace with the code editor\n const html = `\n <div class=\"inline-json-editor\" data-editor-id=\"${editorId}\" data-json-content=\"${this.escapeHtmlAttribute(formattedJson)}\">\n <div class=\"json-editor-container\" style=\"height: 300px; width: 100%; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden;\">\n <pre style=\"margin: 0; padding: 12px; font-family: 'Fira Code', 'Consolas', monospace; font-size: 13px; overflow: auto; height: 100%;\">${this.escapeHtml(formattedJson)}</pre>\n </div>\n </div>\n `;\n \n // Note: In a real implementation, we would need to dynamically create the code editor component\n // For now, we'll use a styled pre tag as a fallback\n return this.sanitizer.bypassSecurityTrustHtml(html);\n } catch {\n // If JSON parsing fails, show as plain text\n const html = `<pre style=\"margin: 0; padding: 12px; font-family: 'Fira Code', 'Consolas', monospace; font-size: 13px; overflow: auto; background: var(--mj-bg-surface-card); border-radius: 4px;\">${this.escapeHtml(jsonStr)}</pre>`;\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n }\n \n /**\n * Escapes HTML content for use in attributes\n */\n private escapeHtmlAttribute(text: string): string {\n return EscapeHTML(text);\n }\n\n /**\n * Renders JSON content with human-readable content prominently displayed\n * and raw JSON in a collapsible section below with proper text wrapping.\n */\n \n /**\n * Gets a summary of the execution for tooltip display\n * @param message - The message to get execution summary for\n * @returns A brief summary of the execution steps\n */\n public getExecutionSummary(message: ConversationMessage): string {\n if (!message.rawContent) return '';\n \n try {\n const parsed = JSON.parse(message.rawContent);\n if (parsed.agentRunID) {\n return `Agent run ID: ${parsed.agentRunID}`;\n }\n } catch {\n // Ignore parse errors\n }\n \n return '';\n }\n\n /**\n * Closes the JSON dialog\n */\n public closeJsonDialog() {\n this.showJsonWindow = false;\n this.currentJsonContent = '';\n }\n \n /**\n * Copies the JSON content to clipboard\n */\n public copyJsonContent() {\n if (this.currentJsonContent) {\n navigator.clipboard.writeText(this.currentJsonContent).then(() => {\n // Success - JSON copied\n }).catch((err) => {\n // Error copying\n });\n }\n }\n\n /**\n * Extracts human-readable content from JSON responses.\n * Prioritizes userMessage field first, then checks other common fields.\n * @param jsonStr - JSON string to extract content from\n * @returns Extracted human-readable content or null if none found\n */\n private extractHumanReadableContent(jsonStr: string): string | null {\n try {\n const parsed = JSON.parse(jsonStr);\n \n // Priority 1: Always check userMessage first, regardless of taskComplete status\n if (parsed.userMessage && typeof parsed.userMessage === 'string' && parsed.userMessage.trim()) {\n return parsed.userMessage;\n }\n \n // Priority 2: Check for nested userMessage in nextStep or other objects\n if (parsed.nextStep && parsed.nextStep.userMessage && \n typeof parsed.nextStep.userMessage === 'string' && parsed.nextStep.userMessage.trim()) {\n return parsed.nextStep.userMessage;\n }\n \n // Priority 3: Other common human-readable fields\n const contentFields = [\n 'message', 'content', 'response', 'text', 'output',\n 'result', 'answer', 'reply', 'description', 'summary'\n ];\n \n for (const field of contentFields) {\n if (parsed[field] && typeof parsed[field] === 'string' && parsed[field].trim()) {\n return parsed[field];\n }\n }\n \n // Priority 4: Check nested objects for content\n for (const key of Object.keys(parsed)) {\n if (typeof parsed[key] === 'object' && parsed[key] !== null) {\n for (const field of ['userMessage', 'message', 'content']) {\n if (parsed[key][field] && typeof parsed[key][field] === 'string' && parsed[key][field].trim()) {\n return parsed[key][field];\n }\n }\n }\n }\n \n // Priority 5: If it's a simple string value, return it\n if (typeof parsed === 'string' && parsed.trim()) {\n return parsed;\n }\n \n // Priority 6: If it's an object with a single string property, consider returning it\n const keys = Object.keys(parsed);\n if (keys.length === 1 && typeof parsed[keys[0]] === 'string' && parsed[keys[0]].trim()) {\n return parsed[keys[0]];\n }\n \n return null;\n } catch {\n return null;\n }\n }\n\n /**\n * Checks if a message contains JSON content that has extractable human-readable content.\n * Used to determine if the raw toggle should be shown.\n * @param message - The conversation message to check\n * @returns True if the message has extractable content different from raw JSON\n */\n public hasExtractableContent(message: ConversationMessage): boolean {\n if (!message.content || message.role === 'user') {\n return false;\n }\n \n const contentStr = typeof message.content === 'string' ? message.content : String(message.content);\n if (!this.isJsonContent(contentStr)) {\n return false;\n }\n \n const extractedContent = this.extractHumanReadableContent(contentStr);\n return extractedContent !== null && extractedContent !== contentStr;\n }\n\n /**\n * Determines whether to show the raw toggle button for a message.\n * Combines the logic for raw content availability and extractable content.\n * @param message - The conversation message to check\n * @returns True if the raw toggle should be displayed\n */\n public showRawToggle(message: ConversationMessage): boolean {\n return (message.rawContent && !message.isStreaming) || this.hasExtractableContent(message);\n }\n\n private escapeHtml(text: string): string {\n return EscapeHTML(text);\n }\n\n /**\n * Formats JSON for proper display with text wrapping instead of wide code blocks.\n * Creates a structured, readable format that respects container width.\n */\n private formatJsonForDisplay(jsonStr: string): string {\n try {\n const parsed = JSON.parse(jsonStr);\n return this.createJsonDisplayHtml(parsed, 0);\n } catch {\n // If JSON parsing fails, escape and display as-is with wrapping\n return `<div class=\"json-fallback\">${this.escapeHtml(jsonStr)}</div>`;\n }\n }\n\n /**\n * Creates formatted HTML for JSON display with proper indentation and wrapping.\n */\n private createJsonDisplayHtml(obj: any, depth: number = 0): string {\n const indent = ' '.repeat(depth);\n const nextIndent = ' '.repeat(depth + 1);\n \n if (obj === null) return `<span class=\"json-null\">null</span>`;\n if (typeof obj === 'boolean') return `<span class=\"json-boolean\">${obj}</span>`;\n if (typeof obj === 'number') return `<span class=\"json-number\">${obj}</span>`;\n if (typeof obj === 'string') {\n const escaped = this.escapeHtml(obj);\n return `<span class=\"json-string\">\"<span class=\"json-string-content\">${escaped}</span>\"</span>`;\n }\n \n if (Array.isArray(obj)) {\n if (obj.length === 0) return '<span class=\"json-bracket\">[]</span>';\n \n const items = obj.map(item => \n `<div class=\"json-array-item\">${nextIndent}${this.createJsonDisplayHtml(item, depth + 1)}</div>`\n ).join(',\\n');\n \n return `<span class=\"json-bracket\">[</span>\\n${items}\\n<div class=\"json-indent\">${indent}</div><span class=\"json-bracket\">]</span>`;\n }\n \n if (typeof obj === 'object') {\n const keys = Object.keys(obj);\n if (keys.length === 0) return '<span class=\"json-bracket\">{}</span>';\n \n const properties = keys.map(key => {\n const escapedKey = this.escapeHtml(key);\n const value = this.createJsonDisplayHtml(obj[key], depth + 1);\n return `<div class=\"json-property\">${nextIndent}<span class=\"json-key\">\"${escapedKey}\"</span><span class=\"json-colon\">:</span> ${value}</div>`;\n }).join(',\\n');\n \n return `<span class=\"json-bracket\">{</span>\\n${properties}\\n<div class=\"json-indent\">${indent}</div><span class=\"json-bracket\">}</span>`;\n }\n \n return String(obj);\n }\n \n /**\n * Type guard to check if entity is an AI Agent\n */\n private isAgentEntity(entity: any): entity is MJAIAgentEntityExtended {\n // Check using the EntityInfo property from BaseEntity\n return entity && entity.EntityInfo && entity.EntityInfo.Name === 'MJ: AI Agents';\n }\n \n /**\n * Type guard to check if entity is an AI Prompt\n */\n private isPromptEntity(entity: any): entity is MJAIPromptEntityExtended {\n // Check using the EntityInfo property from BaseEntity\n const result = entity && entity.EntityInfo && entity.EntityInfo.Name === 'MJ: AI Prompts';\n \n return result;\n }\n \n /**\n * Gets the display name of the current entity\n */\n public getEntityName(): string {\n if (!this.entity) return '';\n return this.entity.Name || 'Untitled';\n }\n \n /**\n * Gets the icon class for the current entity\n */\n public getEntityIconClass(): string {\n if (!this.entity) {\n return this.mode === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-comment-dots';\n }\n \n if (this.isAgentEntity(this.entity)) {\n // Agent entity - check for IconClass\n return (this.entity as any).IconClass || 'fa-solid fa-robot';\n }\n \n // Prompt entity - use default prompt icon\n return 'fa-solid fa-comment-dots';\n }\n \n /**\n * Checks if the entity has a logo URL\n */\n public hasEntityLogo(): boolean {\n if (!this.entity || !this.isAgentEntity(this.entity)) {\n return false;\n }\n return !!(this.entity as any).LogoURL;\n }\n \n /**\n * Gets the logo URL for the entity (agent only)\n */\n public getEntityLogoURL(): string {\n if (!this.entity || !this.isAgentEntity(this.entity)) {\n return '';\n }\n return (this.entity as any).LogoURL || '';\n }\n \n /**\n * Updates stop sequences from the textarea input\n */\n public updateStopSequences() {\n if (this.stopSequencesText.trim() === '') {\n this.advancedParams.stopSequences = [];\n } else {\n // Split by comma and trim each sequence\n this.advancedParams.stopSequences = this.stopSequencesText\n .split(',')\n .map(s => s.trim())\n .filter(s => s.length > 0);\n }\n }\n \n /**\n * Toggles the advanced parameters expansion panel\n */\n public toggleAdvancedParams() {\n this.advancedParamsExpanded = !this.advancedParamsExpanded;\n }\n \n /**\n * Navigates to the AI Agent Run form to view detailed execution information\n * @param agentRunId - The ID of the agent run to view\n */\n public navigateToAgentRun({runId, runType}: {runId: string, runType: 'agent' | 'prompt'}) {\n if (runId && runType==='agent') {\n SharedService.Instance.OpenEntityRecord('MJ: AI Agent Runs', CompositeKey.FromID(runId));\n // Request minimization from our container\n this.minimizeRequested.emit();\n }\n }\n \n /**\n * Loads data from an existing prompt run to pre-populate the test harness\n * @param promptRunId - The ID of the prompt run to load\n */\n private async loadFromPromptRun(promptRunId: string): Promise<void> {\n console.log('🔄 Loading from prompt run:', promptRunId);\n const md = this.ProviderToUse;\n const promptRun = await md.GetEntityObject<MJAIPromptRunEntityExtended>('MJ: AI Prompt Runs');\n \n if (await promptRun.Load(promptRunId)) {\n console.log('✅ Prompt run loaded successfully');\n console.log('📝 Raw Messages field:', promptRun.Messages);\n \n // Set the model/vendor/configuration\n if (promptRun.ModelID) {\n this.selectedModelId = promptRun.ModelID;\n }\n if (promptRun.VendorID) {\n this.selectedVendorId = promptRun.VendorID;\n }\n if (promptRun.ConfigurationID) {\n this.selectedConfigurationId = promptRun.ConfigurationID;\n }\n \n // Set advanced parameters\n if (promptRun.Temperature != null) {\n this.advancedParams.temperature = promptRun.Temperature;\n }\n if (promptRun.TopP != null) {\n this.advancedParams.topP = promptRun.TopP;\n }\n if (promptRun.TopK != null) {\n this.advancedParams.topK = promptRun.TopK;\n }\n if (promptRun.MinP != null) {\n this.advancedParams.minP = promptRun.MinP;\n }\n if (promptRun.FrequencyPenalty != null) {\n this.advancedParams.frequencyPenalty = promptRun.FrequencyPenalty;\n }\n if (promptRun.PresencePenalty != null) {\n this.advancedParams.presencePenalty = promptRun.PresencePenalty;\n }\n if (promptRun.Seed != null) {\n this.advancedParams.seed = promptRun.Seed;\n }\n \n // Use the extended entity methods to get conversation messages\n const parsedData = promptRun.ParseMessagesData();\n console.log('🔍 Parsed messages data:', parsedData);\n \n const chatMessages = promptRun.GetChatMessages();\n console.log('💬 Extracted chat messages:', chatMessages);\n \n if (chatMessages.length > 0) {\n // Convert messages to the format expected by the test harness\n const convertedMessages = chatMessages.map((msg, index) => ({\n id: `msg-${Date.now()}-${index}`,\n role: msg.role,\n content: typeof msg.content === 'string' ? msg.content : \n Array.isArray(msg.content) ? \n msg.content.filter(block => block.type === 'text').map(block => block.content).join('\\n') : \n '',\n timestamp: new Date(),\n isStreaming: false\n }));\n \n console.log('🎯 Converted messages for test harness:', convertedMessages);\n this.conversationMessages = convertedMessages;\n \n // Store original messages for reset functionality\n this.originalPromptRunMessages = [...convertedMessages];\n \n // Reset re-run execution state\n this.hasExecutedRerun = false;\n \n console.log('✅ conversationMessages set:', this.conversationMessages);\n \n // Trigger change detection\n this.cdr.detectChanges();\n } else {\n console.log('⚠️ No chat messages found in prompt run');\n }\n \n // Extract and store the system prompt for re-run\n const systemPrompt = promptRun.GetSystemPrompt();\n if (systemPrompt) {\n this.systemPromptOverride = systemPrompt;\n console.log('📋 System prompt override set');\n }\n \n // Switch to model settings tab for prompt re-runs\n if (this.activeTab !== 'modelSettings') {\n this.selectTab('modelSettings');\n }\n } else {\n console.error('❌ Failed to load prompt run:', promptRunId);\n }\n }\n\n /** Case-insensitive UUID comparison for configuration ID matching in templates. */\n public IsConfigMatchById(config: MJAIConfigurationEntity, id: string | undefined): boolean {\n return UUIDsEqual(config.ID, id);\n }\n}","@if (isVisible) {\n <div class=\"harness-container\">\n <!-- Header -->\n <div class=\"harness-header\">\n @if (entity) {\n <div class=\"agent-info\">\n <div class=\"agent-details\">\n @if (hasEntityLogo()) {\n <img [src]=\"getEntityLogoURL()\" [alt]=\"getEntityName() + ' logo'\" class=\"entity-logo\">\n } @else {\n <i [class]=\"getEntityIconClass()\"></i>\n }\n <div>\n <h3>{{ getEntityName() }}</h3>\n @if (entity.Description) {\n <p>{{ entity.Description }}</p>\n }\n </div>\n </div>\n <div class=\"header-actions\">\n <button\n class=\"custom-button\"\n (click)=\"clearConversation()\"\n [disabled]=\"isExecuting || conversationMessages.length === 0\"\n title=\"Clear conversation\">\n <i class=\"fa-solid fa-broom\"></i>\n Clear\n </button>\n <button\n class=\"custom-button\"\n (click)=\"saveConversation()\"\n [disabled]=\"conversationMessages.length === 0\"\n title=\"Save conversation\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n <button\n class=\"custom-button\"\n (click)=\"exportConversation()\"\n [disabled]=\"conversationMessages.length === 0\"\n title=\"Export conversation\">\n <i class=\"fa-solid fa-download\"></i>\n Export\n </button>\n <button\n class=\"custom-button\"\n (click)=\"importConversation()\"\n title=\"Import conversation\">\n <i class=\"fa-solid fa-upload\"></i>\n Import\n </button>\n <input\n #fileInput\n type=\"file\"\n accept=\".json\"\n style=\"display: none\"\n (change)=\"onFileSelected($event)\">\n <button\n class=\"custom-button icon-only\"\n (click)=\"toggleSidebar()\"\n title=\"Toggle sidebar\">\n <i class=\"fa-solid\" [class.fa-chevron-right]=\"!showSidebar\" [class.fa-chevron-left]=\"showSidebar\"></i>\n </button>\n </div>\n </div>\n }\n </div>\n <!-- Main Content Area with Splitter -->\n <div class=\"harness-body\">\n @if (showSidebar) {\n <as-split\n direction=\"horizontal\"\n style=\"height: 100%; width: 100%;\">\n <!-- Chat Area (Left Pane) -->\n <as-split-area\n [size]=\"70\">\n <div class=\"chat-area\">\n <!-- Messages Container -->\n <div class=\"messages-container\" #messagesContainer>\n @if (conversationMessages.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-comments\"\n Title=\"Start a conversation\"\n Message=\"Send a message to begin testing the AI agent\" />\n }\n @for (message of conversationMessages; track message.id) {\n <div [ngClass]=\"getMessageClass(message)\">\n <div class=\"message-header\">\n <span class=\"message-role\">\n @if (message.role === 'user') {\n <i class=\"fa-solid fa-user\"></i> You\n } @else {\n @if (hasEntityLogo()) {\n <img [src]=\"getEntityLogoURL()\" [alt]=\"getEntityName() + ' logo'\" class=\"message-role-logo\">\n } @else {\n <i [class]=\"getEntityIconClass()\"></i>\n }\n {{ getEntityName() || 'Assistant' }}\n }\n </span>\n <span class=\"message-time\">{{ formatTimestamp(message.timestamp) }}</span>\n @if (message.isStreaming && message.elapsedTime !== undefined) {\n <span class=\"execution-time streaming\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i> {{ formatElapsedTime(message.elapsedTime) }}\n </span>\n } @else if (message.executionTime) {\n <span class=\"execution-time\" [title]=\"getExecutionSummary(message)\">{{ formatExecutionTime(message.executionTime) }}</span>\n }\n @if (showRawToggle(message)) {\n <button class=\"raw-toggle\" (click)=\"showRawJsonDialog(message)\" title=\"View raw JSON response\">\n <i class=\"fa-solid fa-code\"></i>\n </button>\n }\n </div>\n <div class=\"message-content\">\n <button class=\"copy-button-in-bubble\" (click)=\"copyMessage(message)\" title=\"Copy message\">\n <i class=\"fa-solid fa-copy\"></i>\n </button>\n @if (message.isStreaming) {\n <div class=\"streaming-wrapper\">\n <span class=\"streaming-content\" [innerHTML]=\"getFormattedStreamingContent(message)\"></span>\n <span class=\"cursor\">|</span>\n </div>\n } @else {\n <div [innerHTML]=\"getFormattedContent(message)\"></div>\n }\n @if (message.error) {\n <div class=\"error-details\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ message.error }}\n </div>\n }\n @if (hasPayload(message.payload) && mode === 'agent' && message.role === 'assistant') {\n <div class=\"payload-section\" [class.collapsed]=\"message.payloadCollapsed\">\n <div class=\"payload-header\" (click)=\"togglePayloadCollapse(message)\">\n <span class=\"payload-label\">\n <i class=\"fa-solid fa-code\"></i> Payload\n </span>\n <button class=\"payload-toggle\" type=\"button\">\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!message.payloadCollapsed\" [class.fa-chevron-right]=\"message.payloadCollapsed\"></i>\n </button>\n </div>\n @if (!message.payloadCollapsed) {\n <div class=\"payload-content\">\n <mj-code-editor\n [ngModel]=\"formatJson(message.payload)\"\n [language]=\"'json'\"\n [readonly]=\"true\"\n style=\"height: 300px; width: 100%;\">\n </mj-code-editor>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n <!-- Input Area -->\n <div class=\"input-area\">\n @if (originalPromptRunId && conversationMessages.length > 0) {\n <!-- Re-run mode - show loaded message -->\n <div class=\"rerun-mode-container\">\n <div class=\"rerun-message\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n <span>Messages from Prompt Run <strong>{{ originalPromptRunId.substring(0, 8) }}</strong> loaded above</span>\n </div>\n <div class=\"rerun-buttons\">\n @if (!hasExecutedRerun) {\n <!-- Show Re-Run button if we haven't executed yet -->\n <button\n class=\"send-button rerun-button\"\n (click)=\"executeRerun()\"\n [disabled]=\"isExecuting\"\n title=\"Re-run with loaded messages\">\n @if (isExecuting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Running...</span>\n } @else {\n <i class=\"fa-solid fa-play\"></i>\n <span>Re-Run</span>\n }\n </button>\n } @else {\n <!-- Show only Reset button after execution -->\n <button\n class=\"send-button reset-button\"\n (click)=\"resetToOriginalMessages()\"\n [disabled]=\"isExecuting\"\n title=\"Reset conversation messages to the original state from the prompt run. Model settings and parameters will be preserved.\">\n <i class=\"fa-solid fa-rotate-left\"></i>\n <span>Reset Messages</span>\n </button>\n }\n </div>\n </div>\n } @else {\n <!-- Normal mode - show text input -->\n <div class=\"input-container\">\n <textarea\n #messageInput\n class=\"mj-textarea message-input\"\n [(ngModel)]=\"currentUserMessage\"\n [rows]=\"3\"\n placeholder=\"Type your message here... (Press Enter to send, Shift+Enter for new line)\"\n (keypress)=\"handleKeyPress($event)\"\n [disabled]=\"isExecuting\"></textarea>\n <button\n class=\"send-button\"\n (click)=\"sendMessage()\"\n [disabled]=\"isExecuting || !currentUserMessage.trim()\"\n title=\"Send message\">\n @if (isExecuting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-paper-plane\"></i>\n }\n </button>\n </div>\n }\n </div>\n </div>\n </as-split-area>\n <!-- Sidebar (Right Pane) -->\n <as-split-area\n [size]=\"30\">\n <div class=\"sidebar\">\n <!-- Tab Navigation -->\n <div class=\"sidebar-tabs\">\n @if (mode === 'agent') {\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'agentVariables'\"\n [disabled]=\"executionMonitorMode === 'live' && activeTab !== 'agentVariables'\"\n (click)=\"selectTab('agentVariables')\">\n <i class=\"fa-solid fa-code\"></i>\n Agent Variables\n </button>\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'executionMonitor'\"\n (click)=\"selectTab('executionMonitor')\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n Execution Monitor\n </button>\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'agentSettings'\"\n [disabled]=\"executionMonitorMode === 'live' && activeTab !== 'agentSettings'\"\n (click)=\"selectTab('agentSettings')\">\n <i class=\"fa-solid fa-sliders\"></i>\n Settings\n </button>\n } @else {\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'templateVariables'\"\n (click)=\"selectTab('templateVariables')\">\n <i class=\"fa-solid fa-code\"></i>\n Template Variables\n </button>\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'modelSettings'\"\n (click)=\"selectTab('modelSettings')\">\n <i class=\"fa-solid fa-sliders\"></i>\n Model Settings\n </button>\n }\n <button\n class=\"tab-button\"\n [class.active]=\"activeTab === 'savedConversations'\"\n [disabled]=\"executionMonitorMode === 'live' && activeTab !== 'savedConversations'\"\n (click)=\"selectTab('savedConversations')\">\n <i class=\"fa-solid fa-history\"></i>\n Saved\n @if (savedConversations.length > 0) {\n <span class=\"badge\">{{ savedConversations.length }}</span>\n }\n </button>\n </div>\n <!-- Tab Content -->\n <div class=\"sidebar-content\">\n <!-- Agent Variables Tab (Unified) -->\n @if (activeTab === 'agentVariables') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Agent Variables</h4>\n <p>Variables available during agent execution and template rendering</p>\n </div>\n <div class=\"variables-list\">\n @if (agentVariables.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-code\"\n Title=\"No variables defined\"\n Message=\"Click &quot;Add Variable&quot; to get started.\"\n Size=\"compact\" />\n }\n @for (variable of agentVariables; track $index) {\n <div class=\"variable-item\">\n <input type=\"text\"\n class=\"mj-input variable-name\"\n [(ngModel)]=\"variable.name\"\n placeholder=\"Variable name\"\n [disabled]=\"isExecuting\" />\n <mj-dropdown\n [(ngModel)]=\"variable.type\"\n [Data]=\"[\n {text: 'String', value: 'string'},\n {text: 'Number', value: 'number'},\n {text: 'Boolean', value: 'boolean'},\n {text: 'Object', value: 'object'}\n ]\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [Disabled]=\"isExecuting\"\n class=\"variable-type\">\n </mj-dropdown>\n <input type=\"text\"\n class=\"mj-input variable-value\"\n [(ngModel)]=\"variable.value\"\n [placeholder]=\"variable.type === 'object' ? 'JSON value' : 'Value'\"\n [disabled]=\"isExecuting\" />\n <button\n class=\"remove-button\"\n (click)=\"removeAgentVariable($index)\"\n [disabled]=\"isExecuting\"\n title=\"Remove variable\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n }\n </div>\n <button\n class=\"add-button\"\n (click)=\"addAgentVariable()\"\n [disabled]=\"isExecuting\">\n <i class=\"fa-solid fa-plus\"></i> Add Variable\n </button>\n </div>\n }\n <!-- Execution Monitor Tab -->\n @if (activeTab === 'executionMonitor') {\n <div class=\"tab-content\" style=\"padding: 0; height: 100%;\">\n <mj-agent-execution-monitor\n [mode]=\"executionMonitorMode\"\n [agentRun]=\"currentAgentRun\"\n [liveSteps]=\"liveAgentSteps\"\n [autoExpand]=\"true\"\n (viewRunClick)=\"navigateToAgentRun($event)\"\n [runId]=\"getLastRunId()\"\n [runType]=\"mode\">\n </mj-agent-execution-monitor>\n </div>\n }\n <!-- Agent Settings Tab -->\n @if (activeTab === 'agentSettings') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Agent Settings</h4>\n <p>Configure agent execution parameters</p>\n </div>\n <div class=\"model-settings\">\n <div class=\"setting-group\">\n <label>AI Configuration</label>\n <mj-dropdown\n [(ngModel)]=\"agentConfigurationId\"\n [Data]=\"availableConfigurations\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select a configuration...\"\n class=\"configuration-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n @if (agentConfigurationId) {\n @for (config of availableConfigurations; track config.ID) {\n @if (IsConfigMatchById(config, agentConfigurationId) && config.Description) {\n {{ config.Description }}\n }\n }\n } @else {\n Using default configuration\n }\n </div>\n </div>\n </div>\n </div>\n }\n <!-- Template Variables Tab (Prompt Mode) -->\n @if (activeTab === 'templateVariables') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Template Variables</h4>\n <p>Variables for prompt template rendering</p>\n </div>\n <div class=\"variables-list\">\n @for (variable of templateVariables; track $index) {\n <div class=\"variable-item\">\n <input type=\"text\"\n class=\"mj-input variable-name\"\n [(ngModel)]=\"variable.name\"\n placeholder=\"Variable name\"\n [disabled]=\"isExecuting\" />\n <mj-dropdown\n [(ngModel)]=\"variable.type\"\n [Data]=\"[\n {text: 'String', value: 'string'},\n {text: 'Number', value: 'number'},\n {text: 'Boolean', value: 'boolean'},\n {text: 'Object', value: 'object'}\n ]\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [Disabled]=\"isExecuting\"\n class=\"variable-type\">\n </mj-dropdown>\n <input type=\"text\"\n class=\"mj-input variable-value\"\n [(ngModel)]=\"variable.value\"\n [placeholder]=\"variable.type === 'object' ? 'JSON value' : 'Value'\"\n [disabled]=\"isExecuting\" />\n <button\n class=\"remove-button\"\n (click)=\"removeTemplateVariable($index)\"\n title=\"Remove variable\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n }\n </div>\n <button\n class=\"add-button\"\n (click)=\"addTemplateVariable()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Variable\n </button>\n </div>\n }\n <!-- Model Settings Tab (Prompt Mode) -->\n @if (activeTab === 'modelSettings') {\n <div class=\"tab-content\" style=\"overflow-y: auto;\">\n <div class=\"tab-header\">\n <h4>Model Settings</h4>\n <p>Configure AI model parameters</p>\n <button class=\"custom-button icon-only\" (click)=\"resetToPromptDefaults()\" title=\"Reset to Prompt Settings\">\n <i class=\"fa-solid fa-undo\"></i>\n </button>\n </div>\n <div class=\"model-settings\">\n <div class=\"setting-group\">\n <label>AI Model</label>\n <mj-dropdown\n [(ngModel)]=\"selectedModelId\"\n (ngModelChange)=\"onModelSelectionChange()\"\n [Data]=\"availableModels\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select a model...\"\n class=\"model-selector\">\n </mj-dropdown>\n </div>\n <div class=\"setting-group\">\n <label>AI Vendor</label>\n <mj-dropdown\n [(ngModel)]=\"selectedVendorId\"\n [Data]=\"availableVendors\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n [Disabled]=\"availableVendors.length <= 1 || !selectedModelId\"\n Placeholder=\"Select a vendor...\"\n class=\"vendor-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n @if (!selectedModelId) {\n Using default vendor for the default model\n } @else if (availableVendors.length <= 1) {\n Only one vendor available for this model\n } @else {\n Select the inference provider for this model\n }\n </div>\n </div>\n <div class=\"setting-group\">\n <label>AI Configuration</label>\n <mj-dropdown\n [(ngModel)]=\"selectedConfigurationId\"\n [Data]=\"availableConfigurations\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select a configuration...\"\n class=\"configuration-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n @if (selectedConfigurationId) {\n @for (config of availableConfigurations; track config.ID) {\n @if (IsConfigMatchById(config, selectedConfigurationId) && config.Description) {\n {{ config.Description }}\n }\n }\n } @else {\n Using default configuration\n }\n </div>\n </div>\n <div class=\"setting-group\">\n <label>Response Format</label>\n <mj-dropdown\n [(ngModel)]=\"selectedResponseFormat\"\n [Data]=\"responseFormatOptions\"\n TextField=\"text\"\n ValueField=\"value\"\n Placeholder=\"Select format...\"\n class=\"format-selector\">\n </mj-dropdown>\n <div class=\"setting-help\">\n Expected format for AI response (defaults to prompt setting)\n </div>\n </div>\n <div class=\"setting-group\">\n <label>Max Tokens</label>\n <mj-numeric-input\n [(ngModel)]=\"maxTokens\"\n [Min]=\"100\"\n [Max]=\"8000\"\n [Step]=\"100\"\n Placeholder=\"Max tokens...\"\n class=\"max-tokens-input\">\n </mj-numeric-input>\n <div class=\"setting-help\">\n Maximum length of generated response\n </div>\n </div>\n <div class=\"setting-group\">\n <label class=\"checkbox-label\">\n <input type=\"checkbox\"\n [(ngModel)]=\"skipValidation\"\n class=\"skip-validation-checkbox\">\n Skip Validation\n </label>\n <div class=\"setting-help\">\n Skip output validation during testing\n </div>\n </div>\n <!-- Advanced Parameters Expansion Panel -->\n <mj-accordion-panel\n [Title]=\"'Advanced Parameters'\"\n [Expanded]=\"advancedParamsExpanded\"\n class=\"advanced-params-panel\">\n <div class=\"advanced-settings\">\n <div class=\"setting-group\">\n <label title=\"Controls randomness: 0 = more focused and deterministic, 2 = more random and creative\">\n Temperature\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.temperature\"\n [Min]=\"0\"\n [Max]=\"2\"\n [Step]=\"0.1\"\n [Format]=\"'n1'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Nucleus sampling: only consider tokens with cumulative probability up to this value. 1 = consider all tokens\">\n Top P\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.topP\"\n [Min]=\"0\"\n [Max]=\"1\"\n [Step]=\"0.01\"\n [Format]=\"'n2'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Only sample from the top K tokens. Lower values reduce randomness\">\n Top K\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.topK\"\n [Min]=\"1\"\n [Max]=\"100\"\n [Step]=\"1\"\n [Format]=\"'n0'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Minimum probability for token selection. Filters out low-probability tokens\">\n Min P\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.minP\"\n [Min]=\"0\"\n [Max]=\"1\"\n [Step]=\"0.01\"\n [Format]=\"'n2'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Penalizes tokens based on their frequency in the text. Positive values reduce repetition\">\n Frequency Penalty\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.frequencyPenalty\"\n [Min]=\"-2\"\n [Max]=\"2\"\n [Step]=\"0.1\"\n [Format]=\"'n1'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Penalizes tokens that have appeared in the text. Positive values increase topic diversity\">\n Presence Penalty\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.presencePenalty\"\n [Min]=\"-2\"\n [Max]=\"2\"\n [Step]=\"0.1\"\n [Format]=\"'n1'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Random seed for deterministic generation. Same seed produces same output\">\n Seed\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.seed\"\n [Format]=\"'n0'\"\n Placeholder=\"None\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n <div class=\"setting-group\">\n <label title=\"Sequences that will stop generation when encountered. Enter comma-separated values\">\n Stop Sequences\n </label>\n <textarea\n class=\"mj-textarea advanced-param-input\"\n [(ngModel)]=\"stopSequencesText\"\n (ngModelChange)=\"updateStopSequences()\"\n [rows]=\"2\"\n placeholder=\"Enter comma-separated sequences\"></textarea>\n <div class=\"setting-help\">\n Separate multiple sequences with commas\n </div>\n </div>\n <div class=\"setting-group\">\n <label title=\"Include log probabilities of the output tokens in the response\">\n Include Log Probs\n </label>\n <mj-switch\n [(ngModel)]=\"advancedParams.includeLogProbs\"\n class=\"advanced-param-switch\">\n </mj-switch>\n </div>\n @if (advancedParams.includeLogProbs) {\n <div class=\"setting-group\">\n <label title=\"Number of top log probabilities to include for each token\">\n Top Log Probs\n </label>\n <mj-numeric-input\n [(ngModel)]=\"advancedParams.topLogProbs\"\n [Min]=\"2\"\n [Max]=\"20\"\n [Step]=\"1\"\n [Format]=\"'n0'\"\n Placeholder=\"2\"\n class=\"advanced-param-input\">\n </mj-numeric-input>\n </div>\n }\n </div>\n </mj-accordion-panel>\n </div>\n </div>\n }\n <!-- Saved Conversations Tab -->\n @if (activeTab === 'savedConversations') {\n <div class=\"tab-content\">\n <div class=\"tab-header\">\n <h4>Saved Conversations</h4>\n <p>Previously saved test sessions</p>\n @if (currentConversationId) {\n <button class=\"custom-button small primary\" (click)=\"newConversation()\" title=\"Start a new conversation\">\n <i class=\"fa-solid fa-plus\"></i>\n New\n </button>\n }\n </div>\n <div class=\"saved-list\">\n @if (savedConversations.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-folder-open\"\n Title=\"No saved conversations\"\n Size=\"compact\" />\n }\n @for (conv of savedConversations; track conv.id) {\n <div class=\"saved-item\"\n [class.current]=\"conv.id === currentConversationId\"\n (click)=\"loadConversation(conv)\">\n <div class=\"saved-info\">\n <h5>{{ conv.name }}</h5>\n <p>{{ conv.messages.length }} messages</p>\n <span class=\"saved-date\">{{ conv.updatedAt | date:'short' }}</span>\n </div>\n <button\n class=\"delete-button\"\n (click)=\"deleteConversation(conv, $event)\"\n title=\"Delete conversation\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n </as-split-area>\n </as-split>\n } @else {\n <!-- No sidebar - full width chat -->\n <div class=\"chat-area\">\n <!-- Messages Container -->\n <div class=\"messages-container\" #messagesContainer>\n @if (conversationMessages.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-comments\"\n Title=\"Start a conversation\"\n Message=\"Send a message to begin testing the AI agent\" />\n }\n @for (message of conversationMessages; track message.id) {\n <div [ngClass]=\"getMessageClass(message)\">\n <div class=\"message-header\">\n <span class=\"message-role\">\n @if (message.role === 'user') {\n <i class=\"fa-solid fa-user\"></i> You\n } @else {\n <i class=\"fa-solid fa-robot\"></i> {{ getEntityName() || 'Assistant' }}\n }\n </span>\n <span class=\"message-time\">{{ formatTimestamp(message.timestamp) }}</span>\n @if (message.isStreaming && message.elapsedTime !== undefined) {\n <span class=\"execution-time streaming\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i> {{ formatElapsedTime(message.elapsedTime) }}\n </span>\n } @else if (message.executionTime) {\n <span class=\"execution-time\" [title]=\"getExecutionSummary(message)\">{{ formatExecutionTime(message.executionTime) }}</span>\n }\n @if (showRawToggle(message)) {\n <button class=\"raw-toggle\" (click)=\"showRawJsonDialog(message)\" title=\"View raw JSON response\">\n <i class=\"fa-solid fa-code\"></i>\n </button>\n }\n @if (message.executionData && mode === 'agent' && message.role === 'assistant') {\n <button class=\"execution-history-toggle\" (click)=\"showMessageExecutionHistory(message)\" title=\"View execution details\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n </button>\n }\n @if (message.agentRunId && mode === 'agent' && message.role === 'assistant') {\n <button class=\"execution-history-toggle\" (click)=\"navigateToAgentRun({runId: message.agentRunId, runType: 'agent'})\" title=\"View full run details\">\n <i class=\"fa-solid fa-external-link-alt\"></i>\n </button>\n }\n </div>\n <div class=\"message-content\">\n <button class=\"copy-button-in-bubble\" (click)=\"copyMessage(message)\" title=\"Copy message\">\n <i class=\"fa-solid fa-copy\"></i>\n </button>\n @if (message.isStreaming) {\n <div class=\"streaming-wrapper\">\n <span class=\"streaming-content\">{{ message.streamingContent }}<span class=\"cursor\">|</span></span>\n </div>\n } @else {\n <div [innerHTML]=\"getFormattedContent(message)\"></div>\n }\n @if (message.error) {\n <div class=\"error-details\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ message.error }}\n </div>\n }\n @if (hasPayload(message.payload) && mode === 'agent' && message.role === 'assistant') {\n <div class=\"payload-section\" [class.collapsed]=\"message.payloadCollapsed\">\n <div class=\"payload-header\" (click)=\"togglePayloadCollapse(message)\">\n <span class=\"payload-label\">\n <i class=\"fa-solid fa-code\"></i> Payload\n </span>\n <button class=\"payload-toggle\" type=\"button\">\n <i class=\"fa-solid\" [class.fa-chevron-down]=\"!message.payloadCollapsed\" [class.fa-chevron-right]=\"message.payloadCollapsed\"></i>\n </button>\n </div>\n @if (!message.payloadCollapsed) {\n <div class=\"payload-content\">\n <pre>{{ formatJson(message.payload) }}</pre>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n <!-- Input Area -->\n <div class=\"input-area\">\n <div class=\"input-container\">\n <textarea\n #messageInput\n class=\"mj-textarea message-input\"\n [(ngModel)]=\"currentUserMessage\"\n [rows]=\"3\"\n placeholder=\"Type your message here... (Press Enter to send, Shift+Enter for new line)\"\n (keypress)=\"handleKeyPress($event)\"\n [disabled]=\"isExecuting\"></textarea>\n <button\n class=\"send-button\"\n (click)=\"sendMessage()\"\n [disabled]=\"isExecuting || !currentUserMessage.trim()\"\n title=\"Send message\">\n @if (isExecuting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-paper-plane\"></i>\n }\n </button>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n}\n\n<!-- Save Conversation Dialog -->\n@if (showSaveDialog) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"400\"\n (Close)=\"cancelSaveDialog()\"\n class=\"save-dialog\">\n <mj-dialog-titlebar>Save Conversation</mj-dialog-titlebar>\n <div class=\"dialog-content\">\n <p>Enter a name for this conversation:</p>\n <input\n #saveDialogInput\n type=\"text\"\n (keyup)=\"updateTempConversation()\"\n placeholder=\"Conversation name\"\n class=\"mj-input full-width\" />\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"cancelSaveDialog()\">Cancel</button>\n <button mjButton\n variant=\"primary\"\n (click)=\"confirmSaveConversation()\"\n [disabled]=\"tempConversationName === ''\">\n Save\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n\n<!-- Load Confirmation Dialog -->\n@if (showLoadConfirmDialog) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"400\"\n (Close)=\"cancelLoadConversation()\"\n class=\"confirm-dialog\">\n <mj-dialog-titlebar>Replace Current Conversation?</mj-dialog-titlebar>\n <div class=\"dialog-content\">\n <p>Loading this conversation will replace the current one. Any unsaved changes will be lost.</p>\n <p>Do you want to continue?</p>\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"cancelLoadConversation()\">Cancel</button>\n <button mjButton\n variant=\"primary\"\n (click)=\"confirmLoadConversation()\">\n Load Conversation\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n\n<!-- JSON Viewer Window -->\n@if (showJsonWindow) {\n <mj-window\n [Visible]=\"true\"\n Title=\"Raw JSON Response\"\n [Width]=\"900\"\n [Height]=\"700\"\n [MinWidth]=\"600\"\n [MinHeight]=\"400\"\n [Draggable]=\"true\"\n [Resizable]=\"true\"\n (Close)=\"closeJsonWindow()\">\n <mj-json-viewer-window [jsonContent]=\"currentJsonContent\"></mj-json-viewer-window>\n </mj-window>\n}\n\n"]}