@canonry/canonry 7.5.0 → 7.5.1

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
  PACKAGE_VERSION,
6
6
  canonryMcpTools,
7
7
  isMachineFormat
8
- } from "./chunk-JURAGZOO.js";
8
+ } from "./chunk-VVEMJCC6.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-3L7QPB37.js";
53
+ } from "./chunk-RVM6QJQT.js";
54
54
 
55
55
  // src/config.ts
56
56
  import fs from "fs";
@@ -20,20 +20,20 @@ import {
20
20
  saveConfig,
21
21
  saveConfigPatch,
22
22
  sentimentInstallReadiness
23
- } from "./chunk-6Z5MRX24.js";
23
+ } from "./chunk-56YOI7QX.js";
24
24
  import {
25
25
  computeFactorAverages,
26
26
  deleteSiteCrawlGraphLayout,
27
27
  persistSiteCrawlGraphLayout,
28
28
  prepareSiteCrawlGraphLayout,
29
29
  recordedSharePct
30
- } from "./chunk-KS66E5H6.js";
30
+ } from "./chunk-Y7K5NMNV.js";
31
31
  import {
32
32
  CanonryMcpToolNames,
33
33
  CliError,
34
34
  PACKAGE_VERSION,
35
35
  canonryMcpTools
36
- } from "./chunk-JURAGZOO.js";
36
+ } from "./chunk-VVEMJCC6.js";
37
37
  import {
38
38
  CC_CACHE_DIR,
39
39
  DUCKDB_SPEC,
@@ -205,7 +205,7 @@ import {
205
205
  siteLivenessState,
206
206
  toAlertView,
207
207
  usageCounters
208
- } from "./chunk-ZHI2MCMD.js";
208
+ } from "./chunk-JTQ4KFIR.js";
209
209
  import {
210
210
  AGENT_MEMORY_VALUE_MAX_BYTES,
211
211
  AGENT_NONE,
@@ -411,7 +411,7 @@ import {
411
411
  visibilityReportRequestSchema,
412
412
  winnabilityClassLabel,
413
413
  withRetry
414
- } from "./chunk-3L7QPB37.js";
414
+ } from "./chunk-RVM6QJQT.js";
415
415
 
416
416
  // src/runtime-context.ts
417
417
  function cliRuntimeContext(env = process.env, stdio = process) {
@@ -7869,7 +7869,7 @@ function nonBlank(value) {
7869
7869
  return trimmed ? trimmed : void 0;
7870
7870
  }
7871
7871
  function resolveBuildCommit(env = process.env) {
7872
- const embedded = true ? "1fae609bb90f155eec013fe7e84214c3306cc9b7" : void 0;
7872
+ const embedded = true ? "090fac327b8ec7108bb3084bca06488c05f4df02" : void 0;
7873
7873
  return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
7874
7874
  }
7875
7875
  function resolveInstanceIdentity(env = process.env) {
@@ -8881,7 +8881,7 @@ var JobRunner = class {
8881
8881
  if (dispatched >= units.length || providerErrors.has(providerName)) continue;
8882
8882
  providerErrors.set(
8883
8883
  providerName,
8884
- `${units.length - dispatched} expected measurement(s) did not run: no ${provider} provider was available to this worker.`
8884
+ `No ${provider} provider was available to this worker, so ${units.length - dispatched} expected measurement(s) did not run.`
8885
8885
  );
8886
8886
  }
8887
8887
  }
@@ -9179,7 +9179,7 @@ var JobRunner = class {
9179
9179
  const unrecorded = db.select({ outcome: providerBatchRequests.outcome, error: providerBatchRequests.error }).from(providerBatchRequests).where(and3(eq3(providerBatchRequests.batchId, batch.id), inArray(providerBatchRequests.outcome, [...UNRECORDED_OUTCOMES]))).orderBy(asc2(providerBatchRequests.executionId)).all();
9180
9180
  const first = unrecorded[0];
9181
9181
  if (first) {
9182
- add(batch.provider, `${unrecorded.length} of ${batch.requestCount} batch answer(s) were not recorded. First: ${first.error ?? first.outcome}`);
9182
+ add(batch.provider, `Batch answers not recorded: ${unrecorded.length} of ${batch.requestCount}. First: ${first.error ?? first.outcome}`);
9183
9183
  }
9184
9184
  break;
9185
9185
  }
@@ -9194,7 +9194,7 @@ var JobRunner = class {
9194
9194
  }
9195
9195
  const gaps = /* @__PURE__ */ new Map();
9196
9196
  for (const slot of missing) gaps.set(slot.provider, (gaps.get(slot.provider) ?? 0) + 1);
9197
- for (const [provider, gap] of gaps) add(provider, `${gap} expected measurement(s) have not run.`);
9197
+ for (const [provider, gap] of gaps) add(provider, `Expected measurements not run yet: ${gap}.`);
9198
9198
  return errors;
9199
9199
  }
9200
9200
  /**
@@ -9874,7 +9874,7 @@ var JobRunner = class {
9874
9874
  for (const slot of state.missing) remaining.set(slot.provider, (remaining.get(slot.provider) ?? 0) + 1);
9875
9875
  const providers = {};
9876
9876
  for (const [provider, count3] of remaining) {
9877
- providers[provider] = fresh[provider] ?? previous[provider] ?? { message: `${count3} expected measurement(s) have not run.` };
9877
+ providers[provider] = fresh[provider] ?? previous[provider] ?? { message: `Expected measurements not run yet: ${count3}.` };
9878
9878
  }
9879
9879
  txDb.update(runs).set({ error: serializeRunError({ providers }) }).where(and3(eq3(runs.id, input.runId), eq3(runs.status, "partial"))).run();
9880
9880
  }
@@ -796,7 +796,7 @@ import {
796
796
  wordpressSchemaDeployResultDtoSchema,
797
797
  wordpressSchemaStatusResultDtoSchema,
798
798
  wordpressStatusDtoSchema
799
- } from "./chunk-3L7QPB37.js";
799
+ } from "./chunk-RVM6QJQT.js";
800
800
 
801
801
  // src/intelligence-service.ts
802
802
  import { eq as eq84, desc as desc37, asc as asc15, and as and71, ne as ne15, or as or20, inArray as inArray33, gte as gte22, lte as lte20, isNull as isNull16, sql as sql31, exists as exists2 } from "drizzle-orm";
@@ -17721,7 +17721,11 @@ function generationFailure(err, fallbackMessage) {
17721
17721
  if (err instanceof AppError) return err;
17722
17722
  const message = err instanceof Error ? describeError(err) : fallbackMessage;
17723
17723
  switch (classifyProviderErrorMessage(message)) {
17724
+ // Billing has no error code of its own on the wire. It is an account
17725
+ // problem the operator fixes in the provider's console, as with a bad key,
17726
+ // and not a limit to wait out; the message names which one it is.
17724
17727
  case "PROVIDER_AUTH":
17728
+ case "PROVIDER_BILLING":
17725
17729
  return providerAuthError(message);
17726
17730
  case "RATE_LIMITED":
17727
17731
  return quotaExceeded("provider requests", { message });
@@ -79330,7 +79334,8 @@ async function trafficRoutes(app, opts) {
79330
79334
  allEvents = drained.events;
79331
79335
  } catch (e) {
79332
79336
  const msg = describeError(e);
79333
- markFailed(msg, "PROVIDER_PULL");
79337
+ const credentialRefused = e instanceof VercelLogsApiError && (e.status === 401 || e.status === 403);
79338
+ markFailed(msg, credentialRefused ? "PROVIDER_AUTH" : "PROVIDER_PULL");
79334
79339
  throw providerError(`Vercel pull failed: ${msg}`);
79335
79340
  }
79336
79341
  }
@@ -4,14 +4,14 @@ import {
4
4
  installSkills,
5
5
  loadConfigRaw,
6
6
  saveConfigPatch
7
- } from "./chunk-6Z5MRX24.js";
7
+ } from "./chunk-56YOI7QX.js";
8
8
  import {
9
9
  PACKAGE_VERSION
10
- } from "./chunk-JURAGZOO.js";
10
+ } from "./chunk-VVEMJCC6.js";
11
11
  import {
12
12
  SKILL_MANIFEST_FILENAME,
13
13
  SkillsClients
14
- } from "./chunk-3L7QPB37.js";
14
+ } from "./chunk-RVM6QJQT.js";
15
15
 
16
16
  // src/skills-autosync.ts
17
17
  import fs from "fs";
@@ -19351,6 +19351,7 @@ function serializeForInlineScript(value) {
19351
19351
  // ../contracts/src/provider-errors.ts
19352
19352
  var PROVIDER_ERROR_PRIORITY = [
19353
19353
  "PROVIDER_AUTH",
19354
+ "PROVIDER_BILLING",
19354
19355
  "RATE_LIMITED",
19355
19356
  "PROVIDER_UNAVAILABLE",
19356
19357
  "TIMEOUT",
@@ -19359,13 +19360,16 @@ var PROVIDER_ERROR_PRIORITY = [
19359
19360
  "UNKNOWN"
19360
19361
  ];
19361
19362
  function classifyProviderErrorMessage(message) {
19362
- if (/\b401\b|\b403\b|unauthorized|forbidden|invalid[_ -]?api[_ -]?key|missing[_ -]?api[_ -]?key|authentication/i.test(message)) {
19363
+ const status = extractProviderHttpStatus(message);
19364
+ if (status === 401 || status === 403 || /unauthorized|forbidden|invalid[_ -]?api[_ -]?key|missing[_ -]?api[_ -]?key|api[_ -]?key[_ -]?(?:is[_ -]?)?(?:not[_ -]?valid|invalid|expired)|authentication/i.test(message)) {
19363
19365
  return "PROVIDER_AUTH";
19364
19366
  }
19365
- if (/\b429\b|rate[_ -]?limit|too many requests|quota[_ -]?exceeded/i.test(message)) {
19367
+ if (status === 402 || /payment required|credit balance|insufficient[_ -]?(?:quota|credits?|balance|funds)/i.test(message) || /exceeded your current quota/i.test(message) && !/RESOURCE_EXHAUSTED/.test(message)) {
19368
+ return "PROVIDER_BILLING";
19369
+ }
19370
+ if (status === 429 || /rate[_ -]?limit|too many requests|quota[_ -]?exceeded/i.test(message)) {
19366
19371
  return "RATE_LIMITED";
19367
19372
  }
19368
- const status = extractProviderHttpStatus(message);
19369
19373
  if (status !== void 0 && status >= 500 || /overloaded|service unavailable|bad gateway|internal server error/i.test(message)) {
19370
19374
  return "PROVIDER_UNAVAILABLE";
19371
19375
  }
@@ -135,7 +135,7 @@ import {
135
135
  trafficSeriesGranularitySchema,
136
136
  visibilityCompareSelectionSchema,
137
137
  visibilityReportRequestSchema
138
- } from "./chunk-3L7QPB37.js";
138
+ } from "./chunk-RVM6QJQT.js";
139
139
 
140
140
  // src/cli-error.ts
141
141
  function isMachineFormat(format) {
@@ -5,7 +5,7 @@ import {
5
5
  siteCrawlGraphNodes,
6
6
  siteCrawlPages,
7
7
  siteCrawlSnapshots
8
- } from "./chunk-ZHI2MCMD.js";
8
+ } from "./chunk-JTQ4KFIR.js";
9
9
  import {
10
10
  SITE_CRAWL_GRAPH_MAX_EDGES,
11
11
  SITE_CRAWL_GRAPH_MAX_NODES,
@@ -13,7 +13,7 @@ import {
13
13
  TEMPLATE_LINK_RATIO_THRESHOLD,
14
14
  factorStatusFromScore,
15
15
  roundPreservingTotal
16
- } from "./chunk-3L7QPB37.js";
16
+ } from "./chunk-RVM6QJQT.js";
17
17
 
18
18
  // src/site-audit-factors.ts
19
19
  function recordedSharePct(factor) {
package/dist/cli.js CHANGED
@@ -32,11 +32,11 @@ import {
32
32
  trackCliCommandFinished,
33
33
  trackEvent,
34
34
  waitForServerRuntimeStartup
35
- } from "./chunk-OY5QVO34.js";
35
+ } from "./chunk-HAWCV4SU.js";
36
36
  import {
37
37
  autoSyncSkills,
38
38
  formatAutoSyncNotice
39
- } from "./chunk-E7EWAAH3.js";
39
+ } from "./chunk-KJIXDPYH.js";
40
40
  import {
41
41
  configExists,
42
42
  createApiClient,
@@ -53,13 +53,13 @@ import {
53
53
  saveConfig,
54
54
  saveConfigPatch,
55
55
  shouldPrintServeSkillsNudge
56
- } from "./chunk-6Z5MRX24.js";
56
+ } from "./chunk-56YOI7QX.js";
57
57
  import {
58
58
  DEFAULT_DEMO_TRUSTED_PROXIES,
59
59
  trustedProxiesProblem,
60
60
  trustedProxyProblem
61
61
  } from "./chunk-RB2F4D3Z.js";
62
- import "./chunk-KS66E5H6.js";
62
+ import "./chunk-Y7K5NMNV.js";
63
63
  import {
64
64
  CliError,
65
65
  EXIT_SYSTEM_ERROR,
@@ -71,7 +71,7 @@ import {
71
71
  runMeasurementDraftAction,
72
72
  systemError,
73
73
  usageError
74
- } from "./chunk-JURAGZOO.js";
74
+ } from "./chunk-VVEMJCC6.js";
75
75
  import {
76
76
  CLOUDFLARE_WORKER_BINDINGS,
77
77
  CLOUDFLARE_WORKER_GENERATED_MARKER,
@@ -100,7 +100,7 @@ import {
100
100
  querySnapshots,
101
101
  rawEventSamples,
102
102
  runs
103
- } from "./chunk-ZHI2MCMD.js";
103
+ } from "./chunk-JTQ4KFIR.js";
104
104
  import {
105
105
  AdsDeliverySnapshotStatuses,
106
106
  AdsHistoricalCampaignRollupStatuses,
@@ -228,7 +228,7 @@ import {
228
228
  visibilityCompareSelectionSchema,
229
229
  visibilityReportRequestSchema,
230
230
  winnabilityClassSchema
231
- } from "./chunk-3L7QPB37.js";
231
+ } from "./chunk-RVM6QJQT.js";
232
232
 
233
233
  // src/cli.ts
234
234
  import { pathToFileURL } from "url";
@@ -778,7 +778,7 @@ function parseDemoTrustedProxies(values) {
778
778
  async function demoCommand(options) {
779
779
  const { host, port } = parseDemoListenOptions(options);
780
780
  const trustProxy = parseDemoTrustedProxies(options.trustProxy);
781
- const { createDemoServer } = await import("./demo-server-55M7DF3U.js");
781
+ const { createDemoServer } = await import("./demo-server-V3DDLXND.js");
782
782
  const app = await createDemoServer({ trustProxy });
783
783
  let stopping = false;
784
784
  const stop = () => {
@@ -1192,7 +1192,7 @@ No DB writes performed. Re-run without --dry-run to apply.`);
1192
1192
  }
1193
1193
  }
1194
1194
  async function backfillInsightsCommand(project2, opts) {
1195
- const { IntelligenceService } = await import("./intelligence-service-HZSRDMFP.js");
1195
+ const { IntelligenceService } = await import("./intelligence-service-MZVPWIXL.js");
1196
1196
  const config = loadConfig();
1197
1197
  const db = createClient(config.database);
1198
1198
  migrate(db);
@@ -5,11 +5,11 @@ import {
5
5
  computeFactorAverages,
6
6
  layoutSiteCrawlGraphInput,
7
7
  persistSiteCrawlGraphLayout
8
- } from "./chunk-KS66E5H6.js";
8
+ } from "./chunk-Y7K5NMNV.js";
9
9
  import {
10
10
  PACKAGE_VERSION,
11
11
  canonryMcpTools
12
- } from "./chunk-JURAGZOO.js";
12
+ } from "./chunk-VVEMJCC6.js";
13
13
  import {
14
14
  HISTORY_WINDOW_RUNS,
15
15
  IntelligenceService,
@@ -83,7 +83,7 @@ import {
83
83
  siteCrawlPages,
84
84
  siteCrawlSnapshots,
85
85
  trafficSources
86
- } from "./chunk-ZHI2MCMD.js";
86
+ } from "./chunk-JTQ4KFIR.js";
87
87
  import {
88
88
  RunKinds,
89
89
  SiteCrawlFetchStates,
@@ -112,7 +112,7 @@ import {
112
112
  roundPreservingTotal,
113
113
  siteAuditPageFactorSchema,
114
114
  wilsonInterval
115
- } from "./chunk-3L7QPB37.js";
115
+ } from "./chunk-RVM6QJQT.js";
116
116
 
117
117
  // src/demo-server.ts
118
118
  import { dirname, join as join2 } from "path";
package/dist/index.js CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-OY5QVO34.js";
6
+ } from "./chunk-HAWCV4SU.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-6Z5MRX24.js";
10
- import "./chunk-KS66E5H6.js";
11
- import "./chunk-JURAGZOO.js";
12
- import "./chunk-ZHI2MCMD.js";
13
- import "./chunk-3L7QPB37.js";
9
+ } from "./chunk-56YOI7QX.js";
10
+ import "./chunk-Y7K5NMNV.js";
11
+ import "./chunk-VVEMJCC6.js";
12
+ import "./chunk-JTQ4KFIR.js";
13
+ import "./chunk-RVM6QJQT.js";
14
14
  export {
15
15
  GoogleMarketingRuntimeError,
16
16
  createGoogleMarketingCredentialStore,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  HISTORY_WINDOW_RUNS,
3
3
  IntelligenceService
4
- } from "./chunk-ZHI2MCMD.js";
5
- import "./chunk-3L7QPB37.js";
4
+ } from "./chunk-JTQ4KFIR.js";
5
+ import "./chunk-RVM6QJQT.js";
6
6
  export {
7
7
  HISTORY_WINDOW_RUNS,
8
8
  IntelligenceService
package/dist/mcp.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  autoSyncSkills
3
- } from "./chunk-E7EWAAH3.js";
3
+ } from "./chunk-KJIXDPYH.js";
4
4
  import {
5
5
  createApiClient,
6
6
  createCanonryMcpServer
7
- } from "./chunk-6Z5MRX24.js";
8
- import "./chunk-JURAGZOO.js";
7
+ } from "./chunk-56YOI7QX.js";
8
+ import "./chunk-VVEMJCC6.js";
9
9
  import {
10
10
  isReadOnlyKey,
11
11
  updateCheckEnvOptOut
12
- } from "./chunk-3L7QPB37.js";
12
+ } from "./chunk-RVM6QJQT.js";
13
13
 
14
14
  // src/mcp/cli.ts
15
15
  import { randomUUID } from "crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "type": "module",
5
5
  "description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
6
6
  "keywords": [
@@ -86,33 +86,33 @@
86
86
  "tsup": "^8.5.1",
87
87
  "tsx": "^4.19.0",
88
88
  "@ainyc/canonry-web": "0.0.0",
89
- "@ainyc/canonry-api-client": "0.0.0",
90
- "@ainyc/canonry-api-routes": "0.0.0",
91
89
  "@ainyc/canonry-config": "0.0.0",
92
- "@ainyc/canonry-db": "0.0.0",
93
90
  "@ainyc/canonry-contracts": "0.0.0",
91
+ "@ainyc/canonry-api-routes": "0.0.0",
92
+ "@ainyc/canonry-api-client": "0.0.0",
93
+ "@ainyc/canonry-db": "0.0.0",
94
+ "@ainyc/canonry-integration-bing": "0.0.0",
94
95
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
95
96
  "@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
96
- "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
97
97
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
98
98
  "@ainyc/canonry-integration-google": "0.0.0",
99
99
  "@ainyc/canonry-integration-google-ads": "0.0.0",
100
+ "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
100
101
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
101
102
  "@ainyc/canonry-integration-google-places": "0.0.0",
102
- "@ainyc/canonry-integration-bing": "0.0.0",
103
103
  "@ainyc/canonry-integration-google-tag-manager": "0.0.0",
104
104
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
105
- "@ainyc/canonry-integration-traffic": "0.0.0",
106
- "@ainyc/canonry-intelligence": "0.0.0",
107
105
  "@ainyc/canonry-integration-wordpress": "0.0.0",
106
+ "@ainyc/canonry-intelligence": "0.0.0",
107
+ "@ainyc/canonry-integration-traffic": "0.0.0",
108
108
  "@ainyc/canonry-provider-cdp": "0.0.0",
109
109
  "@ainyc/canonry-provider-claude": "0.0.0",
110
- "@ainyc/canonry-provider-local": "0.0.0",
111
110
  "@ainyc/canonry-provider-gemini": "0.0.0",
111
+ "@ainyc/canonry-provider-local": "0.0.0",
112
112
  "@ainyc/canonry-provider-muse": "0.0.0",
113
113
  "@ainyc/canonry-provider-openai": "0.0.0",
114
- "@ainyc/canonry-integration-typesafe": "0.0.0",
115
- "@ainyc/canonry-provider-perplexity": "0.0.0"
114
+ "@ainyc/canonry-provider-perplexity": "0.0.0",
115
+ "@ainyc/canonry-integration-typesafe": "0.0.0"
116
116
  },
117
117
  "scripts": {
118
118
  "build": "pnpm run build:cli && pnpm run build:web",