Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .config/store.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"users": {
"1711055629": {
"name": "Ayush",
"roll": "6372373",
"uni": "IIITM Gwalior"
}
},
"sessions": {
"1711055629": {
"step": "AWAITING_PLATFORM",
"context": "Make a assignment for bubble sort and give me pdf withe rhr code and code op screenshot",
"solution": "Assignment: Implementation and Performance Analysis of Bubble Sort Algorithm\nStudent Name: Ayush\nRoll Number: 6372373\nUniversity: IIITM Gwalior\nDate: 4/1/2026\n\n1. Objective\nThe objective of this assignment is to implement the Bubble Sort algorithm, document the step-by-step logic, provide the source code, and analyze its time complexity in the context of sorting an array of integers.\n\n2. Problem Statement\nWrite a program to sort an array of $n$ elements using the Bubble Sort technique. The program must:\na) Accept input size $n$ and an array of $n$ integers from the user.\nb) Perform the sort by repeatedly stepping through the list, comparing adjacent elements, and swapping them if they are in the wrong order.\nc) Display the sorted array.\n\n3. Algorithm Description\nBubble Sort is a comparison-based algorithm where each pair of adjacent elements is compared, and elements are swapped if they are not in order. This process repeats until the array is sorted.\n- Time Complexity: O(n²) in the worst and average cases.\n- Space Complexity: O(1) as it is an in-place sorting algorithm.\n\n4. Source Code (Python)\n```python\ndef bubble_sort(arr):\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n\n# Driver code\nif __name__ == \"__main__\":\n data = [64, 34, 25, 12, 22, 11, 90]\n print(\"Original array:\", data)\n sorted_data = bubble_sort(data)\n print(\"Sorted array:\", sorted_data)\n```\n\n5. Output Screenshot Placeholder\n[Insert Screenshot of Program Execution Here]\n\n6. Conclusion\nThe implementation confirms that Bubble Sort is effective for smaller datasets but inefficient for large-scale data due to its quadratic time complexity. Proper documentation of the swapping mechanism demonstrates the fundamental working principle of the algorithm.",
"format": "Pdf with code op"
}
}
Comment on lines +2 to +16

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This committed store file contains real user PII and session/assignment content. Runtime state like this shouldn’t be checked in; remove it from the PR and ensure it remains ignored (and consider providing a sample/empty file only if needed).

Suggested change
"users": {
"1711055629": {
"name": "Ayush",
"roll": "6372373",
"uni": "IIITM Gwalior"
}
},
"sessions": {
"1711055629": {
"step": "AWAITING_PLATFORM",
"context": "Make a assignment for bubble sort and give me pdf withe rhr code and code op screenshot",
"solution": "Assignment: Implementation and Performance Analysis of Bubble Sort Algorithm\nStudent Name: Ayush\nRoll Number: 6372373\nUniversity: IIITM Gwalior\nDate: 4/1/2026\n\n1. Objective\nThe objective of this assignment is to implement the Bubble Sort algorithm, document the step-by-step logic, provide the source code, and analyze its time complexity in the context of sorting an array of integers.\n\n2. Problem Statement\nWrite a program to sort an array of $n$ elements using the Bubble Sort technique. The program must:\na) Accept input size $n$ and an array of $n$ integers from the user.\nb) Perform the sort by repeatedly stepping through the list, comparing adjacent elements, and swapping them if they are in the wrong order.\nc) Display the sorted array.\n\n3. Algorithm Description\nBubble Sort is a comparison-based algorithm where each pair of adjacent elements is compared, and elements are swapped if they are not in order. This process repeats until the array is sorted.\n- Time Complexity: O(n²) in the worst and average cases.\n- Space Complexity: O(1) as it is an in-place sorting algorithm.\n\n4. Source Code (Python)\n```python\ndef bubble_sort(arr):\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n\n# Driver code\nif __name__ == \"__main__\":\n data = [64, 34, 25, 12, 22, 11, 90]\n print(\"Original array:\", data)\n sorted_data = bubble_sort(data)\n print(\"Sorted array:\", sorted_data)\n```\n\n5. Output Screenshot Placeholder\n[Insert Screenshot of Program Execution Here]\n\n6. Conclusion\nThe implementation confirms that Bubble Sort is effective for smaller datasets but inefficient for large-scale data due to its quadratic time complexity. Proper documentation of the swapping mechanism demonstrates the fundamental working principle of the algorithm.",
"format": "Pdf with code op"
}
}
"users": {},
"sessions": {}

Copilot uses AI. Check for mistakes.
}
Comment on lines +1 to +17

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Committed user pii store 🐞 Bug ⛨ Security

The PR commits .config/store.json containing a user's name, roll number, university, and full
session/solution content. This leaks personal data and must be removed from the repo (and git
history) and treated as runtime-only state.
Agent Prompt
## Issue description
`.config/store.json` is committed with real user PII and session content. This file is runtime state and should never be shipped or tracked.

## Issue Context
The application persists onboarding/session state to `.config/store.json`, so committing it risks leaking real user data and future sessions.

## Fix
1. Remove `.config/store.json` from git tracking (`git rm --cached .config/store.json`).
2. Purge it from git history if already pushed.
3. Ensure `.config/` remains ignored (it already is) and consider adding an explicit `.config/store.json.example` if you need a schema/sample.
4. (Optional hardening) Store sensitive data with least privilege: file permissions (0600), encryption at rest, and/or move to a proper DB.

## Fix Focus Areas
- .config/store.json[1-17]
- src/core/store.ts[4-26]
- src/bot/index.ts[17-28]
- .gitignore[65-77]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TELEGRAM_BOT_TOKEN=8606625998:AAGuNWcFKDyXBSBITEie_NCSqZ2j2GZ6dC4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Committed bot token 🐞 Bug ⛨ Security

A real TELEGRAM_BOT_TOKEN is committed in .env, allowing anyone with repository access (or
leaked history) to fully control the Telegram bot. This secret must be rotated and removed from git
history to prevent account takeover.
Agent Prompt
## Issue description
A real Telegram bot token is committed in `.env`, which is a credential that enables full bot control. Once committed, it remains accessible through git history even if later removed.

## Issue Context
`.gitignore` already lists `.env`, so this appears accidental but still security-critical.

## Fix
1. Rotate/revoke the leaked Telegram bot token immediately (via @BotFather) and issue a new one.
2. Remove `.env` from the repository (and ensure it is not tracked): `git rm --cached .env`.
3. Purge the secret from git history (e.g., `git filter-repo` / BFG) and force-push if this repo is shared.
4. Add a safe template file (e.g., `.env.example`) with placeholder values.

## Fix Focus Areas
- .env[1-1]
- .gitignore[65-77]
- README.md[57-71]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A real Telegram bot token is committed in this tracked .env file. This is a secret leak and should be removed from git history (rotate/revoke the token, delete the file from the repo, and replace with a non-secret .env.example/setup instructions).

Suggested change
TELEGRAM_BOT_TOKEN=8606625998:AAGuNWcFKDyXBSBITEie_NCSqZ2j2GZ6dC4
TELEGRAM_BOT_TOKEN=YOUR_TELEGRAM_BOT_TOKEN_HERE

Copilot uses AI. Check for mistakes.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,17 @@ web_modules/

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example
.config

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
.env
out

.config
# Nuxt.js build / generate output
.nuxt
dist
Expand Down
72 changes: 71 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,71 @@
# scholarsync
# ScholarSync: Openclaw for students 🎓

ScholarSync is an automated study and assignment agent that you interact with directly through your favorite messaging platforms. By providing assignment prompts and specific platform instructions, ScholarSync will solve, format, and upload your academic coursework exactly how you need it.

---

## 🚀 Key Features

### 💬 Multi-Platform Messaging Integration

Interact with ScholarSync easily on:

- **Telegram**
- **WhatsApp** *(Coming soon)*
- **Slack** *(Coming soon)*

### 📝 Seamless Onboarding

The first time you interact with the bot, you will be onboarded to specify your permanent details:

- **Roll Number**
- **Name**
- **University / College**
These details are automatically attached and formatted into your generated assignments.

### 📚 Complete Assignment Solving

Provide the bot with all required details to solve your assignment (e.g. prompt text, PDF documents, or images via OCR). ScholarSync analyzes the requirements and processes the solution precisely.

### 📤 Custom Upload Destinations

Tell ScholarSync which platform to upload the finished assignment to (e.g., Moodle, Canvas, Github Classroom, or a custom university portal) and the bot will handle the final submission via browser automation.

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brand casing: this line says “Github Classroom”, but the correct spelling is “GitHub Classroom”.

Suggested change
Tell ScholarSync which platform to upload the finished assignment to (e.g., Moodle, Canvas, Github Classroom, or a custom university portal) and the bot will handle the final submission via browser automation.
Tell ScholarSync which platform to upload the finished assignment to (e.g., Moodle, Canvas, GitHub Classroom, or a custom university portal) and the bot will handle the final submission via browser automation.

Copilot uses AI. Check for mistakes.

### 🗂️ Flexible Output Formats

Tell the bot *exactly* what you need. ScholarSync can provide and format:

- **PDF Documents** (theory and conceptual answers).
- **Source Code** files (`.js`, `.py`, `.cpp`, etc.).
- **Code Output** text files.
- **Code Execution Screenshots** (Visual proof that your code executed successfully).

### 🧠 Bring Your Own Model (Local & API)

Running an open-source model like Llama locally? Or prefer using an external API? ScholarSync allows you to run a local model as well through API keys, giving you complete control over costs, privacy, and the intelligence engine behind the solver.

---

## 🛠️ Built With

- **Node.js**: As the core backend environment.
- **Telegraf**: For Telegram integration.
- **Puppeteer**: For headless browser automation (capturing output screenshots, uploading assignments).
- **PDF-Parse & Tesseract.js**: For parsing and reading assignment documents and images.
- **Googleapis**: For integrating with Drive or external storages.

## 🚀 Getting Started

1. Set up your `.env` file with the necessary API Keys (Telegram Bot Token, LLM Config, etc.).
2. Depending on your needs, you can start the service as a CLI tool or a background Bot Daemon.
3. Install dependencies:

```bash
npm install
```

4. Run the development environment:

```bash
npm start # (Ensure you configure standard start scripts in package.json to run src/index.ts)

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The npm start comment is now outdated/incorrect: package.json already defines a start script. Consider updating this snippet to just npm start (and document any required tooling like tsx/pm2 if they remain npx-based).

Suggested change
npm start # (Ensure you configure standard start scripts in package.json to run src/index.ts)
npm start

Copilot uses AI. Check for mistakes.
```
Comment on lines +59 to +71

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README still directs users to configure a .env file, but the code now also relies on .config/scholar.json (interactive setup) and .env is ignored. Update the getting-started steps to reflect the actual configuration flow and which files users should create.

Suggested change
1. Set up your `.env` file with the necessary API Keys (Telegram Bot Token, LLM Config, etc.).
2. Depending on your needs, you can start the service as a CLI tool or a background Bot Daemon.
3. Install dependencies:
```bash
npm install
```
4. Run the development environment:
```bash
npm start # (Ensure you configure standard start scripts in package.json to run src/index.ts)
```
1. Install dependencies:
```bash
npm install
  1. Run the development environment for the first time:

    npm start # (Ensure you configure standard start scripts in package.json to run src/index.ts)

    On first launch, ScholarSync will guide you through an interactive setup and create a configuration file at .config/scholar.json (or ~/.config/scholar.json, depending on your environment). This file stores your API keys (Telegram Bot Token, LLM config, etc.) and other runtime settings.

  2. After setup, you can run ScholarSync either as a CLI tool or as a background bot daemon, depending on your workflow.

Copilot uses AI. Check for mistakes.
Binary file added bin/freeze
Binary file not shown.
148 changes: 132 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading