@canonry/canonry 7.15.0 → 7.16.0

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.
@@ -5,7 +5,7 @@ import {
5
5
  siteCrawlGraphNodes,
6
6
  siteCrawlPages,
7
7
  siteCrawlSnapshots
8
- } from "./chunk-7HJYGDRW.js";
8
+ } from "./chunk-SPZRSKCF.js";
9
9
  import {
10
10
  SITE_CRAWL_GRAPH_MAX_EDGES,
11
11
  SITE_CRAWL_GRAPH_MAX_NODES,
@@ -14,7 +14,7 @@ import {
14
14
  factorStatusFromDistribution,
15
15
  factorStatusFromScore,
16
16
  roundPreservingTotal
17
- } from "./chunk-KOBK4I5N.js";
17
+ } from "./chunk-6LS2R477.js";
18
18
 
19
19
  // src/site-audit-factors.ts
20
20
  function recordedSharePct(factor) {
@@ -5,7 +5,7 @@ import {
5
5
  PACKAGE_VERSION,
6
6
  canonryMcpTools,
7
7
  isMachineFormat
8
- } from "./chunk-LC7GMHOL.js";
8
+ } from "./chunk-KDWTNI4Z.js";
9
9
  import {
10
10
  AGENT_PROVIDER_IDS,
11
11
  CANONRY_NPM_PACKAGE_URL,
@@ -50,7 +50,7 @@ import {
50
50
  skillsClientSchema,
51
51
  upgradeCaveatFor,
52
52
  upgradeCommandFor
53
- } from "./chunk-KOBK4I5N.js";
53
+ } from "./chunk-6LS2R477.js";
54
54
 
55
55
  // src/config.ts
56
56
  import fs from "fs";
@@ -5679,6 +5679,60 @@ function describeError(err) {
5679
5679
  return "unknown error";
5680
5680
  }
5681
5681
  }
5682
+ var NETWORK_ERROR_CODE = /^[A-Z][A-Z0-9_]{1,63}$/;
5683
+ var MAX_CAUSE_DEPTH = 5;
5684
+ var RESOLVE_CODES = /* @__PURE__ */ new Set(["ENOTFOUND", "EAI_AGAIN", "ENODATA"]);
5685
+ var CONNECT_CODES = /* @__PURE__ */ new Set(["ECONNREFUSED", "UND_ERR_CONNECT_TIMEOUT", "ETIMEDOUT", "EHOSTUNREACH", "ENETUNREACH"]);
5686
+ function stringField(value) {
5687
+ return typeof value === "string" && value !== "" ? value : null;
5688
+ }
5689
+ function findNetworkCause(err) {
5690
+ let node = err;
5691
+ for (let depth = 0; depth < MAX_CAUSE_DEPTH && node !== null && typeof node === "object"; depth++) {
5692
+ const record = node;
5693
+ if (typeof record.code === "string" && NETWORK_ERROR_CODE.test(record.code)) {
5694
+ return {
5695
+ code: record.code,
5696
+ syscall: stringField(record.syscall),
5697
+ hostname: stringField(record.hostname),
5698
+ address: stringField(record.address),
5699
+ port: typeof record.port === "number" && Number.isInteger(record.port) ? record.port : null
5700
+ };
5701
+ }
5702
+ node = record.cause ?? (Array.isArray(record.errors) ? record.errors[0] : void 0);
5703
+ }
5704
+ return null;
5705
+ }
5706
+ function requestHostname(requestUrl) {
5707
+ if (requestUrl === void 0) return null;
5708
+ try {
5709
+ return stringField(new URL(requestUrl).hostname);
5710
+ } catch {
5711
+ return null;
5712
+ }
5713
+ }
5714
+ function describeFetchError(err, requestUrl) {
5715
+ const message = describeError(err);
5716
+ let cause;
5717
+ try {
5718
+ cause = findNetworkCause(err);
5719
+ } catch {
5720
+ return message;
5721
+ }
5722
+ if (!cause) return message;
5723
+ const host = cause.hostname ?? requestHostname(requestUrl);
5724
+ const resolving = cause.syscall === "getaddrinfo" || RESOLVE_CODES.has(cause.code);
5725
+ const connecting = cause.syscall === "connect" || CONNECT_CODES.has(cause.code);
5726
+ const verb = resolving ? "resolving" : connecting ? "connecting to" : "calling";
5727
+ const address = cause.address && cause.address !== host ? `${cause.address.includes(":") ? `[${cause.address}]` : cause.address}${cause.port !== null ? `:${cause.port}` : ""}` : null;
5728
+ const parts = [cause.code, host ? `${verb} ${host}` : null, address ? `at ${address}` : null];
5729
+ return `${message} (${parts.filter((part) => part !== null).join(" ")})`;
5730
+ }
5731
+ function isFetchTransportError(err) {
5732
+ if (!(err instanceof Error)) return false;
5733
+ if (err.name === "TimeoutError" || err.name === "AbortError") return true;
5734
+ return err instanceof TypeError && err.message === "fetch failed";
5735
+ }
5682
5736
 
5683
5737
  // ../contracts/src/measurement.ts
5684
5738
  import { z as z12 } from "zod";
@@ -6127,6 +6181,7 @@ var gbpSyncResponseSchema = z13.object({
6127
6181
  runId: z13.string(),
6128
6182
  status: z13.string()
6129
6183
  });
6184
+ var GBP_NO_SELECTED_LOCATIONS_ERROR = "No selected GBP locations to sync. Discover and select locations first.";
6130
6185
  var gbpDailyMetricDtoSchema = z13.object({
6131
6186
  locationName: z13.string(),
6132
6187
  date: z13.string(),
@@ -22401,6 +22456,8 @@ export {
22401
22456
  internalError,
22402
22457
  runtimeStateMissing,
22403
22458
  describeError,
22459
+ describeFetchError,
22460
+ isFetchTransportError,
22404
22461
  AI_ENGINE_DOMAINS,
22405
22462
  AI_ENGINE_SELF_DOMAINS,
22406
22463
  VERTEX_AI_SEARCH_PROXY_DOMAIN,
@@ -22452,6 +22509,7 @@ export {
22452
22509
  gbpLocationSelectionRequestSchema,
22453
22510
  gbpSyncRequestSchema,
22454
22511
  gbpSyncResponseSchema,
22512
+ GBP_NO_SELECTED_LOCATIONS_ERROR,
22455
22513
  gbpDailyMetricListResponseSchema,
22456
22514
  gbpKeywordImpressionListResponseSchema,
22457
22515
  gbpPlaceActionListResponseSchema,
@@ -139,7 +139,7 @@ import {
139
139
  trafficSeriesGranularitySchema,
140
140
  visibilityCompareSelectionSchema,
141
141
  visibilityReportRequestSchema
142
- } from "./chunk-KOBK4I5N.js";
142
+ } from "./chunk-6LS2R477.js";
143
143
 
144
144
  // src/cli-error.ts
145
145
  function isMachineFormat(format) {
@@ -4,14 +4,14 @@ import {
4
4
  installSkills,
5
5
  loadConfigRaw,
6
6
  saveConfigPatch
7
- } from "./chunk-SGQBPTWQ.js";
7
+ } from "./chunk-3ZGBSHZ2.js";
8
8
  import {
9
9
  PACKAGE_VERSION
10
- } from "./chunk-LC7GMHOL.js";
10
+ } from "./chunk-KDWTNI4Z.js";
11
11
  import {
12
12
  SKILL_MANIFEST_FILENAME,
13
13
  SkillsClients
14
- } from "./chunk-KOBK4I5N.js";
14
+ } from "./chunk-6LS2R477.js";
15
15
 
16
16
  // src/skills-autosync.ts
17
17
  import fs from "fs";