Skip to content

Commit 6060f91

Browse files
author
Ganesh Mohanty
committed
feat(ai-wattch): complete extension
0 parents  commit 6060f91

File tree

109 files changed

+13949
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+13949
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Require admin approvals for the entire repo
2+
* @KothariEbrahim
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Auto-create PR on branch push
2+
3+
on:
4+
push:
5+
# Runs for any branch except main
6+
branches-ignore: ['main']
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
create-pr:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Create PR if none exists
17+
uses: actions/github-script@v6
18+
with:
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
script: |
21+
const owner = context.repo.owner;
22+
const repo = context.repo.repo;
23+
const headRef = context.ref.replace('refs/heads/','');
24+
if (!headRef || headRef === 'main') {
25+
core.info('No branch or branch is main — exit.');
26+
return;
27+
}
28+
29+
// Check for an existing open PR from this branch
30+
const existing = await github.rest.pulls.list({
31+
owner, repo,
32+
head: `${owner}:${headRef}`,
33+
state: 'open'
34+
});
35+
36+
if (existing.data.length > 0) {
37+
core.info(`Open PR already exists: ${existing.data[0].html_url}`);
38+
return;
39+
}
40+
41+
// Create PR into main
42+
const title = `Auto PR: ${headRef}`;
43+
const body = `This pull request was auto-created from a push to branch \`${headRef}\`. Please review and approve.`;
44+
const pr = await github.rest.pulls.create({
45+
owner, repo,
46+
head: headRef,
47+
base: 'main',
48+
title,
49+
body
50+
});
51+
52+
core.info(`Created PR: ${pr.data.html_url}`);

.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
dist/
9+
build/
10+
build-*/
11+
*.zip
12+
!releases/*.zip
13+
14+
15+
# Environment variables
16+
.env
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
# IDE files
23+
.vscode/
24+
.idea/
25+
*.swp
26+
*.swo
27+
28+
# OS files
29+
.DS_Store
30+
Thumbs.db
31+
32+
# Logs
33+
logs
34+
*.log
35+
36+
# Runtime data
37+
pids
38+
*.pid
39+
*.seed
40+
*.pid.lock
41+
42+
# Coverage directory used by tools like istanbul
43+
coverage/
44+
45+
# nyc test coverage
46+
.nyc_output
47+
48+
# Dependency directories
49+
jspm_packages/
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional REPL history
55+
.node_repl_history
56+
57+
# Output of 'npm pack'
58+
*.tgz
59+
60+
# Yarn Integrity file
61+
.yarn-integrity
62+
63+
# parcel-bundler cache (https://parceljs.org/)
64+
.cache
65+
.parcel-cache
66+
67+
# next.js build output
68+
.next
69+
70+
# nuxt.js build output
71+
.nuxt
72+
73+
# vuepress build output
74+
.vuepress/dist
75+
76+
# Serverless directories
77+
.serverless
78+
79+
# FuseBox cache
80+
.fusebox/
81+
82+
# DynamoDB Local files
83+
.dynamodb/
84+
85+
86+
dist/
87+
88+
.claude

AUTHORS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Authors
2+
3+
This project is maintained by the teams at **Antarctica** and **IT Climate Ed**.
4+
5+
## Contributors
6+
7+
We would like to thank all the contributors who have and intend to help improve AI Wattch.
8+
9+
---
10+
11+
Interested in contributing? Check out our [CONTRIBUTING.md](./CONTRIBUTING.md) to get started!

CODE_OF_CONDUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at conduct@itclimateed.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4).

CONTRIBUTING.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Contributing to AI Wattch
2+
3+
Thank you for your interest in contributing! We aim to keep the process as simple, transparent, and collaborative as possible.
4+
5+
## ⚖️ Contributing & Governance
6+
7+
We welcome contributions. Please follow these steps:
8+
9+
1. **Fork the repo**.
10+
2. **Create a branch**: `feature/<short-description>`.
11+
3. **Commit with a clear message** and open a PR.
12+
4. **Add tests and update docs**.
13+
5. **One feature per PR**; link relevant issue.
14+
15+
### Pre-PR Discussion
16+
17+
For major architectural or methodology changes, **open an issue first** to discuss design and data assumptions.
18+
19+
- **Methodology is research-sensitive**: Maintain transparency in how variables are chosen.
20+
- **Cite sources**: Include citations and data sources in your PR descriptions.
21+
22+
### Docs to Add/Maintain
23+
24+
- [`CONTRIBUTING.md`](./CONTRIBUTING.md) (detailed)
25+
- [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md)
26+
- [`SECURITY.md`](./SECURITY.md) (vulnerability reporting)
27+
28+
## 🚀 Development Workflow
29+
30+
### 1. Fork & Clone
31+
32+
```bash
33+
git clone https://github.com/AIWattch/AI-Wattch.git
34+
cd ai-wattch-ext
35+
```
36+
37+
### 2. Install Dependencies
38+
39+
```bash
40+
npm install
41+
```
42+
43+
### 3. Development Build
44+
45+
To start the development server with Hot Module Replacement (HMR):
46+
47+
```bash
48+
npm run dev
49+
```
50+
51+
### 4. Production Build
52+
53+
To build the extension for both Chrome and Firefox:
54+
55+
```bash
56+
npm run build:extension
57+
```
58+
59+
This script will:
60+
61+
- Clean previous builds
62+
- Build for Firefox (output in `build-firefox`)
63+
- Build for Chrome (output in `build-chrome`)
64+
- Create ZIP packages for distribution
65+
66+
### 5. Load Extension
67+
68+
**Chrome:**
69+
70+
1. Open `chrome://extensions/`
71+
2. Enable **Developer mode** (top right)
72+
3. Click **Load unpacked**
73+
4. Select the `dist` folder (for dev) or `build-chrome` folder (for production build)
74+
75+
**Firefox:**
76+
77+
1. Open `about:debugging`
78+
2. Click **This Firefox**
79+
3. Click **Load Temporary Add-on**
80+
4. Select the `manifest.json` file from the `dist` or `build-firefox` folder
81+
82+
## 🧩 Project Structure
83+
84+
```
85+
/src
86+
/assets # Static assets (images, fonts)
87+
/background # Background service workers
88+
/constants # Global constants and configuration
89+
/content # Content scripts injected into pages
90+
/core # Core logic (emissions calculation, etc.)
91+
/icons # Icon assets
92+
/modules # Feature modules
93+
/shared # Shared utilities and components
94+
/types # TypeScript type definitions
95+
/utils # General utility functions
96+
```
97+
98+
## 🧑‍💻 Code Style & Standards
99+
100+
To maintain a consistent and clean codebase:
101+
102+
- **TypeScript**: Use TypeScript for all new code.
103+
- **Functions**: Keep functions small, predictable, and pure where possible.
104+
- **Comments**: Add comments for complex or non-obvious logic.
105+
- **Utilities**: Reuse existing utilities in `src/shared` or `src/utils` — avoid duplication.
106+
- **Modern Syntax**: Prefer ES modules and modern syntax.
107+
108+
## 🔧 Pull Request Process
109+
110+
1. **Keep PRs small**: Small, focused PRs are reviewed & merged faster.
111+
2. **Follow Conventional Commits**:
112+
- `feat(ui): add new emissions widget`
113+
- `fix(api): correct model detection`
114+
- `chore(build): update Vite config`
115+
3. **Update Documentation**: Update README or comments if you change user-facing features or complex logic.
116+
4. **Verify**: Ensure the extension builds and loads correctly in the browser.
117+
118+
## 🐞 Reporting Bugs
119+
120+
When filing an issue, please include:
121+
122+
- Browser version (Chrome, Edge, Firefox, etc.)
123+
- Extension version
124+
- Steps to reproduce
125+
- Expected vs. actual behavior
126+
- Screenshots / logs (if applicable)
127+
128+
## ✨ Requesting New Features
129+
130+
Before submitting a feature request:
131+
132+
1. Check if the feature already exists or is open as an issue.
133+
2. Clearly describe the use case and value.
134+
135+
## 💬 Questions? Need Help?
136+
137+
Open a GitHub Issue or Discussions thread. Maintainers are happy to help!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 AIWattch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)