scavio 0.39.0 → 0.39.2

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/README.md CHANGED
@@ -36,12 +36,15 @@ same code, and click Approve. The CLI saves an API key named after your machine
36
36
  (`CLI - <hostname>`) and never prints it:
37
37
 
38
38
  - `~/.config/scavio/credentials.json` (owner-only), and
39
- - `SCAVIO_API_KEY` in your shell startup file (`~/.zshrc`, `~/.bashrc` and on
39
+ - `SCAVIO_API_KEY` in your shell startup file (`~/.zshrc` or `$ZDOTDIR/.zshrc`, `~/.bashrc` and on
40
40
  macOS `~/.bash_profile`, fish `conf.d/scavio.fish`, or the Windows user
41
41
  environment). Skip this with `--no-profile`.
42
42
 
43
- Logging in again on the same machine reuses that machine's key. Open a new
44
- terminal afterwards; `new Scavio()` reads `SCAVIO_API_KEY`.
43
+ Logging in again on the same machine reuses that machine's key. A program
44
+ cannot set variables in the shell that started it, so run `source ~/.zshrc`
45
+ (or your shell's file) or open a new terminal to use the key right away, and
46
+ restart any AI agent that was already running. `new Scavio()` reads
47
+ `SCAVIO_API_KEY`.
45
48
 
46
49
  AI coding agents (Claude Code, Codex, Pi, Cursor and others) can run it for you.
47
50
  When its output is not a terminal, `login` prints the link and exits at once so
package/dist/cli.js CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  // src/cli/index.ts
4
4
  import { spawn } from "child_process";
5
+ import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
5
6
  import { homedir as homedir3 } from "os";
6
7
 
7
8
  // src/http.ts
8
9
  var BASE_URL = "https://api.scavio.dev";
9
- var SDK_VERSION = true ? "0.39.0" : "0.0.0";
10
+ var SDK_VERSION = true ? "0.39.2" : "0.0.0";
10
11
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
11
12
 
12
13
  // src/cli/files.ts
@@ -158,7 +159,13 @@ function profileTargets(env = process.env, platform = process.platform, home = h
158
159
  const shell = basename(env.SHELL || "");
159
160
  const t = (kind, rel) => ({ kind, path: join2(home, rel), display: `~/${rel}` });
160
161
  if (shell === "fish") return [t("fish", ".config/fish/conf.d/scavio.fish")];
161
- if (shell === "zsh") return [t("posix", ".zshrc")];
162
+ if (shell === "zsh") {
163
+ const zdot = env.ZDOTDIR;
164
+ if (zdot && zdot !== home) {
165
+ return [{ kind: "posix", path: join2(zdot, ".zshrc"), display: join2(zdot, ".zshrc").replace(home, "~") }];
166
+ }
167
+ return [t("posix", ".zshrc")];
168
+ }
162
169
  if (shell === "bash") {
163
170
  return platform === "darwin" ? [t("posix", ".bashrc"), t("posix", ".bash_profile")] : [t("posix", ".bashrc")];
164
171
  }
@@ -304,7 +311,12 @@ async function finish(result, dir, args, baseUrl, out) {
304
311
  out.log(` Key works${check.plan ? `: ${check.plan} plan` : ""}${typeof check.credits === "number" ? `, ${check.credits} credits` : ""}.`);
305
312
  }
306
313
  if (places.length) {
307
- out.log("Open a new terminal, or restart your AI agent, so it picks up SCAVIO_API_KEY.");
314
+ if (process.platform === "win32") {
315
+ out.log("Open a new terminal to use it (setx does not change the one you are in).");
316
+ } else {
317
+ out.log(`To use it in this terminal now, run: source ${places[0]}`);
318
+ }
319
+ out.log("Restart your AI agent so it picks up SCAVIO_API_KEY.");
308
320
  } else {
309
321
  out.log("SCAVIO_API_KEY was not exported; read the key from the saved file or set it yourself.");
310
322
  }
@@ -395,7 +407,12 @@ async function status(out) {
395
407
  return EXIT.error;
396
408
  }
397
409
  out.log(`Logged in via ${source}${check.plan ? `: ${check.plan} plan` : ""}${typeof check.credits === "number" ? `, ${check.credits} credits` : ""}.`);
398
- if (!fromEnv) out.log("SCAVIO_API_KEY is not set in this shell yet: open a new terminal or restart your agent.");
410
+ if (!fromEnv) {
411
+ const t = process.platform === "win32" ? [] : profileTargets().filter((x) => existsSync3(x.path) && readFileSync3(x.path, "utf8").includes(MARKER));
412
+ out.log(
413
+ t.length ? `SCAVIO_API_KEY is not set in this shell yet: run source ${t[0].display}, or restart your agent.` : "SCAVIO_API_KEY is not set in this shell yet: open a new terminal or restart your agent."
414
+ );
415
+ }
399
416
  return EXIT.ok;
400
417
  }
401
418
  function logout(out) {
package/dist/index.cjs CHANGED
@@ -265,7 +265,7 @@ function parseRetryAfter(header) {
265
265
  var BASE_URL = "https://api.scavio.dev";
266
266
  var DEFAULT_TIMEOUT = 3e4;
267
267
  var DEFAULT_MAX_RETRIES = 2;
268
- var SDK_VERSION = true ? "0.39.0" : "0.0.0";
268
+ var SDK_VERSION = true ? "0.39.2" : "0.0.0";
269
269
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
270
270
  function isServerRuntime() {
271
271
  const g = globalThis;
package/dist/index.js CHANGED
@@ -145,7 +145,7 @@ function parseRetryAfter(header) {
145
145
  var BASE_URL = "https://api.scavio.dev";
146
146
  var DEFAULT_TIMEOUT = 3e4;
147
147
  var DEFAULT_MAX_RETRIES = 2;
148
- var SDK_VERSION = true ? "0.39.0" : "0.0.0";
148
+ var SDK_VERSION = true ? "0.39.2" : "0.0.0";
149
149
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
150
150
  function isServerRuntime() {
151
151
  const g = globalThis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scavio",
3
- "version": "0.39.0",
3
+ "version": "0.39.2",
4
4
  "description": "TypeScript SDK for the Scavio API — real-time structured web data across 61 platforms on one API key: Google SERP, ChatGPT, Gemini, Amazon, Walmart, Costco, Nordstrom, Nordstrom Rack, Lowe's, Sam's Club, Canadian Tire, Dollar General, Sephora, Ulta Beauty, ALDI, Micro Center, Walgreens, CVS, Whole Foods, Harbor Freight, PetSmart, Petco, iHerb, Chewy, Menards, HEB, Kroger, Mercado Libre, eBay, Zillow, Redfin, Realtor.com, Rightmove, Booking, Airbnb, Yelp, Trustpilot, Indeed, Glassdoor, G2, App Store, Google Play, SEC EDGAR, Google Ads and Meta Ad Library, YouTube, TikTok, Instagram, X, LinkedIn, Reddit and more, plus extract() to read any URL as clean Markdown and extract.map/crawl/batch to map, crawl and batch-extract whole websites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",