{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "feature-bento-ai-copilot",
  "title": "Feature Bento Ai Copilot",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-angular/blocks/feature-bento-ai-copilot/feature-bento-ai-copilot.component.ts",
      "content": "// AI agent copilot bento workbench with model tuning sliders, live inference\n// streaming, and token speed telemetry. Port of the React block 1:1.\nimport { ChangeDetectionStrategy, Component, DestroyRef, Input, computed, inject, signal } from '@angular/core'\nimport {\n  Activity,\n  ArrowRight,\n  BrainCircuit,\n  Check,\n  Copy,\n  Cpu,\n  LucideAngularModule,\n  Play,\n  Sliders,\n  Sparkles,\n  Zap,\n} from 'lucide-angular'\nimport { cn } from '@/lib/utils'\nimport { UiBadgeComponent } from '@/ui/badge/badge.component'\nimport { UiButtonComponent } from '@/ui/button/button.component'\nimport { UiCardComponent, UiCardContentComponent } from '@/ui/card/card.component'\n\nexport type CopilotModel = 'sonnet' | 'gpt4o' | 'gemini'\n\nexport interface CopilotModelMetrics {\n  name: string\n  ttftMs: number\n  tokPerSec: number\n  costPer1k: string\n}\n\nconst models: { id: CopilotModel; label: string }[] = [\n  { id: 'sonnet', label: 'Sonnet 3.5' },\n  { id: 'gpt4o', label: 'GPT-4o' },\n  { id: 'gemini', label: 'Gemini Pro' },\n]\n\n@Component({\n  changeDetection: ChangeDetectionStrategy.Eager,\n  selector: 'ui-feature-bento-ai-copilot, [ui-feature-bento-ai-copilot]',\n  standalone: true,\n  // React renders the root <section> itself: the host stays out of layout and `class` goes to the root.\n  host: { '[attr.class]': '\"contents\"' },\n  imports: [LucideAngularModule, UiBadgeComponent, UiButtonComponent, UiCardComponent, UiCardContentComponent],\n  template: `\n    <section data-slot=\"feature-bento-ai-copilot\" [class]=\"rootClass\">\n      <div class=\"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8\">\n        <!-- Section Header -->\n        <div class=\"mx-auto max-w-3xl space-y-4 text-center\">\n          <a\n            href=\"#ai-copilot\"\n            class=\"group border-border/80 bg-secondary/60 hover:bg-secondary text-foreground inline-flex items-center gap-2 rounded-full border px-3.5 py-1 text-xs font-medium shadow-2xs transition-colors\"\n          >\n            <lucide-icon [img]=\"Sparkles\" class=\"text-primary size-3.5\" />\n            <span>Next-Gen AI Agent Workbench</span>\n            <lucide-icon\n              [img]=\"ArrowRight\"\n              class=\"text-muted-foreground size-3 transition-transform group-hover:translate-x-0.5\"\n            />\n          </a>\n\n          <h2 class=\"text-foreground text-3xl font-bold tracking-tight sm:text-4xl\">{{ title }}</h2>\n\n          <p class=\"text-muted-foreground text-base sm:text-lg\">{{ description }}</p>\n        </div>\n\n        <!-- Bento Grid (2 Cards) -->\n        <div class=\"mt-12 grid grid-cols-1 gap-6 lg:grid-cols-12\">\n          <!-- Left: Model Tuning & Hyperparameters (5 Cols) -->\n          <div\n            ui-card\n            class=\"border-border bg-card/80 flex flex-col justify-between shadow-xs backdrop-blur-xs lg:col-span-5\"\n          >\n            <div ui-card-content class=\"space-y-5 p-6\">\n              <div class=\"border-border flex items-center justify-between border-b pb-3\">\n                <div class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"Sliders\" class=\"text-primary size-4\" />\n                  <span class=\"text-foreground text-sm font-semibold\">Inference Hyperparameters</span>\n                </div>\n                <span ui-badge variant=\"outline\" class=\"border-border font-mono text-xs\">\n                  {{ modelMetrics().name }}\n                </span>\n              </div>\n\n              <!-- Model Switcher -->\n              <div class=\"space-y-2\">\n                <label class=\"text-muted-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Foundation Model\n                </label>\n                <div class=\"grid grid-cols-3 gap-2\">\n                  @for (model of models; track model.id) {\n                    <button type=\"button\" [class]=\"modelButtonClass(model.id)\" (click)=\"selectedModel.set(model.id)\">\n                      {{ model.label }}\n                    </button>\n                  }\n                </div>\n              </div>\n\n              <!-- Temperature Slider -->\n              <div class=\"space-y-2\">\n                <div class=\"flex items-center justify-between text-xs\">\n                  <span class=\"text-foreground font-medium\">Sampling Temperature</span>\n                  <span class=\"text-primary font-mono font-bold\">{{ temperature() }}</span>\n                </div>\n                <input\n                  type=\"range\"\n                  min=\"0\"\n                  max=\"1\"\n                  step=\"0.1\"\n                  [value]=\"temperature()\"\n                  (input)=\"setTemperature($event)\"\n                  class=\"accent-primary w-full cursor-pointer\"\n                  aria-label=\"Sampling temperature\"\n                />\n                <div class=\"text-muted-foreground flex justify-between text-xs\">\n                  <span>0.0 (Deterministic)</span>\n                  <span>1.0 (Creative)</span>\n                </div>\n              </div>\n\n              <!-- System Prompt Input -->\n              <div class=\"space-y-2\">\n                <label class=\"text-muted-foreground text-xs font-semibold tracking-wider uppercase\">\n                  System Directive\n                </label>\n                <textarea\n                  rows=\"3\"\n                  [value]=\"systemPrompt()\"\n                  (input)=\"systemPrompt.set($any($event.target).value)\"\n                  class=\"border-border bg-muted/30 text-foreground focus-visible:ring-primary w-full rounded-md border p-2.5 font-mono text-xs focus-visible:ring-1 focus-visible:outline-none\"\n                ></textarea>\n              </div>\n\n              <!-- Action Button -->\n              <button\n                ui-button\n                class=\"w-full gap-2 shadow-xs\"\n                [disabled]=\"isGenerating()\"\n                (click)=\"triggerGeneration()\"\n              >\n                @if (!isGenerating()) {\n                  <lucide-icon [img]=\"Play\" class=\"size-3.5\" />\n                } @else {\n                  <lucide-icon [img]=\"Zap\" class=\"size-3.5 animate-spin\" />\n                }\n                <span>{{ isGenerating() ? 'Streaming Inference...' : 'Synthesize UI Primitive' }}</span>\n              </button>\n            </div>\n          </div>\n\n          <!-- Right: Streaming Code Output & Real-time Telemetry (7 Cols) -->\n          <div\n            ui-card\n            class=\"border-border bg-card/80 flex flex-col justify-between shadow-xs backdrop-blur-xs lg:col-span-7\"\n          >\n            <div ui-card-content class=\"space-y-4 p-6\">\n              <!-- Output Header & Telemetry -->\n              <div class=\"border-border flex flex-wrap items-center justify-between gap-3 border-b pb-3\">\n                <div class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"BrainCircuit\" class=\"text-success size-4\" />\n                  <span class=\"text-foreground text-sm font-semibold\">Live Streaming Synthesis</span>\n                </div>\n\n                <div class=\"flex items-center gap-2\">\n                  <button\n                    ui-button\n                    variant=\"ghost\"\n                    size=\"sm\"\n                    class=\"h-7 gap-1 px-2 font-mono text-xs\"\n                    (click)=\"copyCode()\"\n                  >\n                    @if (copied()) {\n                      <lucide-icon [img]=\"Check\" class=\"text-primary size-3.5\" />\n                    } @else {\n                      <lucide-icon [img]=\"Copy\" class=\"size-3.5\" />\n                    }\n                    <span>{{ copied() ? 'Copied' : 'Copy SFC' }}</span>\n                  </button>\n                </div>\n              </div>\n\n              <!-- Telemetry KPI Pill Row -->\n              <div class=\"border-border bg-muted/20 grid grid-cols-3 gap-3 rounded-lg border p-3\">\n                <div class=\"space-y-0.5\">\n                  <div class=\"text-muted-foreground flex items-center gap-1 text-xs\">\n                    <lucide-icon [img]=\"Activity\" class=\"text-success size-3\" />\n                    <span>TTFT</span>\n                  </div>\n                  <div class=\"text-foreground font-mono text-sm font-bold\">{{ modelMetrics().ttftMs }}ms</div>\n                </div>\n                <div class=\"space-y-0.5\">\n                  <div class=\"text-muted-foreground flex items-center gap-1 text-xs\">\n                    <lucide-icon [img]=\"Cpu\" class=\"text-info size-3\" />\n                    <span>Velocity</span>\n                  </div>\n                  <div class=\"text-foreground font-mono text-sm font-bold\">{{ modelMetrics().tokPerSec }} tok/s</div>\n                </div>\n                <div class=\"space-y-0.5\">\n                  <div class=\"text-muted-foreground flex items-center gap-1 text-xs\">\n                    <lucide-icon [img]=\"Zap\" class=\"text-primary size-3\" />\n                    <span>Cost</span>\n                  </div>\n                  <div class=\"text-foreground font-mono text-sm font-bold\">{{ modelMetrics().costPer1k }}/1k</div>\n                </div>\n              </div>\n\n              <!-- Code Sandbox Block -->\n              <div\n                class=\"border-border bg-muted/50 text-foreground relative overflow-x-auto rounded-lg border p-4 font-mono text-xs\"\n              >\n                <pre class=\"leading-relaxed\"><code>{{ generatedStream() }}</code></pre>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  `,\n})\nexport class UiFeatureBentoAiCopilotComponent {\n  protected readonly Activity = Activity\n  protected readonly ArrowRight = ArrowRight\n  protected readonly BrainCircuit = BrainCircuit\n  protected readonly Check = Check\n  protected readonly Copy = Copy\n  protected readonly Cpu = Cpu\n  protected readonly Play = Play\n  protected readonly Sliders = Sliders\n  protected readonly Sparkles = Sparkles\n  protected readonly Zap = Zap\n\n  protected readonly models = models\n\n  @Input() title = 'AI Copilot tooling built directly into your component architecture.'\n  @Input() description =\n    'Debug prompts, inspect LLM token streaming speeds, and synthesize Vue 3.5 and React 19 templates in real-time with sub-millisecond local latency.'\n  @Input('class') className?: string\n\n  readonly selectedModel = signal<CopilotModel>('sonnet')\n  readonly temperature = signal(0.2)\n  readonly isGenerating = signal(false)\n  readonly systemPrompt = signal(\n    'You are a senior UI design engineer. Generate an accessible, zero-dependency KPI metric card for Vue 3.5 and React 19 using semantic Tailwind v4 tokens.',\n  )\n  readonly generatedStream = signal(\n    `<template>\\n  <Card class=\"border-border bg-card p-4\">\\n    <div class=\"text-xs text-muted-foreground\">MRR Growth</div>\\n    <div class=\"text-2xl font-bold\">$124,500</div>\\n    <div class=\"text-xs text-success font-medium\">+18.4% vs last month</div>\\n  </Card>\\n</template>`,\n  )\n  readonly copied = signal(false)\n\n  private copyTimer: ReturnType<typeof setTimeout> | undefined\n  private generateTimer: ReturnType<typeof setTimeout> | undefined\n\n  constructor() {\n    inject(DestroyRef).onDestroy(() => {\n      clearTimeout(this.copyTimer)\n      clearTimeout(this.generateTimer)\n    })\n  }\n\n  readonly modelMetrics = computed<CopilotModelMetrics>(() => {\n    if (this.selectedModel() === 'sonnet') {\n      return { name: 'Claude 3.5 Sonnet', ttftMs: 180, tokPerSec: 142, costPer1k: '$0.003' }\n    }\n    if (this.selectedModel() === 'gpt4o') {\n      return { name: 'GPT-4o Omnimodel', ttftMs: 140, tokPerSec: 165, costPer1k: '$0.0025' }\n    }\n    return { name: 'Gemini 1.5 Pro', ttftMs: 160, tokPerSec: 155, costPer1k: '$0.00125' }\n  })\n\n  get rootClass(): string {\n    return cn('bg-background relative overflow-hidden py-16 sm:py-24', this.className)\n  }\n\n  modelButtonClass(id: CopilotModel): string {\n    return cn(\n      'rounded-lg border p-2 text-center text-xs font-medium transition-colors',\n      this.selectedModel() === id\n        ? 'border-primary bg-primary/10 text-primary font-semibold'\n        : 'border-border bg-muted/40 text-muted-foreground hover:text-foreground',\n    )\n  }\n\n  setTemperature(event: Event): void {\n    this.temperature.set(parseFloat((event.target as HTMLInputElement).value))\n  }\n\n  async copyCode(): Promise<void> {\n    try {\n      await navigator.clipboard.writeText(this.generatedStream())\n      this.copied.set(true)\n      clearTimeout(this.copyTimer)\n      this.copyTimer = setTimeout(() => this.copied.set(false), 2000)\n    } catch {\n      // fallback\n    }\n  }\n\n  triggerGeneration(): void {\n    this.isGenerating.set(true)\n    clearTimeout(this.generateTimer)\n    this.generateTimer = setTimeout(() => this.isGenerating.set(false), 1200)\n  }\n}\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/feature-bento-ai-copilot/feature-bento-ai-copilot.component.ts"
    },
    {
      "path": "packages/registry-angular/blocks/feature-bento-ai-copilot/index.ts",
      "content": "export {\n  UiFeatureBentoAiCopilotComponent,\n  type CopilotModel,\n  type CopilotModelMetrics,\n} from './feature-bento-ai-copilot.component'\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/feature-bento-ai-copilot/index.ts"
    }
  ],
  "dependencies": [
    "lucide-angular"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/angular/badge.json",
    "https://uipkge.dev/r/angular/button.json",
    "https://uipkge.dev/r/angular/card.json"
  ],
  "description": "AI agent copilot bento workbench with model tuning sliders, live inference streaming, and token speed telemetry.",
  "categories": [
    "feature",
    "marketing"
  ]
}