# Project export: Trinetra

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 12.0
- Tagline: Autonomous Verification. Trustless Action.
- Devpost: https://devpost.com/software/trinetra-9hx6ca
- GitHub: https://github.com/Shanthan2307/Trinetra_1
- Video: https://www.youtube.com/embed/IIdVG_HP1Zk?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — Shanthan  Sudhini (1 commits)

## Devpost submission (written by the team)

### Overview

The Spark:

### Inspiration

& Problem The core inspiration for Project Trinetra emerged from what we call the “Trust Gap” in autonomous decision-making. While AI is exceptional at reasoning and executing complex actions, and blockchain provides a foundation for immutable trust, there exists a crucial disconnection: How can an AI-driven financial transaction be verifiably tied to an authentic, untampered, real-world condition? Most existing systems rely on centralized data sources or human confirmation, both of which create single points of failure, fraud potential, and transparency gaps. If an AI books a service or executes a high-value transaction based on inaccurate data, who is accountable? Trinetra was conceived to address this question — to enable AI decisions anchored in verifiable real-world truth, authenticated without human input. Our driving principle became: “Did the AI’s action truly reflect the real world — and can we prove it?” The Foundations: What We Learned Building Trinetra meant bringing together three distinct technological pillars: 1. AI / Multi-Agent Systems We discovered that reliable automation requires a decentralized, multi-agent AI architecture rather than a single monolithic model. Trinetra employs multiple intelligent agents such as: Context Analyzer: Decomposes user intent into verifiable sub-tasks. Execution Bot: Executes validated actions once proof is logged on-chain. These agents communicate asynchronously, ensuring scalability and fault-tolerant decision-making. 2. Sui Blockchain for Verifiability The Sui blockchain became our backbone for trustless, immutable audit trails. Rather than merely executing transactions, Sui provides an object-based ledger for recording the rationale behind every AI action — ensuring accountability and transparency. Logged data includes: User intent hash CV analysis result (e.g., "Dry: True") Cryptographic hash of the proof snapshot Execution request metadata Through Sui smart contracts written in Move, every AI decision gains a verifiable provenance that cannot be altered or disputed. 3. Real-World Data Interfacing (The Oracle Problem) One of the hardest challenges was building a tamper-proof interface between the physical world and AI systems — what we termed the “CCTV Oracle Problem.” To solve this, we engineered a Data Ingestion Gateway that: Validates incoming CCTV/IoT feeds, Performs integrity checks, Runs real-time CV analysis, and Hashes results before writing them to the Sui blockchain. This ensures that any data driving an AI decision is verifiable and immutable. The Blueprint: How We Built Trinetra Trinetra’s architecture is layered for security, accountability, and autonomy. 1. User Interface & Intent Layer Action: User issues a natural-language command, e.g., “Book an Uber if the nearest tennis court is dry.” Component: Front-end app or chat interface. Output: Structured intent passed to the AI Core. 2. Cognitive & Data Verification Layer (AI Core) 🧠 AI Context Analyzer (The Brain) Breaks down the command into verifiable actions: 🧩 Data Ingestion Gateway Acquires real-time video stream. Runs Computer Vision (CV) model (YOLO/ResNet). Classifies scene (e.g., dry or wet). Generates cryptographic hashes of both image frame and classification result. Submits proof hash to Sui blockchain for verification. 3. Trust & Security Layer (Sui Blockchain) 🔐 Smart Contract Rationale Logging When the CV model confirms a condition, the Execution Bot initiates a Sui transaction. On-chain, the Sui Move contract records: UserCommand_Hash CV_Result Snapshot_Hash Execution_Request Each record becomes a verifiable on-chain object, creating an immutable trail of the AI’s decision logic. 4. Execution & Feedback Layer 🤖 Execution Bot (The Hand) Once the rationale is confirmed on-chain, this agent executes the external API call (e.g., Uber API). ✅ Settlement: The final booking transaction ID is stored on Sui, closing the verifiable transaction loop. The user receives real-time confirmation through the app. The Gauntlet: Challenges Faced Live Oracle Verification: Ensuring that live video data hasn’t been tampered with required a cryptographic chain-of-trust validated through Proof-of-Authority (PoA) consensus nodes on Sui. Live Oracle Verification: Ensuring that live video data hasn’t been tampered with required a cryptographic chain-of-trust validated through Proof-of-Authority (PoA) consensus nodes on Sui. Computational Efficiency: Running multiple CV analyses in real-time was resource-intensive. We implemented edge-optimized models and tiered data processing to scale efficiently. Computational Efficiency: Running multiple CV analyses in real-time was resource-intensive. We implemented edge-optimized models and tiered data processing to scale efficiently. Privacy Compliance: No personal or raw visual data is ever stored on-chain. Only SHA-256 hashes of snapshots are recorded, ensuring privacy and regulatory compliance. Privacy Compliance: No personal or raw visual data is ever stored on-chain. Only SHA-256 hashes of snapshots are recorded, ensuring privacy and regulatory compliance. Conclusion Project Trinetra is not just a technological prototype — it’s an Accountability Framework for the age of autonomous AI. By combining: The adaptive intelligence of multi-agent AI systems, The object-oriented verifiability of the Sui blockchain, and The authenticity of real-world oracles, Trinetra lays the groundwork for transparent, trustworthy, and self-verifying AI ecosystems. 🏗️ Architectural Foundations (Powered by Sui) A. Core Components and Technologies B. Design Principles 1. Decoupling Separate the concerns of Intent (AI), Proof (Gateway), and Trust (Sui Blockchain) — ensuring that one layer’s failure does not compromise another. Future updates will use ZKPs to verify conclusions (e.g., “court is dry”) without revealing any underlying image data, maximizing privacy and trust. 4. Consortium/Federated Design Trusted data providers (CCTV networks, IoT systems) will participate in a Proof-of-Authority (PoA) or Delegated Proof-of-Stake (DPoS) model on Sui, guaranteeing data validity and reducing oracle manipulation risks. ✨ Final Thought Project Trinetra represents a fusion of cognition and verifiability — where AI thinks, Sui verifies, and the world trusts. Would you like me to add diagrams (Mermaid/PlantUML) next — e.g., a flowchart of the architecture or agent interaction with the Sui blockchain?

## README (from the GitHub repository)



---

# 💡 Project Trinetra: The Autonomous Verification System

---

## **The Spark: Inspiration & Problem**

The core inspiration for **Project Trinetra** emerged from what we call the **“Trust Gap”** in autonomous decision-making.

While **AI** is exceptional at reasoning and executing complex actions, and **blockchain** provides a foundation for immutable trust, there exists a crucial disconnection:

> **How can an AI-driven financial transaction be verifiably tied to an authentic, untampered, real-world condition?**

Most existing systems rely on **centralized data sources** or **human confirmation**, both of which create single points of failure, fraud potential, and transparency gaps.

If an AI books a service or executes a high-value transaction based on inaccurate data, **who is accountable?**

Trinetra was conceived to address this question — to enable AI decisions **anchored in verifiable real-world truth**, authenticated **without human input**.

Our driving principle became:

> *“Did the AI’s action truly reflect the real world — and can we prove it?”*

---

## **The Foundations: What We Learned**

Building Trinetra meant bringing together three distinct technological pillars:

---

### **1. AI / Multi-Agent Systems**

We discovered that reliable automation requires a **decentralized, multi-agent AI architecture** rather than a single monolithic model.

Trinetra employs multiple intelligent agents such as:

* **Context Analyzer:** Decomposes user intent into verifiable sub-tasks.
* **Execution Bot:** Executes validated actions once proof is logged on-chain.

These agents communicate **asynchronously**, ensuring scalability and fault-tolerant decision-making.

---

### **2. Sui Blockchain for Verifiability**

The **Sui blockchain** became our backbone for **trustless, immutable audit trails**.
Rather than merely executing transactions, Sui provides an **object-based ledger** for recording the *rationale* behind every AI action — ensuring accountability and transparency.

Logged data includes:

* User intent hash
* CV analysis result (e.g., `"Dry: True"`)
* Cryptographic hash of the proof snapshot
* Execution request metadata

Through **Sui smart contracts** written in **Move**, every AI decision gains a verifiable provenance that cannot be altered or disputed.

---

### **3. Real-World Data Interfacing (The Oracle Problem)**

One of the hardest challenges was building a **tamper-proof interface** between the physical world and AI systems — what we termed the **“CCTV Oracle Problem.”**

To solve this, we engineered a **Data Ingestion Gateway** that:

* Validates incoming CCTV/IoT feeds,
* Performs integrity checks,
* Runs real-time CV analysis, and
* Hashes results before writing them to the Sui blockchain.

This ensures that any data driving an AI decision is **verifiable and immutable**.

---

## **The Blueprint: How We Built Trinetra**

Trinetra’s architecture is layered for **security**, **accountability**, and **autonomy**.

---

### **1. User Interface & Intent Layer**

* **Action:** User issues a natural-language command, e.g.,

  > “Book an Uber if the nearest tennis court is dry.”
* **Component:** Front-end app or chat interface.
* **Output:** Structured intent passed to the AI Core.

---

### **2. Cognitive & Data Verification Layer (AI Core)**

#### 🧠 *AI Context Analyzer (The Brain)*

Breaks down the command into verifiable actions:

```
Find nearest tennis court → Locate CCTV → Analyze dryness
```

#### 🧩 *Data Ingestion Gateway*

* Acquires real-time video stream.
* Runs **Computer Vision (CV)** model (YOLO/ResNet).
* Classifies scene (e.g., `dry` or `wet`).
* Generates cryptographic hashes of both image frame and classification result.
* Submits proof hash to **Sui blockchain** for verification.

---

### **3. Trust & Security Layer (Sui Blockchain)**

#### 🔐 *Smart Contract Rationale Logging*

When the CV model confirms a condition, the **Execution Bot** initiates a Sui transaction.

On-chain, the **Sui Move contract** records:

* `UserCommand_Hash`
* `CV_Result`
* `Snapshot_Hash`
* `Execution_Request`

Each record becomes a **verifiable on-chain object**, creating an immutable trail of the AI’s decision logic.

---

### **4. Execution & Feedback Layer**

#### 🤖 *Execution Bot (The Hand)*

Once the rationale is confirmed on-chain, this agent executes the external API call (e.g., Uber API).

#### ✅ *Settlement:*

The final booking transaction ID is stored on Sui, closing the **verifiable transaction loop**.
The user receives real-time confirmation through the app.

---

## **The Gauntlet: Challenges Faced**

1. **Live Oracle Verification:**
   Ensuring that live video data hasn’t been tampered with required a **cryptographic chain-of-trust** validated through **Proof-of-Authority (PoA)** consensus nodes on Sui.

2. **Computational Efficiency:**
   Running multiple CV analyses in real-time was resource-intensive.
   We implemented **edge-optimized models** and **tiered data processing** to scale efficiently.

3. **Privacy Compliance:**
   No personal or raw visual data is ever stored on-chain.
   Only **SHA-256 hashes** of snapshots are recorded, ensuring privacy and regulatory compliance.

---

## **Conclusion**

**Project Trinetra** is not just a technological prototype — it’s an **Accountability Framework** for the age of autonomous AI.

By combining:

* The **adaptive intelligence** of multi-agent AI systems,
* The **object-oriented verifiability** of the **Sui blockchain**, and
* The **authenticity of real-world oracles**,

Trinetra lays the groundwork for **transparent**, **trustworthy**, and **self-verifying AI ecosystems**.

---

## 🏗️ Architectural Foundations (Powered by Sui)

---

### **A. Core Components and Technologies**

| **Component**                     | **Function / Role**                                                | **Technology Stack**                                                          |
| :-------------------------------- | :----------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| **Sui Blockchain Layer**          | Immutable audit logs and secure settlements for AI actions.        | **Sui Move smart contracts**, PoA/DPoS consensus, object-based proof storage. |
| **AI / ML Layer**                 | Natural-language intent parsing, CV analysis, and execution logic. | **Python (PyTorch / TensorFlow)**, **LangChain**, **uAgent**.                 |
| **Data Ingestion Gateway**        | Real-world data validation, hashing, and verification.             | **Rust / Go**, **IPFS / Arweave**, **SHA-256 hashing** for proofs.            |
| **API Gateway / Execution Layer** | Handles third-party APIs and notifications.                        | **REST / GraphQL**, **Kafka / RabbitMQ**.                                     |

---

### **B. Design Principles**

#### **1. Decoupling**

Separate the concerns of **Intent (AI)**, **Proof (Gateway)**, and **Trust (Sui Blockchain)** — ensuring that one layer’s failure does not compromise another.



Future updates will use **ZKPs** to verify conclusions (e.g., *“court is dry”*) without revealing any underlying image data, maximizing privacy and trust.

#### **4. Consortium/Federated Design**

Trusted **data providers** (CCTV networks, IoT systems) will participate in a **Proof-of-Authority (PoA)** or **Delegated Proof-of-Stake (DPoS)** model on Sui, guaranteeing data validity and reducing oracle manipulation risks.

---

### **✨ Final Thought**

Project Trinetra represents a **fusion of cognition and verifiability** — where **AI thinks**, **Sui verifies**, and **the world trusts**.

---

Would you like me to add **diagrams (Mermaid/PlantUML)** next — e.g., a flowchart of the architecture or agent interaction with the Sui blockchain?


## Detected evidence (automated analysis)

Indexed codebase: 193 recognized source files, 984 KB.
- CSS (language) — detected in the code
- Express (technology) — detected in the code
- Flask (technology) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- Next.js (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Solidity (language) — detected in the code
- Supabase (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code

## Codebase structure (from repository index)

### Files (120 of 240)

```
AGENT_QUICKSTART.md
agents/face-detection/dockerfile
agents/face-detection/face_recognition_script.py
agents/hyperbolic.py
agents/insurance_agent/insurance_claim.sol
AI_ORCHESTRATION_GUIDE.md
ascii_art_cleaner/ASCII.txt
ascii_art_cleaner/convertor.py
ascii_art_cleaner/output.txt
avs-2/.env.example
avs-2/.gitignore
avs-2/docker-compose.yml
avs-2/Dockerfile
avs-2/Execution_Service/.env.example
avs-2/Execution_Service/.gitignore
avs-2/Execution_Service/configs/app.config.js
avs-2/Execution_Service/Dockerfile
avs-2/Execution_Service/index.js
avs-2/Execution_Service/package.json
avs-2/Execution_Service/src/dal.service.js
avs-2/Execution_Service/src/oracle.service.js
avs-2/Execution_Service/src/task.controller.js
avs-2/Execution_Service/src/utils/validateError.js
avs-2/Execution_Service/src/utils/validateResponse.js
avs-2/grafana/dashboards/othentic-cli.json
avs-2/grafana/provisioning/dashboards/dashboards.yaml
avs-2/grafana/provisioning/datasources/datasources.yaml
avs-2/prometheus.yaml
avs-2/README.md
avs-2/Validation_Service/.env.example
avs-2/Validation_Service/.gitignore
avs-2/Validation_Service/configs/app.config.js
avs-2/Validation_Service/Dockerfile
avs-2/Validation_Service/index.js
avs-2/Validation_Service/package.json
avs-2/Validation_Service/src/dal.service.js
avs-2/Validation_Service/src/oracle.service.js
avs-2/Validation_Service/src/task.controller.js
avs-2/Validation_Service/src/utils/validateError.js
avs-2/Validation_Service/src/utils/validateResponse.js
avs-2/Validation_Service/src/validator.service.js
backend/.env.example
backend/.gitignore
backend/backend.log
backend/backend.pid
backend/CCTV/batch_analyzer.py
backend/CCTV/cctv_analyzer.py
backend/CCTV/example_usage.py
backend/CCTV/ffmpeg_viewer.py
backend/CCTV/find_and_display.sh
backend/CCTV/find_stream_guide.md
backend/CCTV/hls_web_viewer.html
backend/CCTV/HOW_IT_WORKS.md
backend/CCTV/MULTI_FEED_GUIDE.md
backend/CCTV/MULTI_FEED_README.md
backend/CCTV/multi_grid_viewer.html
backend/CCTV/QUICKSTART.md
backend/CCTV/README.md
backend/CCTV/requirements.txt
backend/CCTV/setup_and_run.sh
backend/CCTV/START_HERE.md
backend/CCTV/START_MULTI_FEED.md
backend/CCTV/stream_viewer.py
backend/CCTV/STREAMING_GUIDE.md
backend/CCTV/urls.txt
backend/CCTV/view_hls.sh
backend/CCTV/YOUTUBE_EMBEDDING_FIX.md
backend/CCTV/YOUTUBE_SUPPORT.md
backend/CCTV/YOUTUBE_TROUBLESHOOTING.md
backend/chroma/chroma.sqlite3
backend/elasticsearch_integration.py
backend/fitch_marketplace.py
backend/install_dependencies.sh
backend/main.py
backend/multi-stream.py
backend/requirements.txt
backend/sui_integration.py
backend/trinetra_agent.py
BLOCKCHAIN_INTEGRATIONS.md
BLOCKCHAIN_QUICKSTART.md
CCTV_INTEGRATION_GUIDE.md
CCTV_M3U8_FIX.md
COMPLETE_SYSTEM_SUMMARY.md
DEMO_SCRIPT.md
ELASTICSEARCH_INTEGRATION.md
ELASTICSEARCH_QUICK_START.md
FAULTY_TERMINAL_INTEGRATED.md
frontend_landing/.gitignore
frontend_landing/components.json
frontend_landing/eslint.config.js
frontend_landing/index.html
frontend_landing/package.json
frontend_landing/postcss.config.mjs
frontend_landing/README.md
frontend_landing/src/.gitignore
frontend_landing/src/App.css
frontend_landing/src/app.tsx
frontend_landing/src/app/globals.css
frontend_landing/src/app/layout.tsx
frontend_landing/src/app/page.tsx
frontend_landing/src/components.json
frontend_landing/src/components/ArchitectureDiagram.tsx
frontend_landing/src/components/ExecutionTimeline.tsx
frontend_landing/src/components/FaultyTerminal.css
frontend_landing/src/components/FaultyTerminal.tsx
frontend_landing/src/components/gl/index.tsx
frontend_landing/src/components/gl/particles.tsx
frontend_landing/src/components/gl/shaders/pointMaterial.ts
frontend_landing/src/components/gl/shaders/simulationMaterial.ts
frontend_landing/src/components/gl/shaders/utils.ts
frontend_landing/src/components/gl/shaders/vignetteShader.ts
frontend_landing/src/components/header.tsx
frontend_landing/src/components/hero.tsx
frontend_landing/src/components/HeroTerminal.tsx
frontend_landing/src/components/logo.tsx
frontend_landing/src/components/mobile-menu.tsx
frontend_landing/src/components/ParticleSystem.tsx
frontend_landing/src/components/pill.tsx
frontend_landing/src/components/PrivacyGuard.tsx
frontend_landing/src/components/theme-provider.tsx
[120 more files omitted for size]
```

### Dependencies

- avs-2/Execution_Service/package.json: @pinata/sdk@^2.1.0, @types/axios@^0.14.0, axios@^1.1.3, cors@^2.8.5, dotenv@^16.0.1, ethers@^6.11.1, express@^4.18.1, express-session@^1.17.3, fs@^0.0.1-security, nodemon@^3.1.0
- avs-2/Validation_Service/package.json: @types/axios@^0.14.0, axios@^1.1.3, cors@^2.8.5, dotenv@^16.0.1, express@^4.18.1, express-session@^1.17.3, fs@^0.0.1-security, nodemon@^3.1.0
- backend/CCTV/requirements.txt: beautifulsoup4@>=4.12.0, opencv-python@>=4.8.0, requests@>=2.31.0
- backend/requirements.txt: beautifulsoup4@==4.12.2, face-recognition@==1.3.0, Flask@==3.0.0, flask-cors@==4.0.0, flask-socketio@==5.3.5, google-generativeai@==0.3.1, lxml@==4.9.3, opencv-python@==4.8.1.78, Pillow@==10.1.0, python-dotenv@==1.0.0, python-socketio@==5.10.0, requests@==2.31.0, supabase@==2.0.3
- frontend_landing/package.json: @eslint/js@^9.36.0, @radix-ui/react-dialog@^1.1.15, @react-three/drei@^10.7.6, @react-three/fiber@^9.4.0, @tailwindcss/postcss@^4.1.16, @types/node@^24.6.0, @types/react@^19.1.16, @types/react-dom@^19.1.9, @types/three@^0.180.0, @vitejs/plugin-react@^5.0.4, autoprefixer@^10.4.21, class-variance-authority@^0.7.1, clsx@^2.1.1, eslint@^9.36.0, eslint-plugin-react-hooks@^5.2.0, eslint-plugin-react-refresh@^0.4.22, globals@^16.4.0, leva@^0.10.0, lucide-react@^0.548.0, ogl@^1.0.11, postcss@^8.5.6, react@^19.1.1, react-dom@^19.1.1, tailwind-merge@^3.3.1, tailwindcss@^4.1.16, tailwindcss-animate@^1.0.7, three@^0.180.0, typescript@~5.9.3, typescript-eslint@^8.45.0, vite@^7.1.7
- frontend_landing/src/package.json: @eslint/eslintrc@latest, @hookform/resolvers@^3.10.0, @radix-ui/react-accordion@1.2.2, @radix-ui/react-alert-dialog@1.1.4, @radix-ui/react-aspect-ratio@1.1.1, @radix-ui/react-avatar@1.1.2, @radix-ui/react-checkbox@1.1.3, @radix-ui/react-collapsible@1.1.2, @radix-ui/react-context-menu@2.2.4, @radix-ui/react-dialog@latest, @radix-ui/react-dropdown-menu@2.1.4, @radix-ui/react-hover-card@1.1.4, @radix-ui/react-label@2.1.1, @radix-ui/react-menubar@1.1.4, @radix-ui/react-navigation-menu@1.2.3, @radix-ui/react-popover@1.1.4, @radix-ui/react-progress@1.1.1, @radix-ui/react-radio-group@1.2.2, @radix-ui/react-scroll-area@1.2.2, @radix-ui/react-select@2.1.4, @radix-ui/react-separator@1.1.1, @radix-ui/react-slider@1.2.2, @radix-ui/react-slot@latest, @radix-ui/react-switch@1.1.2, @radix-ui/react-tabs@1.1.2, @radix-ui/react-toast@1.2.4, @radix-ui/react-toggle@1.1.1, @radix-ui/react-toggle-group@1.1.1, @radix-ui/react-tooltip@1.1.6, @react-three/drei@latest, @react-three/fiber@latest, @tailwindcss/postcss@^4.1.9, @types/node@^22, @types/react@^19, @types/react-dom@^19, @types/three@^0.180.0, @vercel/analytics@1.3.1, autoprefixer@^10.4.20, class-variance-authority@^0.7.1, clsx@^2.1.1, cmdk@1.0.4, date-fns@4.1.0, embla-carousel-react@8.5.1, expo@latest, expo-asset@latest, expo-file-system@latest, expo-gl@latest, geist@^1.3.1, input-otp@1.4.1, leva@latest, lucide-react@^0.454.0, maath@latest, next@15.2.4, next-themes@latest, path@latest, postcss@^8.5, r3f-perf@latest, react@^19, react-day-picker@9.8.0, react-dom@^19, react-hook-form@^7.60.0, react-native@latest, react-resizable-panels@^2.1.7, recharts@2.15.4, sonner@^1.7.4, tailwind-merge@^2.5.5, tailwindcss@^4.1.9, tailwindcss-animate@^1.0.7, three@latest, tw-animate-css@1.3.3, typescript@^5, url@latest, vaul@^0.9.9, zod@3.25.67
- frontend/package.json: @dynamic-labs/ethereum@^4.8.1, @dynamic-labs/sdk-react-core@^4.8.1, @dynamic-labs/wagmi-connector@^4.8.1, @ipld/dag-pb@^4.1.3, @mysten/dapp-kit@^0.19.6, @mysten/sui.js@^0.54.1, @story-protocol/core-sdk@^1.3.0-beta.3, @tanstack/react-query@^5.90.5, @testing-library/dom@^10.4.0, @testing-library/jest-dom@^6.6.3, @testing-library/react@^16.2.0, @testing-library/user-event@^13.5.0, assert@^2.1.0, buffer@^6.0.3, crypto-browserify@^3.12.1, dotenv@^16.4.7, ethers@^6.13.5, framer-motion@^12.4.7, fs@^0.0.1-security, hls.js@^1.6.13, https-browserify@^1.0.0, multiformats@^13.3.2, os-browserify@^0.3.0, path-browserify@^1.0.1, pinata-web3@^0.5.4, process@^0.11.10, react@^19.0.0, react-app-rewired@^2.2.1, react-dom@^19.0.0, react-leaflet@^5.0.0, react-leaflet-markercluster@^5.0.0-rc.0, react-scripts@5.0.1, react-toastify@^11.0.5, stream-browserify@^3.0.0, stream-http@^3.2.0, tailwindcss@^3.4.17, url@^0.11.4, viem@^2.23.5, wagmi@^2.14.12, web-vitals@^2.1.4

### Recent commits (newest first)

- Revise README for clarity and structure
- Enhance README with Project Trinetra details
- Cleanup README by removing extensive content
- final push
- working with landing
- working with landing page
- Initial commit

## Key source files (fetched from GitHub, selected and truncated for size)

### QUICK_START_CCTV.md

```markdown
# 🚀 Quick Start - CCTV .m3u8 Streams

## Install & Run (2 steps)

### 1. Install Dependencies
```bash
cd /Users/joker2307/Desktop/unagi/backend
./install_dependencies.sh
```

### 2. Start Backend
```bash
python3 main.py
```

---

## Add .m3u8 Camera (3 steps)

### Step 1: Open Camera Interface
- Click `[INIT-CAMERA-PROTOCOL]` in terminal

### Step 2: Analyze Stream
- Enter .m3u8 URL: `https://example.com/stream.m3u8`
- Click `[ANALYZE URL]`
- Wait for: ✓ "Found 1 stream(s)! (HLS) ✓ Validated"

### Step 3: Add Camera
- Coordinates: `37.7749,-122.4194`
- Description: "Camera Name"
- Click `[COMMIT]`

---

## View Live Streams

Click `[OPEN-CCTV]` → See all cameras in grid view!

---

## Test URL

```
https://stream-uc2-charlie.dropcam.com/nexus_aac/54d1f7859e9741448b240eb44e972098/chunklist_w2002435562.m3u8?public=aQAoqnQ5Af
```

---

## ✅ What's Fixed

- ✅ .m3u8 validation before adding
- ✅ CORS enabled for cross-origin requests
- ✅ Detailed error messages
- ✅ Stream type detection (HLS, MP4, etc.)
- ✅ Automatic HLS playlist verification

---

## 🐛 Troubleshooting

**Error: "Invalid or inaccessible .m3u8 stream"**
- Check if URL is publicly accessible
- Test in VLC: `vlc https://your-stream.m3u8`

**Error: "Module not found"**
- Run: `./install_dependencies.sh`

**Streams not playing in grid**
- Check browser console (F12)
- Ensure streams are HLS (.m3u8)

---

## 📖 Full Documentation

- `CCTV_M3U8_FIX.md` - Complete technical details
- `backend/CCTV/START_HERE.md` - Stream viewer tools

```

### ELASTICSEARCH_QUICK_START.md

```markdown
# ⚡ Elasticsearch Quick Start

## 🚀 Test It Now!

### **1. Verify Connection**
```bash
curl http://localhost:5000/api/elasticsearch/analytics
```

Expected:
```json
{
  "success": true,
  "analytics": {
    "total_cctv_logs": 0,
    "total_ai_analyses": 0,
    "total_transactions": 0,
    "total_orchestrations": 0
  }
}
```

### **2. Run Uber Court Flow**
```
1. Open http://localhost:3000
2. Click [UBER-COURT-FLOW] 🚗
3. Type: "book an Uber if the nearest court is dry"
4. Click [START FLOW]
5. Wait for completion
```

### **3. Check Logs**
```bash
# Get AI analysis logs
curl http://localhost:5000/api/elasticsearch/ai_analysis

# Should show the court analysis with 93% confidence!
```

---

## 📊 View in Elasticsearch Cloud

1. **Login:** https://my-elasticsearch-project-b335c5.es.us-central1.gcp.elastic.cloud
2. **Navigate:** Discover → Select `trinetra-*`
3. **View:** All logs from Trinetra!

---

## 🎯 What's Being Logged

| Action | Index | Trigger |
|--------|-------|---------|
| Add Camera | `trinetra-cctv-footage` | `/api/add_camera` |
| Camera Transaction | `trinetra-transactions` | `/api/add_camera` |
| AI Vision Analysis | `trinetra-ai-analysis` | Uber Court Flow |
| Agent Orchestration | `trinetra-orchestration` | `/api/trinetra/process` |

---

## 🔍 Quick Queries

```bash
# Get all CCTV cameras
curl http://localhost:5000/api/elasticsearch/cctv_logs

# Get high-confidence analyses (>90%)
curl "http://localhost:5000/api/elasticsearch/ai_analysis?min_confidence=0.90"

# Get all transactions
curl http://localhost:5000/api/elasticsearch/transactions

# Get summary
curl http://localhost:5000/api/elasticsearch/analytics
```

---

## ✅ Status

```
✅ Elasticsearch connected
✅ 4 indices created
✅ Auto-logging enabled
✅ API endpoints ready
✅ Frontend integrated
```

**Ready to use!** 🎉

```

### avs-2/Dockerfile

```
FROM node:22.6

RUN npm install -g npm@10.5.0

WORKDIR /app

RUN npm i -g @othentic/othentic-cli-sepolia

ENTRYPOINT [ "othentic-cli" ]

```

### backend/requirements.txt

```
Flask==3.0.0
flask-cors==4.0.0
flask-socketio==5.3.5
python-socketio==5.10.0
requests==2.31.0
beautifulsoup4==4.12.2
lxml==4.9.3
face-recognition==1.3.0
Pillow==10.1.0
supabase==2.0.3
google-generativeai==0.3.1
python-dotenv==1.0.0
opencv-python==4.8.1.78

```

### frontend_landing/package.json

```
{
  "name": "frontend",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "@radix-ui/react-dialog": "^1.1.15",
    "@react-three/drei": "^10.7.6",
    "@react-three/fiber": "^9.4.0",
    "@types/three": "^0.180.0",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "leva": "^0.10.0",
    "lucide-react": "^0.548.0",
    "ogl": "^1.0.11",
    "react": "^19.1.1",
    "react-dom": "^19.1.1",
    "tailwind-merge": "^3.3.1",
    "tailwindcss-animate": "^1.0.7",
    "three": "^0.180.0"
  },
  "devDependencies": {
    "@eslint/js": "^9.36.0",
    "@tailwindcss/postcss": "^4.1.16",
    "@types/node": "^24.6.0",
    "@types/react": "^19.1.16",
    "@types/react-dom": "^19.1.9",
    "@vitejs/plugin-react": "^5.0.4",
    "autoprefixer": "^10.4.21",
    "eslint": "^9.36.0",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-react-refresh": "^0.4.22",
    "globals": "^16.4.0",
    "postcss": "^8.5.6",
    "tailwindcss": "^4.1.16",
    "typescript": "~5.9.3",
    "typescript-eslint": "^8.45.0",
    "vite": "^7.1.7"
  }
}

```

### frontend/package.json

```
{
  "name": "trinetra-frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@dynamic-labs/ethereum": "^4.8.1",
    "@dynamic-labs/sdk-react-core": "^4.8.1",
    "@dynamic-labs/wagmi-connector": "^4.8.1",
    "@ipld/dag-pb": "^4.1.3",
    "@mysten/dapp-kit": "^0.19.6",
    "@mysten/sui.js": "^0.54.1",
    "@story-protocol/core-sdk": "^1.3.0-beta.3",
    "@tanstack/react-query": "^5.90.5",
    "@testing-library/dom": "^10.4.0",
    "@testing-library/jest-dom": "^6.6.3",
    "@testing-library/react": "^16.2.0",
    "@testing-library/user-event": "^13.5.0",
    "dotenv": "^16.4.7",
    "ethers": "^6.13.5",
    "framer-motion": "^12.4.7",
    "fs": "^0.0.1-security",
    "hls.js": "^1.6.13",
    "multiformats": "^13.3.2",
    "path-browserify": "^1.0.1",
    "pinata-web3": "^0.5.4",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "react-leaflet": "^5.0.0",
    "react-leaflet-markercluster": "^5.0.0-rc.0",
    "react-scripts": "5.0.1",
    "react-toastify": "^11.0.5",
    "viem": "^2.23.5",
    "wagmi": "^2.14.12",
    "web-vitals": "^2.1.4"
  },
  "proxy": "http://127.0.0.1:5000",
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "assert": "^2.1.0",
    "buffer": "^6.0.3",
    "crypto-browserify": "^3.12.1",
    "https-browserify": "^1.0.0",
    "os-browserify": "^0.3.0",
    "process": "^0.11.10",
    "react-app-rewired": "^2.2.1",
    "stream-browserify": "^3.0.0",
    "stream-http": "^3.2.0",
    "tailwindcss": "^3.4.17",
    "url": "^0.11.4"
  }
}

```

### avs-2/docker-compose.yml

```yaml
version: '3.7'
x-othentic-cli: &othentic-cli
  env_file: .env
  build:
    context: .
    dockerfile: ./Dockerfile
services:
  aggregator:
    <<: *othentic-cli
    command: ["node", "aggregator", "--json-rpc", "--l1-chain", "sepolia:nightly", "--l2-chain", "amoy:nightly", "--metrics", "--internal-tasks", "--sync-interval", "5400000"]
    environment:
      PRIVATE_KEY: ${PRIVATE_KEY_AGGREGATOR}
    ports:
      - "8545:8545"
      - "9876:9876"
    networks:
      p2p:
        ipv4_address: 10.8.0.69
  attester-1:
    <<: *othentic-cli
    command: [
      "node",
      "attester",
      "/ip4/10.8.0.69/tcp/9876/p2p/${OTHENTIC_BOOTSTRAP_ID}",
      "--avs-webapi",
      "http://10.8.0.42",
      "--l1-chain", "sepolia:nightly",
      "--l2-chain", "amoy:nightly"
    ]
    environment:
      PRIVATE_KEY: ${PRIVATE_KEY_ATTESTER1}
      TASK_PERFORMER: 0x0000000000000000000000000000000000000000
    depends_on:
      aggregator:
        condition: service_started
    networks:
      p2p:
        ipv4_address: 10.8.0.2
  attester-2:
    <<: *othentic-cli
    command: [
      "node",
      "attester",
      "/ip4/10.8.0.69/tcp/9876/p2p/${OTHENTIC_BOOTSTRAP_ID}",
      "--avs-webapi",
      "http://10.8.0.42",
      "--l1-chain", "sepolia:nightly",
      "--l2-chain", "amoy:nightly"
    ]
    environment:
      PRIVATE_KEY: ${PRIVATE_KEY_ATTESTER2}
      TASK_PERFORMER: 0x0000000000000000000000000000000000000000
    depends_on:
      aggregator:
        condition: service_started
    networks:
      p2p:
        ipv4_address: 10.8.0.3
  attester-3:
    <<: *othentic-cli
    command: [
      "node",
      "attester",
      "/ip4/10.8.0.69/tcp/9876/p2p/${OTHENTIC_BOOTSTRAP_ID}",
      "--avs-webapi",
      "http://10.8.0.42",
      "--l1-chain", "sepolia:nightly",
      "--l2-chain", "amoy:nightly"
    ]
    environment:
      PRIVATE_KEY: ${PRIVATE_KEY_ATTESTER3}
      TASK_PERFORMER: 0x0000000000000000000000000000000000000000
    depends_on:
      aggregator:
        condition: service_started
    networks:
      p2p:
        ipv4_address: 10.8.0.4
  validation-service:
    build:
      context: ./Validation_Service
      dockerfile: ./Dockerfile
    env_file: .env
    networks:
      p2p:
        ipv4_address: 10.8.0.42
  execution-service:
    build:
      context: ./Execution_Service
      dockerfile: ./Dockerfile
    environment:
      OTHENTIC_CLIENT_RPC_ADDRESS: http://10.8.0.69:8545
      PRIVATE_KEY: ${PRIVATE_KEY_PERFORMER}
    env_file: .env
    ports:
      - "4003:4003"
    networks:
      p2p:
        ipv4_address: 10.8.0.101
networks:
  p2p:
    driver: bridge
    ipam:
      config:
        - subnet: 10.8.0.0/16
          gateway: 10.8.0.1

```

### backend/CCTV/requirements.txt

```
requests>=2.31.0
beautifulsoup4>=4.12.0
opencv-python>=4.8.0

```

### avs-2/Execution_Service/Dockerfile

```
FROM node:22.6

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "index.js" ]
```

### avs-2/Validation_Service/Dockerfile

```
FROM node:22.6

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "index.js" ]
```

[184 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]