dis-gravity 0.0.0-stage → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +9 -0
- package/.mcpbignore +20 -0
- package/LICENSE.txt +20 -0
- package/README.md +471 -3
- package/SECURITY.md +105 -0
- package/bin/dis-gravity.js +1199 -0
- package/changelog.md +182 -0
- package/dist/extension.js +11690 -0
- package/lib/core.js +1712 -0
- package/lib/onboarding.js +512 -0
- package/manifest.json +115 -0
- package/mcp/server.js +2174 -0
- package/media/discord.svg +4 -0
- package/media/icon.png +0 -0
- package/media/mcp-icon.png +0 -0
- package/media/screenshot-chat.png +0 -0
- package/media/screenshot-settings.png +0 -0
- package/package.json +261 -5
- package/scripts/package-mcpb.js +29 -0
package/.gitlab-ci.yml
ADDED
package/.mcpbignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
.git/
|
|
3
|
+
.disgravity/
|
|
4
|
+
*.vsix
|
|
5
|
+
*.mcpb
|
|
6
|
+
*.dxt
|
|
7
|
+
*.bak
|
|
8
|
+
docs/
|
|
9
|
+
scratch/
|
|
10
|
+
test/
|
|
11
|
+
.vscodeignore
|
|
12
|
+
.npmignore
|
|
13
|
+
.npmrc
|
|
14
|
+
.vsixmanifest
|
|
15
|
+
media/*.gif
|
|
16
|
+
media/*.mp4
|
|
17
|
+
media/icon.png
|
|
18
|
+
media/screenshot*.png
|
|
19
|
+
bin/
|
|
20
|
+
dist/
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sambath-rethinakumar
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,471 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="media/icon.png" width="140" alt="Dis-Gravity Logo" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Dis-Gravity</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Connect & Control Your IDE from Mobile — The Ultimate Multi-IDE Discord Remote Bridge</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="#supported-ides--environments"><img src="https://img.shields.io/badge/Supports-Antigravity%20%7C%20VS%20Code%20%7C%20Cursor%20%7C%20Windsurf%20%7C%20JetBrains-blueviolet?style=flat-square" alt="Supported IDEs"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/dis-gravity"><img src="https://img.shields.io/npm/v/dis-gravity?style=flat-square&color=cb3837&logo=npm" alt="npm version"></a>
|
|
14
|
+
<a href="#installation"><img src="https://img.shields.io/badge/VS%20Code-v1.93+-007acc?style=flat-square&logo=visualstudiocode" alt="VS Code Version"></a>
|
|
15
|
+
<a href="LICENSE.txt"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="MIT License"></a>
|
|
16
|
+
<a href="https://discord.com"><img src="https://img.shields.io/badge/Discord-discord.js%20v14-5865F2?style=flat-square&logo=discord" alt="Discord.js"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
> **Connect your IDE to mobile and control VS Code, Google Antigravity, and Cursor directly from Discord.**
|
|
22
|
+
> Approve AI agent tool executions in 38ms, inspect real-time streaming steps, run terminal commands, view colored git diffs, download artifacts, and control your development workspace from your phone with **zero inbound open ports**.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<img src="media/dis-gravity-demo.gif" width="860" alt="Dis-Gravity live 2X split-screen demo: connecting and controlling desktop IDE from mobile Discord in 38 milliseconds" />
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 📱 How Can I Connect My IDE to Mobile?
|
|
33
|
+
|
|
34
|
+
Connecting your desktop IDE (VS Code, Google Antigravity, Cursor, Windsurf) to your iOS or Android phone takes under 90 seconds with Dis-Gravity:
|
|
35
|
+
|
|
36
|
+
1. **Launch Dis-Gravity on your desktop**:
|
|
37
|
+
Run the zero-install CLI daemon or install the extension (`.vsix`) in your IDE:
|
|
38
|
+
```bash
|
|
39
|
+
npx dis-gravity@latest
|
|
40
|
+
```
|
|
41
|
+
2. **Connect your private Discord bot**:
|
|
42
|
+
Run the frictionless setup wizard and paste your bot token. Dis-Gravity automatically enables Gateway Message Content intent, configures permissions, and provisions a secure channel:
|
|
43
|
+
```bash
|
|
44
|
+
dis-gravity setup
|
|
45
|
+
```
|
|
46
|
+
3. **Open Discord on your mobile phone**:
|
|
47
|
+
Open Discord on your iOS or Android phone. Your IDE is now fully connected to mobile! You can approve prompts in 38ms, run terminal commands, and stream AI coding thoughts on the go with **zero inbound open ports**.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 🎮 How to Control IDE with Mobile
|
|
52
|
+
|
|
53
|
+
Once your IDE is connected to mobile via Dis-Gravity, you have full remote control:
|
|
54
|
+
|
|
55
|
+
* **⚡ 1-Tap 38ms AI Approvals**: When an AI agent prompts for terminal or file permission, tap the interactive Discord button on your phone to inject a native DOM click via Chrome DevTools Protocol (CDP) in 38ms.
|
|
56
|
+
* **💻 Remote Mobile Terminal**: Type `/sh pytest`, `/sh npm test`, or `/sh git status` in your mobile Discord chat to run shell commands in your host IDE with real-time output.
|
|
57
|
+
* **📡 In-Place Step Streaming**: Watch AI reasoning, file inspections, and edits update live inside a single Discord embed card without mobile notification spam.
|
|
58
|
+
* **🖼️ 2x Retina Visual Cards**: Inspect high-DPI rendered PNG cards of markdown tables and colorized git diffs directly on mobile screens.
|
|
59
|
+
* **🔄 Multi-IDE Switching**: Control Google Antigravity, VS Code with Copilot, Cursor AI, Windsurf, or Claude Desktop interchangeably.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📑 Table of Contents
|
|
64
|
+
|
|
65
|
+
- [📱 How Can I Connect My IDE to Mobile?](#-how-can-i-connect-my-ide-to-mobile)
|
|
66
|
+
- [🎮 How to Control IDE with Mobile](#-how-to-control-ide-with-mobile)
|
|
67
|
+
- [Supported IDEs & Environments](#supported-ides--environments)
|
|
68
|
+
- [📦 Installation](#-installation)
|
|
69
|
+
- [Option 1: Instant via npx (Zero Install)](#option-1-instant-via-npx-zero-install)
|
|
70
|
+
- [Option 2: Install Global CLI via npm](#option-2-install-global-cli-via-npm)
|
|
71
|
+
- [Option 3: Install VS Code / Antigravity Extension (.vsix)](#option-3-install-vs-code--antigravity-extension-vsix)
|
|
72
|
+
- [Option 4: Install Claude Desktop Extension (.mcpb / .dxt)](#option-4-install-claude-desktop-extension-mcpb--dxt)
|
|
73
|
+
- [Option 5: Build .vsix or .mcpb from Source](#option-5-build-vsix-or-mcpb-from-source)
|
|
74
|
+
- [🚀 3-Minute Quickstart Guide](#-3-minute-quickstart-guide)
|
|
75
|
+
- [Step 1: Create Your Discord Bot](#step-1-create-your-discord-bot)
|
|
76
|
+
- [Step 2: Invite the Bot to Your Server](#step-2-invite-the-bot-to-your-server)
|
|
77
|
+
- [Step 3: Retrieve Channel ID & User ID](#step-3-retrieve-channel-id--user-id)
|
|
78
|
+
- [Step 4: Configure Dis-Gravity in Your IDE](#step-4-configure-dis-gravity-in-your-ide)
|
|
79
|
+
- [Connecting Your Specific IDE](#connecting-your-specific-ide)
|
|
80
|
+
- [1. Visual Studio Code & GitHub Copilot (Zero Port Required)](#1-visual-studio-code--github-copilot-zero-port-required)
|
|
81
|
+
- [2. Google Antigravity, Cursor AI & Windsurf (Port 9000)](#2-google-antigravity-cursor-ai--windsurf-port-9000)
|
|
82
|
+
- [3. JetBrains, Neovim & Headless Servers (Standalone CLI Daemon)](#3-jetbrains-neovim--headless-servers-standalone-cli-daemon)
|
|
83
|
+
- [4. Claude Desktop & Claude Code (Model Context Protocol / MCP)](#4-claude-desktop--claude-code-model-context-protocol--mcp)
|
|
84
|
+
- [🛡️ Security Best Practices (`allowedUsers`)](#️-security-best-practices-allowedusers)
|
|
85
|
+
- [🌟 Key Features](#-key-features)
|
|
86
|
+
- [⌨️ Slash Commands & Text Shortcuts](#️-slash-commands--text-shortcuts)
|
|
87
|
+
- [⚙️ Configuration Reference](#️-configuration-reference)
|
|
88
|
+
- [❓ Troubleshooting & FAQ](#-troubleshooting--faq)
|
|
89
|
+
- [📄 License](#-license)
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Supported IDEs & Environments
|
|
94
|
+
|
|
95
|
+
| IDE / Environment | Provider Mode (`agentProvider`) | Connection Type | Autonomous Tools |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| **Google Antigravity** | `antigravity` or `auto` | CDP (`:9000`) | Native IDE Agent + Approval Dialogs + Lexical Mode Chips |
|
|
98
|
+
| **VS Code + GitHub Copilot** | `copilot` or `auto` | Native `vscode.lm` | Autonomous ReAct Loop (`view`, `edit`, `sh`, `git`, `tree`) |
|
|
99
|
+
| **Cursor AI** | `cursor` or `auto` | CDP (`:9000`) | Composer & Chat (`/plan`, `/edit`, `@Codebase`) |
|
|
100
|
+
| **Windsurf** | `windsurf` or `auto` | CDP (`:9000`) | Cascade Chat Webview with deep iframe traversal |
|
|
101
|
+
| **Claude Desktop & Claude Code** | `mcp` (`mcp/server.js`) | Model Context Protocol (`stdio`) | Interactive Discord Approval Buttons (`allow`/`deny`), Notifications, Bridge Status |
|
|
102
|
+
| **JetBrains / Neovim / Headless** | `cli` (`bin/dis-gravity.js`) | Subprocess / PTY | Universal CLI (`agy`, `claude`, `aider`, `shell`) |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 📦 Installation
|
|
107
|
+
|
|
108
|
+
Choose the setup that best fits your workflow:
|
|
109
|
+
|
|
110
|
+
### Option 1: Instant via npx (Zero Install)
|
|
111
|
+
Run the standalone Dis-Gravity CLI daemon directly from npm without installing:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx dis-gravity --token="YOUR_BOT_TOKEN" --channel="YOUR_CHANNEL_ID" --provider="cli"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Option 2: Install Global CLI via npm
|
|
118
|
+
Install the `dis-gravity` command globally on your machine:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm install -g dis-gravity
|
|
122
|
+
dis-gravity --help
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Option 3: Install VS Code / Antigravity Extension (.vsix)
|
|
126
|
+
1. Download `dis-gravity-1.2.3.vsix` from [GitLab Releases](https://gitlab.com/rethinakumarsambath8/dis-gravity/-/releases) or the root of this repository.
|
|
127
|
+
2. In VS Code or Google Antigravity IDE:
|
|
128
|
+
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS).
|
|
129
|
+
- Type **Extensions: Install from VSIX...** and select `dis-gravity-1.2.3.vsix`.
|
|
130
|
+
|
|
131
|
+
### Option 4: Install Claude Desktop Extension (.mcpb / .dxt)
|
|
132
|
+
Dis-Gravity packages as a native **Anthropic Model Context Protocol Bundle** (`.mcpb`) and legacy DXT archive (`.dxt`):
|
|
133
|
+
|
|
134
|
+
1. Download `dis-gravity-1.2.3.mcpb` (or `dis-gravity-1.2.3.dxt`) from [GitLab Releases](https://gitlab.com/rethinakumarsambath8/dis-gravity/-/releases).
|
|
135
|
+
2. In **Claude Desktop**:
|
|
136
|
+
- Double-click `dis-gravity-1.2.3.mcpb` or go to **Settings** → **Extensions** → **Install Extension...** and select the file.
|
|
137
|
+
- Enter your `bot_token`, `channel_id`, and optional `allowed_users` in the configuration panel.
|
|
138
|
+
3. For **Claude Code CLI**, connect directly via stdio:
|
|
139
|
+
```bash
|
|
140
|
+
claude mcp add dis-gravity node /path/to/Dis-Gravity/mcp/server.js \
|
|
141
|
+
-e DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN" \
|
|
142
|
+
-e DISCORD_CHANNEL_ID="YOUR_CHANNEL_ID" \
|
|
143
|
+
-e ALLOWED_USERS="YOUR_DISCORD_USER_ID"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Option 5: Build .vsix or .mcpb from Source
|
|
147
|
+
```bash
|
|
148
|
+
git clone https://gitlab.com/rethinakumarsambath8/dis-gravity.git
|
|
149
|
+
cd Dis-Gravity
|
|
150
|
+
npm install
|
|
151
|
+
|
|
152
|
+
# Build VS Code .vsix package:
|
|
153
|
+
npm run package
|
|
154
|
+
|
|
155
|
+
# Build Claude Desktop .mcpb & .dxt bundles:
|
|
156
|
+
npm run package:mcpb
|
|
157
|
+
```
|
|
158
|
+
*(The production extension and CLI bundles are pre-compiled and self-contained; packaging produces `dis-gravity-1.2.0.vsix` immediately).*
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## ⚡ 60-Second Frictionless Setup Wizard (Recommended)
|
|
163
|
+
|
|
164
|
+
Dis-Gravity automates all tedious Discord developer configurations—Message Content intents, OAuth2 permissions, private `#dis-gravity` channel creation, owner whitelisting, and secure secret storage—in **under 90 seconds**. You only do **one manual thing**: paste your Discord bot token.
|
|
165
|
+
|
|
166
|
+
### For VS Code, Google Antigravity IDE & Cursor (Extension)
|
|
167
|
+
1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`).
|
|
168
|
+
2. Run **`Dis-Gravity: Run Setup Wizard`** (or click **⚡ Launch Setup Wizard** in the Dis-Gravity sidebar).
|
|
169
|
+
3. Paste your Discord bot token.
|
|
170
|
+
4. The wizard automatically enables **Message Content Intent** via Discord API, generates your invite link, configures a private locked `#dis-gravity` channel, whitelists your user ID, and connects securely via `SecretStorage`.
|
|
171
|
+
|
|
172
|
+
### For Standalone CLI, JetBrains, Neovim & Headless (CLI)
|
|
173
|
+
Run the interactive CLI wizard in any terminal:
|
|
174
|
+
```bash
|
|
175
|
+
npx dis-gravity setup
|
|
176
|
+
```
|
|
177
|
+
Dis-Gravity will inspect your bot, auto-enable intents, open the browser for server authorization, create `#dis-gravity`, and save credentials to `~/.dis-gravity/config.json` with strict `0600` permissions.
|
|
178
|
+
|
|
179
|
+
<details>
|
|
180
|
+
<summary><b>🛠️ Manual Setup Guide (Click to expand)</b></summary>
|
|
181
|
+
|
|
182
|
+
### Step 1: Create Your Discord Bot
|
|
183
|
+
|
|
184
|
+
1. Open the **[Discord Developer Portal](https://discord.com/developers/applications)** and sign in.
|
|
185
|
+
2. Click **New Application** (top right), enter `Dis-Gravity` (or your preferred name), and click **Create**.
|
|
186
|
+
3. In the left navigation, select **Bot**:
|
|
187
|
+
- Under **Build-A-Bot**, click **Reset Token** and copy the **Bot Token** (keep this secret!).
|
|
188
|
+
4. Scroll down to **Privileged Gateway Intents**:
|
|
189
|
+
> [!IMPORTANT]
|
|
190
|
+
> You **MUST** turn ON the following intents, otherwise Discord will silently drop message text and your bot will fail to process chat commands:
|
|
191
|
+
- ✅ **MESSAGE CONTENT INTENT** *(Required to read messages and slash prompts)*
|
|
192
|
+
- ✅ **SERVER MEMBERS INTENT** *(Recommended for user whitelist lookups)*
|
|
193
|
+
5. Click **Save Changes**.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### Step 2: Invite the Bot to Your Server
|
|
198
|
+
|
|
199
|
+
1. In the left navigation, go to **OAuth2** → **OAuth2 URL Generator**.
|
|
200
|
+
2. Under **Scopes**, select:
|
|
201
|
+
- ✅ `bot`
|
|
202
|
+
- ✅ `applications.commands` *(Required for native slash commands `/`)*
|
|
203
|
+
3. Under **Bot Permissions**, select:
|
|
204
|
+
- ✅ `Send Messages`
|
|
205
|
+
- ✅ `Create Public Threads`
|
|
206
|
+
- ✅ `Send Messages in Threads`
|
|
207
|
+
- ✅ `Embed Links`
|
|
208
|
+
- ✅ `Attach Files`
|
|
209
|
+
- ✅ `Read Message History`
|
|
210
|
+
- ✅ `Use Slash Commands`
|
|
211
|
+
4. Copy the generated **OAuth2 URL** at the bottom, paste it into your browser, choose your server, and click **Authorize**.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### Step 3: Retrieve Channel ID & User ID
|
|
216
|
+
|
|
217
|
+
1. In Discord, go to **User Settings** (⚙️ bottom left) → **Advanced** → turn **ON** **Developer Mode**.
|
|
218
|
+
2. Right-click the channel where you want Dis-Gravity to chat → click **Copy Channel ID**.
|
|
219
|
+
3. Right-click your own avatar/profile in the chat → click **Copy User ID** (used for security access control).
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
### Step 4: Configure Dis-Gravity in Your IDE
|
|
224
|
+
|
|
225
|
+
1. Open VS Code or Antigravity IDE with the Dis-Gravity extension installed.
|
|
226
|
+
2. Click the **Discord** icon in the Activity Bar (left sidebar) to open Dis-Gravity settings.
|
|
227
|
+
3. Fill in the fields:
|
|
228
|
+
- **Bot Token**: Paste the token from Step 1.
|
|
229
|
+
- **Channel ID**: Paste the Channel ID from Step 3.
|
|
230
|
+
- **Allowed Users**: Paste your Discord User ID from Step 3.
|
|
231
|
+
- **Agent Provider**: Choose `auto` (or `copilot`, `antigravity`, `cursor`, `windsurf`, `cli`).
|
|
232
|
+
4. Click **Save Settings** or reload your window (`Developer: Reload Window`). Both status dots will turn green:
|
|
233
|
+
- 🟢 **Discord: Connected**
|
|
234
|
+
- 🟢 **CDP / Agent: Connected**
|
|
235
|
+
|
|
236
|
+
</details>
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Connecting Your Specific IDE
|
|
241
|
+
|
|
242
|
+
### 1. Visual Studio Code & GitHub Copilot (Zero Port Required)
|
|
243
|
+
|
|
244
|
+
If you are using standard Visual Studio Code with GitHub Copilot Chat:
|
|
245
|
+
1. In settings, set `antigravity-discord.agentProvider` to `"copilot"`.
|
|
246
|
+
2. **Zero debug port is needed!** Dis-Gravity communicates directly via VS Code's native Language Model API (`vscode.lm`).
|
|
247
|
+
3. Dis-Gravity automatically activates an **autonomous ReAct tool loop** supporting `view_file`, `edit_file`, `run_command`, and `git_diff` with live step streaming and Discord confirmation buttons (`[ 🟢 Allow ]`, `[ 🔴 Deny ]`) for sensitive changes.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### 2. Google Antigravity, Cursor AI & Windsurf (Port 9000)
|
|
252
|
+
|
|
253
|
+
These IDEs drive agent chat via Chrome DevTools Protocol (CDP) and require launching the application with `--remote-debugging-port=9000`.
|
|
254
|
+
|
|
255
|
+
#### **Windows**
|
|
256
|
+
1. Right-click your desktop shortcut for Antigravity / Cursor / Windsurf → select **Properties**.
|
|
257
|
+
2. In the **Target** box, append ` --remote-debugging-port=9000` to the end of the path:
|
|
258
|
+
```text
|
|
259
|
+
"C:\Users\...\AppData\Local\Programs\Antigravity\Antigravity.exe" --remote-debugging-port=9000
|
|
260
|
+
```
|
|
261
|
+
3. Click **Apply** and launch the IDE from this shortcut.
|
|
262
|
+
|
|
263
|
+
#### **macOS**
|
|
264
|
+
Launch via Terminal or save a shell script / Automator app:
|
|
265
|
+
```bash
|
|
266
|
+
# Google Antigravity
|
|
267
|
+
open -a "Google Antigravity" --args --remote-debugging-port=9000
|
|
268
|
+
|
|
269
|
+
# Cursor
|
|
270
|
+
open -a "Cursor" --args --remote-debugging-port=9000
|
|
271
|
+
|
|
272
|
+
# Windsurf
|
|
273
|
+
open -a "Windsurf" --args --remote-debugging-port=9000
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### **Linux**
|
|
277
|
+
```bash
|
|
278
|
+
antigravity --remote-debugging-port=9000
|
|
279
|
+
# or cursor --remote-debugging-port=9000
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### 3. JetBrains, Neovim & Headless Servers (Standalone CLI Daemon)
|
|
285
|
+
|
|
286
|
+
Dis-Gravity includes a standalone, editor-agnostic daemon that runs in any terminal or remote SSH session:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Run instantly with npx:
|
|
290
|
+
npx dis-gravity --token="YOUR_BOT_TOKEN" --channel="CHANNEL_ID" --workspace="." --allowed-users="YOUR_USER_ID"
|
|
291
|
+
|
|
292
|
+
# Or run globally via npm:
|
|
293
|
+
npm install -g dis-gravity
|
|
294
|
+
dis-gravity --token="YOUR_BOT_TOKEN" --channel="CHANNEL_ID" --provider="cli"
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**CLI Daemon Flags:**
|
|
298
|
+
- `--token`, `-t`: Discord Bot Token (or `DISCORD_BOT_TOKEN` env var)
|
|
299
|
+
- `--channel`, `-c`: Discord Channel ID (or `DISCORD_CHANNEL_ID` env var)
|
|
300
|
+
- `--guild`, `-g`: Discord Guild ID for instant slash command registration
|
|
301
|
+
- `--allowed-users`, `-u`: Comma-separated Discord User IDs allowed to issue commands
|
|
302
|
+
- `--provider`, `-p`: AI engine (`cli`, `antigravity`, `cursor`, `windsurf`)
|
|
303
|
+
- `--workspace`, `-w`: Path to root workspace directory (defaults to current working directory)
|
|
304
|
+
- `--table-style`: Tabular style (`image`, `cards`, `rounded`, `boxed`, `ascii`)
|
|
305
|
+
- `--port`: Remote debugging CDP port (defaults to `9000`)
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### 4. Claude Desktop & Claude Code (Model Context Protocol / MCP)
|
|
310
|
+
|
|
311
|
+
Dis-Gravity provides a native MCP server (`mcp/server.js`) and Anthropic MCP bundle (`.mcpb` / `.dxt`). It allows Claude Desktop and Claude Code agents to proactively request approval directly on mobile Discord before running critical tools, as well as sending notifications to your channel:
|
|
312
|
+
|
|
313
|
+
- **`ask_discord_approval`**: Sends an interactive Discord embed with `[ 🟢 Allow ]` and `[ 🔴 Deny ]` buttons directly to your phone. Claude waits in real-time until you tap a button or timeout expires.
|
|
314
|
+
- **`notify_discord`**: Streams status updates, alerts, or completed agent summaries to your Discord channel.
|
|
315
|
+
- **`get_discord_bridge_status`**: Inspects Discord gateway latency, connected channel ID, and active permissions.
|
|
316
|
+
|
|
317
|
+
**Using with Claude Desktop:**
|
|
318
|
+
Double-click `dis-gravity-1.2.0.mcpb` to install the extension automatically, or configure your `claude_desktop_config.json`:
|
|
319
|
+
```json
|
|
320
|
+
{
|
|
321
|
+
"mcpServers": {
|
|
322
|
+
"dis-gravity": {
|
|
323
|
+
"command": "node",
|
|
324
|
+
"args": ["/path/to/Dis-Gravity/mcp/server.js"],
|
|
325
|
+
"env": {
|
|
326
|
+
"DISCORD_BOT_TOKEN": "YOUR_BOT_TOKEN",
|
|
327
|
+
"DISCORD_CHANNEL_ID": "YOUR_CHANNEL_ID",
|
|
328
|
+
"ALLOWED_USERS": "YOUR_DISCORD_USER_ID"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## 🛡️ Security Best Practices & Architecture (`allowedUsers`)
|
|
338
|
+
|
|
339
|
+
> [!CAUTION]
|
|
340
|
+
> **Never connect Dis-Gravity to a public or multi-user Discord channel without configuring `allowedUsers`!**
|
|
341
|
+
|
|
342
|
+
Dis-Gravity is engineered for high-security, privacy-conscious developer workflows with a **zero-inbound-ports threat model**:
|
|
343
|
+
|
|
344
|
+
- **🔒 Zero Inbound Listening Ports:** Operates 100% via outbound TLS WebSocket connections (`wss://gateway.discord.gg`). No open ports on your router, no port forwarding, no ngrok tunnels, and zero public IP exposure.
|
|
345
|
+
- **🛑 Strict Fail-Closed Authorization:** Every command, shortcut, and button click is verified against `allowedUsers` (`isUserAllowed`). Unlisted users are rejected immediately with an audit log.
|
|
346
|
+
- **🌐 Localhost-Only CDP Isolation:** Chrome DevTools Protocol connections for Google Antigravity, Cursor AI, and Windsurf are strictly bound to local loopback (`127.0.0.1:9000`) and never exposed to the network.
|
|
347
|
+
- **📂 Path Traversal Containment:** All filesystem operations (`/cat`, `/open`, `/diff`, `/tree`) pass through `safeResolveWorkspacePath` to prevent directory traversal outside workspace boundaries.
|
|
348
|
+
- **🔐 Local Credential Storage:** Bot tokens are stored locally in `~/.dis-gravity/config.json` with restricted file permissions (`0o600`). Dis-Gravity transmits zero telemetry to third-party servers.
|
|
349
|
+
|
|
350
|
+
For comprehensive threat model details, comparative security analysis, and vulnerability disclosure policies, see **[SECURITY.md](SECURITY.md)**.
|
|
351
|
+
|
|
352
|
+
1. **Always configure `allowedUsers`**: Enter your Discord User ID (e.g. `123456789012345678`). Multiple authorized users can be separated by commas (`123456789,987654321`). Unauthorized users and unconfigured environments receive an explicit rejection notice.
|
|
353
|
+
2. **Use a Private Channel**: Dedicate a private Discord text channel accessible only to you and the bot.
|
|
354
|
+
3. **Interactive Approvals**: File modifications and terminal executions in Copilot / CLI modes prompt you with interactive `[ 🟢 Allow ]` and `[ 🔴 Deny ]` buttons before changes take effect.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## 🌟 Key Features
|
|
359
|
+
|
|
360
|
+
### 🖼️ High-Resolution Visual Table Image Cards (`/table`, `!table`)
|
|
361
|
+
Discord mobile apps suffer from a notorious line-wrapping bug that scrambles monospaced ASCII tables into unreadable text blocks. Dis-Gravity dynamically converts Markdown tables into **high-resolution 2x retina PNG cards** rendered natively in Discord messages, complete with dark theme styling, zebra rows, bold headers, colored status chips (`#57f287` green, `#fee75c` yellow, `#ed4245` red), full-color emojis, and pinch-to-zoom support. Features headless browser fallback (`msedge`/`chrome`) for environments without CDP ports.
|
|
362
|
+
|
|
363
|
+
### 🎮 1-Click Command Palette (`/palette`, `/action`)
|
|
364
|
+
Execute any of VS Code's 1,000+ commands remotely from your phone with 1 tap. Pre-built buttons across Developer (Reload Window, Restart Extension Host), Terminal (New, Toggle, Kill), Files (Save All, Close All), and Git (Sync, Pull, Push), plus live autocomplete search for any IDE command.
|
|
365
|
+
|
|
366
|
+
### 💻 Remote Shell & Git Suite (`/sh`, `/git`, `/diff`)
|
|
367
|
+
Execute terminal commands in your workspace root (`/sh npm test`), inspect syntax-highlighted stdout/stderr with exit codes and execution duration, review git status (`/git status`), browse colored unified diffs (`/diff`), stage all changes, and export `.patch` files.
|
|
368
|
+
|
|
369
|
+
### 📁 Remote File Explorer & Slicer (`/cat`, `/tree`, `/open`)
|
|
370
|
+
Read files with syntax highlighting and line numbers (`/cat src/index.js 1 50`), inspect visual directory trees (`/tree src 2`), or open files directly in your desktop IDE editor tabs remotely (`/open README.md`).
|
|
371
|
+
|
|
372
|
+
### 📦 Artifact Discovery & Download (`/artifact`, `/get`)
|
|
373
|
+
Browse and download AI-generated walkthroughs, architectural plans, patch files, diagrams, or workspace assets directly in Discord with interactive dropdown menus and path-traversal security protection.
|
|
374
|
+
|
|
375
|
+
### ⏳ Live Step Streaming & Observability
|
|
376
|
+
Replaces static wait timers with real-time DOM step updates: `⏳ Working (18s): 🔍 Viewing file package.json`, `⚡ Running command npm test`, `💭 Thinking...`.
|
|
377
|
+
|
|
378
|
+
### 🖥️ Host Health & Workspace Dashboard (`/info`, `/workspace`)
|
|
379
|
+
Check active workspace, git branch, dirty file count, open editor tabs, host OS, CPU load, memory utilization, and uptime directly from chat.
|
|
380
|
+
|
|
381
|
+
### ⏰ Scheduled & Cron Prompts (`/schedule`, `!schedule`)
|
|
382
|
+
Schedule one-shot delayed prompts (`15m`, `2h`, `in 30m`), recurring intervals (`every 30m`, `@hourly`, `@daily`), or standard 5-field cron expressions (`0 9 * * 1-5`, `*/15 * * * *`) directly from Discord. Automatically triggers AI prompts or `/sh` commands at the scheduled time with 1-tap `[ 🛑 Cancel ]` buttons.
|
|
383
|
+
|
|
384
|
+
### 🧵 Thread-per-Session & Multi-Workspace Mapping (`/bind`, `/threads`)
|
|
385
|
+
Bind individual Discord threads to dedicated local project directories (`/bind workspace:/path/to/repo`) so `/sh`, `/git`, `/diff`, `/cat`, `/tree`, and AI prompts inside each thread execute isolated against that thread's bound workspace without colliding.
|
|
386
|
+
|
|
387
|
+
### 🎙️ Mobile Voice Messages & Voicecoding
|
|
388
|
+
Send a native Discord mobile voice message (or audio attachment `.ogg`, `.mp3`, `.wav`, `.m4a`) in your channel or thread. Dis-Gravity automatically transcribes your voice prompt using OpenAI/Groq Whisper API (`OPENAI_API_KEY` / `GROQ_API_KEY` / `antigravity-discord.whisperApiKey`), local Whisper CLI (`whisper-cli` / `whisper`), or Windows native `System.Speech`, posts the transcription, and executes the prompt or command hands-free.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## ⌨️ Slash Commands & Text Shortcuts
|
|
393
|
+
|
|
394
|
+
| Command | Chat Shortcut | Description |
|
|
395
|
+
|---|---|---|
|
|
396
|
+
| `/home` | `!home`, `!dash` | Dis-Gravity Mission Control Cockpit (1-tap remote dashboard) |
|
|
397
|
+
| `/plan <prompt>` | `!plan <prompt>` | Activates Planning Mode with auto-thread isolation & chip |
|
|
398
|
+
| `/goal <prompt>` | `!goal <prompt>` | Activates Goal Mode with autonomous execution instructions |
|
|
399
|
+
| `/grill <prompt>` | `!grill <prompt>` | Activates Alignment Interview mode |
|
|
400
|
+
| `/sh <cmd>` | `!sh <cmd>` or `$ <cmd>` | Execute shell command with contextual follow-up action buttons |
|
|
401
|
+
| `/git [status\|diff\|log]` | `!git [subcommand]` | Remote Git repository management |
|
|
402
|
+
| `/diff [file] [staged]` | `!diff` | 2x Retina Visual Diff card with 1-tap Stage/Push/Review |
|
|
403
|
+
| `/cat <path> [start] [end]` | `!cat <path>` | Read file contents with syntax highlighting |
|
|
404
|
+
| `/tree [dir] [depth]` | `!tree` | Visual workspace directory tree |
|
|
405
|
+
| `/open <path>` | `!open <path>` | Open file in active desktop IDE editor tab |
|
|
406
|
+
| `/palette [category]` | `!palette` | 1-click command palette dashboard |
|
|
407
|
+
| `/action <command>` | `!run <id>` | Trigger any IDE command with live autocomplete |
|
|
408
|
+
| `/info` | `!info`, `!workspace` | Host hardware, CPU, memory & workspace health |
|
|
409
|
+
| `/status` | `!status` | Bridge connection status, model & queue health |
|
|
410
|
+
| `/models` | `!models` | Interactive AI model selector dropdown |
|
|
411
|
+
| `/effort <level>` | `!effort <level>`, `!high` | Reasoning effort switcher (Low, Medium, High) |
|
|
412
|
+
| `/table [style]` | `!table [style]` | Tabular style switcher (`image`, `cards`, `rounded`, `boxed`, `ascii`) |
|
|
413
|
+
| `/artifact [name]` | `!artifact` | Browse and download AI-generated artifacts |
|
|
414
|
+
| `/get <path>` | `!get <path>` | Download file from workspace or brain directory |
|
|
415
|
+
| `/stop` | `!stop`, `cancel` | Emergency abort running AI generation |
|
|
416
|
+
| `/new` | `!new` | Clear conversation history and reset context |
|
|
417
|
+
| `/schedule <when> [prompt]` | `!schedule <spec> \| <prompt>` | Schedule one-shot delays (`15m`), intervals (`every 1h`), or cron tasks (`0 9 * * 1-5`) |
|
|
418
|
+
| `/bind [workspace]` | `!bind [path\|unbind]` | Bind current Discord thread to a dedicated project directory |
|
|
419
|
+
| `/threads` | `!threads` | List all active Discord thread-to-workspace bindings |
|
|
420
|
+
| `/help` | `!help` | Display command help guide |
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## ⚙️ Configuration Reference
|
|
425
|
+
|
|
426
|
+
Configure via VS Code Settings GUI or in `.vscode/settings.json`:
|
|
427
|
+
|
|
428
|
+
```json
|
|
429
|
+
{
|
|
430
|
+
"antigravity-discord.botToken": "YOUR_DISCORD_BOT_TOKEN",
|
|
431
|
+
"antigravity-discord.channelId": "YOUR_DISCORD_CHANNEL_ID",
|
|
432
|
+
"antigravity-discord.allowedUsers": "123456789012345678",
|
|
433
|
+
"antigravity-discord.agentProvider": "auto",
|
|
434
|
+
"antigravity-discord.tableStyle": "image",
|
|
435
|
+
"antigravity-discord.autoAttachTableImages": true,
|
|
436
|
+
"antigravity-discord.debugPort": 9000,
|
|
437
|
+
"antigravity-discord.cursorPort": 9000,
|
|
438
|
+
"antigravity-discord.windsurfPort": 9000,
|
|
439
|
+
"antigravity-discord.cliAgentPath": "auto",
|
|
440
|
+
"antigravity-discord.enableCopilotReAct": true,
|
|
441
|
+
"antigravity-discord.copilotMaxToolSteps": 10,
|
|
442
|
+
"antigravity-discord.renderVisualDiffs": true,
|
|
443
|
+
"antigravity-discord.autoThreadTasks": true,
|
|
444
|
+
"antigravity-discord.voiceConfirmationGuard": true,
|
|
445
|
+
"antigravity-discord.urgentMentionOnApproval": true
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## ❓ Troubleshooting & FAQ
|
|
452
|
+
|
|
453
|
+
#### 1. "The bot is online in Discord, but it doesn't respond to messages."
|
|
454
|
+
- **Root Cause**: The **Message Content Intent** is disabled in the Discord Developer Portal.
|
|
455
|
+
- **Fix**: Go to [Discord Developer Portal](https://discord.com/developers/applications) → select your Application → **Bot** tab → under **Privileged Gateway Intents**, turn **ON** **MESSAGE CONTENT INTENT** → click **Save Changes**.
|
|
456
|
+
|
|
457
|
+
#### 2. "Bridge Status shows 🔴 Disconnected."
|
|
458
|
+
- **If using Antigravity, Cursor, or Windsurf**: Launch the IDE with `--remote-debugging-port=9000` (see instructions [above](#2-google-antigravity-cursor-ai--windsurf-port-9000)).
|
|
459
|
+
- **If using standard VS Code**: Change `antigravity-discord.agentProvider` to `"copilot"` in settings. It connects natively via `vscode.lm` with zero ports required.
|
|
460
|
+
|
|
461
|
+
#### 3. "I received `⛔ Unauthorized: Your Discord User ID is not on the whitelist`."
|
|
462
|
+
- Right-click your profile in Discord → click **Copy User ID**. Open Dis-Gravity settings in the IDE and paste your User ID into **Allowed Users**.
|
|
463
|
+
|
|
464
|
+
#### 4. "My table columns are wrapping into a jumble on my mobile phone."
|
|
465
|
+
- Run `/table image` or `!table image` in Discord. Dis-Gravity will automatically render tables into high-DPI visual PNG image cards that display cleanly without text wrapping on any screen size.
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## 📄 License
|
|
470
|
+
|
|
471
|
+
MIT © [Anon King](https://gitlab.com/rethinakumarsambath8/dis-gravity)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Dis-Gravity Security Policy & Architecture
|
|
2
|
+
|
|
3
|
+
Dis-Gravity is designed from the ground up for high-security, privacy-conscious developer workflows. When connecting an IDE and agentic coding environment to an external messaging platform like Discord, execution boundaries, credential handling, and network isolation are critical.
|
|
4
|
+
|
|
5
|
+
This document outlines Dis-Gravity's threat model, security architecture, fail-closed authorization, and responsible disclosure policy.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🛡️ Core Security Architecture
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ DEVELOPER LOCAL MACHINE │
|
|
14
|
+
│ │
|
|
15
|
+
│ ┌─────────────────────────┐ ┌─────────────────────────────┐ │
|
|
16
|
+
│ │ Desktop IDE / Agent │ │ Dis-Gravity Engine │ │
|
|
17
|
+
│ │ (Antigravity / Cursor / │◄── CDP ──┤ - Snowflake Allowlist │ │
|
|
18
|
+
│ │ VS Code / Windsurf) │:9000 │ - Path Traversal Guard │ │
|
|
19
|
+
│ └─────────────────────────┘(local) │ - Shell Buffer Limits │ │
|
|
20
|
+
│ └──────────────┬──────────────┘ │
|
|
21
|
+
│ │ │
|
|
22
|
+
│ Outbound TLS │ (ZERO INBOUND │
|
|
23
|
+
│ WebSocket WSS │ OPEN PORTS) │
|
|
24
|
+
└──────────────────────────────────────────────────────┼─────────────────┘
|
|
25
|
+
│
|
|
26
|
+
▼
|
|
27
|
+
┌─────────────────────┐
|
|
28
|
+
│ Discord Gateway │
|
|
29
|
+
│ (discord.gg / API) │
|
|
30
|
+
└──────────┬──────────┘
|
|
31
|
+
│
|
|
32
|
+
▼
|
|
33
|
+
┌─────────────────────┐
|
|
34
|
+
│ Mobile Discord App │
|
|
35
|
+
│ (Authorized User) │
|
|
36
|
+
└─────────────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 1. Zero Inbound Listening Ports
|
|
40
|
+
* **Outbound-Only Ingress:** Dis-Gravity establishes a persistent, TLS-encrypted outbound WebSocket connection (`wss://gateway.discord.gg`) to the Discord Gateway.
|
|
41
|
+
* **No Open Ports on WAN:** Dis-Gravity **never** opens an inbound TCP/UDP port on your host router or public network. It does not require port forwarding, ngrok tunnels, reverse proxies, or dynamic DNS.
|
|
42
|
+
* **Attack Surface Reduction:** External port scanners, automated botnets, and local network peers cannot probe or connect to Dis-Gravity because there is no listening network socket.
|
|
43
|
+
|
|
44
|
+
### 2. Strict Fail-Closed Authorization (`allowedUsers`)
|
|
45
|
+
* **Snowflake ID Verification:** Every incoming interaction (slash commands, text shortcuts, button clicks, modal submissions, thread creations) is verified against `allowedUsers` in `lib/core.js` (`isUserAllowed`).
|
|
46
|
+
* **Fail-Closed Default:** If `allowedUsers` is empty, unconfigured, or contains an unverified ID, access is **strictly denied immediately**. The command is dropped and never reaches the shell or the IDE.
|
|
47
|
+
* **Channel Partitioning:** During onboarding (`dis-gravity setup`), Dis-Gravity automatically configures strict channel permission overwrites, hiding the bot control channel from `@everyone` and granting access solely to your specific user account.
|
|
48
|
+
|
|
49
|
+
### 3. Localhost-Only CDP Isolation (Chrome DevTools Protocol)
|
|
50
|
+
* **Loopback Binding Only:** For IDEs that utilize Chrome DevTools Protocol (Google Antigravity, Cursor AI, Windsurf), Dis-Gravity communicates strictly over local loopback (`127.0.0.1:9000`).
|
|
51
|
+
* **No Remote CDP Exposure:** CDP is never bridged over the network. Only the local Dis-Gravity process running on the host machine connects to the IDE's debugging port.
|
|
52
|
+
* **Deterministic Native Clicks:** Approvals (such as "Always Allow" or "Allow Once") are resolved through precise DOM inspection and native mouse click injection. Dis-Gravity never executes arbitrary scripts inside the IDE's webview sandbox.
|
|
53
|
+
|
|
54
|
+
### 4. Filesystem Boundary & Path Traversal Containment
|
|
55
|
+
* **Safe Path Resolution:** All filesystem inspection commands (`/cat`, `/open`, `/diff`, `/tree`, `/get`) pass through `safeResolveWorkspacePath(workspaceRoot, targetPath)`.
|
|
56
|
+
* **Escaped Path Rejection:** If a relative path or symlink attempts to traverse outside the bounded workspace directory (e.g., `../../etc/passwd` or `..\\Windows\\System32`), Dis-Gravity throws an explicit error and rejects the request.
|
|
57
|
+
* **Thread-Bound Sandboxes:** When using thread-to-workspace mapping (`/bind`), commands executed in that thread are strictly anchored to the assigned directory.
|
|
58
|
+
|
|
59
|
+
### 5. Safe Shell Subprocess Execution
|
|
60
|
+
* **Hard Timeouts:** Shell commands dispatched via `/sh` or `!sh` are governed by a strict timeout (default: 30 seconds) to prevent runaway or hanging processes.
|
|
61
|
+
* **Buffer Overflow Prevention:** Subprocess outputs are capped at a maximum buffer of 10 MB (`maxBuffer`) to prevent memory exhaustion and denial-of-service on the host machine.
|
|
62
|
+
* **Destructive Keyword Warnings:** Dis-Gravity heuristics detect dangerous operations (`rm -rf`, `mkfs`, `format`, `dd`) and require explicit interactive confirmation before execution.
|
|
63
|
+
|
|
64
|
+
### 6. Local Credential Isolation
|
|
65
|
+
* **Local Storage Only:** Your Discord bot token and preferences are stored locally on your machine at `~/.dis-gravity/config.json`.
|
|
66
|
+
* **Strict File Permissions:** Configuration files are saved with restricted filesystem permissions (`0o600`).
|
|
67
|
+
* **Zero External Telemetry:** Dis-Gravity does **not** transmit your bot tokens, workspace code, command histories, diffs, or prompts to any external third-party analytics, metrics, or telemetry servers.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🔍 Comparison: Dis-Gravity vs. Insecure Bridge Architectures
|
|
72
|
+
|
|
73
|
+
| Security Vector | Insecure / Unaudited Bridges | Dis-Gravity Architecture |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| **Installation Hooks** | Risky npm `postinstall` scripts that download remote binaries or patch system files | **Zero postinstall scripts.** Pure npm/VS Code standard extension packaging. |
|
|
76
|
+
| **Network Ingress** | Exposes HTTP webhooks, ngrok tunnels, or open WAN ports | **Zero inbound open ports.** 100% outbound TLS WebSocket via Discord.js Gateway. |
|
|
77
|
+
| **User Authorization** | Checks username strings or allows any user in the Discord server | **Fail-closed Discord snowflake ID check.** Cryptographically unforgeable user ID. |
|
|
78
|
+
| **Filesystem Access** | Unrestricted `fs.readFile` allowing full disk access | **`safeResolveWorkspacePath`** strictly enforces directory boundaries. |
|
|
79
|
+
| **Code Execution** | Unchecked background auto-execution | **Explicit 1-tap interactive approvals**; dangerous commands flagged before running. |
|
|
80
|
+
| **Telemetry & Leaks** | Sends tokens or telemetry to creator's backend | **Zero third-party telemetry.** All communication stays strictly between you and Discord. |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## ⚙️ Recommended Security Practices for Users
|
|
85
|
+
|
|
86
|
+
1. **Keep Your Bot Private:** When creating your bot in the [Discord Developer Portal](https://discord.com/developers/applications), ensure **"Public Bot"** is unchecked so third parties cannot invite your bot to other servers.
|
|
87
|
+
2. **Restrict Bot Intents:** Dis-Gravity only requires **Message Content Intent** to process your typed commands and voice messages. It does not require Server Members Intent or Presence Intent.
|
|
88
|
+
3. **Use Dedicated Channels:** Create a private server or private channel accessible only to you. Do not run Dis-Gravity in shared public Discord channels.
|
|
89
|
+
4. **Never Commit Your Bot Token:** Keep your Discord bot token strictly in `~/.dis-gravity/config.json` or as an environment variable (`DISGRAVITY_BOT_TOKEN`). Never commit it to git repositories.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🚨 Reporting a Vulnerability
|
|
94
|
+
|
|
95
|
+
We take the security of Dis-Gravity seriously. If you discover a security vulnerability, please do **not** open a public issue.
|
|
96
|
+
|
|
97
|
+
Instead, please report it via one of the following confidential channels:
|
|
98
|
+
* **Private GitLab Vulnerability Report:** Submit a confidential vulnerability advisory through [Dis-Gravity Security Advisories](https://gitlab.com/rethinakumarsambath8/dis-gravity/-/security/advisories/new).
|
|
99
|
+
* **Direct Email:** Send an encrypted email with reproduction steps to `rethinakumarsambath8@gmail.com`.
|
|
100
|
+
|
|
101
|
+
### Response SLA
|
|
102
|
+
* **Initial Response:** Within 24 hours of receipt.
|
|
103
|
+
* **Assessment & Triage:** Within 48 hours.
|
|
104
|
+
* **Patch & Coordinated Disclosure:** Within 7 business days for critical vulnerabilities.
|
|
105
|
+
|