@apmantza/greedysearch-pi 1.0.3 → 1.0.5

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.
Files changed (2) hide show
  1. package/launch.mjs +9 -4
  2. package/package.json +1 -1
package/launch.mjs CHANGED
@@ -154,11 +154,16 @@ async function main() {
154
154
  // Already running?
155
155
  const existing = isRunning();
156
156
  if (existing) {
157
- console.log(`GreedySearch Chrome already running (pid ${existing}, port ${PORT}).`);
158
- // Ensure redirect is in place (idempotent)
159
157
  const ready = await writePortFile(5000);
160
- if (ready) { redirectCdpToGreedySearch(); console.log('DevToolsActivePort redirected.'); }
161
- return;
158
+ if (ready) {
159
+ console.log(`GreedySearch Chrome already running (pid ${existing}, port ${PORT}).`);
160
+ redirectCdpToGreedySearch();
161
+ console.log('DevToolsActivePort redirected.');
162
+ return;
163
+ }
164
+ // Stale PID — process alive but not Chrome on port 9223. Fall through to fresh launch.
165
+ console.log(`Stale PID ${existing} detected (not Chrome on port ${PORT}) — launching fresh.`);
166
+ try { unlinkSync(PID_FILE); } catch {}
162
167
  }
163
168
 
164
169
  const CHROME_EXE = process.env.CHROME_PATH || findChrome();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apmantza/greedysearch-pi",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Pi extension: search Perplexity, Bing Copilot, and Google AI simultaneously — synthesized AI answers, not just links",
5
5
  "type": "module",
6
6
  "keywords": [