dis-gravity 0.0.0-stage → 1.1.0

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/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,313 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="media/icon.png" width="140" alt="Dis-Gravity Logo" />
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">Dis-Gravity</h1>
6
+
7
+ <p align="center">
8
+ <strong>The Ultimate Multi-IDE Discord Remote Bridge & AI Coding Interface</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="#supported-ides"><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="#installation"><img src="https://img.shields.io/badge/VS%20Code-v1.93+-007acc?style=flat-square&logo=visualstudiocode" alt="VS Code Version"></a>
14
+ <a href="LICENSE.txt"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="MIT License"></a>
15
+ <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>
16
+ </p>
17
+
18
+ ---
19
+
20
+ > **Control your IDE, AI assistant, shell, and git repo directly from Discord on mobile, tablet, or secondary machines.**
21
+ > Send prompts, approve tool executions, inspect real-time streaming steps, run terminal commands, view colored git diffs, download artifacts, and receive retina-crisp visual PNG table cards anywhere you go.
22
+
23
+ ---
24
+
25
+ <p align="center">
26
+ <img src="media/dis-gravity-demo.gif" width="860" alt="Dis-Gravity Live Split-Screen Demo" />
27
+ </p>
28
+
29
+ ---
30
+
31
+ ## 📑 Table of Contents
32
+
33
+ - [Supported IDEs & Environments](#supported-ides--environments)
34
+ - [🚀 3-Minute Quickstart Guide](#-3-minute-quickstart-guide)
35
+ - [Step 1: Create Your Discord Bot](#step-1-create-your-discord-bot)
36
+ - [Step 2: Invite the Bot to Your Server](#step-2-invite-the-bot-to-your-server)
37
+ - [Step 3: Retrieve Channel ID & User ID](#step-3-retrieve-channel-id--user-id)
38
+ - [Step 4: Configure Dis-Gravity in Your IDE](#step-4-configure-dis-gravity-in-your-ide)
39
+ - [Connecting Your Specific IDE](#connecting-your-specific-ide)
40
+ - [Visual Studio Code & Copilot (Zero Port Required)](#1-visual-studio-code--github-copilot-zero-port-required)
41
+ - [Google Antigravity, Cursor AI & Windsurf (Port 9000)](#2-google-antigravity-cursor-ai--windsurf-port-9000)
42
+ - [JetBrains, Neovim & Headless Servers (Standalone CLI Daemon)](#3-jetbrains-neovim--headless-servers-standalone-cli-daemon)
43
+ - [🛡️ Security Best Practices (`allowedUsers`)](#️-security-best-practices-allowedusers)
44
+ - [🌟 Key Features](#-key-features)
45
+ - [⌨️ Slash Commands & Text Shortcuts](#️-slash-commands--text-shortcuts)
46
+ - [⚙️ Configuration Reference](#️-configuration-reference)
47
+ - [❓ Troubleshooting & FAQ](#-troubleshooting--faq)
48
+
49
+ ---
50
+
51
+ ## Supported IDEs & Environments
52
+
53
+ | IDE / Environment | Provider Mode (`agentProvider`) | Connection Type | Autonomous Tools |
54
+ |---|---|---|---|
55
+ | **Google Antigravity** | `antigravity` or `auto` | CDP (`:9000`) | Native IDE Agent + Approval Dialogs + Lexical Mode Chips |
56
+ | **VS Code + GitHub Copilot** | `copilot` or `auto` | Native `vscode.lm` | Autonomous ReAct Loop (`view`, `edit`, `sh`, `git`, `tree`) |
57
+ | **Cursor AI** | `cursor` or `auto` | CDP (`:9000`) | Composer & Chat (`/plan`, `/edit`, `@Codebase`) |
58
+ | **Windsurf** | `windsurf` or `auto` | CDP (`:9000`) | Cascade Chat Webview with deep iframe traversal |
59
+ | **JetBrains / Neovim / Headless** | `cli` (`bin/dis-gravity.js`) | Subprocess / PTY | Universal CLI (`agy`, `claude`, `aider`, `shell`) |
60
+
61
+ ---
62
+
63
+ ## 🚀 3-Minute Quickstart Guide
64
+
65
+ ### Step 1: Create Your Discord Bot
66
+
67
+ 1. Open the **[Discord Developer Portal](https://discord.com/developers/applications)** and sign in.
68
+ 2. Click **New Application** (top right), enter `Dis-Gravity` (or your preferred name), and click **Create**.
69
+ 3. In the left navigation, select **Bot**:
70
+ - Under **Build-A-Bot**, click **Reset Token** and copy the **Bot Token** (keep this secret!).
71
+ 4. Scroll down to **Privileged Gateway Intents**:
72
+ > [!IMPORTANT]
73
+ > You **MUST** turn ON the following intents, otherwise Discord will silently drop message text and your bot will fail to process chat commands:
74
+ - ✅ **MESSAGE CONTENT INTENT** *(Required to read messages and slash prompts)*
75
+ - ✅ **SERVER MEMBERS INTENT** *(Recommended for user whitelist lookups)*
76
+ 5. Click **Save Changes**.
77
+
78
+ ---
79
+
80
+ ### Step 2: Invite the Bot to Your Server
81
+
82
+ 1. In the left navigation, go to **OAuth2** → **OAuth2 URL Generator**.
83
+ 2. Under **Scopes**, select:
84
+ - ✅ `bot`
85
+ - ✅ `applications.commands` *(Required for native slash commands `/`)*
86
+ 3. Under **Bot Permissions**, select:
87
+ - ✅ `Send Messages`
88
+ - ✅ `Create Public Threads`
89
+ - ✅ `Send Messages in Threads`
90
+ - ✅ `Embed Links`
91
+ - ✅ `Attach Files`
92
+ - ✅ `Read Message History`
93
+ - ✅ `Use Slash Commands`
94
+ 4. Copy the generated **OAuth2 URL** at the bottom, paste it into your browser, choose your server, and click **Authorize**.
95
+
96
+ ---
97
+
98
+ ### Step 3: Retrieve Channel ID & User ID
99
+
100
+ 1. In Discord, go to **User Settings** (⚙️ bottom left) → **Advanced** → turn **ON** **Developer Mode**.
101
+ 2. Right-click the channel where you want Dis-Gravity to chat → click **Copy Channel ID**.
102
+ 3. Right-click your own avatar/profile in the chat → click **Copy User ID** (used for security access control).
103
+
104
+ ---
105
+
106
+ ### Step 4: Configure Dis-Gravity in Your IDE
107
+
108
+ 1. Open VS Code or Antigravity IDE with the Dis-Gravity extension installed.
109
+ 2. Click the **Discord** icon in the Activity Bar (left sidebar) to open Dis-Gravity settings.
110
+ 3. Fill in the fields:
111
+ - **Bot Token**: Paste the token from Step 1.
112
+ - **Channel ID**: Paste the Channel ID from Step 3.
113
+ - **Allowed Users**: Paste your Discord User ID from Step 3.
114
+ - **Agent Provider**: Choose `auto` (or `copilot`, `antigravity`, `cursor`, `windsurf`, `cli`).
115
+ 4. Click **Save Settings** or reload your window (`Developer: Reload Window`). Both status dots will turn green:
116
+ - 🟢 **Discord: Connected**
117
+ - 🟢 **CDP / Agent: Connected**
118
+
119
+ ---
120
+
121
+ ## Connecting Your Specific IDE
122
+
123
+ ### 1. Visual Studio Code & GitHub Copilot (Zero Port Required)
124
+
125
+ If you are using standard Visual Studio Code with GitHub Copilot Chat:
126
+ 1. In settings, set `antigravity-discord.agentProvider` to `"copilot"`.
127
+ 2. **Zero debug port is needed!** Dis-Gravity communicates directly via VS Code's native Language Model API (`vscode.lm`).
128
+ 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.
129
+
130
+ ---
131
+
132
+ ### 2. Google Antigravity, Cursor AI & Windsurf (Port 9000)
133
+
134
+ These IDEs drive agent chat via Chrome DevTools Protocol (CDP) and require launching the application with `--remote-debugging-port=9000`.
135
+
136
+ #### **Windows**
137
+ 1. Right-click your desktop shortcut for Antigravity / Cursor / Windsurf → select **Properties**.
138
+ 2. In the **Target** box, append ` --remote-debugging-port=9000` to the end of the path:
139
+ ```text
140
+ "C:\Users\...\AppData\Local\Programs\Antigravity\Antigravity.exe" --remote-debugging-port=9000
141
+ ```
142
+ 3. Click **Apply** and launch the IDE from this shortcut.
143
+
144
+ #### **macOS**
145
+ Launch via Terminal or save a shell script / Automator app:
146
+ ```bash
147
+ # Google Antigravity
148
+ open -a "Google Antigravity" --args --remote-debugging-port=9000
149
+
150
+ # Cursor
151
+ open -a "Cursor" --args --remote-debugging-port=9000
152
+
153
+ # Windsurf
154
+ open -a "Windsurf" --args --remote-debugging-port=9000
155
+ ```
156
+
157
+ #### **Linux**
158
+ ```bash
159
+ antigravity --remote-debugging-port=9000
160
+ # or cursor --remote-debugging-port=9000
161
+ ```
162
+
163
+ ---
164
+
165
+ ### 3. JetBrains, Neovim & Headless Servers (Standalone CLI Daemon)
166
+
167
+ Dis-Gravity includes a standalone, editor-agnostic daemon that runs in any terminal or remote SSH session:
168
+
169
+ ```bash
170
+ # Run directly via Node.js
171
+ node bin/dis-gravity.js --token="YOUR_BOT_TOKEN" --channel="CHANNEL_ID" --workspace="." --allowed-users="YOUR_USER_ID"
172
+ ```
173
+
174
+ Or install globally / link:
175
+ ```bash
176
+ npm link
177
+ dis-gravity --token="YOUR_BOT_TOKEN" --channel="CHANNEL_ID" --provider="cli"
178
+ ```
179
+
180
+ **CLI Daemon Flags:**
181
+ - `--token`, `-t`: Discord Bot Token (or `DISCORD_BOT_TOKEN` env var)
182
+ - `--channel`, `-c`: Discord Channel ID (or `DISCORD_CHANNEL_ID` env var)
183
+ - `--guild`, `-g`: Discord Guild ID for instant slash command registration
184
+ - `--allowed-users`, `-u`: Comma-separated Discord User IDs allowed to issue commands
185
+ - `--provider`, `-p`: AI engine (`cli`, `antigravity`, `cursor`, `windsurf`)
186
+ - `--workspace`, `-w`: Path to root workspace directory (defaults to current working directory)
187
+ - `--table-style`: Tabular style (`image`, `cards`, `rounded`, `boxed`, `ascii`)
188
+
189
+ ---
190
+
191
+ ## 🛡️ Security Best Practices (`allowedUsers`)
192
+
193
+ > [!CAUTION]
194
+ > **Never connect Dis-Gravity to a public or multi-user Discord channel without configuring `allowedUsers`!**
195
+
196
+ Because Dis-Gravity allows remote terminal execution (`/sh`) and file reading (`/cat`), anyone with access to the channel can execute commands on your host workstation if `allowedUsers` is empty.
197
+
198
+ 1. **Always configure `allowedUsers`**: Enter your Discord User ID (e.g. `123456789012345678`). Multiple authorized users can be separated by commas (`123456789,987654321`).
199
+ 2. **Use a Private Channel**: Dedicate a private Discord text channel accessible only to you and the bot.
200
+ 3. **Interactive Approvals**: File modifications and terminal executions in Copilot / CLI modes prompt you with interactive `[ 🟢 Allow ]` and `[ 🔴 Deny ]` buttons before changes take effect.
201
+
202
+ ---
203
+
204
+ ## 🌟 Key Features
205
+
206
+ ### 🖼️ High-Resolution Visual Table Image Cards (`/table`, `!table`)
207
+ Discord mobile apps suffer from a notorious line-wrapping bug that scrambled 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.
208
+
209
+ ### 🎮 1-Click Command Palette (`/palette`, `/action`)
210
+ 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.
211
+
212
+ ### 💻 Remote Shell & Git Suite (`/sh`, `/git`, `/diff`)
213
+ 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.
214
+
215
+ ### 📁 Remote File Explorer & Slicer (`/cat`, `/tree`, `/open`)
216
+ 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`).
217
+
218
+ ### 📦 Artifact Discovery & Download (`/artifact`, `/get`)
219
+ 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.
220
+
221
+ ### ⏳ Live Step Streaming & Observability
222
+ Replaces static wait timers with real-time DOM step updates: `⏳ Working (18s): 🔍 Viewing file package.json`, `⚡ Running command npm test`, `💭 Thinking...`.
223
+
224
+ ---
225
+
226
+ ## ⌨️ Slash Commands & Text Shortcuts
227
+
228
+ | Command | Chat Shortcut | Description |
229
+ |---|---|---|
230
+ | `/plan <prompt>` | `!plan <prompt>` | Activates Planning Mode with native IDE chip |
231
+ | `/goal <prompt>` | `!goal <prompt>` | Activates Goal Mode with autonomous execution instructions |
232
+ | `/grill <prompt>` | `!grill <prompt>` | Activates Alignment Interview mode |
233
+ | `/sh <cmd>` | `!sh <cmd>` or `$ <cmd>` | Execute shell command in workspace root |
234
+ | `/git [status\|diff\|log]` | `!git [subcommand]` | Remote Git repository management |
235
+ | `/diff [file] [staged]` | `!diff` | Colored git diff inspector with 1-tap Stage/Push |
236
+ | `/cat <path> [start] [end]` | `!cat <path>` | Read file contents with syntax highlighting |
237
+ | `/tree [dir] [depth]` | `!tree` | Visual workspace directory tree |
238
+ | `/open <path>` | `!open <path>` | Open file in active desktop IDE editor tab |
239
+ | `/palette [category]` | `!palette` | 1-click command palette dashboard |
240
+ | `/action <command>` | `!run <id>` | Trigger any IDE command with live autocomplete |
241
+ | `/info` | `!info`, `!workspace` | Host hardware, CPU, memory & workspace health |
242
+ | `/status` | `!status` | Bridge connection status, model & queue health |
243
+ | `/models` | `!models` | Interactive AI model selector dropdown |
244
+ | `/effort <level>` | `!effort <level>`, `!high` | Reasoning effort switcher (Low, Medium, High) |
245
+ | `/table [style]` | `!table [style]` | Tabular style switcher (`image`, `cards`, `rounded`, `boxed`, `ascii`) |
246
+ | `/artifact [name]` | `!artifact` | Browse and download AI-generated artifacts |
247
+ | `/get <path>` | `!get <path>` | Download file from workspace or brain directory |
248
+ | `/stop` | `!stop`, `cancel` | Emergency abort running AI generation |
249
+ | `/new` | `!new` | Clear conversation history and reset context |
250
+ | `/help` | `!help` | Display command help guide |
251
+
252
+ ---
253
+
254
+ ## ⚙️ Configuration Reference
255
+
256
+ Configure via VS Code Settings GUI or in `.vscode/settings.json`:
257
+
258
+ ```json
259
+ {
260
+ "antigravity-discord.botToken": "YOUR_DISCORD_BOT_TOKEN",
261
+ "antigravity-discord.channelId": "YOUR_DISCORD_CHANNEL_ID",
262
+ "antigravity-discord.allowedUsers": "123456789012345678",
263
+ "antigravity-discord.agentProvider": "auto",
264
+ "antigravity-discord.tableStyle": "image",
265
+ "antigravity-discord.autoAttachTableImages": true,
266
+ "antigravity-discord.debugPort": 9000,
267
+ "antigravity-discord.cursorPort": 9000,
268
+ "antigravity-discord.windsurfPort": 9000,
269
+ "antigravity-discord.cliAgentPath": "auto",
270
+ "antigravity-discord.enableCopilotReAct": true,
271
+ "antigravity-discord.copilotMaxToolSteps": 10
272
+ }
273
+ ```
274
+
275
+ ---
276
+
277
+ ## ❓ Troubleshooting & FAQ
278
+
279
+ #### 1. "The bot is online in Discord, but it doesn't respond to messages."
280
+ - **Root Cause**: The **Message Content Intent** is disabled in the Discord Developer Portal.
281
+ - **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**.
282
+
283
+ #### 2. "Bridge Status shows 🔴 Disconnected."
284
+ - **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)).
285
+ - **If using standard VS Code**: Change `antigravity-discord.agentProvider` to `"copilot"` in settings. It connects natively via `vscode.lm` with zero ports required.
286
+
287
+ #### 3. "I received `⛔ Unauthorized: Your Discord User ID is not on the whitelist`."
288
+ - 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**.
289
+
290
+ #### 4. "My table columns are wrapping into a jumble on my mobile phone."
291
+ - 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.
292
+
293
+ ---
294
+
295
+ ## 📦 Installation
296
+
297
+ ### Install from VSIX Release
298
+ 1. Download `dis-gravity-1.1.0.vsix` from [Releases](https://github.com/sambath-rethinakumar/Dis-Gravity/releases).
299
+ 2. In VS Code / Antigravity: `Ctrl+Shift+P` → **Extensions: Install from VSIX...** → select the `.vsix` file.
300
+
301
+ ### Build from Source
302
+ ```bash
303
+ git clone https://github.com/sambath-rethinakumar/Dis-Gravity.git
304
+ cd Dis-Gravity
305
+ npm install
306
+ npx @vscode/vsce package --no-dependencies
307
+ ```
308
+
309
+ ---
310
+
311
+ ## 📄 License
312
+
313
+ MIT © [Anon King](https://github.com/sambath-rethinakumar/Dis-Gravity)