From fb2b416b8fe68caceea4698591715c193f071c9b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Apr 2026 19:06:38 -0400 Subject: [PATCH 1/3] first commit --- .../agentic/interview-automation/.env.example | 4 + kits/agentic/interview-automation/.gitignore | 33 + kits/agentic/interview-automation/.npmrc | 1 + kits/agentic/interview-automation/README.md | 56 ++ .../actions/orchestrate.ts | 83 ++ .../interview-automation/app/globals.css | 153 ++++ .../interview-automation/app/layout.tsx | 28 + .../agentic/interview-automation/app/page.tsx | 236 ++++++ .../interview-automation/components.json | 21 + .../components/theme-provider.tsx | 11 + .../components/ui/accordion.tsx | 66 ++ .../components/ui/alert-dialog.tsx | 157 ++++ .../components/ui/alert.tsx | 66 ++ .../components/ui/aspect-ratio.tsx | 11 + .../components/ui/avatar.tsx | 53 ++ .../components/ui/badge.tsx | 46 ++ .../components/ui/breadcrumb.tsx | 109 +++ .../components/ui/button-group.tsx | 83 ++ .../components/ui/button.tsx | 60 ++ .../components/ui/calendar.tsx | 213 +++++ .../components/ui/card.tsx | 92 +++ .../components/ui/carousel.tsx | 241 ++++++ .../components/ui/chart.tsx | 353 +++++++++ .../components/ui/checkbox.tsx | 32 + .../components/ui/collapsible.tsx | 33 + .../components/ui/command.tsx | 184 +++++ .../components/ui/context-menu.tsx | 252 ++++++ .../components/ui/dialog.tsx | 143 ++++ .../components/ui/drawer.tsx | 135 ++++ .../components/ui/dropdown-menu.tsx | 257 +++++++ .../components/ui/empty.tsx | 104 +++ .../components/ui/field.tsx | 244 ++++++ .../components/ui/form.tsx | 167 ++++ .../components/ui/hover-card.tsx | 44 ++ .../components/ui/input-group.tsx | 169 ++++ .../components/ui/input-otp.tsx | 77 ++ .../components/ui/input.tsx | 21 + .../components/ui/item.tsx | 193 +++++ .../components/ui/kbd.tsx | 28 + .../components/ui/label.tsx | 24 + .../components/ui/menubar.tsx | 276 +++++++ .../components/ui/navigation-menu.tsx | 166 ++++ .../components/ui/pagination.tsx | 127 +++ .../components/ui/popover.tsx | 48 ++ .../components/ui/progress.tsx | 31 + .../components/ui/radio-group.tsx | 45 ++ .../components/ui/resizable.tsx | 56 ++ .../components/ui/scroll-area.tsx | 58 ++ .../components/ui/select.tsx | 185 +++++ .../components/ui/separator.tsx | 28 + .../components/ui/sheet.tsx | 139 ++++ .../components/ui/sidebar.tsx | 726 ++++++++++++++++++ .../components/ui/skeleton.tsx | 13 + .../components/ui/slider.tsx | 63 ++ .../components/ui/sonner.tsx | 25 + .../components/ui/spinner.tsx | 16 + .../components/ui/switch.tsx | 31 + .../components/ui/table.tsx | 116 +++ .../components/ui/tabs.tsx | 66 ++ .../components/ui/textarea.tsx | 18 + .../components/ui/toast.tsx | 129 ++++ .../components/ui/toaster.tsx | 35 + .../components/ui/toggle-group.tsx | 73 ++ .../components/ui/toggle.tsx | 47 ++ .../components/ui/tooltip.tsx | 61 ++ .../components/ui/use-mobile.tsx | 19 + .../components/ui/use-toast.ts | 191 +++++ kits/agentic/interview-automation/config.json | 22 + .../hooks/use-camera-preview.ts | 88 +++ .../hooks/use-live-transcription.ts | 132 ++++ .../interview-automation/hooks/use-mobile.ts | 19 + .../interview-automation/hooks/use-toast.ts | 191 +++++ .../interview-automation/lib/jobs-data.ts | 169 ++++ .../lib/lamatic-client.ts | 20 + .../agentic/interview-automation/lib/utils.ts | 6 + .../interview-automation/next.config.mjs | 14 + .../interview-automation/orchestrate.js | 29 + .../agentic/interview-automation/package.json | 81 ++ .../interview-automation/postcss.config.mjs | 8 + .../public/images/lamatic-logo.png | Bin 0 -> 4100 bytes .../public/placeholder-logo.png | Bin 0 -> 568 bytes .../public/placeholder-logo.svg | 1 + .../public/placeholder-user.jpg | Bin 0 -> 1635 bytes .../public/placeholder.jpg | Bin 0 -> 1064 bytes .../public/placeholder.svg | 1 + .../interview-automation/styles/globals.css | 125 +++ .../interview-automation/tsconfig.json | 27 + 87 files changed, 8004 insertions(+) create mode 100644 kits/agentic/interview-automation/.env.example create mode 100644 kits/agentic/interview-automation/.gitignore create mode 100644 kits/agentic/interview-automation/.npmrc create mode 100644 kits/agentic/interview-automation/README.md create mode 100644 kits/agentic/interview-automation/actions/orchestrate.ts create mode 100644 kits/agentic/interview-automation/app/globals.css create mode 100644 kits/agentic/interview-automation/app/layout.tsx create mode 100644 kits/agentic/interview-automation/app/page.tsx create mode 100644 kits/agentic/interview-automation/components.json create mode 100644 kits/agentic/interview-automation/components/theme-provider.tsx create mode 100644 kits/agentic/interview-automation/components/ui/accordion.tsx create mode 100644 kits/agentic/interview-automation/components/ui/alert-dialog.tsx create mode 100644 kits/agentic/interview-automation/components/ui/alert.tsx create mode 100644 kits/agentic/interview-automation/components/ui/aspect-ratio.tsx create mode 100644 kits/agentic/interview-automation/components/ui/avatar.tsx create mode 100644 kits/agentic/interview-automation/components/ui/badge.tsx create mode 100644 kits/agentic/interview-automation/components/ui/breadcrumb.tsx create mode 100644 kits/agentic/interview-automation/components/ui/button-group.tsx create mode 100644 kits/agentic/interview-automation/components/ui/button.tsx create mode 100644 kits/agentic/interview-automation/components/ui/calendar.tsx create mode 100644 kits/agentic/interview-automation/components/ui/card.tsx create mode 100644 kits/agentic/interview-automation/components/ui/carousel.tsx create mode 100644 kits/agentic/interview-automation/components/ui/chart.tsx create mode 100644 kits/agentic/interview-automation/components/ui/checkbox.tsx create mode 100644 kits/agentic/interview-automation/components/ui/collapsible.tsx create mode 100644 kits/agentic/interview-automation/components/ui/command.tsx create mode 100644 kits/agentic/interview-automation/components/ui/context-menu.tsx create mode 100644 kits/agentic/interview-automation/components/ui/dialog.tsx create mode 100644 kits/agentic/interview-automation/components/ui/drawer.tsx create mode 100644 kits/agentic/interview-automation/components/ui/dropdown-menu.tsx create mode 100644 kits/agentic/interview-automation/components/ui/empty.tsx create mode 100644 kits/agentic/interview-automation/components/ui/field.tsx create mode 100644 kits/agentic/interview-automation/components/ui/form.tsx create mode 100644 kits/agentic/interview-automation/components/ui/hover-card.tsx create mode 100644 kits/agentic/interview-automation/components/ui/input-group.tsx create mode 100644 kits/agentic/interview-automation/components/ui/input-otp.tsx create mode 100644 kits/agentic/interview-automation/components/ui/input.tsx create mode 100644 kits/agentic/interview-automation/components/ui/item.tsx create mode 100644 kits/agentic/interview-automation/components/ui/kbd.tsx create mode 100644 kits/agentic/interview-automation/components/ui/label.tsx create mode 100644 kits/agentic/interview-automation/components/ui/menubar.tsx create mode 100644 kits/agentic/interview-automation/components/ui/navigation-menu.tsx create mode 100644 kits/agentic/interview-automation/components/ui/pagination.tsx create mode 100644 kits/agentic/interview-automation/components/ui/popover.tsx create mode 100644 kits/agentic/interview-automation/components/ui/progress.tsx create mode 100644 kits/agentic/interview-automation/components/ui/radio-group.tsx create mode 100644 kits/agentic/interview-automation/components/ui/resizable.tsx create mode 100644 kits/agentic/interview-automation/components/ui/scroll-area.tsx create mode 100644 kits/agentic/interview-automation/components/ui/select.tsx create mode 100644 kits/agentic/interview-automation/components/ui/separator.tsx create mode 100644 kits/agentic/interview-automation/components/ui/sheet.tsx create mode 100644 kits/agentic/interview-automation/components/ui/sidebar.tsx create mode 100644 kits/agentic/interview-automation/components/ui/skeleton.tsx create mode 100644 kits/agentic/interview-automation/components/ui/slider.tsx create mode 100644 kits/agentic/interview-automation/components/ui/sonner.tsx create mode 100644 kits/agentic/interview-automation/components/ui/spinner.tsx create mode 100644 kits/agentic/interview-automation/components/ui/switch.tsx create mode 100644 kits/agentic/interview-automation/components/ui/table.tsx create mode 100644 kits/agentic/interview-automation/components/ui/tabs.tsx create mode 100644 kits/agentic/interview-automation/components/ui/textarea.tsx create mode 100644 kits/agentic/interview-automation/components/ui/toast.tsx create mode 100644 kits/agentic/interview-automation/components/ui/toaster.tsx create mode 100644 kits/agentic/interview-automation/components/ui/toggle-group.tsx create mode 100644 kits/agentic/interview-automation/components/ui/toggle.tsx create mode 100644 kits/agentic/interview-automation/components/ui/tooltip.tsx create mode 100644 kits/agentic/interview-automation/components/ui/use-mobile.tsx create mode 100644 kits/agentic/interview-automation/components/ui/use-toast.ts create mode 100644 kits/agentic/interview-automation/config.json create mode 100644 kits/agentic/interview-automation/hooks/use-camera-preview.ts create mode 100644 kits/agentic/interview-automation/hooks/use-live-transcription.ts create mode 100644 kits/agentic/interview-automation/hooks/use-mobile.ts create mode 100644 kits/agentic/interview-automation/hooks/use-toast.ts create mode 100644 kits/agentic/interview-automation/lib/jobs-data.ts create mode 100644 kits/agentic/interview-automation/lib/lamatic-client.ts create mode 100644 kits/agentic/interview-automation/lib/utils.ts create mode 100644 kits/agentic/interview-automation/next.config.mjs create mode 100644 kits/agentic/interview-automation/orchestrate.js create mode 100644 kits/agentic/interview-automation/package.json create mode 100644 kits/agentic/interview-automation/postcss.config.mjs create mode 100644 kits/agentic/interview-automation/public/images/lamatic-logo.png create mode 100644 kits/agentic/interview-automation/public/placeholder-logo.png create mode 100644 kits/agentic/interview-automation/public/placeholder-logo.svg create mode 100644 kits/agentic/interview-automation/public/placeholder-user.jpg create mode 100644 kits/agentic/interview-automation/public/placeholder.jpg create mode 100644 kits/agentic/interview-automation/public/placeholder.svg create mode 100644 kits/agentic/interview-automation/styles/globals.css create mode 100644 kits/agentic/interview-automation/tsconfig.json diff --git a/kits/agentic/interview-automation/.env.example b/kits/agentic/interview-automation/.env.example new file mode 100644 index 00000000..65d0b75c --- /dev/null +++ b/kits/agentic/interview-automation/.env.example @@ -0,0 +1,4 @@ +AUTOMATION_INTERVIEW_AUTOMATION="AUTOMATION_INTERVIEW_AUTOMATION Flow ID" +LAMATIC_API_URL="LAMATIC_API_URL" +LAMATIC_PROJECT_ID="LAMATIC_PROJECT_ID" +LAMATIC_API_KEY="LAMATIC_API_KEY" \ No newline at end of file diff --git a/kits/agentic/interview-automation/.gitignore b/kits/agentic/interview-automation/.gitignore new file mode 100644 index 00000000..4fa2e808 --- /dev/null +++ b/kits/agentic/interview-automation/.gitignore @@ -0,0 +1,33 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules + +# next.js +/.next/ +/out/ + +# production +/build + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files +.env +.env.local +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# package manager +package-lock.json +yarn.lock +pnpm-lock.yaml +bun.lockb \ No newline at end of file diff --git a/kits/agentic/interview-automation/.npmrc b/kits/agentic/interview-automation/.npmrc new file mode 100644 index 00000000..5e3cde50 --- /dev/null +++ b/kits/agentic/interview-automation/.npmrc @@ -0,0 +1 @@ +force=true diff --git a/kits/agentic/interview-automation/README.md b/kits/agentic/interview-automation/README.md new file mode 100644 index 00000000..49581351 --- /dev/null +++ b/kits/agentic/interview-automation/README.md @@ -0,0 +1,56 @@ +# Interview Automation Kit (Next.js) + +Real-time transcription for interviews with AI post-analysis, built fully in Next.js. + +## What This Kit Does + +- Captures speech live in the browser (Web Speech API). +- Shows interim and final transcript text while the candidate speaks. +- Sends transcript to a Lamatic workflow for interview analysis. +- Returns: + - Summary + - Key interview signals + - Follow-up questions + - Recommendation + +## Why Next.js Only + +This kit keeps everything in one app: + +- Frontend: transcript UI +- Backend: server action for Lamatic workflow invocation +- Config: local env + kit metadata + +No separate Express service is required for this starter. + +## Environment Variables + +Create `.env.local`: + +```bash +AUTOMATION_INTERVIEW_AUTOMATION="AUTOMATION_INTERVIEW_AUTOMATION Flow ID" +LAMATIC_API_URL="LAMATIC_API_URL" +LAMATIC_PROJECT_ID="LAMATIC_PROJECT_ID" +LAMATIC_API_KEY="LAMATIC_API_KEY" +``` + +## Local Run + +```bash +npm install +npm run dev +``` + +Open `http://localhost:3000`. + +## Lamatic Setup + +1. Build/deploy a flow in Lamatic Studio for transcript analysis. +2. Use input field: `transcript`. +3. Return output fields: `summary`, `keySignals`, `followUps`, `recommendation`. +4. Paste the deployed flow ID into `AUTOMATION_INTERVIEW_AUTOMATION`. + +## Notes + +- Live browser transcription relies on Web Speech API support (best in Chrome/Edge). +- For production-grade multi-speaker audio/video stream STT, you can later replace this with provider realtime WebSocket streaming while keeping the same Next.js UI and Lamatic analysis action. diff --git a/kits/agentic/interview-automation/actions/orchestrate.ts b/kits/agentic/interview-automation/actions/orchestrate.ts new file mode 100644 index 00000000..481b9ff2 --- /dev/null +++ b/kits/agentic/interview-automation/actions/orchestrate.ts @@ -0,0 +1,83 @@ +"use server" + +import { lamaticClient } from "@/lib/lamatic-client" +import { config } from "../orchestrate.js" + +type AnalysisInput = { + transcript: string +} + +type AnalysisResult = { + summary: string +} + +const analysisFlow = config.flows.interviewAnalysis + +export async function analyzeInterviewTranscript(input: AnalysisInput): Promise<{ + success: boolean + result?: AnalysisResult + error?: string +}> { + try { + if (!analysisFlow?.workflowId) { + throw new Error("Workflow not found in config.") + } + + if (!input.transcript.trim()) { + throw new Error("Transcript is empty. Start transcription before analysis.") + } + + const inputType = "text" + const instructions = input.transcript + + console.log("[v0] Generating content with:", { inputType, instructions }) + console.log("[v0] Using workflow:", analysisFlow.name, analysisFlow.workflowId) + + const workflowInput = { + mode: inputType, + instructions, + userPrompt: instructions, + prompt: instructions, + type: inputType, + } + + console.log("[v0] Sending inputs:", workflowInput) + const response = await lamaticClient.executeFlow(analysisFlow.workflowId, workflowInput) + console.log("[v0] Raw response:", response) + if (response?.status === "error") { + throw new Error(response.message || "Lamatic workflow execution failed") + } + + const result = response?.result || {} + + // Support multiple output shapes from deployed Lamatic workflows. + const output = { + summary: result.summary || result.output?.summary || result.response || "", + } + + if (!output.summary) { + throw new Error("No analysis summary returned from workflow") + } + + return { + success: true, + result: output, + } + } catch (error) { + let errorMessage = "Unknown error occurred" + + if (error instanceof Error) { + errorMessage = error.message + if (error.message.includes("fetch failed")) { + errorMessage = "Network error: Unable to connect to Lamatic service." + } else if (error.message.includes("API key")) { + errorMessage = "Authentication error: Please check your Lamatic API credentials." + } + } + + return { + success: false, + error: errorMessage, + } + } +} diff --git a/kits/agentic/interview-automation/app/globals.css b/kits/agentic/interview-automation/app/globals.css new file mode 100644 index 00000000..f4a49a29 --- /dev/null +++ b/kits/agentic/interview-automation/app/globals.css @@ -0,0 +1,153 @@ +@import "tailwindcss"; +@import "tw-animate-css"; + +@custom-variant dark (&:is(.dark *)); + +:root { + --background: oklch(1 0 0); + --foreground: oklch(0.145 0 0); + --card: oklch(1 0 0); + --card-foreground: oklch(0.145 0 0); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.145 0 0); + --primary: oklch(0.205 0 0); + --primary-foreground: oklch(0.985 0 0); + --secondary: oklch(0.97 0 0); + --secondary-foreground: oklch(0.205 0 0); + --muted: oklch(0.97 0 0); + --muted-foreground: oklch(0.556 0 0); + --accent: oklch(0.97 0 0); + --accent-foreground: oklch(0.205 0 0); + --destructive: oklch(0.577 0.245 27.325); + --destructive-foreground: oklch(0.577 0.245 27.325); + --border: oklch(0.922 0 0); + --input: oklch(0.922 0 0); + --ring: oklch(0.708 0 0); + --chart-1: oklch(0.646 0.222 41.116); + --chart-2: oklch(0.6 0.118 184.704); + --chart-3: oklch(0.398 0.07 227.392); + --chart-4: oklch(0.828 0.189 84.429); + --chart-5: oklch(0.769 0.188 70.08); + --radius: 0.625rem; + --sidebar: oklch(0.985 0 0); + --sidebar-foreground: oklch(0.145 0 0); + --sidebar-primary: oklch(0.205 0 0); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.97 0 0); + --sidebar-accent-foreground: oklch(0.205 0 0); + --sidebar-border: oklch(0.922 0 0); + --sidebar-ring: oklch(0.708 0 0); +} + +.dark { + --background: oklch(0.145 0 0); + --foreground: oklch(0.985 0 0); + --card: oklch(0.145 0 0); + --card-foreground: oklch(0.985 0 0); + --popover: oklch(0.145 0 0); + --popover-foreground: oklch(0.985 0 0); + --primary: oklch(0.985 0 0); + --primary-foreground: oklch(0.205 0 0); + --secondary: oklch(0.269 0 0); + --secondary-foreground: oklch(0.985 0 0); + --muted: oklch(0.269 0 0); + --muted-foreground: oklch(0.708 0 0); + --accent: oklch(0.269 0 0); + --accent-foreground: oklch(0.985 0 0); + --destructive: oklch(0.396 0.141 25.723); + --destructive-foreground: oklch(0.637 0.237 25.331); + --border: oklch(0.269 0 0); + --input: oklch(0.269 0 0); + --ring: oklch(0.439 0 0); + --chart-1: oklch(0.488 0.243 264.376); + --chart-2: oklch(0.696 0.17 162.48); + --chart-3: oklch(0.769 0.188 70.08); + --chart-4: oklch(0.627 0.265 303.9); + --chart-5: oklch(0.645 0.246 16.439); + --sidebar: oklch(0.205 0 0); + --sidebar-foreground: oklch(0.985 0 0); + --sidebar-primary: oklch(0.488 0.243 264.376); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.269 0 0); + --sidebar-accent-foreground: oklch(0.985 0 0); + --sidebar-border: oklch(0.269 0 0); + --sidebar-ring: oklch(0.439 0 0); +} + +@theme inline { + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); + --color-popover: var(--popover); + --color-popover-foreground: var(--popover-foreground); + --color-primary: var(--primary); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-foreground: var(--secondary-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); + --color-destructive: var(--destructive); + --color-destructive-foreground: var(--destructive-foreground); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); + --color-chart-1: var(--chart-1); + --color-chart-2: var(--chart-2); + --color-chart-3: var(--chart-3); + --color-chart-4: var(--chart-4); + --color-chart-5: var(--chart-5); + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); + --color-sidebar: var(--sidebar); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-ring: var(--sidebar-ring); +} + +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } + + .prose-invert { + color: rgb(255, 255, 255); + } + + .prose-invert p, + .prose-invert ul, + .prose-invert ol, + .prose-invert li, + .prose-invert strong, + .prose-invert em, + .prose-invert span, + .prose-invert div { + color: rgb(229, 231, 235) !important; + } + + .prose-invert strong { + color: rgb(255, 255, 255) !important; + font-weight: 600; + } + + .prose-invert ul, + .prose-invert ol { + padding-left: 1.5rem; + margin: 0.5rem 0; + } + + .prose-invert li { + margin: 0.25rem 0; + } +} diff --git a/kits/agentic/interview-automation/app/layout.tsx b/kits/agentic/interview-automation/app/layout.tsx new file mode 100644 index 00000000..5f0fbdc0 --- /dev/null +++ b/kits/agentic/interview-automation/app/layout.tsx @@ -0,0 +1,28 @@ +import type React from "react" +import type { Metadata } from "next" +import { GeistSans } from "geist/font/sans" +import { GeistMono } from "geist/font/mono" +import { Analytics } from "@vercel/analytics/next" +import { Suspense } from "react" +import "./globals.css" + +export const metadata: Metadata = { + title: "Interview Automation Kit - Live Transcription and Analysis", + description: "Capture interview speech in real time and run Lamatic-powered transcript analysis.", + generator: "v0.app", +} + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode +}>) { + return ( + + + Loading...}>{children} + + + + ) +} diff --git a/kits/agentic/interview-automation/app/page.tsx b/kits/agentic/interview-automation/app/page.tsx new file mode 100644 index 00000000..2c7bc246 --- /dev/null +++ b/kits/agentic/interview-automation/app/page.tsx @@ -0,0 +1,236 @@ +"use client" + +import { useMemo, useState } from "react" +import { analyzeInterviewTranscript } from "@/actions/orchestrate" +import { useCameraPreview } from "@/hooks/use-camera-preview" +import { useLiveTranscription } from "@/hooks/use-live-transcription" + +type AnalysisResult = { + summary: string +} + +export default function InterviewAutomationPage() { + const [isAnalyzing, setIsAnalyzing] = useState(false) + const [analysisError, setAnalysisError] = useState("") + const [analysisResult, setAnalysisResult] = useState(null) + + const { + videoRef, + isSupported: isCameraSupported, + isCameraOn, + error: cameraError, + startCamera, + stopCamera, + } = useCameraPreview() + + const { + isSupported, + isListening, + transcript, + interimTranscript, + error, + start, + stop, + reset, + } = useLiveTranscription() + + const mergedTranscript = useMemo( + () => `${transcript}${interimTranscript ? ` ${interimTranscript}` : ""}`.trim(), + [transcript, interimTranscript], + ) + + const handleAnalyze = async () => { + setAnalysisError("") + setAnalysisResult(null) + + if (!mergedTranscript.trim()) { + setAnalysisError("No transcript found. Start speaking first.") + return + } + + setIsAnalyzing(true) + + const response = await analyzeInterviewTranscript({ + transcript: mergedTranscript, + }) + + setIsAnalyzing(false) + + if (!response.success) { + setAnalysisError(response.error || "Analysis failed") + return + } + + setAnalysisResult(response.result || null) + } + + return ( +
+
+
+

+ Automation Kit +

+

Interview Automation - Live Transcription

+

+ Capture speech in real time, review transcript as the interview happens, and run Lamatic analysis for + summary, interviewer signals, follow-ups, and recommendation. +

+
+ + {!isSupported && ( +
+ This browser does not support Web Speech API live recognition. Use Chrome or Edge for local real-time + transcription. +
+ )} + + {error && ( +
{error}
+ )} + + {cameraError && ( +
+ {cameraError} +
+ )} + +
+
+
+

Camera Preview

+ + {isCameraOn ? "Camera On" : "Camera Off"} + +
+ +
+ {isCameraOn ? ( +
+ +
+ + +
+
+ + +
+
+
+ ) +} diff --git a/kits/agentic/interview-automation/components.json b/kits/agentic/interview-automation/components.json new file mode 100644 index 00000000..4ee62ee1 --- /dev/null +++ b/kits/agentic/interview-automation/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} diff --git a/kits/agentic/interview-automation/components/theme-provider.tsx b/kits/agentic/interview-automation/components/theme-provider.tsx new file mode 100644 index 00000000..55c2f6eb --- /dev/null +++ b/kits/agentic/interview-automation/components/theme-provider.tsx @@ -0,0 +1,11 @@ +'use client' + +import * as React from 'react' +import { + ThemeProvider as NextThemesProvider, + type ThemeProviderProps, +} from 'next-themes' + +export function ThemeProvider({ children, ...props }: ThemeProviderProps) { + return {children} +} diff --git a/kits/agentic/interview-automation/components/ui/accordion.tsx b/kits/agentic/interview-automation/components/ui/accordion.tsx new file mode 100644 index 00000000..e538a33b --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/accordion.tsx @@ -0,0 +1,66 @@ +'use client' + +import * as React from 'react' +import * as AccordionPrimitive from '@radix-ui/react-accordion' +import { ChevronDownIcon } from 'lucide-react' + +import { cn } from '@/lib/utils' + +function Accordion({ + ...props +}: React.ComponentProps) { + return +} + +function AccordionItem({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AccordionTrigger({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + svg]:rotate-180', + className, + )} + {...props} + > + {children} + + + + ) +} + +function AccordionContent({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + +
{children}
+
+ ) +} + +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } diff --git a/kits/agentic/interview-automation/components/ui/alert-dialog.tsx b/kits/agentic/interview-automation/components/ui/alert-dialog.tsx new file mode 100644 index 00000000..97044526 --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/alert-dialog.tsx @@ -0,0 +1,157 @@ +'use client' + +import * as React from 'react' +import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog' + +import { cn } from '@/lib/utils' +import { buttonVariants } from '@/components/ui/button' + +function AlertDialog({ + ...props +}: React.ComponentProps) { + return +} + +function AlertDialogTrigger({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogPortal({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogOverlay({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + + ) +} + +function AlertDialogHeader({ + className, + ...props +}: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function AlertDialogFooter({ + className, + ...props +}: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function AlertDialogTitle({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogDescription({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogAction({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AlertDialogCancel({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, +} diff --git a/kits/agentic/interview-automation/components/ui/alert.tsx b/kits/agentic/interview-automation/components/ui/alert.tsx new file mode 100644 index 00000000..e6751abe --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/alert.tsx @@ -0,0 +1,66 @@ +import * as React from 'react' +import { cva, type VariantProps } from 'class-variance-authority' + +import { cn } from '@/lib/utils' + +const alertVariants = cva( + 'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current', + { + variants: { + variant: { + default: 'bg-card text-card-foreground', + destructive: + 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +) + +function Alert({ + className, + variant, + ...props +}: React.ComponentProps<'div'> & VariantProps) { + return ( +
+ ) +} + +function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function AlertDescription({ + className, + ...props +}: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +export { Alert, AlertTitle, AlertDescription } diff --git a/kits/agentic/interview-automation/components/ui/aspect-ratio.tsx b/kits/agentic/interview-automation/components/ui/aspect-ratio.tsx new file mode 100644 index 00000000..40bb1208 --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/aspect-ratio.tsx @@ -0,0 +1,11 @@ +'use client' + +import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio' + +function AspectRatio({ + ...props +}: React.ComponentProps) { + return +} + +export { AspectRatio } diff --git a/kits/agentic/interview-automation/components/ui/avatar.tsx b/kits/agentic/interview-automation/components/ui/avatar.tsx new file mode 100644 index 00000000..aa98465a --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/avatar.tsx @@ -0,0 +1,53 @@ +'use client' + +import * as React from 'react' +import * as AvatarPrimitive from '@radix-ui/react-avatar' + +import { cn } from '@/lib/utils' + +function Avatar({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarImage({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarFallback({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Avatar, AvatarImage, AvatarFallback } diff --git a/kits/agentic/interview-automation/components/ui/badge.tsx b/kits/agentic/interview-automation/components/ui/badge.tsx new file mode 100644 index 00000000..fc4126b7 --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/badge.tsx @@ -0,0 +1,46 @@ +import * as React from 'react' +import { Slot } from '@radix-ui/react-slot' +import { cva, type VariantProps } from 'class-variance-authority' + +import { cn } from '@/lib/utils' + +const badgeVariants = cva( + 'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', + { + variants: { + variant: { + default: + 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90', + secondary: + 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90', + destructive: + 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', + outline: + 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +) + +function Badge({ + className, + variant, + asChild = false, + ...props +}: React.ComponentProps<'span'> & + VariantProps & { asChild?: boolean }) { + const Comp = asChild ? Slot : 'span' + + return ( + + ) +} + +export { Badge, badgeVariants } diff --git a/kits/agentic/interview-automation/components/ui/breadcrumb.tsx b/kits/agentic/interview-automation/components/ui/breadcrumb.tsx new file mode 100644 index 00000000..1750ff26 --- /dev/null +++ b/kits/agentic/interview-automation/components/ui/breadcrumb.tsx @@ -0,0 +1,109 @@ +import * as React from 'react' +import { Slot } from '@radix-ui/react-slot' +import { ChevronRight, MoreHorizontal } from 'lucide-react' + +import { cn } from '@/lib/utils' + +function Breadcrumb({ ...props }: React.ComponentProps<'nav'>) { + return