vg-coder-cli 2.0.70 → 2.0.71

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vg-coder-cli",
3
- "version": "2.0.70",
3
+ "version": "2.0.71",
4
4
  "description": "🚀 CLI tool to analyze projects, concatenate source files, count tokens, and export HTML with syntax highlighting and copy functionality",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -524,28 +524,15 @@ function connect() {
524
524
  } catch (e) { ack && ack({ ok: false, error: e.message }); }
525
525
  });
526
526
 
527
- // Dump extension metadata via SW message — version, installType, ID,
528
- // permissions. Useful when the user has multiple extension installs
529
- // (Web Store + Load Unpacked) and we need to know which is live.
527
+ // Dump extension metadata — version, installType, ID, permissions.
528
+ // Comes from window.vetgo.extInfo which background.ts injects when the
529
+ // controller script loads. (Page context has no chrome.runtime.* so
530
+ // we can't query at runtime — pre-injection is the only path.)
530
531
  socket.on('worker:ext-info', async (_payload, ack) => {
531
532
  try {
532
- if (typeof chrome === 'undefined' || !chrome.runtime?.sendMessage) {
533
- return ack && ack({ ok: false, error: 'no_chrome_runtime' });
534
- }
535
- const reply = await new Promise((resolve) => {
536
- try {
537
- chrome.runtime.sendMessage({ action: 'WORKER_EXT_INFO' }, (resp) => {
538
- if (chrome.runtime.lastError) {
539
- resolve({ ok: false, error: chrome.runtime.lastError.message });
540
- return;
541
- }
542
- resolve(resp || { ok: false, error: 'no_response' });
543
- });
544
- } catch (err) {
545
- resolve({ ok: false, error: err?.message || String(err) });
546
- }
547
- });
548
- ack && ack({ ok: true, info: reply });
533
+ const info = (window.vetgo && window.vetgo.extInfo) || null;
534
+ if (!info) return ack && ack({ ok: false, error: 'extInfo not injected — extension may be outdated' });
535
+ ack && ack({ ok: true, info, tabUrl: location.href, vetgo: window.vetgo });
549
536
  } catch (e) { ack && ack({ ok: false, error: e.message }); }
550
537
  });
551
538