vg-coder-cli 2.0.64 → 2.0.65
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
package/src/server/api-server.js
CHANGED
|
@@ -788,6 +788,31 @@ class ApiServer {
|
|
|
788
788
|
} catch (e) { res.status(launcherErr(e)).json({ error: e.message }); }
|
|
789
789
|
});
|
|
790
790
|
|
|
791
|
+
// Dump launcher SW state (chromeId source, tabs, storage, runtime info).
|
|
792
|
+
// Query: chromeId? | workerLabel? | (none → broadcast all launchers).
|
|
793
|
+
// Useful for diagnosing chromeId/profile mismatches.
|
|
794
|
+
this.app.get('/api/launcher/debug', async (req, res) => {
|
|
795
|
+
try {
|
|
796
|
+
const opts = launcherOpts({}, req.query) || { all: true };
|
|
797
|
+
const result = await taskQueue.requestLauncher('launcher:debug', {}, opts, 5_000);
|
|
798
|
+
res.json(result);
|
|
799
|
+
} catch (e) { res.status(launcherErr(e)).json({ error: e.message }); }
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
// Run JS inside the launcher SW. Body: { chromeId? | workerLabel?, code, timeoutMs? }
|
|
803
|
+
// Code is wrapped in `async () => { ${code} }` — use `return` to surface
|
|
804
|
+
// a value. Result must JSON-serialize. Debug-only.
|
|
805
|
+
this.app.post('/api/launcher/eval', async (req, res) => {
|
|
806
|
+
try {
|
|
807
|
+
const body = req.body || {};
|
|
808
|
+
if (!body.code) return res.status(400).json({ error: 'code required' });
|
|
809
|
+
const opts = launcherOpts(body) || (body.all ? { all: true } : {});
|
|
810
|
+
const timeoutMs = Math.min(Math.max(parseInt(body.timeoutMs, 10) || 10_000, 1_000), 30_000);
|
|
811
|
+
const result = await taskQueue.requestLauncher('launcher:eval', { code: body.code }, opts, timeoutMs);
|
|
812
|
+
res.json(result);
|
|
813
|
+
} catch (e) { res.status(launcherErr(e)).json({ error: e.message }); }
|
|
814
|
+
});
|
|
815
|
+
|
|
791
816
|
this.app.get('/api/worker/status', (req, res) => {
|
|
792
817
|
const label = (req.query?.label || req.query?.workerLabel || '').toString().toLowerCase().trim();
|
|
793
818
|
res.json(taskQueue.workerStatus(label || undefined));
|