yaver-cli 1.99.263 → 1.99.265

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/package.json +1 -1
  2. package/src/postinstall.js +38 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaver-cli",
3
- "version": "1.99.263",
3
+ "version": "1.99.265",
4
4
  "mcpName": "io.github.kivanccakmak/yaver",
5
5
  "description": "Unified npm bootstrap for the Yaver agent, SDK injection, and local-first developer runtime",
6
6
  "bin": {
@@ -227,6 +227,38 @@ function installMissingMobileTools() {
227
227
  }
228
228
  }
229
229
 
230
+ // Test-runner tooling. ffmpeg + chromium arrive via the vibe-preview stack;
231
+ // here we ensure the optional Playwright web driver so `yaver test` works with
232
+ // `target: web-playwright` straight after `npm install -g yaver-cli`. The
233
+ // chromedp driver + redroid image are provisioned on demand by the in-app
234
+ // "Install test tools" button (testkit_deps_install), so a run never fails on
235
+ // missing tooling. Best-effort; never fails npm install.
236
+ function installTestRunnerTools() {
237
+ if (!commandExists("node")) {
238
+ log("Node not found — skipping Playwright test driver bootstrap.");
239
+ return;
240
+ }
241
+ let hasPW = false;
242
+ try {
243
+ execSync("node -e \"require.resolve('playwright')\"", { stdio: ["ignore", "ignore", "ignore"] });
244
+ hasPW = true;
245
+ } catch (_) {}
246
+ if (hasPW) {
247
+ log("Playwright test driver already present.");
248
+ return;
249
+ }
250
+ const npmCmd = (process.env.npm_execpath || "npm").trim() || "npm";
251
+ try {
252
+ execSync(`"${npmCmd}" install -g --no-fund --no-audit playwright`, { stdio: "inherit" });
253
+ try {
254
+ execSync("npx --yes playwright install chromium", { stdio: "inherit" });
255
+ } catch (_) {}
256
+ log("Installed Playwright test driver (web-playwright target).");
257
+ } catch (error) {
258
+ log(`Skipping Playwright test driver bootstrap: ${error.message}`);
259
+ }
260
+ }
261
+
230
262
  // Make sure `yaver` resolves on PATH for the next shell session. npm's
231
263
  // global prefix (e.g. ~/.npm-global/bin) is not on PATH by default on
232
264
  // most Linux distros — so `npm install -g yaver-cli` succeeds but
@@ -519,6 +551,12 @@ async function main() {
519
551
  }
520
552
  }
521
553
 
554
+ // Test runner stack — Playwright web driver (chromium + ffmpeg come from
555
+ // vibe-preview above). Opt out with YAVER_SKIP_POSTINSTALL_TESTKIT=1.
556
+ if (!envEnabled("YAVER_SKIP_POSTINSTALL_TESTKIT")) {
557
+ installTestRunnerTools();
558
+ }
559
+
522
560
  // Free/offline voice stack — provision ffmpeg + whisper.cpp + a ggml
523
561
  // model so `yaver voice test` / `voice listen` (provider=local) work out
524
562
  // of the box with no API key and no cost. Best-effort; cloud STT