lazy-gravity 0.9.0 β 0.9.1
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/README.md +1 -0
- package/dist/services/antigravityLauncher.js +20 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,7 @@ Just type in any bound channel:
|
|
|
93
93
|
- `π /join` β Join an existing Antigravity session (shows up to 20 recent sessions)
|
|
94
94
|
- `π /mirror` β Toggle PCβDiscord message mirroring for the current session
|
|
95
95
|
- `π /stop` β Force-stop a running Antigravity task
|
|
96
|
+
- `π /shutdown` β Shut down the IDE while keeping the active CDP project connections and session bindings
|
|
96
97
|
- `πΈ /screenshot` β Capture and send Antigravity's current screen
|
|
97
98
|
- `π§ /status` β Show bot connection status, current mode, and active project
|
|
98
99
|
- `β
/autoaccept [on|off|status]` β Toggle auto-approval of file edit dialogs
|
|
@@ -68,6 +68,9 @@ function checkPort(port) {
|
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Waits for a specific port to respond within the given timeout.
|
|
73
|
+
*/
|
|
71
74
|
async function waitForPort(port, timeoutMs = 30000) {
|
|
72
75
|
const deadline = Date.now() + timeoutMs;
|
|
73
76
|
do {
|
|
@@ -77,6 +80,9 @@ async function waitForPort(port, timeoutMs = 30000) {
|
|
|
77
80
|
} while (Date.now() < deadline);
|
|
78
81
|
return false;
|
|
79
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Ensures lifecycle operations (start/stop) are executed sequentially to prevent race conditions.
|
|
85
|
+
*/
|
|
80
86
|
function serializeLifecycle(operation) {
|
|
81
87
|
const pending = lifecycleOperation
|
|
82
88
|
? lifecycleOperation.then(operation, operation)
|
|
@@ -88,6 +94,9 @@ function serializeLifecycle(operation) {
|
|
|
88
94
|
}).catch(() => { });
|
|
89
95
|
return pending;
|
|
90
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Starts the Antigravity IDE process with CDP enabled on the specified port.
|
|
99
|
+
*/
|
|
91
100
|
function startAntigravity(port = cdpPorts_1.CDP_PORTS[0]) {
|
|
92
101
|
return serializeLifecycle(async () => {
|
|
93
102
|
if (await checkPort(port))
|
|
@@ -112,13 +121,17 @@ function startAntigravity(port = cdpPorts_1.CDP_PORTS[0]) {
|
|
|
112
121
|
return 'started';
|
|
113
122
|
});
|
|
114
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Stops the running Antigravity IDE CDP process on the specified port (SIGTERM on POSIX, Stop-Process -Force on Windows).
|
|
126
|
+
*/
|
|
115
127
|
function stopAntigravity(port = cdpPorts_1.CDP_PORTS[0]) {
|
|
116
128
|
return serializeLifecycle(async () => {
|
|
117
129
|
if (!await checkPort(port))
|
|
118
130
|
return 'already-stopped';
|
|
119
131
|
const version = await getCdpVersion(port);
|
|
120
132
|
const browser = typeof version?.Browser === 'string' ? version.Browser.toLowerCase() : '';
|
|
121
|
-
|
|
133
|
+
const userAgent = typeof version?.['User-Agent'] === 'string' ? version['User-Agent'].toLowerCase() : '';
|
|
134
|
+
if (!browser.includes('antigravity') && !userAgent.includes('antigravity')) {
|
|
122
135
|
throw new Error(`Refusing to stop non-Antigravity CDP service on port ${port}.`);
|
|
123
136
|
}
|
|
124
137
|
await new Promise((resolve, reject) => {
|
|
@@ -148,6 +161,9 @@ function stopAntigravity(port = cdpPorts_1.CDP_PORTS[0]) {
|
|
|
148
161
|
return 'stopped';
|
|
149
162
|
});
|
|
150
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Fetches the CDP /json/version payload to identify the connected browser target.
|
|
166
|
+
*/
|
|
151
167
|
function getCdpVersion(port) {
|
|
152
168
|
return new Promise((resolve, reject) => {
|
|
153
169
|
const req = http.get(`http://127.0.0.1:${port}/json/version`, (res) => {
|
|
@@ -169,6 +185,9 @@ function getCdpVersion(port) {
|
|
|
169
185
|
});
|
|
170
186
|
});
|
|
171
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Fetches the CDP /json/list payload to discover available debugging targets.
|
|
190
|
+
*/
|
|
172
191
|
function getCdpTargets(port) {
|
|
173
192
|
return new Promise((resolve, reject) => {
|
|
174
193
|
const req = http.get(`http://127.0.0.1:${port}/json/list`, (res) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lazy-gravity",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Control Antigravity from anywhere β a local, secure bot (Discord + Telegram) that lets you remotely operate Antigravity on your home PC from your smartphone.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|