Array of agent action entities for card display
Array of agent note entities for display
Array of agent prompt entities for card display
ReadonlyAgentColumn spec for the AIAgentSearchScope child grid (mockup #5).
Voice/realtime sessions where this agent is the co-agent or the delegation target
The agent type entity for this agent
Agent types loaded from the database
Size of the bottom area as a percentage (0-100) for angular-split. Used by CodeGen-generated templates with as-split.
TreeDropdown configuration for the agent category field
Per-instance presentation config (toolbar visibility, related-entity
sections, collapsibility, width, in-form navigation). Set by the form host
(MjEntityFormHostComponent) or any consumer that instantiates the form
directly. Read back by MjRecordFormContainerComponent and the collapsible
panels through the FormComponent reference, so it takes effect WITHOUT
regenerating the CodeGen-produced template. Null means "use the container's
own defaults" (the classic full-page tab behavior).
ID of the currently-rendered variant (null when no override is active and the form is the CodeGen /
ProtectedelementPagination state for execution history
Which record type the Execution History section shows: agent runs (default) or realtime voice sessions
Search functionality for execution history
Track which execution cards are expanded
ProtectedformFlag to indicate if there are unsaved changes
Whether the form header is collapsed to a single compact line
Main loading state for initial data load
True when no explicit permission records exist (agent is open to everyone)
Array of learning cycle entities for display
Individual loading states for each section, start off true until loading complete
Model selection mode options for the dropdown
Emitted when navigation is requested (record link, external link, email, new record, etc.)
Emitted when a user-facing notification should be shown
Hook called when the user picks a different variant from the picker.
Default is a no-op; the Explorer-level single-record component replaces
this on the form instance to wire FormResolverService.SetSelectedVariant
and reload the record. Kept as a method (not an EventEmitter) so the host
doesn't need to subscribe — assignment is enough.
Read-only summary of SearchScopePermission rows that apply to the scopes this agent is assigned to. Drives a small audit table inside the agent form's Search section so an agent owner can see at a glance who has access to the scopes their agent uses, without navigating away to the Knowledge Hub Config dashboard's full audit surface.
Each entry pairs a scope name with a list of permission rows (principal type + name + level). Rebuilt whenever the agent's AIAgentSearchScope assignments change.
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.
Array of recent execution records for history display
The AI Agent entity being edited
Emitted after a record is deleted successfully
Emitted when a record delete fails
Emitted once after ngOnInit completes and the record is fully initialized (favorites loaded, form state initialized). This is the safe point for the container to start loading badge counts and other record-dependent data.
Emitted after a record is saved successfully
Emitted when a record save fails
ProtectedsectionsTracked expanded/collapsed state for each panelbar section
Current category selection for the TreeDropdown
Currently selected context compression prompt
Controls visibility of the new permissions dialog from @memberjunction/ng-agents
Agent status options for the dropdown
Current filter for sub-agents display
Array of sub-agent entities for card display (DEPRECATED - use allSubAgents)
ReadonlytoolbarToolbar config — hide right-hand section controls since this form has a custom layout
Height of the top area when a splitter layout is used. Referenced by CodeGen-generated templates for entities with "top area" sections.
Size of the top area as a percentage (0-100) for angular-split. Used by CodeGen-generated templates with as-split.
Emitted when validation fails before save
Variants applicable to the current (entity, user) tuple, supplied by the Explorer-level form resolver. When more than one entry is present, the record-form-container shows a picker that lets the user switch between variants. Empty / single-entry arrays hide the picker.
The container reads this via its EffectiveVariants accessor — generated
form templates do NOT need to bind it explicitly.
StaticɵdirStaticɵfacNumber of actions configured for this agent
Returns all organic key related entities across all organic keys, flattened and sorted.
Number of child sub-agents (ParentID-based)
Number of execution history records
Message shown when the execution-history search matches nothing.
Filtered sub-agents based on current filter
Checks if there is a next page available
Whether the current entity has any active organic keys with related entities configured.
Checks if there is a previous page available
Number of learning cycles for this agent
Number of notes associated with this agent
Returns all active organic keys for the current entity, or an empty array if none.
ProtectedPendingNumber of prompts associated with this agent
Returns either the default Metadata provider or the one specified in the Provider property, if it was specified
Number of related sub-agents (Relationship-based)
Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified
Returns either the default RunReport 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
Number of sub-agents under this agent (for backward compatibility)
Gets the total number of pages
Total number of sub-agents across both types
Check if user can create AI Agent Actions
Check if user can create AI Prompts (needed for creating new prompts)
Check if user can create both AI Prompts and AI Agent Prompts (for createNewPrompt functionality)
Check if user can create AI Agent Notes
Check if user can create AI Agent Prompts
Check if user can create AI Agents (for sub-agents)
Check if user can delete AI Agent Actions
Check if user can delete AI Agent Notes
Check if user can delete AI Agent Prompts
Check if user can delete AI Agents (for sub-agents)
Check if user can update AI Agent Actions
Check if user can update AI Agent Notes
Check if user can update AI Agent Prompts
Check if user can update AI Agents (for sub-agents)
Check if user can view AI Agent Runs (execution history)
Check if user can view AI Agent Learning Cycles
Check if user can view AI Agent Sessions (realtime voice session history)
Adds a new note to the agent
Adds a new prompt to the agent (deferred until save)
Opens the sub-agent selector dialog for adding sub-agents (deferred until save)
Builds RunViewParams for a specific organic key related entity.
Convenience method to build organic key view params by organic key name and related entity name.
OptionalrelatedEntityJoinField: stringOverride CancelEdit to restore UI state when user cancels changes
Clears the selected context compression prompt
Clears the permission cache. Call this when user context changes or permissions are updated.
Opens the modern Add Action dialog for selecting actions (deferred until save)
Opens a dialog to configure the output mapping for a related sub-agent
Creates a new child sub-agent (renamed from createSubAgent for clarity)
Creates a new sub-agent using the CreateAgentService slide-in panel. Uses the new unified agent creation UI from @memberjunction/ng-agents.
Debug method to check current pending records state Useful for troubleshooting cancel/revert issues
Formats cost with appropriate precision
Formats execution time
Optionaldecimals: numberOptionalcurrency: stringSession duration: created → closed (terminal) or last-active (still open).
Formats token count with appropriate units (K for thousands, M for millions)
Optionaldecimals: numberOptionalcurrency: stringGets the count of actions
Gets the icon class for an action Falls back to default bolt icon if no IconClass is set
Gets the agent's display icon Prioritizes LogoURL, falls back to IconClass, then default robot icon
Custom-layout AI Agent form looks best full-width on first open.
OptionalrelatedEntityJoinField: stringGets the icon for the execution mode
Gets the full execution result message for expanded view
Gets a preview of the execution result for collapsed view
Gets the status color for execution runs
Gets the status icon for execution runs
Gets the priority badge color
Gets the priority label
Gets the count of prompts
ProtectedgetGet the expanded state for a panelbar section, falling back to a default
Status color for a session lifecycle status (Active / Idle / Closed).
Status icon for a session lifecycle status.
Returns the appropriate color for the agent status badge. Uses standard color coding: green for active, yellow for pending, gray for disabled.
CSS color value for the status badge
Gets the badge color for a sub-agent based on its type
Gets the badge icon for a sub-agent based on its type
Gets the badge text for a sub-agent based on its type
Gets the count of sub-agents
Gets the icon for a sub-agent Prioritizes LogoURL, falls back to IconClass, then default robot icon
Gets the payload information string for display
Navigates to the next page of execution history
Navigates to the previous page of execution history
Checks if the agent has a logo URL (for image display)
ProtectedinitProtectedInternalThe base SaveRecord() method will call this InternalSaveRecord() method after handling validation and pending record population
OptionaldefaultExpanded: booleanOpens dialog to link an existing agent as a related sub-agent
Loads the permission summary for the scopes currently assigned to this agent. Called on agent load and after AIAgentSearchScope edits.
Navigates to a related entity
Navigates to the parent agent when the "Child of..." badge is clicked
A callback method that is invoked immediately after Angular has completed initialization of a component's view. It is invoked only once when the view is instantiated.
Update custom section when EditMode changes
Component cleanup - critical for preventing memory leaks
After view initialization, load any custom form section if defined
Handle category selection change from the TreeDropdown
Handle context compression toggle and reset related fields when disabled
Handles state change events for the custom section panel
The panel bar state change event
Handles delete requests from the form container. Emits RecordDeleted on success, RecordDeleteFailed on failure. Generated form templates bind this as: (DeleteRequested)="OnDeleteRequested()"
Handles search text changes - debounced to avoid excessive processing
Handles favorite toggle from the form container. Generated form templates bind this as: (FavoriteToggled)="OnFavoriteToggled()"
Handles navigation events from the form container and related entity grids. Relays the event upward via the Navigate
Handles history view requests from the form container. Generated form templates bind this as: (HistoryRequested)="OnHistoryRequested()"
Handles list management requests from the form container. Generated form templates bind this as: (ListManagementRequested)="OnListManagementRequested()"
Handle panelbar stateChange — fires when any section expands or collapses
Opens the prompt selector dialog for context compression prompt
Opens the full execution record in a new view
Opens the advanced settings dialog for a prompt
Opens an AI Agent Session record (renders via the custom session form).
Opens the advanced settings dialog for a sub-agent
Opens the integrated test harness for the current agent. Validates that the agent has been saved before allowing testing. Shows a notification if the agent needs to be saved first.
ProtectedPendingProtectedPopulateOverride PopulatePendingRecords to preserve our pending records before parent clears them However, during cancel operations, we want to clear all pending records completely
ProtectedRaiseRefreshes the related data and updates snapshots
Manually refreshes the snapshot for cancel/revert functionality Useful when you want to reset the "original state" to the current state
Removes an action from the agent (deferred until save)
Removes a child sub-agent (updated to work with UnifiedSubAgent)
Removes a prompt from the agent (deferred until save)
Removes a sub-agent from this agent (deferred until save)
Switches the Execution History section between agent runs and voice sessions.
Sets the sub-agent filter to show all, child, or related sub-agents
Called when the splitter layout changes (for entities with "top area" sections). No-op in the generic version; override in host application if splitter resizing is needed.
Toggles the expanded state of an execution card
Toggle the header between expanded and collapsed modes
Unlinks a related sub-agent (removes the relationship)
Updates payload field values from code editor
ProtectedValidate
Enhanced AI Agent form component that extends the auto-generated base form with comprehensive agent management capabilities including test harness integration, related entity management, and execution history tracking.
Key Features:
Form Sections:
Usage:
This component is automatically loaded when editing AI Agent entities through the MemberJunction form system. It extends the base generated form with additional functionality while maintaining full compatibility.
Example