lazy-gravity 0.4.0 → 0.4.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.
|
@@ -78,8 +78,11 @@ const SCRAPE_PAST_CONVERSATIONS_SCRIPT = `(() => {
|
|
|
78
78
|
const isVisible = (el) => !!el && el instanceof HTMLElement && el.offsetParent !== null;
|
|
79
79
|
const normalize = (text) => (text || '').trim();
|
|
80
80
|
|
|
81
|
-
//
|
|
82
|
-
|
|
81
|
+
// Past Conversations opens as a floating QuickInput dialog, not inside the side panel.
|
|
82
|
+
// Try the visible QuickInput dialog first, then fall back to the side panel.
|
|
83
|
+
const quickInputPanels = Array.from(document.querySelectorAll('div[class*="bg-quickinput-background"]'));
|
|
84
|
+
const panel = quickInputPanels.find((el) => isVisible(el))
|
|
85
|
+
|| document.querySelector('.antigravity-agent-side-panel');
|
|
83
86
|
if (!panel) return null;
|
|
84
87
|
|
|
85
88
|
const items = [];
|
|
@@ -136,7 +139,11 @@ const SCRAPE_PAST_CONVERSATIONS_SCRIPT = `(() => {
|
|
|
136
139
|
*/
|
|
137
140
|
const FIND_SHOW_MORE_BUTTON_SCRIPT = `(() => {
|
|
138
141
|
const isVisible = (el) => !!el && el instanceof HTMLElement && el.offsetParent !== null;
|
|
139
|
-
const
|
|
142
|
+
const quickInputPanels = Array.from(document.querySelectorAll('div[class*="bg-quickinput-background"]'));
|
|
143
|
+
const root = quickInputPanels.find((el) => isVisible(el))
|
|
144
|
+
|| document.querySelector('.antigravity-agent-side-panel')
|
|
145
|
+
|| document;
|
|
146
|
+
const els = Array.from(root.querySelectorAll('div, span'));
|
|
140
147
|
for (const el of els) {
|
|
141
148
|
if (!isVisible(el)) continue;
|
|
142
149
|
const text = (el.textContent || '').trim();
|
|
@@ -454,7 +461,9 @@ class ChatSessionService {
|
|
|
454
461
|
// Step 3: Wait for panel to render (poll for content, up to 3s)
|
|
455
462
|
const PANEL_READY_CHECK = `(() => {
|
|
456
463
|
const isVisible = (el) => !!el && el instanceof HTMLElement && el.offsetParent !== null;
|
|
457
|
-
const
|
|
464
|
+
const quickInputPanels = Array.from(document.querySelectorAll('div[class*="bg-quickinput-background"]'));
|
|
465
|
+
const panel = quickInputPanels.find((el) => isVisible(el))
|
|
466
|
+
|| document.querySelector('.antigravity-agent-side-panel');
|
|
458
467
|
if (!panel) return false;
|
|
459
468
|
const containers = Array.from(
|
|
460
469
|
panel.querySelectorAll('div[class*="overflow-auto"], div[class*="overflow-y-scroll"]')
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.COOLDOWN_MS = exports.UPDATE_CHECK_FILE = void 0;
|
|
37
37
|
exports.shouldCheckForUpdates = shouldCheckForUpdates;
|
|
38
38
|
exports.fetchLatestVersion = fetchLatestVersion;
|
|
39
|
+
exports.isGlobalInstall = isGlobalInstall;
|
|
39
40
|
exports.checkForUpdates = checkForUpdates;
|
|
40
41
|
const https = __importStar(require("https"));
|
|
41
42
|
const fs = __importStar(require("fs"));
|
|
@@ -127,11 +128,25 @@ function compareSemver(a, b) {
|
|
|
127
128
|
}
|
|
128
129
|
return 0;
|
|
129
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Detect whether the process is running from a global npm install
|
|
133
|
+
* (as opposed to a local dev checkout via `ts-node`, `tsx`, etc.).
|
|
134
|
+
*/
|
|
135
|
+
function isGlobalInstall() {
|
|
136
|
+
const execPath = process.argv[1] || '';
|
|
137
|
+
// Global installs run from a path containing node_modules
|
|
138
|
+
// Local dev runs from the source tree (no node_modules/.bin in argv[1])
|
|
139
|
+
const globalIndicators = ['/lib/node_modules/', '\\node_modules\\lazy-gravity\\'];
|
|
140
|
+
return globalIndicators.some((indicator) => execPath.includes(indicator));
|
|
141
|
+
}
|
|
130
142
|
/**
|
|
131
143
|
* Non-blocking update check. Call at startup (fire-and-forget).
|
|
132
144
|
* Respects a 24-hour cooldown via a local cache file.
|
|
145
|
+
* Skipped when running from source (dev/local checkout).
|
|
133
146
|
*/
|
|
134
147
|
async function checkForUpdates(currentVersion) {
|
|
148
|
+
if (!isGlobalInstall())
|
|
149
|
+
return;
|
|
135
150
|
if (!shouldCheckForUpdates())
|
|
136
151
|
return;
|
|
137
152
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lazy-gravity",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.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": {
|