From a0a0784e4e16683c428bafa7689ad3e5f4d9d1c0 Mon Sep 17 00:00:00 2001
From: Pavan Kumar
Date: Fri, 2 Jan 2026 13:52:38 +0530
Subject: [PATCH 1/2] feat: Integrate Farm Vaidya voice assistant on home page
---
VOICE_AGENT_INTEGRATION.md | 140 +++++++++++++
package-lock.json | 151 +++++++++++++-
package.json | 9 +-
public/Farm-vaidya-icon.png | Bin 0 -> 7553 bytes
src/app/page.tsx | 7 +
src/app/voice-agent.css | 72 +++++++
src/components/VoiceAgent.tsx | 367 ++++++++++++++++++++++++++++++++++
src/components/ui/button.tsx | 44 ++++
src/components/ui/card.tsx | 78 ++++++++
src/components/ui/toaster.tsx | 2 +
src/components/ui/tooltip.tsx | 25 +++
src/hooks/use-toast.ts | 25 +++
src/lib/utils.ts | 6 +
13 files changed, 923 insertions(+), 3 deletions(-)
create mode 100644 VOICE_AGENT_INTEGRATION.md
create mode 100644 public/Farm-vaidya-icon.png
create mode 100644 src/app/voice-agent.css
create mode 100644 src/components/VoiceAgent.tsx
create mode 100644 src/components/ui/button.tsx
create mode 100644 src/components/ui/card.tsx
create mode 100644 src/components/ui/toaster.tsx
create mode 100644 src/components/ui/tooltip.tsx
create mode 100644 src/hooks/use-toast.ts
create mode 100644 src/lib/utils.ts
diff --git a/VOICE_AGENT_INTEGRATION.md b/VOICE_AGENT_INTEGRATION.md
new file mode 100644
index 0000000..992cc7b
--- /dev/null
+++ b/VOICE_AGENT_INTEGRATION.md
@@ -0,0 +1,140 @@
+# Farm Vaidya Voice Agent - Integration Complete! ✅
+
+## What's Been Added
+
+### 1. Files Copied
+- ✅ `src/components/VoiceAgent.tsx` - Main voice agent component
+- ✅ `src/components/ui/*` - UI components (button, card, tooltip, toaster)
+- ✅ `src/hooks/use-toast.ts` - Toast notification hook
+- ✅ `src/app/voice-agent.css` - CSS animations
+- ✅ `public/Farm-vaidya-icon.png` - Voice agent icon
+
+### 2. Dependencies Installed
+- ✅ @daily-co/daily-js (voice infrastructure)
+- ✅ sonner (toast notifications)
+- ✅ lucide-react (icons)
+- ✅ clsx & tailwind-merge (styling utilities)
+
+### 3. Environment Variables Added
+Check your `.env.local` - these were added:
+```
+NEXT_PUBLIC_PIPECAT_TOKEN=pk_aff3af37-4821-4efc-9776-1f2d300a52d0
+NEXT_PUBLIC_PIPECAT_ENDPOINT=https://api.pipecat.daily.co/v1/public/techsprint/start
+```
+
+## How to Enable the Voice Agent
+
+### Option 1: Add to All Pages (Recommended)
+
+Edit `src/app/layout.tsx`:
+
+```tsx
+import VoiceAgent from '@/components/VoiceAgent';
+import { Toaster } from 'sonner';
+import './voice-agent.css'; // Add this import
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+
+
+
+
+ <>
+
+
+
+ {children}
+
+
+
+
+
+ {/* Add Farm Vaidya Voice Agent */}
+
+
+ >
+
+
+
+ );
+}
+```
+
+### Option 2: Add to Specific Pages Only
+
+In any page file (e.g., `src/app/page.tsx`):
+
+```tsx
+import VoiceAgent from '@/components/VoiceAgent';
+import { Toaster } from 'sonner';
+import './voice-agent.css';
+
+export default function HomePage() {
+ return (
+
+ {/* Your existing content */}
+
+ {/* Add voice agent */}
+
+
+
+ );
+}
+```
+
+## How to Test
+
+1. **Start the dev server:**
+ ```bash
+ cd ~/techsprint
+ npm run dev
+ ```
+
+2. **Open in browser:**
+ - Go to http://localhost:3000
+ - You'll see a floating button with "Talk to Farm Vaidya" at bottom-left
+
+3. **Click the button:**
+ - Grant microphone permission when prompted
+ - The agent will connect automatically
+ - Start speaking!
+
+## Features
+
+- ✅ Real-time voice conversations with AI farming expert
+- ✅ Visual feedback when speaking
+- ✅ Mute/unmute controls
+- ✅ Call timer
+- ✅ Floating widget (doesn't interfere with your site)
+- ✅ Responsive design
+
+## Customization
+
+### Change Position
+Edit `VoiceAgent.tsx` line ~256:
+```tsx
+// Change from bottom-left to bottom-right
+
+```
+
+### Change Bot Name/Icon
+- Replace `/public/Farm-vaidya-icon.png` with your icon
+- Edit text in VoiceAgent.tsx
+
+### Disable on Certain Pages
+Wrap with conditional:
+```tsx
+{!pathname.includes('/admin') &&
}
+```
+
+## Next Steps
+
+1. Add the voice agent to your layout (see Option 1 above)
+2. Test it out
+3. Customize as needed
+
+Need help? The voice agent is fully functional and ready to use!
diff --git a/package-lock.json b/package-lock.json
index 31e2143..ecc9b63 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,18 +8,23 @@
"name": "gdgoc-hackathon",
"version": "0.1.0",
"dependencies": {
+ "@daily-co/daily-js": "^0.85.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/icons-material": "^7.3.6",
"@mui/material": "^7.3.6",
+ "clsx": "^2.1.1",
"firebase": "^12.7.0",
"lodash": "^4.17.21",
"lottie-web": "^5.12.2",
+ "lucide-react": "^0.562.0",
"next": "16.1.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-fast-marquee": "^1.6.5",
- "react-qr-code": "^2.0.18"
+ "react-qr-code": "^2.0.18",
+ "sonner": "^2.0.7",
+ "tailwind-merge": "^3.4.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
@@ -285,6 +290,22 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@daily-co/daily-js": {
+ "version": "0.85.0",
+ "resolved": "https://registry.npmjs.org/@daily-co/daily-js/-/daily-js-0.85.0.tgz",
+ "integrity": "sha512-lpl111ZWNTUWDnwYcPuNi9PGJPbLCeCw6LzmEY40nG0hv1jg5JLVW8Rq3Cj/+lOCP6W6h4PXm211ss0FFnxITQ==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5",
+ "@sentry/browser": "^8.33.1",
+ "bowser": "^2.8.1",
+ "dequal": "^2.0.3",
+ "events": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
"node_modules/@emnapi/core": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz",
@@ -2348,6 +2369,81 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@sentry-internal/browser-utils": {
+ "version": "8.55.0",
+ "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.55.0.tgz",
+ "integrity": "sha512-ROgqtQfpH/82AQIpESPqPQe0UyWywKJsmVIqi3c5Fh+zkds5LUxnssTj3yNd1x+kxaPDVB023jAP+3ibNgeNDw==",
+ "license": "MIT",
+ "dependencies": {
+ "@sentry/core": "8.55.0"
+ },
+ "engines": {
+ "node": ">=14.18"
+ }
+ },
+ "node_modules/@sentry-internal/feedback": {
+ "version": "8.55.0",
+ "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.55.0.tgz",
+ "integrity": "sha512-cP3BD/Q6pquVQ+YL+rwCnorKuTXiS9KXW8HNKu4nmmBAyf7urjs+F6Hr1k9MXP5yQ8W3yK7jRWd09Yu6DHWOiw==",
+ "license": "MIT",
+ "dependencies": {
+ "@sentry/core": "8.55.0"
+ },
+ "engines": {
+ "node": ">=14.18"
+ }
+ },
+ "node_modules/@sentry-internal/replay": {
+ "version": "8.55.0",
+ "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.55.0.tgz",
+ "integrity": "sha512-roCDEGkORwolxBn8xAKedybY+Jlefq3xYmgN2fr3BTnsXjSYOPC7D1/mYqINBat99nDtvgFvNfRcZPiwwZ1hSw==",
+ "license": "MIT",
+ "dependencies": {
+ "@sentry-internal/browser-utils": "8.55.0",
+ "@sentry/core": "8.55.0"
+ },
+ "engines": {
+ "node": ">=14.18"
+ }
+ },
+ "node_modules/@sentry-internal/replay-canvas": {
+ "version": "8.55.0",
+ "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.55.0.tgz",
+ "integrity": "sha512-nIkfgRWk1091zHdu4NbocQsxZF1rv1f7bbp3tTIlZYbrH62XVZosx5iHAuZG0Zc48AETLE7K4AX9VGjvQj8i9w==",
+ "license": "MIT",
+ "dependencies": {
+ "@sentry-internal/replay": "8.55.0",
+ "@sentry/core": "8.55.0"
+ },
+ "engines": {
+ "node": ">=14.18"
+ }
+ },
+ "node_modules/@sentry/browser": {
+ "version": "8.55.0",
+ "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.55.0.tgz",
+ "integrity": "sha512-1A31mCEWCjaMxJt6qGUK+aDnLDcK6AwLAZnqpSchNysGni1pSn1RWSmk9TBF8qyTds5FH8B31H480uxMPUJ7Cw==",
+ "license": "MIT",
+ "dependencies": {
+ "@sentry-internal/browser-utils": "8.55.0",
+ "@sentry-internal/feedback": "8.55.0",
+ "@sentry-internal/replay": "8.55.0",
+ "@sentry-internal/replay-canvas": "8.55.0",
+ "@sentry/core": "8.55.0"
+ },
+ "engines": {
+ "node": ">=14.18"
+ }
+ },
+ "node_modules/@sentry/core": {
+ "version": "8.55.0",
+ "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.55.0.tgz",
+ "integrity": "sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.18"
+ }
+ },
"node_modules/@swc/helpers": {
"version": "0.5.15",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
@@ -3582,6 +3678,12 @@
"baseline-browser-mapping": "dist/cli.js"
}
},
+ "node_modules/bowser": {
+ "version": "2.13.1",
+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.13.1.tgz",
+ "integrity": "sha512-OHawaAbjwx6rqICCKgSG0SAnT05bzd7ppyKLVUITZpANBaaMFBAsaNkto3LoQ31tyFP5kNujE8Cdx85G9VzOkw==",
+ "license": "MIT"
+ },
"node_modules/brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
@@ -3955,6 +4057,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/detect-libc": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
@@ -4662,6 +4773,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/events": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
+ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.x"
+ }
+ },
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -6179,6 +6299,15 @@
"yallist": "^3.0.2"
}
},
+ "node_modules/lucide-react": {
+ "version": "0.562.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.562.0.tgz",
+ "integrity": "sha512-82hOAu7y0dbVuFfmO4bYF1XEwYk/mEbM5E+b1jgci/udUBEE/R7LF5Ip0CCEmXe8AybRM8L+04eP+LGZeDvkiw==",
+ "license": "ISC",
+ "peerDependencies": {
+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
"node_modules/magic-string": {
"version": "0.30.21",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
@@ -7266,6 +7395,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/sonner": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
+ "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
+ "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ }
+ },
"node_modules/source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
@@ -7527,6 +7666,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/tailwind-merge": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz",
+ "integrity": "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
"node_modules/tailwindcss": {
"version": "4.1.18",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz",
diff --git a/package.json b/package.json
index 1e968b6..2ee2a38 100644
--- a/package.json
+++ b/package.json
@@ -9,18 +9,23 @@
"lint": "eslint"
},
"dependencies": {
+ "@daily-co/daily-js": "^0.85.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/icons-material": "^7.3.6",
"@mui/material": "^7.3.6",
+ "clsx": "^2.1.1",
"firebase": "^12.7.0",
"lodash": "^4.17.21",
"lottie-web": "^5.12.2",
+ "lucide-react": "^0.562.0",
"next": "16.1.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-fast-marquee": "^1.6.5",
- "react-qr-code": "^2.0.18"
+ "react-qr-code": "^2.0.18",
+ "sonner": "^2.0.7",
+ "tailwind-merge": "^3.4.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
@@ -33,4 +38,4 @@
"tailwindcss": "^4",
"typescript": "^5"
}
-}
\ No newline at end of file
+}
diff --git a/public/Farm-vaidya-icon.png b/public/Farm-vaidya-icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..6eebeb24ecd0be1381bc51342c04f284f09426a0
GIT binary patch
literal 7553
zcmaJ`^-~mX69*)ZI_dzCRJx85q`Mm=kM25-F6nOR?v6Ve4p2IzOE?jb1_cB`k%rgr
zKk&|M%(L^^o!Osu_xZ$YYbp@}o&(U(&
(!tn$?ImeJ-w+HblHVd3a|k-$Ix=CzUcdr*+s2i;cufI~L+1cpXp8ZsiXd0jx;sh;Kao2nu
z-vR(3;-zz^poDl<1`{5ma6vXqLyD)~kz|fcBA}0+xMIfoieUGS%~W1_xQm|PN-pCV
zn-MbLSsKq%9m}JZbZx2CZ0@5b@m!C0=n4$QCLA8+6-$ufENjIbj#^`
znzIThJg0~=j{73P$o;#&Z;63LzzFH2*YvjbvWMtWy3!k7KBWE6f@OG+5$
z#f9HV^{3`;-2!x_)s&pBcguUe+BQOtskFCJv>npc_h99*I{6px!6rD7cm3)55}Y*!
zMB~SYf=(8At_W>V!MKWXG1vHM#&N0$x})neiJYCBX_37`Wxa9UguHA
z6neM|tuE7O$XNu?y(MNXt5&&`-7+kNEHT@7q%I-nhP}zEQiPn9RzH+NXzX3Fov2O)
zZ9!a0a7Y9o>;chAAp3A4QsR&o7w7o9L!vWB?JGBg7uTn-Hz3!4YhA2=-~P
zf&Ty#*o@!0xnCCs%rq6IFW7*%Gw>+#>fSfKY2!0RCbHB23s7h-W1r_Ab9fbJPf%1Q
zgsfXTM`sO!3_JJV##?y~){(+RWn-+XVaH9&-G6iW!k#Z%z%#;gQM7v<77t>4NhBhs
zl-LVJuOh+6Nyjs>{3{Yxx6jjdg&YWL-wa){@D($qFbF7G8<@3GJ3v&ps+euinJk@^n>j)aSJ(cA#8HjWc}krfa6))mEl*xu4i48l2Yf)b~6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p%65?M~Ub$Q9O_%4o$
zg#=f=yZ3`gg4q{#$Uq$v3yH6Ms+g4$te*CQcvj(g5`bT;chq13BZwQJ6^!h$3}_eu
zOYrq0nE-!HAoMp<(z8$7gI?->5YZM(rvlqIe@)jJLcaw_i&uOc0sDo!Jv&R*m1*Xr
z{hVl163Vcs&^9uBn5$sBcdfzr)q?{#+KQAkAGyIT3A&>VDBiI10@joLE%8|MVBHZ{
zQ7?&jy7E;@>D5tBq^a!lg53Mj^95r-Y^Gxauh1xRckn4;leHGP=}US5pwOv8C@v}%
z?w+<!HC_=9&Fqq9%JM)kCm+4TbJwdLn!%Kwt!npWfv~SnAp-L^PbQw&nuJ=2&
z{%O+*lvD4oCjr);@;nkx6}XZgWo+DqU1ut9su1kR@=z2KmhlKcDl>EVh
z!c33)y{plhG$2=fBcx6pv7!7UrQFdqK_ji|Wxv04pf!c75wHhC~Y15{_+40DrB$gh|Ea?J*X13FaS-blpO
zr=1Q{Fkx0@U!|$;?4n7QSb6aOf69?y_>XWXj#{H)@xZL!-+zoLnu>y^JVMqo;(rOz
BWD)=X
literal 0
HcmV?d00001
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 6d1f942..2ba809e 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -8,6 +8,9 @@ import dynamic from "next/dynamic";
import Gallery from '@/components/Gallery';
import Partners from '@/components/Partners';
import Links from '@/components/Links';
+import VoiceAgent from '@/components/VoiceAgent';
+import { Toaster } from 'sonner';
+import './voice-agent.css';
const Countdown = dynamic(() => import("@/components/Countdown"), {
ssr: false,
@@ -65,6 +68,10 @@ export default function Home() {
+
+ {/* Farm Vaidya Voice Agent */}
+
+
);
}
diff --git a/src/app/voice-agent.css b/src/app/voice-agent.css
new file mode 100644
index 0000000..251ef27
--- /dev/null
+++ b/src/app/voice-agent.css
@@ -0,0 +1,72 @@
+/* Farm Vaidya Voice Agent Animations */
+
+@keyframes pulse-glow {
+ 0%, 100% {
+ box-shadow: 0 0 0 0 hsl(var(--mic-pulse) / 0.7);
+ }
+ 50% {
+ box-shadow: 0 0 0 20px hsl(var(--mic-pulse) / 0);
+ }
+}
+
+@keyframes wave {
+ 0%, 100% {
+ transform: scaleY(0.5);
+ }
+ 50% {
+ transform: scaleY(1);
+ }
+}
+
+@keyframes bounce-subtle {
+ 0%, 100% {
+ transform: translateY(-5%);
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
+ }
+ 50% {
+ transform: translateY(0);
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
+ }
+}
+
+@keyframes ring-rotate {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+
+.pulse-animation {
+ animation: pulse-glow 2s ease-in-out infinite;
+}
+
+.wave-bar {
+ animation: wave 1s ease-in-out infinite;
+}
+
+.wave-bar:nth-child(1) { animation-delay: 0s; }
+.wave-bar:nth-child(2) { animation-delay: 0.1s; }
+.wave-bar:nth-child(3) { animation-delay: 0.2s; }
+.wave-bar:nth-child(4) { animation-delay: 0.3s; }
+.wave-bar:nth-child(5) { animation-delay: 0.4s; }
+
+.animate-bounce-subtle {
+ animation: bounce-subtle 2s infinite;
+}
+
+.animate-ring-rotate {
+ animation: ring-rotate 3s linear infinite;
+}
+
+.rotate-135 {
+ transform: rotate(135deg);
+}
+
+:root {
+ --mic-pulse: 142 76% 36%;
+ --mic-glow: 142 76% 70%;
+ --brown: 30 40% 40%;
+ --brown-foreground: 0 0% 98%;
+}
diff --git a/src/components/VoiceAgent.tsx b/src/components/VoiceAgent.tsx
new file mode 100644
index 0000000..15dbbc6
--- /dev/null
+++ b/src/components/VoiceAgent.tsx
@@ -0,0 +1,367 @@
+"use client";
+
+import { useState, useRef, useEffect } from "react";
+import DailyIframe from "@daily-co/daily-js";
+import { Mic, MicOff, Phone } from "lucide-react";
+import { useToast } from "@/hooks/use-toast";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+
+interface TranscriptMessage {
+ id: string;
+ speaker: "user" | "ai";
+ text: string;
+ timestamp: Date;
+}
+
+export default function VoiceAgent() {
+ const [isOpen, setIsOpen] = useState(false);
+ const [isConnected, setIsConnected] = useState(false);
+ const [isConnecting, setIsConnecting] = useState(false);
+ const [isMuted, setIsMuted] = useState(false);
+ const [transcript, setTranscript] = useState([]);
+ const [callFrame, setCallFrame] = useState(null);
+ const [timer, setTimer] = useState(0);
+ const [inputText, setInputText] = useState("");
+ const { toast } = useToast();
+ const connectLockRef = useRef(false);
+ const transcriptEndRef = useRef(null);
+ const timerRef = useRef(null);
+
+ // Auto-scroll transcript to bottom
+ useEffect(() => {
+ transcriptEndRef.current?.scrollIntoView({ behavior: "smooth" });
+ }, [transcript]);
+
+ // Auto-connect when opening
+ useEffect(() => {
+ if (isOpen && !isConnected && !isConnecting) {
+ startConversation();
+ }
+ }, [isOpen]);
+
+ // Timer logic
+ useEffect(() => {
+ if (isConnected) {
+ timerRef.current = setInterval(() => {
+ setTimer((prev) => prev + 1);
+ }, 1000);
+ } else {
+ if (timerRef.current) {
+ clearInterval(timerRef.current);
+ }
+ setTimer(0);
+ }
+ return () => {
+ if (timerRef.current) {
+ clearInterval(timerRef.current);
+ }
+ };
+ }, [isConnected]);
+
+ const formatTime = (seconds: number) => {
+ const hrs = Math.floor(seconds / 3600);
+ const mins = Math.floor((seconds % 3600) / 60);
+ const secs = seconds % 60;
+ return `${hrs.toString().padStart(2, "0")}:${mins
+ .toString()
+ .padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
+ };
+
+ const addToTranscript = (speaker: "user" | "ai", text: string) => {
+ setTranscript((prev) => [
+ ...prev,
+ {
+ id: Math.random().toString(36).substring(7),
+ speaker,
+ text,
+ timestamp: new Date(),
+ },
+ ]);
+ };
+
+ const startConversation = async () => {
+ if (connectLockRef.current || isConnecting || isConnected) return;
+
+ connectLockRef.current = true;
+ setIsConnecting(true);
+
+ try {
+ /*
+ // Simulate API delay
+ await new Promise(resolve => setTimeout(resolve, 1000));
+
+ setIsConnected(true);
+ setIsConnecting(false);
+ connectLockRef.current = false;
+ // toast({ title: "Connected", description: "Farm Vaidya is listening (Test Mode)" });
+
+ // Simulate bot greeting
+ addToTranscript("ai", "Namaste! I am Farm Vaidya. How can I help you with your crops today?");
+ */
+
+ const endpoint = process.env.NEXT_PUBLIC_PIPECAT_ENDPOINT || "https://api.pipecat.daily.co/v1/public/webagent/start";
+ const apiKey = process.env.NEXT_PUBLIC_PIPECAT_TOKEN;
+ console.log("Connecting to Pipecat endpoint:", endpoint);
+ console.log("API Key provided:", !!apiKey);
+
+ if (!apiKey) {
+ throw new Error("VITE_PIPECAT_TOKEN is not configured in .env file");
+ }
+
+ // Ensure the Authorization header uses a Bearer token. If the token
+ // already includes the Bearer prefix, leave it as-is.
+ const authHeader = apiKey.match(/^Bearer\s+/i) ? apiKey : `Bearer ${apiKey}`;
+
+ // Start API request immediately
+ const fetchPromise = fetch(
+ endpoint,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ "Authorization": authHeader,
+ },
+ body: JSON.stringify({
+ createDailyRoom: true,
+ dailyRoomProperties: {
+ enable_recording: "cloud",
+ privacy: "public",
+ },
+ dailyMeetingTokenProperties: {
+ is_owner: true,
+ },
+ }),
+ }
+ ).then(async (res) => {
+ if (!res.ok) {
+ const errorText = await res.text();
+ console.error("API Error Response:", errorText);
+ throw new Error(`API request failed: ${res.status} ${res.statusText} - ${errorText}`);
+ }
+ return res.json();
+ });
+
+ // Cleanup existing frame while API is fetching
+ if (callFrame) {
+ await callFrame.leave().catch(console.error);
+ await callFrame.destroy().catch(console.error);
+ setCallFrame(null);
+ }
+
+ // Initialize new frame while API is fetching
+ const frame = DailyIframe.createFrame({
+ showLeaveButton: false,
+ showFullscreenButton: false,
+ iframeStyle: {
+ position: "fixed",
+ width: "1px",
+ height: "1px",
+ opacity: "0",
+ pointerEvents: "none",
+ },
+ });
+
+ // Setup listeners immediately
+ frame
+ .on("joined-meeting", () => {
+ setIsConnected(true);
+ setIsConnecting(false);
+ connectLockRef.current = false;
+ })
+ .on("left-meeting", () => {
+ setIsConnected(false);
+ connectLockRef.current = false;
+ })
+ .on("error", () => {
+ setIsConnecting(false);
+ connectLockRef.current = false;
+ toast({ title: "Error", description: "Connection failed", variant: "destructive" });
+ })
+ .on("participant-joined", (e: any) => {
+ if (e.participant.user_name === "Chatbot") {
+ addToTranscript("ai", "I am Farm Vaidya AI");
+ }
+ })
+ .on("active-speaker-change", (e: any) => {
+ const localParticipant = frame.participants().local;
+ if (e.activeSpeaker && e.activeSpeaker.peerId === localParticipant.user_id) {
+ // User is speaking
+ } else if (e.activeSpeaker) {
+ // AI is speaking
+ } else {
+ // No one is speaking
+ }
+ });
+
+ // Wait for API data
+ const data = await fetchPromise;
+ const roomUrl = data.dailyRoom || data.room_url || data.roomUrl;
+ const roomToken = data.dailyToken || data.token;
+
+ if (!roomUrl || !roomToken) {
+ console.error("API Response:", data);
+ throw new Error("Missing room URL or token from API response");
+ }
+
+ // Join room with optimized settings
+ await frame.join({
+ url: roomUrl,
+ token: roomToken,
+ subscribeToTracksAutomatically: true
+ });
+ setCallFrame(frame);
+
+ } catch (error: any) {
+ console.error(error);
+ setIsConnecting(false);
+ connectLockRef.current = false;
+ toast({ title: "Error", description: error.message || "Could not start conversation", variant: "destructive" });
+ }
+ };
+
+ const endConversation = async () => {
+ if (callFrame) {
+ await callFrame.leave();
+ }
+ setIsConnected(false);
+ setIsOpen(false);
+ };
+
+ const toggleMute = () => {
+ const newMuteState = !isMuted;
+ if (callFrame) {
+ callFrame.setLocalAudio(!newMuteState);
+ }
+ setIsMuted(newMuteState);
+ };
+
+ // @ts-ignore - Used for future text input functionality
+ const handleSendMessage = () => {
+ if (!inputText.trim()) return;
+ addToTranscript("user", inputText);
+ setInputText("");
+ // Here you would typically send the text to the AI if supported by the backend
+
+ // Simulate AI response for testing
+ setTimeout(() => {
+ addToTranscript("ai", "I am a mock bot response. The API is bypassed for testing.");
+ }, 1000);
+ };
+
+ const GoogleLogo = () => (
+
+
+
+
+
+
+ );
+
+ const GoogleDots = () => (
+
+ );
+
+ return (
+
+ {/* Active Call Pill UI */}
+ {isOpen && (
+
+
+ {/* Avatar Section */}
+
+ {/* Spinning Ring - Blue Colors */}
+
+
+ {/* Avatar Container */}
+
+
+
+
+
+ {/* Status Text */}
+
+
+ {isConnecting ? "Connecting..." : "Connected"}
+
+
+ {isConnecting ? "00:00:00" : formatTime(timer)}
+
+
+
+ {/* Controls */}
+
+
+ {isMuted ? : }
+
+
+
+
+
+
+
+
+ )}
+
+ {/* Floating Toggle Button */}
+ {!isOpen && (
+
{
+ setIsOpen(true);
+ startConversation();
+ }}
+ className="w-fit cursor-pointer group relative p-[2px] rounded-full bg-black border-2 border-blue-500 shadow-2xl transition-all duration-300 hover:scale-105 animate-bounce-subtle"
+ >
+
+
+ {/* Avatar Container */}
+
+
+
+
+
+
+ Talk to TechSprint
+
+
+ Hackathon 2026
+
+
+
+
+ )}
+
+ );
+}
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
new file mode 100644
index 0000000..41a2ec3
--- /dev/null
+++ b/src/components/ui/button.tsx
@@ -0,0 +1,44 @@
+import * as React from "react"
+import { cn } from "@/lib/utils"
+
+export type ButtonProps = React.ButtonHTMLAttributes & {
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"
+ size?: "default" | "sm" | "lg" | "icon"
+}
+
+const Button = React.forwardRef(
+ ({ className, variant = "default", size = "default", ...props }, ref) => {
+ const variants: Record = {
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ }
+
+ const sizes: Record = {
+ default: "h-10 px-4 py-2",
+ sm: "h-9 rounded-md px-3",
+ lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
+ }
+
+ return (
+
+ )
+ }
+)
+
+Button.displayName = "Button"
+
+export { Button }
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx
new file mode 100644
index 0000000..9cb9d6b
--- /dev/null
+++ b/src/components/ui/card.tsx
@@ -0,0 +1,78 @@
+import * as React from "react"
+import { cn } from "@/lib/utils"
+
+const Card = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+Card.displayName = "Card"
+
+const CardHeader = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardHeader.displayName = "CardHeader"
+
+const CardTitle = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardTitle.displayName = "CardTitle"
+
+const CardDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardDescription.displayName = "CardDescription"
+
+const CardContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardContent.displayName = "CardContent"
+
+const CardFooter = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+CardFooter.displayName = "CardFooter"
+
+export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
diff --git a/src/components/ui/toaster.tsx b/src/components/ui/toaster.tsx
new file mode 100644
index 0000000..653321a
--- /dev/null
+++ b/src/components/ui/toaster.tsx
@@ -0,0 +1,2 @@
+// Toaster is provided by sonner, we just need a placeholder
+export const Toaster = () => null;
diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx
new file mode 100644
index 0000000..12a64e4
--- /dev/null
+++ b/src/components/ui/tooltip.tsx
@@ -0,0 +1,25 @@
+import * as React from "react"
+
+const TooltipProvider = ({ children }: { children: React.ReactNode }) => {
+ return <>{children}>
+}
+
+const Tooltip = ({ children }: { children: React.ReactNode }) => {
+ return <>{children}>
+}
+
+const TooltipTrigger = React.forwardRef<
+ HTMLButtonElement,
+ React.HTMLAttributes
+>((props, ref) => )
+
+TooltipTrigger.displayName = "TooltipTrigger"
+
+const TooltipContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes
+>((props, ref) =>
)
+
+TooltipContent.displayName = "TooltipContent"
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
diff --git a/src/hooks/use-toast.ts b/src/hooks/use-toast.ts
new file mode 100644
index 0000000..894ce8c
--- /dev/null
+++ b/src/hooks/use-toast.ts
@@ -0,0 +1,25 @@
+import { toast as sonnerToast } from "sonner";
+
+export function useToast() {
+ return {
+ toast: ({
+ title,
+ description,
+ variant = "default",
+ }: {
+ title: string;
+ description?: string;
+ variant?: "default" | "destructive";
+ }) => {
+ if (variant === "destructive") {
+ sonnerToast.error(title, {
+ description,
+ });
+ } else {
+ sonnerToast.success(title, {
+ description,
+ });
+ }
+ },
+ };
+}
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
new file mode 100644
index 0000000..2cb92be
--- /dev/null
+++ b/src/lib/utils.ts
@@ -0,0 +1,6 @@
+import { type ClassValue, clsx } from "clsx"
+import { twMerge } from "tailwind-merge"
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs))
+}
From 59783654455bab3fde92d84008dc265e329c9b3f Mon Sep 17 00:00:00 2001
From: Pavan Kumar
Date: Fri, 2 Jan 2026 19:39:01 +0530
Subject: [PATCH 2/2] feat: Close registration - replace button with
"Registration Closed" message
---
src/components/Hero.tsx | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx
index 44cf1ee..5e90657 100644
--- a/src/components/Hero.tsx
+++ b/src/components/Hero.tsx
@@ -121,19 +121,12 @@ export default function Hero() {