@extends('admin.layouts.app') @section('title', $agent->name . ' — ' . __('admin.nav.ai_agents')) @section('page_title', $agent->name) @push('styles') @endpush @section('content') @if (session('status'))
{{ session('status') }}
@endif
{{-- Overview --}}

OverviewPrompt & responseRuns

Key
{{ $agent->agent_key }}
@if($agent->agent_code)
n8n code
{{ $agent->agent_code }}
@endif @if($agent->agent_code)
Integration active
{{ $agent->is_active ? 'Active' : 'Inactive — blocked' }}
@csrf
@endif
Description
{{ $agent->description ?? '—' }}
Environment
{{ $agent->environment }}
Version
{{ $agent->agent_version ?? '—' }}
Core skill
{{ $agent->core_skill_version ?? '—' }}
Stage skill
{{ $agent->stage_skill_version ?? '—' }}
@include('admin.agents.partials.definition-card', ['agent' => $agent]) @include('admin.agents.partials.capability-policies', [ 'agent' => $agent, 'capabilities' => $n8nCapabilities, 'environment' => $env, ]) {{-- Knowledge Cache (read-only) — per-environment active pointer + refresh + immutable history/rollback --}}

Knowledge

{{-- Active pointer per environment --}} @foreach ($knowledgeEnvironments as $e) @php $a = $knowledgeActive[$e] ?? null; @endphp @endforeach
EnvironmentActive version PackageFiles ChecksumLoaded
{{ $e }} @if ($a){{ $a->version }}@elsenot loaded@endif {{ $a?->package_version ?? '—' }}@if ($a && $a->registry_version) · reg {{ $a->registry_version }}@endif {{ $a?->file_count ?? '—' }} @if ($a){{ \Illuminate\Support\Str::limit((string) $a->checksum, 12) }}@endif {{ $a ? (optional($a->loaded_at)->format('Y-m-d H:i') ?? '—') : '—' }}
{{-- Refresh (environment-scoped) --}}
@csrf
@if ($knowledgeHistory->isNotEmpty())

Version history (immutable)

@foreach ($knowledgeHistory as $v) @endforeach
EnvVersionPackage FilesStatus ChecksumLoaded
{{ $v->environment }} {{ $v->version }} @if ($v->is_active)active@endif {{ $v->package_version ?? '—' }} {{ $v->file_count ?? '—' }} {{ $v->status }} {{ \Illuminate\Support\Str::limit((string) $v->checksum, 12) }} {{ optional($v->loaded_at)->format('Y-m-d H:i') ?? '—' }} @unless ($v->is_active)
@csrf
@endunless
@endif
{{-- Statistics --}}

Statistics

{{ $stats['total_runs'] }}
Total runs
{{ number_format($stats['success_rate']*100,1) }}%
Success rate
{{ $stats['executed_runs'] }}
Executed
{{ $stats['failed_runs'] }}
Failed
{{ $stats['blocked'] }}
Blocked
{{ $stats['approvals'] }}
Approvals
{{-- Assigned Actions — the source of truth for agent↔action assignment --}} @if (false)

{{ __('admin.agents.assigned_actions.title') }}

{{-- add-action row --}}
{{ __('admin.action_details.action_name') }} {{ __('admin.agents.assigned_actions.policy') }} {{ __('admin.agents.assigned_actions.enabled') }}
{{ __('admin.agents.assigned_actions.empty') }}
{{-- Application Action links are configured from Labels → Action. They are distinct from Agent Action Policies above: the link controls webhook trigger; the policy controls what a later agent run may do. --}} @endif

Linked Application Actions {{ $linkedActionOptions->count() }}

@if ($canManageApplicationActionLinks)

Choose the Startup Application actions that should queue this Agent's n8n webhook. This does not change the workflow group or status.

@csrf
@endif @forelse ($linkedActionOptions as $option) @if ($canManageApplicationActionLinks) @else @endif @empty @endforelse
ActionCodePolicyLinked
{{ $option->name_en ?: $option->name_ar ?: $option->value }} {{ $option->value }}
@csrf
{{ optional($option->pivot->created_at)->format('Y-m-d H:i') ?? '—' }}
@csrf @method('DELETE')
No Application Action links yet.
{{-- Recent Runs --}} @include('admin.agents.partials.recent-runs', ['recentRuns' => $recentRuns])

Webhook Activity

@forelse ($recentWebhookDeliveries as $delivery) @empty @endforelse
DeliveryApplicationActionStatusHTTPAttemptsQueued
#{{ $delivery->id }} #{{ $delivery->startup_investment_round_id }}@if($delivery->startupApplication) · {{ $delivery->startupApplication->round_number }}@endif {{ $delivery->actionOption?->name_en ?: $delivery->actionOption?->name_ar ?: $delivery->actionOption?->value ?: '—' }} {{ $delivery->status }} {{ $delivery->http_status ?? '—' }} {{ $delivery->attempts }} {{ optional($delivery->queued_at)->format('Y-m-d H:i') ?? '—' }}
No webhook deliveries yet.
@push('scripts') @endpush @endsection