@canonry/canonry 7.91.2 → 7.92.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.
Files changed (135) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -1
  2. package/assets/assets/{AgentSetupPage-DpBlChWi.js → AgentSetupPage-Dr5ZoPYi.js} +1 -1
  3. package/assets/assets/{AuditHistoryPanel-DAotR_zD.js → AuditHistoryPanel-Dc8pGeZT.js} +1 -1
  4. package/assets/assets/{BacklinksPage-CFoi9mrt.js → BacklinksPage-zEaP7G6s.js} +1 -1
  5. package/assets/assets/{HistoryPage-DIGmY4wi.js → HistoryPage-9OaxBSY8.js} +1 -1
  6. package/assets/assets/{MeasurementPropertyPage-C6o9U2R6.js → MeasurementPropertyPage-k_mqkoWn.js} +1 -1
  7. package/assets/assets/{ProjectPage-00Vsnxv4.js → ProjectPage-vgHaFT7S.js} +1 -1
  8. package/assets/assets/{RunsPage-ChSbIrF9.js → RunsPage-CXkefezd.js} +1 -1
  9. package/assets/assets/{SettingsPage-CIrzXeP8.js → SettingsPage-C8FUNUN5.js} +1 -1
  10. package/assets/assets/{SiteHealthSection-HZXdeAOx.js → SiteHealthSection-C94uYTE3.js} +2 -2
  11. package/assets/assets/ToneBadge-COrS2zpP.js +60 -0
  12. package/assets/assets/{TrafficPage-ZYsFSEuq.js → TrafficPage-KlGx3-bc.js} +1 -1
  13. package/assets/assets/{TrafficSourceDetailPage-D5uJZpZ4.js → TrafficSourceDetailPage-BMs9kd7S.js} +1 -1
  14. package/assets/assets/{account-context-DMLbDVNZ.js → account-context-F2VRKRtu.js} +1 -1
  15. package/assets/assets/{agent-trust-copy-DbpAXPxc.js → agent-trust-copy-Hb775a57.js} +1 -1
  16. package/assets/assets/{card-Be_eN_-Q.js → card-P1VA-JnV.js} +1 -1
  17. package/assets/assets/{format-helpers-IKCsn-Iw.js → format-helpers-COfTmLRL.js} +1 -1
  18. package/assets/assets/{index-3jdPlyTf.js → index-DHrWeA6k.js} +4 -4
  19. package/assets/assets/{query-client-CoKNm49W.js → query-client-BHtq57Sw.js} +1 -1
  20. package/assets/assets/{react-query-DIdeX4Dn.js → react-query-IhpEAOba.js} +1 -1
  21. package/assets/assets/{react-sigma_core.esm.min-De3OcL3T.js → react-sigma_core.esm.min-B4NX5_aX.js} +1 -1
  22. package/assets/assets/{server-traffic-DvN44H1n.js → server-traffic-ykAWQo0I.js} +1 -1
  23. package/assets/assets/{service-RpR2yqfP.js → service-m9l8my0x.js} +1 -1
  24. package/assets/index.html +7 -7
  25. package/dist/{ads-RC5EHP6E.js → ads-LRHVFP2J.js} +3 -3
  26. package/dist/{agent-JYG5XPUJ.js → agent-P7HWL7VX.js} +7 -7
  27. package/dist/{agent-ask-FGPGEOEI.js → agent-ask-S374MIJS.js} +3 -3
  28. package/dist/{agent-conversations-Q3EKETCC.js → agent-conversations-3SSKVUYG.js} +3 -3
  29. package/dist/{agent-journeys-IHBTU6SZ.js → agent-journeys-ZEO7Z4QR.js} +3 -3
  30. package/dist/{agent-memory-RXEPKF5K.js → agent-memory-E5YVW5WY.js} +3 -3
  31. package/dist/{agent-providers-LDMGD7TD.js → agent-providers-BWWB42XJ.js} +3 -3
  32. package/dist/{agent-transcript-NXSXOYNE.js → agent-transcript-YG7TTHWS.js} +3 -3
  33. package/dist/{analytics-4BILIAM5.js → analytics-AIKX4BUM.js} +3 -3
  34. package/dist/{apply-ENLWU4Z2.js → apply-5MPSMIKM.js} +3 -3
  35. package/dist/{backfill-HHG3Z46F.js → backfill-2BFEE6XJ.js} +10 -10
  36. package/dist/{backlinks-5MMWYPFW.js → backlinks-L6BYIJIK.js} +3 -3
  37. package/dist/{bing-KO3PDNXZ.js → bing-E4ZSEVQV.js} +3 -3
  38. package/dist/{bootstrap-E76JLH63.js → bootstrap-V7OE6XXB.js} +10 -10
  39. package/dist/{cdp-BZRWX3MX.js → cdp-LWNX6UZF.js} +7 -7
  40. package/dist/{chunk-MNIQFFLL.js → chunk-2D3JYWFX.js} +4 -4
  41. package/dist/{chunk-MM3OYQ53.js → chunk-3WWSOWXP.js} +2 -2
  42. package/dist/{chunk-OK6MKE4B.js → chunk-4HLR3DRQ.js} +1 -1
  43. package/dist/{chunk-V4MRQPV2.js → chunk-4QYGB5IC.js} +1 -1
  44. package/dist/{chunk-XFVB3UCE.js → chunk-7534NXSP.js} +1 -1
  45. package/dist/{chunk-7LN6QPV7.js → chunk-76KBMLPR.js} +1 -1
  46. package/dist/{chunk-SMH4FUXJ.js → chunk-AUC47DFW.js} +1 -1
  47. package/dist/{chunk-PIOCF5GN.js → chunk-BRNZ3G3B.js} +5 -5
  48. package/dist/{chunk-PIDL7OJ4.js → chunk-BTYOU24P.js} +2 -2
  49. package/dist/{chunk-QZM44MJL.js → chunk-BYDJIBAB.js} +358 -357
  50. package/dist/{chunk-KVNGLXG7.js → chunk-CIP3CE2C.js} +3 -3
  51. package/dist/{chunk-5MBZUPY3.js → chunk-DEFHTBJV.js} +1 -1
  52. package/dist/{chunk-B23XQ5OP.js → chunk-ERSHLW5J.js} +4 -4
  53. package/dist/{chunk-KKVIRNFF.js → chunk-EWZOL56J.js} +3 -3
  54. package/dist/{chunk-2REKLGYS.js → chunk-FYYOX7UY.js} +18 -1
  55. package/dist/{chunk-ZYHP6QZO.js → chunk-GNHXSSQM.js} +2 -2
  56. package/dist/{chunk-ZR4WEKEC.js → chunk-H3PWMM4K.js} +1 -1
  57. package/dist/{chunk-FX5H2PD5.js → chunk-IDISBRPO.js} +7 -7
  58. package/dist/{chunk-5DMCGBIT.js → chunk-JZVTSC2V.js} +2 -2
  59. package/dist/{chunk-JC2MAKWO.js → chunk-K7ZG6K7J.js} +1 -1
  60. package/dist/{chunk-JXGVPQA5.js → chunk-KKSE52CI.js} +6 -6
  61. package/dist/{chunk-ML3KDUHO.js → chunk-MDYFHX5Y.js} +70 -22
  62. package/dist/{chunk-UHCRUGI5.js → chunk-N2EWSWZD.js} +1 -1
  63. package/dist/{chunk-6SEWKBDC.js → chunk-O7D7KV75.js} +3 -3
  64. package/dist/{chunk-JKBQ3G25.js → chunk-P6ZDIVFZ.js} +1 -1
  65. package/dist/{chunk-FYJMNYVR.js → chunk-T5DH6FEH.js} +1 -1
  66. package/dist/{chunk-SMSTXGJX.js → chunk-TY5YTNLU.js} +2 -2
  67. package/dist/{chunk-SC7WEHEK.js → chunk-U3T37P7H.js} +3 -3
  68. package/dist/{chunk-PAC5EE5X.js → chunk-UMTYAPCQ.js} +4 -4
  69. package/dist/{chunk-FLP4XMWI.js → chunk-WONUYAKB.js} +4 -4
  70. package/dist/{chunk-IPFSY55D.js → chunk-XYQMPYWE.js} +1 -1
  71. package/dist/{chunk-T6ZYAUJX.js → chunk-ZEZPTUUB.js} +31 -14
  72. package/dist/{chunk-EIYNZOQA.js → chunk-ZPVJ5PVB.js} +2 -2
  73. package/dist/{chunk-QS57GCF4.js → chunk-ZTCQVHQV.js} +2 -2
  74. package/dist/{chunk-HMNQTF3E.js → chunk-ZTRGUTUP.js} +5 -5
  75. package/dist/{citations-UEKKVKBV.js → citations-BYSB6NON.js} +3 -3
  76. package/dist/{cli-catalog-HJOVIDG6.js → cli-catalog-CFCLMVSK.js} +3 -3
  77. package/dist/{cli-commands-5FUTLXQS.js → cli-commands-G5LDZRUU.js} +7 -7
  78. package/dist/cli.js +13 -13
  79. package/dist/{competitor-3TX3GOLA.js → competitor-DUYU7EL7.js} +3 -3
  80. package/dist/{content-BKICG6BP.js → content-OGURKOCE.js} +3 -3
  81. package/dist/{dashboard-HOCPAGFO.js → dashboard-UOIHD75S.js} +6 -6
  82. package/dist/{demo-IXNY4QU4.js → demo-UTXZOVOZ.js} +1 -1
  83. package/dist/{demo-server-HGKXT27V.js → demo-server-4TRTOGKP.js} +12 -12
  84. package/dist/{discover-LBULUEYL.js → discover-SHUCBUDJ.js} +3 -3
  85. package/dist/{discover-eval-V7UJGWHK.js → discover-eval-3ZTYLTGU.js} +3 -3
  86. package/dist/{doctor-O45PQVTM.js → doctor-FRSV5GAR.js} +3 -3
  87. package/dist/{evidence-FCNEZ7OV.js → evidence-7UJHNILW.js} +3 -3
  88. package/dist/{export-cmd-CFC3HYWQ.js → export-cmd-2DAWSD52.js} +3 -3
  89. package/dist/{ga-V643BFQV.js → ga-K2EVI3KO.js} +3 -3
  90. package/dist/{gbp-L5PCSFCF.js → gbp-NXFINC7N.js} +3 -3
  91. package/dist/{google-TO6R7PKD.js → google-J4T52EIG.js} +4 -4
  92. package/dist/{google-marketing-BOSOBO4T.js → google-marketing-PZGKZPEB.js} +1 -1
  93. package/dist/{health-cmd-UZKM4AB7.js → health-cmd-5IHX5GRQ.js} +3 -3
  94. package/dist/{history-WRVANB63.js → history-IVO5IVH2.js} +3 -3
  95. package/dist/index.d.ts +71 -71
  96. package/dist/index.js +25 -25
  97. package/dist/{init-CYKAYU6A.js → init-TNCLNDMS.js} +12 -12
  98. package/dist/{insights-UQ76TUH7.js → insights-SPA2BVMV.js} +3 -3
  99. package/dist/intelligence-service-YPKAM4JJ.js +16 -0
  100. package/dist/{journeys-6S235DIK.js → journeys-7FAHZRGP.js} +3 -3
  101. package/dist/{keys-VXQWKBDR.js → keys-PPBHRYPZ.js} +3 -3
  102. package/dist/{keyword-VM26Z6Z7.js → keyword-C4ULYIWF.js} +3 -3
  103. package/dist/{logs-B4UKUNNS.js → logs-X7NQN4UT.js} +3 -3
  104. package/dist/{mcp-NFRDBPMW.js → mcp-ERMFW6WJ.js} +4 -4
  105. package/dist/mcp.js +9 -9
  106. package/dist/{measurement-plan-PH4S4NL4.js → measurement-plan-7IPWYNIC.js} +5 -5
  107. package/dist/{notify-XCFFEECP.js → notify-AC4ZHLUK.js} +3 -3
  108. package/dist/{organic-evidence-P6YKEE5J.js → organic-evidence-GDDMNJHN.js} +3 -3
  109. package/dist/{overview-XA7WM5QI.js → overview-7VCUIYQE.js} +4 -4
  110. package/dist/{project-US5UT3TO.js → project-N4RGX5CT.js} +3 -3
  111. package/dist/{query-MVLTNGDG.js → query-Y7LGD6PG.js} +3 -3
  112. package/dist/{research-XWJOXQDW.js → research-WTZO3D7B.js} +3 -3
  113. package/dist/{results-export-QMNLDPOB.js → results-export-BYUFBWEK.js} +3 -3
  114. package/dist/{run-U7Y3UINV.js → run-SXMD6GW5.js} +4 -4
  115. package/dist/{schedule-WO72K2TA.js → schedule-UQFPQBHI.js} +3 -3
  116. package/dist/{search-VFN7HC4Q.js → search-EJUJRZEE.js} +3 -3
  117. package/dist/{serve-R5SZLLJ7.js → serve-ON5OOCRY.js} +26 -26
  118. package/dist/{session-IF7IXHSS.js → session-4RJTRXIO.js} +13 -13
  119. package/dist/{settings-RTPDTKM3.js → settings-ZBP3KDJK.js} +3 -3
  120. package/dist/{sitemaps-5CCNCMM4.js → sitemaps-KVROUSLB.js} +3 -3
  121. package/dist/{skills-ZWET6NI7.js → skills-AGAHFQD5.js} +2 -2
  122. package/dist/{snapshot-CCQ62PWI.js → snapshot-WDK6ZSJA.js} +3 -3
  123. package/dist/{src-G42HKGIS.js → src-XGUBO65J.js} +2 -2
  124. package/dist/{status-YE6MWDYD.js → status-IFUJIB73.js} +4 -4
  125. package/dist/{technical-aeo-LIEMDI5R.js → technical-aeo-6KR3YH4X.js} +3 -3
  126. package/dist/{telemetry-D5OR6DKJ.js → telemetry-EZNMZMH6.js} +4 -4
  127. package/dist/{tools-R63V5YCE.js → tools-HRHCCGJ5.js} +11 -11
  128. package/dist/{traffic-6JJNWQZL.js → traffic-7OSHD23C.js} +5 -5
  129. package/dist/{trends-QZEDEIQE.js → trends-I3NWFNHX.js} +3 -3
  130. package/dist/{users-UYTKWYR6.js → users-VBLZGMML.js} +3 -3
  131. package/dist/{visibility-stats-ESDTTTAE.js → visibility-stats-6YAV2MTM.js} +18 -3
  132. package/dist/{wordpress-EJLVQNNU.js → wordpress-EM3S3NDA.js} +3 -3
  133. package/package.json +1 -1
  134. package/assets/assets/ToneBadge-ht0n6RUH.js +0 -60
  135. package/dist/intelligence-service-LVOX33SJ.js +0 -16
@@ -2,13 +2,13 @@ import {
2
2
  bucketCliCommandDuration,
3
3
  isTelemetryEnabled,
4
4
  trackEvent
5
- } from "./chunk-SMSTXGJX.js";
5
+ } from "./chunk-TY5YTNLU.js";
6
6
  import {
7
7
  getConfigDir
8
- } from "./chunk-V4MRQPV2.js";
8
+ } from "./chunk-4QYGB5IC.js";
9
9
  import {
10
10
  currentOutcomeAttribution
11
- } from "./chunk-JC2MAKWO.js";
11
+ } from "./chunk-K7ZG6K7J.js";
12
12
  import {
13
13
  AGENT_NONE,
14
14
  OutcomeSurfaces,
@@ -19,7 +19,7 @@ import {
19
19
  integrationConnectionPropertiesSchema,
20
20
  normalizeAgentSlug,
21
21
  usageSurfaceSchema
22
- } from "./chunk-2REKLGYS.js";
22
+ } from "./chunk-FYYOX7UY.js";
23
23
 
24
24
  // src/outcome-telemetry.ts
25
25
  import fs from "fs";
@@ -23,7 +23,7 @@ import {
23
23
  measurementDraftUpsertGroupRequestSchema,
24
24
  measurementDraftUpsertMarketRequestSchema,
25
25
  measurementDraftUpsertTargetRequestSchema
26
- } from "./chunk-2REKLGYS.js";
26
+ } from "./chunk-FYYOX7UY.js";
27
27
 
28
28
  // src/measurement-draft-actions.ts
29
29
  import { z } from "zod";
@@ -15,14 +15,14 @@ import {
15
15
  normalizeCloudflareWorkerEvent,
16
16
  sessionizeJourneyRequests,
17
17
  verifyRequestSignature
18
- } from "./chunk-XFVB3UCE.js";
18
+ } from "./chunk-7534NXSP.js";
19
19
  import {
20
20
  currentOutcomeAttribution,
21
21
  getRequestContext,
22
22
  registerRequestContext,
23
23
  requestAuditIdentity,
24
24
  sanitizeRequestContext
25
- } from "./chunk-JC2MAKWO.js";
25
+ } from "./chunk-K7ZG6K7J.js";
26
26
  import {
27
27
  RawEventSampleEventTypes,
28
28
  SentimentIdempotencyConflict,
@@ -180,7 +180,7 @@ import {
180
180
  userSessions,
181
181
  users,
182
182
  writeNegativeReviewMaxStars
183
- } from "./chunk-ZR4WEKEC.js";
183
+ } from "./chunk-H3PWMM4K.js";
184
184
  import {
185
185
  ADS_ACTIVATE_SCOPE,
186
186
  ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
@@ -1275,7 +1275,7 @@ import {
1275
1275
  wordpressSchemaDeployResultDtoSchema,
1276
1276
  wordpressSchemaStatusResultDtoSchema,
1277
1277
  wordpressStatusDtoSchema
1278
- } from "./chunk-2REKLGYS.js";
1278
+ } from "./chunk-FYYOX7UY.js";
1279
1279
 
1280
1280
  // ../api-routes/src/user-session.ts
1281
1281
  import crypto2 from "crypto";
@@ -33381,6 +33381,11 @@ function computeVisibilityStats(input) {
33381
33381
  const byQuery = /* @__PURE__ */ new Map();
33382
33382
  const totals = emptyAgg();
33383
33383
  const totalsByProvider = /* @__PURE__ */ new Map();
33384
+ const byClass = { branded: emptyAgg(), nonBrand: emptyAgg(), unclassified: emptyAgg() };
33385
+ const classKey = (queryId) => {
33386
+ const queryClass = input.queryClasses?.get(queryId) ?? null;
33387
+ return queryClass === "branded" ? "branded" : queryClass === "non-brand" ? "nonBrand" : "unclassified";
33388
+ };
33384
33389
  for (const snap of input.snapshots) {
33385
33390
  const resolved = resolveCurrentQuery(attribution, snap);
33386
33391
  if (!resolved) continue;
@@ -33391,6 +33396,7 @@ function computeVisibilityStats(input) {
33391
33396
  }
33392
33397
  addSnapshot(bucket.agg, snap);
33393
33398
  addSnapshot(totals, snap);
33399
+ if (input.queryClasses) addSnapshot(byClass[classKey(resolved.id)], snap);
33394
33400
  if (wantProviders) {
33395
33401
  const qpAgg = bucket.byProvider.get(snap.provider) ?? emptyAgg();
33396
33402
  addSnapshot(qpAgg, snap);
@@ -33406,12 +33412,14 @@ function computeVisibilityStats(input) {
33406
33412
  ...counts(bucket.agg),
33407
33413
  firstObserved: bucket.agg.first ?? "",
33408
33414
  lastObserved: bucket.agg.last ?? "",
33415
+ ...input.queryClasses ? { queryClass: input.queryClasses.get(bucket.id) ?? null } : {},
33409
33416
  ...wantProviders ? { providers: providerEntries(bucket.byProvider) } : {}
33410
33417
  })).sort((a, b) => a.query.localeCompare(b.query));
33411
33418
  return {
33412
33419
  totals: counts(totals),
33413
33420
  ...wantProviders ? { byProvider: providerEntries(totalsByProvider) } : {},
33414
- queries: queryEntries
33421
+ queries: queryEntries,
33422
+ ...input.queryClasses ? { byQueryClass: { branded: counts(byClass.branded), nonBrand: counts(byClass.nonBrand), unclassified: counts(byClass.unclassified) } } : {}
33415
33423
  };
33416
33424
  }
33417
33425
  async function visibilityStatsRoutes(app) {
@@ -33493,7 +33501,8 @@ async function visibilityStatsRoutes(app) {
33493
33501
  answerMentioned: querySnapshots.answerMentioned,
33494
33502
  createdAt: querySnapshots.createdAt
33495
33503
  }).from(querySnapshots).where(inArray34(querySnapshots.runId, runIds)).all() : [];
33496
- const stats = computeVisibilityStats({ queries: projectQueries, snapshots, groupBy });
33504
+ const queryClasses = readQueryClasses(app.db, project, projectQueries);
33505
+ const stats = computeVisibilityStats({ queries: projectQueries, snapshots, groupBy, queryClasses });
33497
33506
  const queryAttribution = buildQueryAttribution(projectQueries);
33498
33507
  let shareOfVoice;
33499
33508
  if (wantShareOfVoice) {
@@ -33526,6 +33535,7 @@ async function visibilityStatsRoutes(app) {
33526
33535
  runCount
33527
33536
  },
33528
33537
  totals: stats.totals,
33538
+ ...stats.byQueryClass ? { byQueryClass: stats.byQueryClass } : {},
33529
33539
  queries: stats.queries,
33530
33540
  // `groupBy` + `byProvider` appear together only when a breakdown was
33531
33541
  // requested; both are OMITTED otherwise (absent = no breakdown) so the
@@ -39053,7 +39063,7 @@ var routeCatalog = [
39053
39063
  method: "get",
39054
39064
  path: "/api/v1/projects/{name}/visibility-stats",
39055
39065
  summary: "Get aggregated mention/citation stats per query",
39056
- description: "Per-query mention (answer-text) and citation (source-list) counts with a sample size, pooled across many answer-visibility runs (probe-excluded). Tri-state aware: `checked` counts only snapshots where answerMentioned was recorded (null = not checked is excluded). Lets a consumer compute confidence-aware (e.g. Wilson) proportions without N+1 run fetches. With no since/until/lastRuns, EVERY completed/partial answer-visibility run is pooled \u2014 `window.runCount` reports how many; bound the window with lastRuns, since/until, or month=YYYY-MM for a recent sample. Set groupBy=provider for a per-provider breakdown whose counts sum to the pooled counts, or shareOfVoice=1 to add share of voice vs tracked competitors (non-brand queries by default; set queryClass=branded for brand recall).",
39066
+ description: "Per-query mention (answer-text) and citation (source-list) counts with a sample size, pooled across many answer-visibility runs (probe-excluded). Tri-state aware: `checked` counts only snapshots where answerMentioned was recorded (null = not checked is excluded). Lets a consumer compute confidence-aware (e.g. Wilson) proportions without N+1 run fetches. With no since/until/lastRuns, EVERY completed/partial answer-visibility run is pooled \u2014 `window.runCount` reports how many; bound the window with lastRuns, since/until, or month=YYYY-MM for a recent sample. Set groupBy=provider for a per-provider breakdown whose counts sum to the pooled counts, or shareOfVoice=1 to add share of voice vs tracked competitors (non-brand queries by default; set queryClass=branded for brand recall). `totals` pools branded and non-brand queries; `byQueryClass` splits the same counts by each query's class (as the query list reports it), and each query carries `queryClass`. The `queryClass` parameter scopes share of voice only.",
39057
39067
  tags: ["analytics"],
39058
39068
  parameters: [
39059
39069
  nameParameter,
@@ -57640,11 +57650,14 @@ var BingApiError = class extends Error {
57640
57650
  * callers do not have to parse prose.
57641
57651
  */
57642
57652
  isThrottle;
57643
- constructor(message, status, bingErrorCode = null) {
57653
+ /** Only the retry header is retained; never retain response credentials. */
57654
+ headers;
57655
+ constructor(message, status, bingErrorCode = null, retryAfter) {
57644
57656
  super(message);
57645
57657
  this.name = "BingApiError";
57646
57658
  this.status = status;
57647
57659
  this.bingErrorCode = bingErrorCode;
57660
+ this.headers = retryAfter == null ? void 0 : { "retry-after": retryAfter };
57648
57661
  this.isThrottle = status === 429 || bingErrorCode != null && BING_THROTTLE_ERROR_CODES.has(bingErrorCode);
57649
57662
  }
57650
57663
  };
@@ -57738,14 +57751,14 @@ async function bingFetchOnce(apiKey, endpoint, opts) {
57738
57751
  }
57739
57752
  if (res.status === 429) {
57740
57753
  bingClientLog("error", "http.rate-limited", { endpoint, method, httpStatus: 429 });
57741
- throw new BingApiError("Bing API rate limit exceeded", 429);
57754
+ throw new BingApiError("Bing API rate limit exceeded", 429, null, res.headers.get("retry-after"));
57742
57755
  }
57743
57756
  if (!res.ok) {
57744
57757
  const body = await res.text();
57745
57758
  let detail = body.length <= 500 ? body : `${body.slice(0, 500)}... [truncated]`;
57746
57759
  detail = detail.replace(new RegExp(escapeRegExp(apiKey), "g"), "***");
57747
57760
  const bingErrorCode = parseBingErrorCode(body);
57748
- const err = new BingApiError(`Bing API error (${res.status}): ${detail}`, res.status, bingErrorCode);
57761
+ const err = new BingApiError(`Bing API error (${res.status}): ${detail}`, res.status, bingErrorCode, res.headers.get("retry-after"));
57749
57762
  bingClientLog("error", err.isThrottle ? "http.throttled" : "http.error", {
57750
57763
  endpoint,
57751
57764
  method,
@@ -57783,9 +57796,13 @@ function throttleCooldownRemainingMs(apiKey) {
57783
57796
  }
57784
57797
  return remaining;
57785
57798
  }
57786
- function openThrottleCooldown(apiKey) {
57787
- throttleCooldownUntil.set(cooldownKey(apiKey), cooldownNow() + BING_THROTTLE_COOLDOWN_MS);
57788
- bingClientLog("error", "http.cooldown-open", { cooldownMs: BING_THROTTLE_COOLDOWN_MS });
57799
+ function openThrottleCooldown(apiKey, err) {
57800
+ const cooldownMs = Math.max(BING_THROTTLE_COOLDOWN_MS, retryAfterDelayMs(err) ?? 0);
57801
+ const key = cooldownKey(apiKey);
57802
+ const now = cooldownNow();
57803
+ const retryAt = Math.max(throttleCooldownUntil.get(key) ?? 0, now + cooldownMs);
57804
+ throttleCooldownUntil.set(key, retryAt);
57805
+ bingClientLog("error", "http.cooldown-open", { cooldownMs: retryAt - now });
57789
57806
  }
57790
57807
  async function bingFetch(apiKey, endpoint, opts) {
57791
57808
  const isIdempotent = opts?.idempotent ?? (opts?.method ?? "GET") === "GET";
@@ -57817,7 +57834,7 @@ async function bingFetch(apiKey, endpoint, opts) {
57817
57834
  }
57818
57835
  });
57819
57836
  } catch (err) {
57820
- if (err instanceof BingApiError && err.isThrottle) openThrottleCooldown(apiKey);
57837
+ if (err instanceof BingApiError && err.isThrottle) openThrottleCooldown(apiKey, err);
57821
57838
  throw err;
57822
57839
  }
57823
57840
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-4QYGB5IC.js";
4
4
  import {
5
5
  PACKAGE_VERSION
6
6
  } from "./chunk-AOJU5LKX.js";
@@ -36,7 +36,7 @@ import {
36
36
  sentimentSettingsReadSchema,
37
37
  sentimentSummaryReadSchema,
38
38
  upgradeCommandFor
39
- } from "./chunk-2REKLGYS.js";
39
+ } from "./chunk-FYYOX7UY.js";
40
40
 
41
41
  // ../api-client-generated/src/generated/core/bodySerializer.gen.ts
42
42
  var jsonBodySerializer = {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  trackIntegrationConnection
3
- } from "./chunk-FLP4XMWI.js";
3
+ } from "./chunk-WONUYAKB.js";
4
4
  import {
5
5
  cliRuntimeContext
6
- } from "./chunk-SMSTXGJX.js";
6
+ } from "./chunk-TY5YTNLU.js";
7
7
 
8
8
  // src/cli-connection-telemetry.ts
9
9
  function trackCliConnection(properties) {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pickProjectCitedDomain
3
- } from "./chunk-SMH4FUXJ.js";
3
+ } from "./chunk-AUC47DFW.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-PIDL7OJ4.js";
6
+ } from "./chunk-BTYOU24P.js";
7
7
  import {
8
8
  GBP_INSIGHT_PROVIDER,
9
9
  PERSISTENT_GAP_THRESHOLD,
@@ -17,7 +17,7 @@ import {
17
17
  mergeGscQueryTotalsWithFallback,
18
18
  readGscQueryDailyRows,
19
19
  readLatestGscDataDate
20
- } from "./chunk-T6ZYAUJX.js";
20
+ } from "./chunk-ZEZPTUUB.js";
21
21
  import {
22
22
  competitors,
23
23
  gbpDailyMetrics,
@@ -35,14 +35,14 @@ import {
35
35
  queries,
36
36
  querySnapshots,
37
37
  runs
38
- } from "./chunk-ZR4WEKEC.js";
38
+ } from "./chunk-H3PWMM4K.js";
39
39
  import {
40
40
  CitationStates,
41
41
  RunKinds,
42
42
  RunStatuses,
43
43
  RunTriggers,
44
44
  effectiveDomains
45
- } from "./chunk-2REKLGYS.js";
45
+ } from "./chunk-FYYOX7UY.js";
46
46
 
47
47
  // src/intelligence-service.ts
48
48
  import { eq, desc, asc, and, ne, or, inArray, gte, lte, isNull, sql, exists } from "drizzle-orm";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import "./chunk-HGMYEDAQ.js";
7
- import "./chunk-2REKLGYS.js";
7
+ import "./chunk-FYYOX7UY.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
 
10
10
  // src/commands/citations.ts
@@ -3,11 +3,11 @@ import {
3
3
  buildCliCatalog,
4
4
  printCliCatalog,
5
5
  renderTopLevelHelp
6
- } from "./chunk-6SEWKBDC.js";
7
- import "./chunk-JKBQ3G25.js";
6
+ } from "./chunk-O7D7KV75.js";
7
+ import "./chunk-P6ZDIVFZ.js";
8
8
  import "./chunk-Z7IUAJOF.js";
9
9
  import "./chunk-HGMYEDAQ.js";
10
- import "./chunk-2REKLGYS.js";
10
+ import "./chunk-FYYOX7UY.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
13
13
  CLI_ROOT_SUMMARIES,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  REGISTERED_CLI_COMMANDS
3
- } from "./chunk-QZM44MJL.js";
3
+ } from "./chunk-BYDJIBAB.js";
4
4
  import "./chunk-6GO5VVAC.js";
5
5
  import "./chunk-VJWDBFSL.js";
6
- import "./chunk-SC7WEHEK.js";
6
+ import "./chunk-U3T37P7H.js";
7
7
  import "./chunk-TSENU4GG.js";
8
- import "./chunk-EIYNZOQA.js";
9
- import "./chunk-V4MRQPV2.js";
10
- import "./chunk-JKBQ3G25.js";
8
+ import "./chunk-ZPVJ5PVB.js";
9
+ import "./chunk-4QYGB5IC.js";
10
+ import "./chunk-P6ZDIVFZ.js";
11
11
  import "./chunk-Z7IUAJOF.js";
12
- import "./chunk-IPFSY55D.js";
12
+ import "./chunk-XYQMPYWE.js";
13
13
  import "./chunk-AOJU5LKX.js";
14
14
  import "./chunk-HGMYEDAQ.js";
15
- import "./chunk-2REKLGYS.js";
15
+ import "./chunk-FYYOX7UY.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
18
18
  REGISTERED_CLI_COMMANDS
package/dist/cli.js CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node --import tsx
2
2
  import {
3
3
  REGISTERED_CLI_COMMANDS
4
- } from "./chunk-QZM44MJL.js";
4
+ } from "./chunk-BYDJIBAB.js";
5
5
  import "./chunk-6GO5VVAC.js";
6
6
  import {
7
7
  buildSetupState,
8
8
  runPendingServeHandoff
9
- } from "./chunk-MNIQFFLL.js";
9
+ } from "./chunk-2D3JYWFX.js";
10
10
  import "./chunk-VJWDBFSL.js";
11
- import "./chunk-SC7WEHEK.js";
11
+ import "./chunk-U3T37P7H.js";
12
12
  import "./chunk-TSENU4GG.js";
13
- import "./chunk-UHCRUGI5.js";
13
+ import "./chunk-N2EWSWZD.js";
14
14
  import {
15
15
  checkLatestVersionForCli,
16
16
  cliRuntimeContext,
@@ -24,24 +24,24 @@ import {
24
24
  showFirstRunNotice,
25
25
  trackCliCommandFinished,
26
26
  trackEvent
27
- } from "./chunk-SMSTXGJX.js";
27
+ } from "./chunk-TY5YTNLU.js";
28
28
  import {
29
29
  autoSyncSkills,
30
30
  formatAutoSyncNotice
31
- } from "./chunk-KKVIRNFF.js";
32
- import "./chunk-EIYNZOQA.js";
33
- import "./chunk-V4MRQPV2.js";
31
+ } from "./chunk-EWZOL56J.js";
32
+ import "./chunk-ZPVJ5PVB.js";
33
+ import "./chunk-4QYGB5IC.js";
34
34
  import {
35
35
  accessFilterFromArgs,
36
36
  dispatchRegisteredCommand,
37
37
  printCliCatalog
38
- } from "./chunk-6SEWKBDC.js";
38
+ } from "./chunk-O7D7KV75.js";
39
39
  import {
40
40
  resolveCliAccess
41
- } from "./chunk-JKBQ3G25.js";
41
+ } from "./chunk-P6ZDIVFZ.js";
42
42
  import "./chunk-Z7IUAJOF.js";
43
- import "./chunk-FYJMNYVR.js";
44
- import "./chunk-IPFSY55D.js";
43
+ import "./chunk-T5DH6FEH.js";
44
+ import "./chunk-XYQMPYWE.js";
45
45
  import "./chunk-AOJU5LKX.js";
46
46
  import {
47
47
  CliError,
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-HGMYEDAQ.js";
53
53
  import {
54
54
  OperationAccesses
55
- } from "./chunk-2REKLGYS.js";
55
+ } from "./chunk-FYYOX7UY.js";
56
56
  import "./chunk-MLKGABMK.js";
57
57
 
58
58
  // src/cli.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -21,7 +21,7 @@ import {
21
21
  normalizeCompetitorDomain,
22
22
  shareOfVoiceLabel,
23
23
  shareOfVoiceReason
24
- } from "./chunk-2REKLGYS.js";
24
+ } from "./chunk-FYYOX7UY.js";
25
25
  import "./chunk-MLKGABMK.js";
26
26
 
27
27
  // src/commands/competitor.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  contentTargetDismissRequestSchema,
16
16
  formatPercent
17
- } from "./chunk-2REKLGYS.js";
17
+ } from "./chunk-FYYOX7UY.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
 
20
20
  // src/commands/content.ts
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  clearDashboardPassword,
3
3
  loadConfigRaw
4
- } from "./chunk-V4MRQPV2.js";
4
+ } from "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  isMachineFormat
7
7
  } from "./chunk-HGMYEDAQ.js";
8
8
  import {
9
9
  anyUsersExist
10
- } from "./chunk-T6ZYAUJX.js";
11
- import "./chunk-XFVB3UCE.js";
12
- import "./chunk-JC2MAKWO.js";
10
+ } from "./chunk-ZEZPTUUB.js";
11
+ import "./chunk-7534NXSP.js";
12
+ import "./chunk-K7ZG6K7J.js";
13
13
  import {
14
14
  createClient
15
- } from "./chunk-ZR4WEKEC.js";
16
- import "./chunk-2REKLGYS.js";
15
+ } from "./chunk-H3PWMM4K.js";
16
+ import "./chunk-FYYOX7UY.js";
17
17
  import "./chunk-MLKGABMK.js";
18
18
 
19
19
  // src/commands/dashboard.ts
@@ -40,7 +40,7 @@ function parseDemoTrustedProxies(values) {
40
40
  async function demoCommand(options) {
41
41
  const { host, port } = parseDemoListenOptions(options);
42
42
  const trustProxy = parseDemoTrustedProxies(options.trustProxy);
43
- const { createDemoServer } = await import("./demo-server-HGKXT27V.js");
43
+ const { createDemoServer } = await import("./demo-server-4TRTOGKP.js");
44
44
  const app = await createDemoServer({ trustProxy });
45
45
  let stopping = false;
46
46
  const stop = () => {
@@ -5,12 +5,12 @@ import {
5
5
  computeFactorAverages,
6
6
  layoutSiteCrawlGraphInput,
7
7
  persistSiteCrawlGraphLayout
8
- } from "./chunk-MM3OYQ53.js";
8
+ } from "./chunk-3WWSOWXP.js";
9
9
  import {
10
10
  canonryMcpTools
11
- } from "./chunk-PAC5EE5X.js";
12
- import "./chunk-7LN6QPV7.js";
13
- import "./chunk-IPFSY55D.js";
11
+ } from "./chunk-UMTYAPCQ.js";
12
+ import "./chunk-76KBMLPR.js";
13
+ import "./chunk-XYQMPYWE.js";
14
14
  import {
15
15
  PACKAGE_VERSION
16
16
  } from "./chunk-AOJU5LKX.js";
@@ -18,17 +18,17 @@ import "./chunk-HGMYEDAQ.js";
18
18
  import {
19
19
  HISTORY_WINDOW_RUNS,
20
20
  IntelligenceService
21
- } from "./chunk-HMNQTF3E.js";
21
+ } from "./chunk-ZTRGUTUP.js";
22
22
  import {
23
23
  determineCitationState
24
- } from "./chunk-SMH4FUXJ.js";
25
- import "./chunk-PIDL7OJ4.js";
24
+ } from "./chunk-AUC47DFW.js";
25
+ import "./chunk-BTYOU24P.js";
26
26
  import {
27
27
  apiRoutes,
28
28
  assessConversionTrackingIntegrity
29
- } from "./chunk-T6ZYAUJX.js";
30
- import "./chunk-XFVB3UCE.js";
31
- import "./chunk-JC2MAKWO.js";
29
+ } from "./chunk-ZEZPTUUB.js";
30
+ import "./chunk-7534NXSP.js";
31
+ import "./chunk-K7ZG6K7J.js";
32
32
  import {
33
33
  adsAdGroups,
34
34
  adsAds,
@@ -104,7 +104,7 @@ import {
104
104
  siteCrawlPages,
105
105
  siteCrawlSnapshots,
106
106
  trafficSources
107
- } from "./chunk-ZR4WEKEC.js";
107
+ } from "./chunk-H3PWMM4K.js";
108
108
  import {
109
109
  AI_ENGINE_DOMAINS,
110
110
  GA_OVERVIEW_HISTORY_DAYS,
@@ -151,7 +151,7 @@ import {
151
151
  roundPreservingTotal,
152
152
  siteAuditPageFactorSchema,
153
153
  wilsonInterval
154
- } from "./chunk-2REKLGYS.js";
154
+ } from "./chunk-FYYOX7UY.js";
155
155
  import "./chunk-MLKGABMK.js";
156
156
 
157
157
  // src/demo-server.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -14,7 +14,7 @@ import {
14
14
  CitationStates,
15
15
  DiscoveryPromoteCompetitorSkipReasons,
16
16
  describeError
17
- } from "./chunk-2REKLGYS.js";
17
+ } from "./chunk-FYYOX7UY.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
 
20
20
  // src/commands/discover.ts
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  CliError,
8
8
  EXIT_USER_ERROR
9
9
  } from "./chunk-HGMYEDAQ.js";
10
- import "./chunk-2REKLGYS.js";
10
+ import "./chunk-FYYOX7UY.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
 
13
13
  // src/commands/discover-eval.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  CheckScopes,
15
15
  CheckStatuses
16
- } from "./chunk-2REKLGYS.js";
16
+ } from "./chunk-FYYOX7UY.js";
17
17
  import "./chunk-MLKGABMK.js";
18
18
 
19
19
  // src/commands/doctor.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -9,7 +9,7 @@ import "./chunk-AOJU5LKX.js";
9
9
  import "./chunk-HGMYEDAQ.js";
10
10
  import {
11
11
  CitationStates
12
- } from "./chunk-2REKLGYS.js";
12
+ } from "./chunk-FYYOX7UY.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
 
15
15
  // src/commands/evidence.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  isEndpointMissing,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-HGMYEDAQ.js";
10
10
  import {
11
11
  isRedactedNotificationUrl
12
- } from "./chunk-2REKLGYS.js";
12
+ } from "./chunk-FYYOX7UY.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
 
15
15
  // src/commands/export-cmd.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -26,7 +26,7 @@ import {
26
26
  gaSearchLandingHasSearchData,
27
27
  gaSearchLandingPageLabel,
28
28
  isGaOverviewWindow
29
- } from "./chunk-2REKLGYS.js";
29
+ } from "./chunk-FYYOX7UY.js";
30
30
  import "./chunk-MLKGABMK.js";
31
31
 
32
32
  // src/commands/ga.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-EIYNZOQA.js";
4
- import "./chunk-V4MRQPV2.js";
3
+ } from "./chunk-ZPVJ5PVB.js";
4
+ import "./chunk-4QYGB5IC.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  isMachineFormat
@@ -11,7 +11,7 @@ import {
11
11
  formatPercent,
12
12
  gbpLocalPostCreateSchema,
13
13
  validationError
14
- } from "./chunk-2REKLGYS.js";
14
+ } from "./chunk-FYYOX7UY.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
 
17
17
  // src/commands/gbp.ts