@canonry/canonry 7.125.3 → 7.125.5

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 (119) hide show
  1. package/dist/activity-KCUWSNHF.js +13 -0
  2. package/dist/{ads-CKWRWWUL.js → ads-6ZCVMSJ2.js} +4 -4
  3. package/dist/{agent-ESSNC46H.js → agent-ZZJO7ET6.js} +8 -8
  4. package/dist/{agent-ask-37D6WCPX.js → agent-ask-CPRHVULM.js} +4 -4
  5. package/dist/{agent-conversations-GKY7Q2IO.js → agent-conversations-NIWKSUC2.js} +4 -4
  6. package/dist/{agent-journeys-FIH4K5PI.js → agent-journeys-SHNRNV5E.js} +4 -4
  7. package/dist/{agent-memory-FXWCBJRP.js → agent-memory-4IGCNFR5.js} +4 -4
  8. package/dist/{agent-providers-5AKSFZHC.js → agent-providers-3Q7NQS7Y.js} +4 -4
  9. package/dist/{agent-transcript-F4HO6LWW.js → agent-transcript-M3NYHNNV.js} +4 -4
  10. package/dist/{analytics-GJRUFRVW.js → analytics-UHBUOG4T.js} +4 -4
  11. package/dist/{answerability-L5MS4AKC.js → answerability-IRXQDOBX.js} +4 -4
  12. package/dist/{apply-ZZQIJN4W.js → apply-3HP75CA2.js} +4 -4
  13. package/dist/{backfill-WK2FPQA7.js → backfill-3A47CQR7.js} +11 -11
  14. package/dist/{backlinks-53DXYL4A.js → backlinks-O5IYHDAY.js} +4 -4
  15. package/dist/{bing-6G7LXZDT.js → bing-2MTKNQB2.js} +4 -4
  16. package/dist/{bootstrap-ESCW4ZGJ.js → bootstrap-O7FRHURI.js} +11 -11
  17. package/dist/{cdp-BR54QYDW.js → cdp-BTXUJFAN.js} +8 -8
  18. package/dist/{chunk-27MI43WQ.js → chunk-2MDEKCDU.js} +7 -12
  19. package/dist/{chunk-ZI5JGJFY.js → chunk-2UAW7YJQ.js} +54 -30
  20. package/dist/{chunk-OC35PZAC.js → chunk-35NITZHC.js} +1 -1
  21. package/dist/{chunk-73ANFHPL.js → chunk-3FQMXAES.js} +4 -4
  22. package/dist/{chunk-G46YLF5X.js → chunk-3G5FQLF7.js} +2 -2
  23. package/dist/{chunk-LEW6WFYV.js → chunk-3OZ5WKRH.js} +1 -0
  24. package/dist/{chunk-7V3V5H7L.js → chunk-63R3NM64.js} +5 -5
  25. package/dist/{chunk-J3C4XFWJ.js → chunk-A75GIIWP.js} +1 -1
  26. package/dist/{chunk-6E7BS7BA.js → chunk-AE7OACJJ.js} +5 -5
  27. package/dist/{chunk-YKB75BPD.js → chunk-BYKV65R3.js} +4 -4
  28. package/dist/{chunk-6ZL5ILQI.js → chunk-C5EK4TJ5.js} +3 -3
  29. package/dist/{chunk-P42TP4BJ.js → chunk-CD3XPOHP.js} +1 -1
  30. package/dist/{chunk-OZRJ73XU.js → chunk-DI5EEYDP.js} +2 -2
  31. package/dist/{chunk-2T4IZBIB.js → chunk-EGTFX3NN.js} +30 -3
  32. package/dist/{chunk-P2RFC35A.js → chunk-GAWCJBY6.js} +5 -5
  33. package/dist/{chunk-B63ZO4TX.js → chunk-INKN6X4R.js} +6 -6
  34. package/dist/{chunk-XLJWITPC.js → chunk-JKBGIO5A.js} +8 -8
  35. package/dist/{chunk-7Q5OVRVX.js → chunk-JTIFRAGE.js} +3 -3
  36. package/dist/{chunk-EWJKPCIT.js → chunk-K7BROEPL.js} +3 -3
  37. package/dist/{chunk-QFGEFEKV.js → chunk-KIO37ZVB.js} +4 -4
  38. package/dist/{chunk-ODEDQ4Z7.js → chunk-MB7VQPWX.js} +2 -2
  39. package/dist/{chunk-JXKRQ63F.js → chunk-ML7G6NS3.js} +2 -2
  40. package/dist/{chunk-FJHPA47P.js → chunk-OH3HQENA.js} +4 -4
  41. package/dist/{chunk-TZ5ALARK.js → chunk-OL6HAMWW.js} +2 -2
  42. package/dist/{chunk-2JMNIWOG.js → chunk-PAP62URW.js} +4 -4
  43. package/dist/{chunk-OXM2WUTJ.js → chunk-PDSB34VB.js} +1 -1
  44. package/dist/{chunk-R2F5JHCB.js → chunk-QCEXADUT.js} +2 -2
  45. package/dist/{chunk-EEYFNSVL.js → chunk-QQFTJVHT.js} +1 -1
  46. package/dist/{chunk-C7IGAN7U.js → chunk-QRA6GFXX.js} +1 -1
  47. package/dist/{chunk-Y7Y3GDOM.js → chunk-RSZ3L5FJ.js} +1 -1
  48. package/dist/{chunk-Z7TP2GD4.js → chunk-U2LYHQHF.js} +1 -1
  49. package/dist/{chunk-MXDKDPRJ.js → chunk-VD6Q7ZUX.js} +1 -1
  50. package/dist/{chunk-WHH3XSRE.js → chunk-VP3F4BOG.js} +2 -2
  51. package/dist/{chunk-SP44JHI4.js → chunk-VUL3BACZ.js} +4 -4
  52. package/dist/{chunk-HN6UIFHO.js → chunk-XQUGLXAN.js} +2 -2
  53. package/dist/{chunk-FBVCBRXQ.js → chunk-YYBYRAMI.js} +4 -4
  54. package/dist/{chunk-FM56GWUC.js → chunk-ZT4UEBE5.js} +372 -372
  55. package/dist/{chunk-DFEVW234.js → chunk-ZV32JKXF.js} +27 -25
  56. package/dist/{citations-ZIDSGKRU.js → citations-5JSLIPNI.js} +5 -5
  57. package/dist/{cli-catalog-6LW7C6JJ.js → cli-catalog-U3DKCQC5.js} +4 -4
  58. package/dist/cli-commands-2TUN6IW5.js +18 -0
  59. package/dist/cli.js +14 -14
  60. package/dist/{competitor-SL756CGS.js → competitor-AMA7WPH4.js} +4 -4
  61. package/dist/{content-K57ZUYTK.js → content-7HZ23UXM.js} +4 -4
  62. package/dist/{dashboard-XKP2Z7NL.js → dashboard-BLIFEMUC.js} +7 -7
  63. package/dist/{demo-3KROYDH3.js → demo-2NMBL24B.js} +3 -3
  64. package/dist/{demo-server-E7LTZ55I.js → demo-server-ZOIEWNA6.js} +13 -13
  65. package/dist/{discover-RWVSCRJU.js → discover-TJXKEHVP.js} +5 -5
  66. package/dist/{discover-eval-N4M5JU6F.js → discover-eval-MUS46MSL.js} +4 -4
  67. package/dist/{doctor-NW4FDB77.js → doctor-5CIMYYUA.js} +4 -4
  68. package/dist/{evidence-FMUJNJSJ.js → evidence-MY4Z6VNC.js} +4 -4
  69. package/dist/{export-cmd-VALOYBEX.js → export-cmd-VBULRDSJ.js} +4 -4
  70. package/dist/{ga-DPMYKD4B.js → ga-ORQCNNJ6.js} +4 -4
  71. package/dist/{gbp-AVZSBYRE.js → gbp-LWVNCHMT.js} +4 -4
  72. package/dist/{google-YU4U7NGP.js → google-U6LQOAQ3.js} +5 -5
  73. package/dist/{google-marketing-6QVRXGBM.js → google-marketing-6RA4AOMN.js} +2 -2
  74. package/dist/{health-cmd-WWLJRTUO.js → health-cmd-LQGRFFT3.js} +5 -5
  75. package/dist/{history-TTA7FGQW.js → history-LYJAA6QI.js} +4 -4
  76. package/dist/index.d.ts +26 -26
  77. package/dist/index.js +26 -26
  78. package/dist/{init-7HJIOE4N.js → init-6NWXREYH.js} +13 -13
  79. package/dist/{insights-Q5D55GAR.js → insights-OP7ZJLC5.js} +4 -4
  80. package/dist/intelligence-service-HSPZWXK6.js +15 -0
  81. package/dist/{journeys-6TQ4XKFU.js → journeys-ENN25PA5.js} +4 -4
  82. package/dist/{keys-GEKZTCDB.js → keys-FVPHQIOM.js} +4 -4
  83. package/dist/{keyword-RFOYIC3F.js → keyword-ELCUWNQC.js} +4 -4
  84. package/dist/{logs-JVV3JWBY.js → logs-SVKY3HXZ.js} +4 -4
  85. package/dist/{mcp-F5UBBUYS.js → mcp-W7AMWAST.js} +5 -5
  86. package/dist/mcp.js +10 -10
  87. package/dist/{measurement-plan-3MBPWMKF.js → measurement-plan-F3ZZ4MCG.js} +6 -6
  88. package/dist/{notify-I6PK7D5F.js → notify-U253YRTY.js} +4 -4
  89. package/dist/{organic-evidence-XGMEFGZV.js → organic-evidence-4GI6HG56.js} +4 -4
  90. package/dist/{overview-3CXTYKPK.js → overview-TPZI3OKL.js} +7 -7
  91. package/dist/{project-NODDRMYN.js → project-BZPMAZAH.js} +4 -4
  92. package/dist/{project-setup-O2ZHNOQA.js → project-setup-2NSUAFXD.js} +4 -4
  93. package/dist/{query-FS5JMNWT.js → query-4AL5P6DI.js} +4 -4
  94. package/dist/{research-PAQYTNO7.js → research-3WAJ6RWX.js} +4 -4
  95. package/dist/{results-export-SXJ7QORQ.js → results-export-VHA6BPC2.js} +4 -4
  96. package/dist/{run-AKHP63FR.js → run-3EEHYWIA.js} +6 -6
  97. package/dist/{schedule-4UJCAZRL.js → schedule-7CXVWV75.js} +4 -4
  98. package/dist/{search-M6F2BKN5.js → search-EPPXH2TK.js} +4 -4
  99. package/dist/{serve-M5CIAJQP.js → serve-K2IQQEBQ.js} +27 -27
  100. package/dist/{session-FTWUJBXC.js → session-S6EE3QAM.js} +14 -14
  101. package/dist/{settings-UYXGO73G.js → settings-UKIPQVIX.js} +4 -4
  102. package/dist/{sitemaps-UFZAM5AM.js → sitemaps-L2OOCCHX.js} +4 -4
  103. package/dist/{skills-CST64NUF.js → skills-VJSJNLWC.js} +3 -3
  104. package/dist/{snapshot-R7M77CR2.js → snapshot-SYVUVM7F.js} +4 -4
  105. package/dist/{src-NPY2WNGF.js → src-VYDX5USM.js} +2 -2
  106. package/dist/{status-NWAVNBJC.js → status-ALZWCQ7W.js} +6 -6
  107. package/dist/{support-AJYIPDYH.js → support-XRKYBNND.js} +2 -2
  108. package/dist/{technical-aeo-HNEUXZZ4.js → technical-aeo-JNYI6Q7L.js} +4 -4
  109. package/dist/{telemetry-4HMLYE5C.js → telemetry-ZENJ5BDE.js} +5 -5
  110. package/dist/{tools-HQ5AFHJ2.js → tools-YCJ5LXWJ.js} +12 -12
  111. package/dist/{traffic-MGZDVEAM.js → traffic-DG77A42Q.js} +6 -6
  112. package/dist/{trends-NMJFTKOE.js → trends-3755UQT3.js} +4 -4
  113. package/dist/{users-HWBPRVSG.js → users-7XCGU7BU.js} +4 -4
  114. package/dist/{visibility-stats-DALS5MUL.js → visibility-stats-QJBO7HFN.js} +5 -5
  115. package/dist/{wordpress-23RX6PVT.js → wordpress-VC6UN5UK.js} +4 -4
  116. package/package.json +1 -1
  117. package/dist/activity-MYEOLXH7.js +0 -13
  118. package/dist/cli-commands-MAM3MHKR.js +0 -18
  119. package/dist/intelligence-service-EIVZPZDC.js +0 -15
@@ -19,14 +19,14 @@ import {
19
19
  normalizeTrafficPathPattern,
20
20
  sessionizeJourneyRequests,
21
21
  verifyRequestSignature
22
- } from "./chunk-2T4IZBIB.js";
22
+ } from "./chunk-EGTFX3NN.js";
23
23
  import {
24
24
  currentOutcomeAttribution,
25
25
  getRequestContext,
26
26
  registerRequestContext,
27
27
  requestAuditIdentity,
28
28
  sanitizeRequestContext
29
- } from "./chunk-J3C4XFWJ.js";
29
+ } from "./chunk-A75GIIWP.js";
30
30
  import {
31
31
  RawEventSampleEventTypes,
32
32
  SentimentIdempotencyConflict,
@@ -191,7 +191,7 @@ import {
191
191
  userSessions,
192
192
  users,
193
193
  writeNegativeReviewMaxStars
194
- } from "./chunk-OC35PZAC.js";
194
+ } from "./chunk-35NITZHC.js";
195
195
  import {
196
196
  ADS_ACTIVATE_SCOPE,
197
197
  ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
@@ -568,6 +568,7 @@ import {
568
568
  apiKeyListDtoSchema,
569
569
  applyHarvestSemanticNovelty,
570
570
  applyPreviewDtoSchema,
571
+ asRecord,
571
572
  auditHistoryQuerySchema,
572
573
  auditLogEntrySchema,
573
574
  authInvalid,
@@ -1406,7 +1407,7 @@ import {
1406
1407
  wordpressSchemaDeployResultDtoSchema,
1407
1408
  wordpressSchemaStatusResultDtoSchema,
1408
1409
  wordpressStatusDtoSchema
1409
- } from "./chunk-LEW6WFYV.js";
1410
+ } from "./chunk-3OZ5WKRH.js";
1410
1411
 
1411
1412
  // ../api-routes/src/user-session.ts
1412
1413
  import crypto2 from "crypto";
@@ -58758,7 +58759,7 @@ async function googleRoutes(app, opts) {
58758
58759
  const project = resolveProject(app.db, request.params.name);
58759
58760
  const conn = store.getConnection(project.canonicalDomain, "gsc");
58760
58761
  if (!conn) {
58761
- throw validationError('No GSC connection found for this domain. Run "canonry google connect" first.');
58762
+ throw integrationNotConnected('No GSC connection found for this domain. Run "canonry google connect" first.');
58762
58763
  }
58763
58764
  const now = (/* @__PURE__ */ new Date()).toISOString();
58764
58765
  const runId = crypto47.randomUUID();
@@ -60311,10 +60312,15 @@ function normalizeConversionTrackingContractWrite(input) {
60311
60312
  }
60312
60313
  };
60313
60314
  }
60314
- function requiredCredential(opts, project, provider) {
60315
- const credential = opts.googleMarketingCredentialStore?.get(project, provider);
60315
+ function requiredCredential(app, opts, project, provider) {
60316
+ const credential = requireCredentialStore(opts).get(project, provider);
60316
60317
  if (!credential?.accessToken) {
60317
- throw integrationNotConnected(`No ${provider === GoogleMarketingProviders["google-ads"] ? "Google Ads" : "Google Tag Manager"} OAuth connection is available for this project.`);
60318
+ const label = provider === GoogleMarketingProviders["google-ads"] ? "Google Ads" : "Google Tag Manager";
60319
+ const connection = provider === GoogleMarketingProviders["google-ads"] ? app.db.select({ id: googleAdsConnections.id }).from(googleAdsConnections).where(eq100(googleAdsConnections.projectId, project.id)).get() : app.db.select({ id: gtmConnections.id }).from(gtmConnections).where(eq100(gtmConnections.projectId, project.id)).get();
60320
+ if (credential || connection) {
60321
+ throw validationError(`Saved ${label} OAuth credentials are unavailable. Reconnect before retrying.`);
60322
+ }
60323
+ throw integrationNotConnected(`No ${label} OAuth connection is available for this project.`);
60318
60324
  }
60319
60325
  return credential;
60320
60326
  }
@@ -61196,7 +61202,7 @@ async function googleMarketingRoutes(app, opts) {
61196
61202
  assertNotProjectScoped(request, "listing Google Ads customers");
61197
61203
  const project = resolveProject(app.db, request.params.name);
61198
61204
  const projectRef = asProjectRef(project);
61199
- requiredCredential(opts, projectRef, GoogleMarketingProviders["google-ads"]);
61205
+ requiredCredential(app, opts, projectRef, GoogleMarketingProviders["google-ads"]);
61200
61206
  const reader = requireLiveReader(opts);
61201
61207
  let result;
61202
61208
  try {
@@ -61211,7 +61217,7 @@ async function googleMarketingRoutes(app, opts) {
61211
61217
  assertNotProjectScoped(request, "listing Google Tag Manager accounts");
61212
61218
  const project = resolveProject(app.db, request.params.name);
61213
61219
  const projectRef = asProjectRef(project);
61214
- requiredCredential(opts, projectRef, GoogleMarketingProviders.gtm);
61220
+ requiredCredential(app, opts, projectRef, GoogleMarketingProviders.gtm);
61215
61221
  const reader = requireLiveReader(opts);
61216
61222
  try {
61217
61223
  return gtmAccountsResponseSchema.parse(await reader.listGtmAccounts(projectRef));
@@ -61224,7 +61230,7 @@ async function googleMarketingRoutes(app, opts) {
61224
61230
  assertNotProjectScoped(request, "listing Google Tag Manager containers");
61225
61231
  const project = resolveProject(app.db, request.params.name);
61226
61232
  const projectRef = asProjectRef(project);
61227
- requiredCredential(opts, projectRef, GoogleMarketingProviders.gtm);
61233
+ requiredCredential(app, opts, projectRef, GoogleMarketingProviders.gtm);
61228
61234
  const accountId = canonicalizeGtmAccountId(request.params.accountId);
61229
61235
  if (!accountId) throw validationError("Invalid GTM account resource path.");
61230
61236
  const reader = requireLiveReader(opts);
@@ -61239,7 +61245,7 @@ async function googleMarketingRoutes(app, opts) {
61239
61245
  assertNotProjectScoped(request, "listing Google Tag Manager workspaces");
61240
61246
  const project = resolveProject(app.db, request.params.name);
61241
61247
  const projectRef = asProjectRef(project);
61242
- requiredCredential(opts, projectRef, GoogleMarketingProviders.gtm);
61248
+ requiredCredential(app, opts, projectRef, GoogleMarketingProviders.gtm);
61243
61249
  const selection = canonicalizeGtmResourceSelection({
61244
61250
  accountId: request.params.accountId,
61245
61251
  containerId: request.params.containerId
@@ -61285,9 +61291,9 @@ async function googleMarketingRoutes(app, opts) {
61285
61291
  const project = resolveProject(app.db, request.params.name);
61286
61292
  const projectRef = asProjectRef(project);
61287
61293
  try {
61288
- requiredCredential(opts, projectRef, GoogleMarketingProviders["google-ads"]);
61294
+ requiredCredential(app, opts, projectRef, GoogleMarketingProviders["google-ads"]);
61289
61295
  } catch (err) {
61290
- attempt.failed(err, "NOT_CONNECTED");
61296
+ attempt.failed(err);
61291
61297
  throw err;
61292
61298
  }
61293
61299
  const existing = app.db.select().from(googleAdsConnections).where(eq100(googleAdsConnections.projectId, project.id)).get();
@@ -61336,9 +61342,9 @@ async function googleMarketingRoutes(app, opts) {
61336
61342
  const project = resolveProject(app.db, request.params.name);
61337
61343
  const projectRef = asProjectRef(project);
61338
61344
  try {
61339
- requiredCredential(opts, projectRef, GoogleMarketingProviders.gtm);
61345
+ requiredCredential(app, opts, projectRef, GoogleMarketingProviders.gtm);
61340
61346
  } catch (err) {
61341
- attempt.failed(err, "NOT_CONNECTED");
61347
+ attempt.failed(err);
61342
61348
  throw err;
61343
61349
  }
61344
61350
  const existing = app.db.select().from(gtmConnections).where(eq100(gtmConnections.projectId, project.id)).get();
@@ -61387,9 +61393,9 @@ async function googleMarketingRoutes(app, opts) {
61387
61393
  throw notImplemented("Google Ads sync is not configured for this deployment.");
61388
61394
  }
61389
61395
  const project = resolveProject(app.db, request.params.name);
61390
- requiredCredential(opts, asProjectRef(project), GoogleMarketingProviders["google-ads"]);
61396
+ requiredCredential(app, opts, asProjectRef(project), GoogleMarketingProviders["google-ads"]);
61391
61397
  const connection = app.db.select().from(googleAdsConnections).where(eq100(googleAdsConnections.projectId, project.id)).get();
61392
- if (!connection) throw validationError("Connect Google Ads before starting a sync.");
61398
+ if (!connection) throw integrationNotConnected("Connect Google Ads before starting a sync.");
61393
61399
  const candidateRun = queuedRun(project.id, RunKinds["google-ads-sync"], project.name, opts.claimScheduledSync);
61394
61400
  let run = candidateRun;
61395
61401
  let queued = false;
@@ -61423,9 +61429,9 @@ async function googleMarketingRoutes(app, opts) {
61423
61429
  throw notImplemented("Google Tag Manager sync is not configured for this deployment.");
61424
61430
  }
61425
61431
  const project = resolveProject(app.db, request.params.name);
61426
- requiredCredential(opts, asProjectRef(project), GoogleMarketingProviders.gtm);
61432
+ requiredCredential(app, opts, asProjectRef(project), GoogleMarketingProviders.gtm);
61427
61433
  const connection = app.db.select().from(gtmConnections).where(eq100(gtmConnections.projectId, project.id)).get();
61428
- if (!connection) throw validationError("Connect Google Tag Manager before starting a sync.");
61434
+ if (!connection) throw integrationNotConnected("Connect Google Tag Manager before starting a sync.");
61429
61435
  const candidateRun = queuedRun(project.id, RunKinds["gtm-sync"], project.name, opts.claimScheduledSync);
61430
61436
  let run = candidateRun;
61431
61437
  let queued = false;
@@ -68010,7 +68016,7 @@ async function bingRoutes(app, opts) {
68010
68016
  function requireConnection(store, domain) {
68011
68017
  const conn = store.getConnection(domain);
68012
68018
  if (!conn) {
68013
- throw validationError('No Bing connection found for this domain. Run "canonry bing connect <project>" first.');
68019
+ throw integrationNotConnected('No Bing connection found for this domain. Run "canonry bing connect <project>" first.');
68014
68020
  }
68015
68021
  return conn;
68016
68022
  }
@@ -70166,6 +70172,17 @@ async function ga4Routes(app, opts) {
70166
70172
  if (only !== void 0 && !gaSyncOnlySchema.safeParse(only).success) {
70167
70173
  throw validationError(`Invalid "only" value "${only}". Must be one of: ${gaSyncOnlySchema.options.join(", ")}`);
70168
70174
  }
70175
+ const outcome2 = startRouteOutcome(app, FeatureNames.ga4, "sync");
70176
+ const serviceAccount = opts.ga4CredentialStore?.getConnection(project.name);
70177
+ const oauth = opts.googleConnectionStore?.getConnection(project.canonicalDomain, "ga4");
70178
+ if (!serviceAccount && !oauth) {
70179
+ const auth = opts.ga4CredentialStore ? void 0 : opts.getGoogleAuthConfig?.();
70180
+ if (opts.ga4CredentialStore || opts.googleConnectionStore && auth?.clientId && auth.clientSecret) {
70181
+ const error = integrationNotConnected('No GA4 connection found. Run "canonry ga connect <project>" first.');
70182
+ outcome2.report({ status: OutcomeStatuses.failed, ...classifyOutcomeError(error) });
70183
+ throw error;
70184
+ }
70185
+ }
70169
70186
  const syncTraffic = true;
70170
70187
  const syncSummary = true;
70171
70188
  const syncAi = !only || only === "ai";
@@ -70187,7 +70204,6 @@ async function ga4Routes(app, opts) {
70187
70204
  startedAt,
70188
70205
  createdAt: startedAt
70189
70206
  }).run();
70190
- const outcome2 = startRouteOutcome(app, FeatureNames.ga4, "sync");
70191
70207
  let credentialsResolved = false;
70192
70208
  let componentFailure;
70193
70209
  try {
@@ -70656,9 +70672,17 @@ async function ga4Routes(app, opts) {
70656
70672
  } catch (e) {
70657
70673
  const msg = describeError(e);
70658
70674
  gaLog("error", "sync.fetch-failed", { projectId: project.id, runId, error: msg });
70659
- app.db.update(runs).set({ status: RunStatuses.failed, error: msg, finishedAt: (/* @__PURE__ */ new Date()).toISOString() }).where(eq110(runs.id, runId)).run();
70675
+ const saved = app.db.update(runs).set({ status: RunStatuses.failed, error: msg, finishedAt: (/* @__PURE__ */ new Date()).toISOString() }).where(eq110(runs.id, runId)).run().changes === 1;
70660
70676
  outcome2.report({ status: OutcomeStatuses.failed, ...ga4SyncFailure(e, credentialsResolved, opts, project) });
70661
- throw e;
70677
+ if (!saved) throw e;
70678
+ if (e instanceof AppError) {
70679
+ throw new AppError(e.code, e.message, e.statusCode, { ...e.details, runId });
70680
+ }
70681
+ const error = asRecord(e);
70682
+ const httpStatus = error?.statusCode ?? error?.status ?? 500;
70683
+ if (typeof httpStatus === "number" && httpStatus >= 400 && httpStatus < 500) throw e;
70684
+ app.log.error(e);
70685
+ throw internalError("An unexpected error occurred", { runId });
70662
70686
  }
70663
70687
  });
70664
70688
  app.get("/projects/:name/ga/traffic", async (request, _reply) => {
@@ -74885,7 +74909,7 @@ async function requestJson(options, request, signal) {
74885
74909
  sleep: options.sleep
74886
74910
  });
74887
74911
  }
74888
- function asRecord(value, label) {
74912
+ function asRecord2(value, label) {
74889
74913
  if (value == null || typeof value !== "object" || Array.isArray(value)) {
74890
74914
  throw new CloudflareQueueApiError(`Cloudflare Queue ${label} is malformed`, 502);
74891
74915
  }
@@ -74906,7 +74930,7 @@ function stringField(record3, key, label) {
74906
74930
  return value;
74907
74931
  }
74908
74932
  function metadata(record3) {
74909
- const value = asRecord(record3.metadata, "message metadata");
74933
+ const value = asRecord2(record3.metadata, "message metadata");
74910
74934
  const parsed = {};
74911
74935
  for (const [key, entry] of Object.entries(value)) {
74912
74936
  if (typeof entry !== "string") {
@@ -75011,11 +75035,11 @@ function decodeMessage(record3) {
75011
75035
  return poison("unsupported-content-type");
75012
75036
  }
75013
75037
  function parsePullEnvelope(value) {
75014
- const envelope = asRecord(value, "pull response");
75038
+ const envelope = asRecord2(value, "pull response");
75015
75039
  if (envelope.success !== true) {
75016
75040
  throw new CloudflareQueueApiError("Cloudflare Queue pull was not successful", 502);
75017
75041
  }
75018
- const result = asRecord(envelope.result, "pull result");
75042
+ const result = asRecord2(envelope.result, "pull result");
75019
75043
  const messageBacklogCount = nonNegativeInteger(result.message_backlog_count, "message_backlog_count");
75020
75044
  if (!Array.isArray(result.messages)) {
75021
75045
  throw new CloudflareQueueApiError("Cloudflare Queue messages is malformed", 502);
@@ -75055,12 +75079,12 @@ function ackWarningCount(value) {
75055
75079
  return Object.keys(warnings).length;
75056
75080
  }
75057
75081
  function parseAckEnvelope(value, expectedAckCount, expectedRetryCount) {
75058
- const envelope = asRecord(value, "ack response");
75082
+ const envelope = asRecord2(value, "ack response");
75059
75083
  if (envelope.success !== true) {
75060
75084
  throw new CloudflareQueueApiError("Cloudflare Queue acknowledgement was not successful", 502);
75061
75085
  }
75062
75086
  if (envelope.result == null) return 0;
75063
- const result = asRecord(envelope.result, "ack result");
75087
+ const result = asRecord2(envelope.result, "ack result");
75064
75088
  const ackCount = optionalAckCount(result, "ackCount");
75065
75089
  const retryCount = optionalAckCount(result, "retryCount");
75066
75090
  if (ackCount !== void 0 && ackCount !== expectedAckCount || retryCount !== void 0 && retryCount !== expectedRetryCount) {
@@ -21,7 +21,7 @@ import {
21
21
  templateLinkRatio,
22
22
  templateLinkUbiquityAvailable,
23
23
  validationError
24
- } from "./chunk-LEW6WFYV.js";
24
+ } from "./chunk-3OZ5WKRH.js";
25
25
 
26
26
  // ../db/src/client.ts
27
27
  import { mkdirSync } from "fs";
@@ -2,10 +2,10 @@ import {
2
2
  SNAPSHOT_CELL_LEGEND,
3
3
  citationGlyph,
4
4
  mentionGlyph
5
- } from "./chunk-MXDKDPRJ.js";
5
+ } from "./chunk-VD6Q7ZUX.js";
6
6
  import {
7
7
  createApiClient
8
- } from "./chunk-27MI43WQ.js";
8
+ } from "./chunk-2MDEKCDU.js";
9
9
  import {
10
10
  emitJsonl
11
11
  } from "./chunk-Z7IUAJOF.js";
@@ -13,7 +13,7 @@ import {
13
13
  CliError,
14
14
  EXIT_SYSTEM_ERROR,
15
15
  isMachineFormat
16
- } from "./chunk-EEYFNSVL.js";
16
+ } from "./chunk-QQFTJVHT.js";
17
17
  import {
18
18
  MentionIdentities,
19
19
  OUTSTANDING_PROVIDER_BATCH_STATUSES,
@@ -23,7 +23,7 @@ import {
23
23
  formatMicros,
24
24
  formatRunErrorOneLine,
25
25
  resolveProviderInput
26
- } from "./chunk-LEW6WFYV.js";
26
+ } from "./chunk-3OZ5WKRH.js";
27
27
 
28
28
  // src/commands/run.ts
29
29
  function getClient() {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  CliError,
6
6
  isMachineFormat
7
- } from "./chunk-EEYFNSVL.js";
7
+ } from "./chunk-QQFTJVHT.js";
8
8
  import {
9
9
  CodingAgents,
10
10
  SKILL_MANIFEST_FILENAME,
@@ -15,7 +15,7 @@ import {
15
15
  formatCanonryPluginUpdateHint,
16
16
  formatCanonryPluginVersionMismatch,
17
17
  skillsClientSchema
18
- } from "./chunk-LEW6WFYV.js";
18
+ } from "./chunk-3OZ5WKRH.js";
19
19
 
20
20
  // src/commands/skills.ts
21
21
  import crypto from "crypto";
@@ -28716,6 +28716,7 @@ function classifyOutcomeError(err) {
28716
28716
  if (code === "FORBIDDEN") return { reasonCode: "PERMISSION_MISSING", errorName };
28717
28717
  if (code === "PROVIDER_BILLING") return { reasonCode: "BILLING", errorName };
28718
28718
  if (code === "NOT_FOUND") return { reasonCode: "NOT_FOUND", errorName };
28719
+ if (code === "INTEGRATION_NOT_CONNECTED") return { reasonCode: "NOT_CONNECTED", errorName };
28719
28720
  if (code === "VALIDATION_ERROR") return { reasonCode: "VALIDATION", errorName };
28720
28721
  if (code === "RUN_CANCELLED") return { reasonCode: "CANCELLED_BY_USER", errorName };
28721
28722
  const status = httpStatusOf(e);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pickProjectCitedDomain
3
- } from "./chunk-C7IGAN7U.js";
3
+ } from "./chunk-QRA6GFXX.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-OZRJ73XU.js";
6
+ } from "./chunk-DI5EEYDP.js";
7
7
  import {
8
8
  GBP_INSIGHT_PROVIDER,
9
9
  PERSISTENT_GAP_THRESHOLD,
@@ -18,7 +18,7 @@ import {
18
18
  notScopedRun,
19
19
  readGscQueryDailyRows,
20
20
  readLatestGscDataDate
21
- } from "./chunk-ZI5JGJFY.js";
21
+ } from "./chunk-2UAW7YJQ.js";
22
22
  import {
23
23
  competitors,
24
24
  gbpDailyMetrics,
@@ -36,7 +36,7 @@ import {
36
36
  queries,
37
37
  querySnapshots,
38
38
  runs
39
- } from "./chunk-OC35PZAC.js";
39
+ } from "./chunk-35NITZHC.js";
40
40
  import {
41
41
  CitationStates,
42
42
  RunKinds,
@@ -45,7 +45,7 @@ import {
45
45
  effectiveDomains,
46
46
  isCitationStateMeasured,
47
47
  readCitationState
48
- } from "./chunk-LEW6WFYV.js";
48
+ } from "./chunk-3OZ5WKRH.js";
49
49
 
50
50
  // src/intelligence-service.ts
51
51
  import { eq, desc, asc, and, ne, or, inArray, gte, lte, isNull, sql, exists } from "drizzle-orm";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  USAGE_TELEMETRY_HEADERS,
3
3
  redactLogString
4
- } from "./chunk-LEW6WFYV.js";
4
+ } from "./chunk-3OZ5WKRH.js";
5
5
 
6
6
  // ../api-routes/src/request-context.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createLogger
3
- } from "./chunk-OZRJ73XU.js";
3
+ } from "./chunk-DI5EEYDP.js";
4
4
  import {
5
5
  addLikelyFakeAgentHits,
6
6
  correctBackgroundCallJourneys,
7
7
  mergeSplitJourneyVisitors,
8
8
  repairAiReferralArrivalsOnStartup,
9
9
  writeUnrecognizedAgentBuckets
10
- } from "./chunk-ZI5JGJFY.js";
10
+ } from "./chunk-2UAW7YJQ.js";
11
11
  import {
12
12
  AGENT_TRUST_RULES_VERSION,
13
13
  BROWSER_AGENT_BOT_IDS,
@@ -31,7 +31,7 @@ import {
31
31
  normalizeTrafficPathPattern,
32
32
  rulesShareVerificationList,
33
33
  unrecognizedAgentName
34
- } from "./chunk-2T4IZBIB.js";
34
+ } from "./chunk-EGTFX3NN.js";
35
35
  import {
36
36
  RawEventSampleEventTypes,
37
37
  agentJourneyCaptureDays,
@@ -48,7 +48,7 @@ import {
48
48
  trafficReclassificationState,
49
49
  trafficSources,
50
50
  unrecognizedAgentEventsHourly
51
- } from "./chunk-OC35PZAC.js";
51
+ } from "./chunk-35NITZHC.js";
52
52
  import {
53
53
  AI_ENGINE_DOMAINS,
54
54
  AI_ENGINE_SELF_DOMAINS,
@@ -84,7 +84,7 @@ import {
84
84
  sortedUnique,
85
85
  usageCount,
86
86
  withRetry
87
- } from "./chunk-LEW6WFYV.js";
87
+ } from "./chunk-3OZ5WKRH.js";
88
88
 
89
89
  // ../provider-openai/src/normalize.ts
90
90
  import OpenAI from "openai";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  registeredProviderNames
3
- } from "./chunk-Z7TP2GD4.js";
3
+ } from "./chunk-U2LYHQHF.js";
4
4
  import {
5
5
  configExists,
6
6
  loadConfigRaw
7
- } from "./chunk-WHH3XSRE.js";
7
+ } from "./chunk-VP3F4BOG.js";
8
8
 
9
9
  // src/setup-state.ts
10
10
  import fs from "fs";
@@ -28,7 +28,7 @@ async function buildSetupState() {
28
28
  }
29
29
  if (dbPath && fs.existsSync(dbPath)) {
30
30
  try {
31
- const { createClient, projects, queries: queriesTable } = await import("./src-NPY2WNGF.js");
31
+ const { createClient, projects, queries: queriesTable } = await import("./src-VYDX5USM.js");
32
32
  const db = createClient(dbPath);
33
33
  project_count = db.select({ id: projects.id }).from(projects).all().length;
34
34
  const firstQuery = db.select({ id: queriesTable.id }).from(queriesTable).limit(1).all();
@@ -47,7 +47,7 @@ function queueServeHandoff() {
47
47
  async function runPendingServeHandoff(format) {
48
48
  if (!pendingServeHandoff) return;
49
49
  pendingServeHandoff = false;
50
- const { serveCommand } = await import("./serve-M5CIAJQP.js");
50
+ const { serveCommand } = await import("./serve-K2IQQEBQ.js");
51
51
  await serveCommand(format);
52
52
  }
53
53
 
@@ -2,18 +2,18 @@ import {
2
2
  configExists,
3
3
  loadConfigRaw,
4
4
  saveConfigPatch
5
- } from "./chunk-WHH3XSRE.js";
5
+ } from "./chunk-VP3F4BOG.js";
6
6
  import {
7
7
  BUNDLED_SKILL_NAMES,
8
8
  installSkills
9
- } from "./chunk-G46YLF5X.js";
9
+ } from "./chunk-3G5FQLF7.js";
10
10
  import {
11
11
  PACKAGE_VERSION
12
12
  } from "./chunk-AOJU5LKX.js";
13
13
  import {
14
14
  SKILL_MANIFEST_FILENAME,
15
15
  SkillsClients
16
- } from "./chunk-LEW6WFYV.js";
16
+ } from "./chunk-3OZ5WKRH.js";
17
17
 
18
18
  // src/skills-autosync.ts
19
19
  import fs from "fs";
@@ -28,7 +28,7 @@ import {
28
28
  unknownUsageObservation,
29
29
  usdToMicros,
30
30
  withRetry
31
- } from "./chunk-LEW6WFYV.js";
31
+ } from "./chunk-3OZ5WKRH.js";
32
32
 
33
33
  // ../provider-answer-services/src/core/http.ts
34
34
  var MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getRequestContext
3
- } from "./chunk-J3C4XFWJ.js";
3
+ } from "./chunk-A75GIIWP.js";
4
4
  import {
5
5
  diagnosticIdentity,
6
6
  redactLogString,
7
7
  redactLogValue
8
- } from "./chunk-LEW6WFYV.js";
8
+ } from "./chunk-3OZ5WKRH.js";
9
9
 
10
10
  // ../api-routes/src/runtime-logger.ts
11
11
  import { format } from "util";
@@ -17,7 +17,7 @@ import {
17
17
  hostOf,
18
18
  isLocationRedirectStatus,
19
19
  pathWithoutQuery
20
- } from "./chunk-LEW6WFYV.js";
20
+ } from "./chunk-3OZ5WKRH.js";
21
21
 
22
22
  // ../integration-traffic/src/agent-trust.ts
23
23
  var AGENT_TRUST_RULES_VERSION = 3;
@@ -11418,11 +11418,14 @@ var chatgpt_user_default = {
11418
11418
  // ../integration-traffic/src/ip-ranges/claude-agent.json
11419
11419
  var claude_agent_default = {
11420
11420
  _source: "https://claude.com/.well-known/sail",
11421
- creationTime: "2026-10-22T18:36:00Z",
11421
+ creationTime: "2026-11-14T02:20:00Z",
11422
11422
  prefixes: [
11423
11423
  {
11424
11424
  ipv4Prefix: "136.71.21.147/32"
11425
11425
  },
11426
+ {
11427
+ ipv4Prefix: "153.61.208.16/32"
11428
+ },
11426
11429
  {
11427
11430
  ipv4Prefix: "34.171.207.92/32"
11428
11431
  },
@@ -17243,7 +17246,7 @@ var perplexity_user_default = {
17243
17246
  // ../integration-traffic/src/ip-ranges/perplexitybot.json
17244
17247
  var perplexitybot_default = {
17245
17248
  _source: "https://www.perplexity.com/perplexitybot.json",
17246
- creationTime: "2026-10-28T16:48:51.000000",
17249
+ creationTime: "2026-11-18T16:30:18.000000",
17247
17250
  prefixes: [
17248
17251
  {
17249
17252
  ipv4Prefix: "107.20.236.150/32"
@@ -17283,6 +17286,30 @@ var perplexitybot_default = {
17283
17286
  },
17284
17287
  {
17285
17288
  ipv4Prefix: "3.224.62.45/32"
17289
+ },
17290
+ {
17291
+ ipv4Prefix: "3.41.218.160/32"
17292
+ },
17293
+ {
17294
+ ipv4Prefix: "3.41.218.161/32"
17295
+ },
17296
+ {
17297
+ ipv4Prefix: "3.41.218.162/32"
17298
+ },
17299
+ {
17300
+ ipv4Prefix: "3.41.218.163/32"
17301
+ },
17302
+ {
17303
+ ipv4Prefix: "3.41.218.164/32"
17304
+ },
17305
+ {
17306
+ ipv4Prefix: "3.41.218.165/32"
17307
+ },
17308
+ {
17309
+ ipv4Prefix: "3.41.218.166/32"
17310
+ },
17311
+ {
17312
+ ipv4Prefix: "3.41.218.167/32"
17286
17313
  }
17287
17314
  ]
17288
17315
  };
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  runWithUsageTags
3
- } from "./chunk-27MI43WQ.js";
3
+ } from "./chunk-2MDEKCDU.js";
4
4
  import {
5
5
  CanonryMcpToolNames,
6
6
  DEPRECATED_MCP_TOOL_ALIAS_NAMES,
7
7
  canonryMcpTools
8
- } from "./chunk-2JMNIWOG.js";
8
+ } from "./chunk-PAP62URW.js";
9
9
  import {
10
10
  CliError
11
- } from "./chunk-EEYFNSVL.js";
11
+ } from "./chunk-QQFTJVHT.js";
12
12
  import {
13
13
  buildOpenApiDocument
14
- } from "./chunk-ZI5JGJFY.js";
14
+ } from "./chunk-2UAW7YJQ.js";
15
15
  import {
16
16
  DEFAULT_COMPETITOR_AUTO_ALIAS_MODE,
17
17
  MeasurementPortfolioLists,
@@ -24,7 +24,7 @@ import {
24
24
  seoDatasetWithoutVendor,
25
25
  seoProviderSchema,
26
26
  truncateUtf16
27
- } from "./chunk-LEW6WFYV.js";
27
+ } from "./chunk-3OZ5WKRH.js";
28
28
 
29
29
  // src/agent/tools.ts
30
30
  import { Type as Type2 } from "@earendil-works/pi-ai";
@@ -5,7 +5,7 @@ import {
5
5
  isStoredPageReadTool,
6
6
  isStoredReadTool,
7
7
  truncateToolResult
8
- } from "./chunk-P2RFC35A.js";
8
+ } from "./chunk-GAWCJBY6.js";
9
9
  import {
10
10
  CANONRY_MCP_TOOLKITS,
11
11
  resolveAeroSkillDir
@@ -23,18 +23,18 @@ import {
23
23
  resolveApiKeyFor,
24
24
  resolveModelForProvider,
25
25
  validateAgentProviderRegistry
26
- } from "./chunk-WHH3XSRE.js";
26
+ } from "./chunk-VP3F4BOG.js";
27
27
  import {
28
28
  CanonryMcpToolNames,
29
29
  canonryMcpTools
30
- } from "./chunk-2JMNIWOG.js";
30
+ } from "./chunk-PAP62URW.js";
31
31
  import {
32
32
  createLogger
33
- } from "./chunk-OZRJ73XU.js";
33
+ } from "./chunk-DI5EEYDP.js";
34
34
  import {
35
35
  agentToolEvents,
36
36
  llmUsageEvents
37
- } from "./chunk-OC35PZAC.js";
37
+ } from "./chunk-35NITZHC.js";
38
38
  import {
39
39
  MeasurementPortfolioLists,
40
40
  SEO_TREND_METRICS_BY_KIND,
@@ -45,7 +45,7 @@ import {
45
45
  describeError,
46
46
  validationError,
47
47
  visibilityReportRequestSchema
48
- } from "./chunk-LEW6WFYV.js";
48
+ } from "./chunk-3OZ5WKRH.js";
49
49
 
50
50
  // src/agent/session.ts
51
51
  import fs2 from "fs";