@ysgao/web-cli 0.3.1 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51804,8 +51804,9 @@ function callOptionsFor(intent, signal) {
51804
51804
  }
51805
51805
  async function attemptReplay(site, intent, param, jarOverride, signal) {
51806
51806
  const config2 = getSiteConfig(site);
51807
+ const siteSupportsLogin = config2.requiresLogin !== false;
51807
51808
  const cookieJar = jarOverride ?? getEstablishedSession(site) ?? mergeStoredSession(await getLiveCookieJar(config2.host), await loadSessionJar(site));
51808
- if (Object.keys(cookieJar).length === 0) {
51809
+ if (Object.keys(cookieJar).length === 0 && siteSupportsLogin) {
51809
51810
  throw new AuthRequiredError(
51810
51811
  `No live session cookies found for ${config2.host} in web-cli's Chrome profile`,
51811
51812
  site
@@ -51823,7 +51824,7 @@ async function attemptReplay(site, intent, param, jarOverride, signal) {
51823
51824
  if (isAbortError(err)) {
51824
51825
  throw err;
51825
51826
  }
51826
- if (isAuthFailure(err)) {
51827
+ if (isAuthFailure(err) && siteSupportsLogin) {
51827
51828
  throw err;
51828
51829
  }
51829
51830
  }
@@ -51836,7 +51837,10 @@ async function attemptReplay(site, intent, param, jarOverride, signal) {
51836
51837
  persistTemplateBestEffort(site, intent, preseed);
51837
51838
  return { data, discovered: false };
51838
51839
  } catch (err) {
51839
- if (isAuthFailure(err) || isAbortError(err)) {
51840
+ if (isAbortError(err)) {
51841
+ throw err;
51842
+ }
51843
+ if (isAuthFailure(err) && siteSupportsLogin) {
51840
51844
  throw err;
51841
51845
  }
51842
51846
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ysgao/web-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Self-discovering REST API CLI for subscription medical-knowledge sites, driven by an AI agent",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {