Creates a new AI Test Harness component instance.
Angular DomSanitizer for safe HTML rendering of formatted content
Angular ChangeDetectorRef for managing change detection
Currently active tab in the sidebar
Advanced LLM Parameters
Whether advanced parameters panel is expanded
Selected AI configuration for agent execution
Unified variables for agent execution (combines data context and template data)
Available AI configurations
Available AI models for prompt execution
Available AI vendors for the selected model
Complete array of all messages in the current conversation session
Current agent run being displayed in execution monitor
ID of the currently active/loaded conversation, if any
Current JSON content to display in the dialog
Current text input by the user (bound to textarea)
The entity to test - either an AI Agent or AI Prompt
Mode for the execution monitor component
[chat, sidebar] percentages. Restored from MJ: User Settings.
Whether a re-run has been executed (shows Reset button instead of Re-Run)
Whether an agent execution is currently in progress
Tracks agent steps during live execution (deprecated - now using agent run's Steps directly)
Maximum tokens for prompt execution
Use MinimizeRequested.
The same emitter under the old binding name, so a template still binding (minimizeRequested) keeps working. Must stay AFTER MinimizeRequested: class fields initialise in order, and the other way round this captures undefined.
Event emitted when the component requests to be minimized (e.g., when navigating to a run)
The mode of operation - either 'agent' or 'prompt'
Name for the new conversation being saved
The original prompt run ID when re-running a previous prompt execution
If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.
ProtectedresponseAvailable response format options
Use RunOpened.
The same emitter under the old binding name, so a template still binding (runOpened) keeps working. Must stay AFTER RunOpened: class fields initialise in order, and the other way round this captures undefined.
Emitted when the user navigates to view a run (agent or prompt)
Array of saved conversation sessions loaded from localStorage
Selected AI configuration for prompt execution
Selected AI model for prompt execution
Selected response format for prompt execution
Selected AI vendor for prompt execution
Flag to control JSON dialog visibility
Whether the JSON viewer window is visible
Whether to show the load confirmation dialog
Whether to show the save conversation dialog
Whether the configuration sidebar is currently visible
Whether to skip validation when running prompts
Starting-payload editor is collapsed unless the person opens it.
Raw stop sequences input for textarea
The system prompt override to use instead of rendering from template
Temporary name for the dialog input to avoid binding conflicts
Variables for prompt template rendering
Use VisibilityChange.
The same emitter under the old binding name, so a template still binding (visibilityChange) keeps working. Must stay AFTER VisibilityChange: class fields initialise in order, and the other way round this captures undefined.
Event emitted when the visibility state changes, allowing parent components to react
True after Debug — chrome, breakpoints, and the start-paused seed stay on for this run.
The graph the most recent run submitted, so the harness can show it running.
Parse error for the payload editor, shown inline rather than swallowed at submit time.
Optional starting payload for a workflow run, as JSON the user can edit.
StaticɵdirStaticɵfacUse ActiveTab.
Use ActiveTab.
Use AdvancedParams.
Use AdvancedParams.
Use AgentConfigurationId.
Use AgentVariables.
Use AiAgent.
Use AvailableModels.
Use AvailableVendors.
Use ConversationMessages.
Use CurrentAgentRun.
Use CurrentJsonContent.
Use CurrentUserMessage.
The effective mode, with a Flow agent selecting 'workflow' whatever the caller asked for.
Use ExecutionMonitorMode.
Use HasExecutedRerun.
Use IsExecuting.
Use IsVisible.
Controls the visibility of the test harness. When set to true, automatically resets the harness state. This property is typically controlled by parent components or dialog wrappers.
True when the loaded agent is a Flow agent, which is decided by its type rather than by a
caller remembering to set one more input. vwAIAgents carries the type's name, so this costs
no extra query.
Use LiveAgentSteps.
Use MaxTokens.
Use Mode.
What the execution monitor is watching.
A workflow run IS an agent run — it is the same AIAgentRun row, just one that compiled a
graph instead of reasoning. Widening the monitor's own contract would imply otherwise.
Use NewConversationName.
Use OriginalPromptRunId.
Returns either the default Metadata provider or the one specified in the Provider property, if it was specified
Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified
Returns either the default RunView provider or the one specified in the Provider property, if it was specified
Use SavedConversations.
Use SelectedModelId.
Use SelectedVendorId.
Use ShowJsonDialog.
Use ShowJsonWindow.
Use ShowSaveDialog.
Use ShowSidebar.
Use SkipValidation.
Use StopSequencesText.
Use SystemPromptOverride.
Use TempConversationName.
Use TemplateVariables.
Use AddAgentVariable.
Adds a new empty agent variable to the collection. Agent variables are passed to the agent during execution for dynamic content and template rendering.
Use AddTemplateVariable.
Adds a new empty template variable to the collection (prompt mode only). Template variables are used for prompt template rendering.
Cancels loading a conversation
Use CancelSaveDialog.
Cancels the save dialog
Use ClearConversation.
Clears the current conversation after user confirmation. Resets both the message history and the current conversation ID.
Closes the test harness by setting visibility to false and emitting the change event. Used by dialog implementations and close buttons.
Use CloseJsonDialog.
Closes the JSON dialog
Use CloseJsonWindow.
Closes the JSON viewer window
Confirms loading a conversation after dialog confirmation
Handles the save dialog confirmation
Use CopyJsonContent.
Copies the JSON content to clipboard
Copies the message content to clipboard.
The message to copy
Starts the workflow paused. $.debug.paused is written at Submit — Pause-after-submit
races the first dispatcher poll, so this cannot be a follow-up control.
Use DeleteConversation.
Automatically detects the content type of a message for appropriate rendering. Uses pattern matching to identify JSON, Markdown, or plain text content.
Content string to analyze
Detected content type ('markdown', 'json', or 'text')
Use ExecuteRerun.
Executes a re-run of a previously loaded prompt run. This bypasses the need for a new user message since we're re-running with existing messages.
Use ExportConversation.
Formats execution time from milliseconds into a human-readable string. Automatically selects appropriate units (minutes, seconds, or milliseconds).
Execution time in milliseconds
Formatted time string (e.g., "2m 30.5s", "1.23s", "500ms")
Formats JSON content with proper indentation for display. Also recursively parses any nested JSON strings.
JSON string to format
Formatted JSON string or original content if parsing fails
Formats a Date object into a user-friendly time string.
Date object to format
Formatted time string in HH:MM format
Use GetEntityIconClass.
Gets the icon class for the current entity
Use GetEntityLogoURL.
Gets the logo URL for the entity (agent only)
Gets the display name of the current entity
Gets a summary of the execution for tooltip display
The message to get execution summary for
A brief summary of the execution steps
Formats streaming content with markdown rendering
The message containing streaming content
SafeHtml formatted content
Use GetLastRunId.
Get the last run ID from conversation messages
Generates CSS class names for message display based on message properties.
The conversation message to generate classes for
Space-separated CSS class string for styling
Handles keyboard input in the message textarea. Sends message on Enter (without Shift) and allows multi-line input with Shift+Enter.
Keyboard event from the textarea
Use HasEntityLogo.
Checks if the entity has a logo URL
Checks if a message contains JSON content that has extractable human-readable content. Used to determine if the raw toggle should be shown.
The conversation message to check
True if the message has extractable content different from raw JSON
Checks if the payload should be displayed (not null, undefined, or empty object)
The payload to check
true if the payload has content, false otherwise
Use ImportConversation.
Case-insensitive UUID comparison for configuration ID matching in templates.
Determines if the provided content is valid JSON.
String content to test
True if content can be parsed as JSON, false otherwise
Navigates to the AI Agent Run form to view detailed execution information
The ID of the agent run to view
Use NavigateToRun.
Navigate to the run details form
Use NewConversation.
Starts a new conversation
Post-view check hook that handles auto-scrolling to the bottom of the message container when new content is added.
Responds to input property changes, particularly when entity is set/changed
Component cleanup. Destroys subscriptions and clears any active intervals to prevent memory leaks.
Component initialization. Loads saved conversations, sets up event subscriptions, and initializes the harness to a clean state.
Handles model selection change and loads available vendors for the selected model
Removes an agent variable at the specified index.
Zero-based index of the variable to remove
Removes a template variable at the specified index (prompt mode only).
Zero-based index of the variable to remove
Use ResetHarness.
Resets the test harness to its initial state, clearing all conversations, variables, and UI state. Called automatically when the harness becomes visible.
Resets the conversation back to the original messages from the prompt run. This is available after a re-run has been executed.
Resets all model settings to the prompt defaults
Starts the workflow.
Deliberately not routed through the chat send path: there is no message, and pushing an empty user turn into a transcript to trigger a run is exactly the fiction this mode removes.
Use SaveConversation.
Saves the current conversation to localStorage with user-provided name. Handles both creating new conversations and updating existing ones. Automatically limits storage to 50 conversations to prevent excessive memory usage.
Use SelectTab.
Switches to the specified tab in the configuration sidebar.
The tab to activate
Use SendMessage.
Shows the execution history for a specific message
The message to show execution history for
Shows the raw JSON dialog for a specific message
The message to show raw JSON for
Determines whether to show the raw toggle button for a message. Combines the logic for raw content availability and extractable content.
The conversation message to check
True if the raw toggle should be displayed
Use ToggleAdvancedParams.
Toggles the advanced parameters expansion panel
Toggles the collapsed state of a message's payload section
The message to toggle payload visibility for
Use ToggleSidebar.
Toggles the visibility of the configuration sidebar. Allows users to show/hide the data context and conversation management panels.
Use UpdateStopSequences.
Updates stop sequences from the textarea input
Comprehensive test harness component for AI Agent development and testing. Provides a full-featured chat interface with conversation management, data context configuration, template data management, streaming responses, conversation persistence, and import/export capabilities.
Key Features:
Usage:
Example