@canonry/canonry 7.107.0 → 7.108.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.
Files changed (136) hide show
  1. package/assets/assets/{AccessControls-DZ5cXUCe.js → AccessControls-B6bkOAge.js} +1 -1
  2. package/assets/assets/{AgentSetupPage-FDXu506u.js → AgentSetupPage-DpAEnB3w.js} +1 -1
  3. package/assets/assets/{AuditHistoryPanel-DkE__mRZ.js → AuditHistoryPanel-Cmm537Mw.js} +1 -1
  4. package/assets/assets/{BacklinksPage-D1Ggkyrv.js → BacklinksPage-Dg6IJr83.js} +1 -1
  5. package/assets/assets/{ChartPrimitives-DEz30Z9z.js → ChartPrimitives-C1meaNiX.js} +1 -1
  6. package/assets/assets/{HistoryPage-kpX7NVZh.js → HistoryPage-DMmZ0fSd.js} +1 -1
  7. package/assets/assets/{MeasurementPropertyPage-BL9S7Liv.js → MeasurementPropertyPage-ChCEhCKX.js} +1 -1
  8. package/assets/assets/{ProjectPage-DNiGZ8xI.js → ProjectPage-B42XeJQf.js} +3 -3
  9. package/assets/assets/{RunsPage-BmP3fbIn.js → RunsPage-C6fUugLg.js} +1 -1
  10. package/assets/assets/{ServerTrafficSection-DCWfI0Fx.js → ServerTrafficSection-BkH0owR_.js} +1 -1
  11. package/assets/assets/{SettingsPage-DPBsvCi7.js → SettingsPage-CSsTnTJz.js} +1 -1
  12. package/assets/assets/{ToneBadge-CuSeVDnU.js → ToneBadge-BkNG9buI.js} +4 -4
  13. package/assets/assets/{TrafficPage-DSzSCXBB.js → TrafficPage-BNH-yhiN.js} +1 -1
  14. package/assets/assets/{TrafficSourceDetailPage-DWHkV2Xv.js → TrafficSourceDetailPage-Ce4hROUh.js} +1 -1
  15. package/assets/assets/{account-context-CpzX0Z1G.js → account-context-C66suepK.js} +1 -1
  16. package/assets/assets/{agent-trust-copy-D98fG0_0.js → agent-trust-copy-BKQRIoVJ.js} +1 -1
  17. package/assets/assets/{card-DWR8qy5a.js → card-iPmHn3JZ.js} +1 -1
  18. package/assets/assets/{index-C5G1odHn.js → index-9cWtJSDg.js} +3 -3
  19. package/assets/assets/{query-client-C7Egmt4p.js → query-client-D_jULVYr.js} +1 -1
  20. package/assets/assets/{react-query-BLqV8H9z.js → react-query-ih29UP0I.js} +1 -1
  21. package/assets/assets/{react-sigma_core.esm.min-COzNq4-6.js → react-sigma_core.esm.min-C7Pkr6r0.js} +1 -1
  22. package/assets/assets/{server-traffic-_-UeODwH.js → server-traffic-BScF0-_t.js} +1 -1
  23. package/assets/assets/{service-NEj5iRFZ.js → service-DYJdF5mP.js} +1 -1
  24. package/assets/index.html +8 -8
  25. package/dist/{ads-PZ3XRR3G.js → ads-IJHKPMDL.js} +3 -3
  26. package/dist/{agent-XSNYX5UT.js → agent-X5SDBTII.js} +7 -7
  27. package/dist/{agent-ask-JLTMBXNF.js → agent-ask-UPROPFVK.js} +3 -3
  28. package/dist/{agent-conversations-ZE4T4FNS.js → agent-conversations-A7W74X6Q.js} +3 -3
  29. package/dist/{agent-journeys-BD3Z5DK6.js → agent-journeys-WOLFWP3G.js} +3 -3
  30. package/dist/{agent-memory-WX56VBOU.js → agent-memory-TH6ORG63.js} +3 -3
  31. package/dist/{agent-providers-CJTXJSZX.js → agent-providers-FKVRHV4J.js} +7 -3
  32. package/dist/{agent-transcript-AYTSM4SW.js → agent-transcript-UFEBYD4L.js} +3 -3
  33. package/dist/{analytics-OFNC3HM7.js → analytics-XNFXAKRP.js} +3 -3
  34. package/dist/{apply-WTICVOOL.js → apply-O46BRKQG.js} +3 -3
  35. package/dist/{backfill-WBJNVGP7.js → backfill-IUCWBDEI.js} +10 -10
  36. package/dist/{backlinks-N5AV2VX7.js → backlinks-PB2Y3APJ.js} +3 -3
  37. package/dist/{bing-ZTRTEF7T.js → bing-YOUZDEA2.js} +3 -3
  38. package/dist/{bootstrap-E277KW5U.js → bootstrap-E4EI2W54.js} +10 -10
  39. package/dist/{cdp-LOIU5NYH.js → cdp-72553DTZ.js} +7 -7
  40. package/dist/{chunk-V6M3NFTI.js → chunk-2S25YWMO.js} +1 -1
  41. package/dist/{chunk-A3AV433T.js → chunk-3XYCTAL7.js} +3 -3
  42. package/dist/{chunk-D2KDCPQJ.js → chunk-46QQ3MQC.js} +1 -1
  43. package/dist/{chunk-BO6EC224.js → chunk-4FEKXZYP.js} +5 -5
  44. package/dist/{chunk-LG4SNIWY.js → chunk-5KH7Y233.js} +5 -5
  45. package/dist/{chunk-RUKWZBJA.js → chunk-6OBPZ6WK.js} +1 -1
  46. package/dist/{chunk-GFXEV6DH.js → chunk-6Y3I2QFU.js} +2 -2
  47. package/dist/{chunk-6SQCUQ6U.js → chunk-7K3EFBNK.js} +27 -1
  48. package/dist/{chunk-5FHMAF6G.js → chunk-7XDDCPZV.js} +1 -1
  49. package/dist/{chunk-P2QM24P2.js → chunk-AVBTCCAY.js} +2 -2
  50. package/dist/{chunk-WQ6FUYQR.js → chunk-BPKV6YLN.js} +7 -7
  51. package/dist/{chunk-OXRXWDJK.js → chunk-CLWAZBJY.js} +1 -1
  52. package/dist/{chunk-2IXEJCHX.js → chunk-CORHE557.js} +4 -4
  53. package/dist/{chunk-QS2SI5TV.js → chunk-E2ACURKW.js} +2 -2
  54. package/dist/{chunk-HJNF2N7E.js → chunk-EFY5C7ZJ.js} +4 -4
  55. package/dist/{chunk-AQTVLBEB.js → chunk-F5EGU7NA.js} +533 -317
  56. package/dist/{chunk-U5LKR2UV.js → chunk-FU324DV3.js} +2 -2
  57. package/dist/{chunk-66JQPB3X.js → chunk-HABH5YAF.js} +1 -1
  58. package/dist/{chunk-UTGTX62K.js → chunk-HAOLFBSD.js} +3 -3
  59. package/dist/{chunk-Z7RXT2DB.js → chunk-HOKR2Q26.js} +1 -1
  60. package/dist/{chunk-5YPNDBMQ.js → chunk-IZMQNTWQ.js} +3 -3
  61. package/dist/{chunk-FTUOVEFL.js → chunk-JH6E6IV4.js} +2 -2
  62. package/dist/{chunk-HIOVULSX.js → chunk-K6HCS36A.js} +15 -8
  63. package/dist/{chunk-TKHPOC3U.js → chunk-LU3TWJX7.js} +3 -3
  64. package/dist/{chunk-MKMFIVWH.js → chunk-MA5VHGWC.js} +41 -16
  65. package/dist/{chunk-USRICZAH.js → chunk-NE3IYK64.js} +366 -366
  66. package/dist/{chunk-OMIPA5T6.js → chunk-OEV6HQ3X.js} +47 -2
  67. package/dist/{chunk-NJIBWTHC.js → chunk-PKD22D4H.js} +1 -1
  68. package/dist/{chunk-7IXLQHAD.js → chunk-PYLSLW6L.js} +1 -1
  69. package/dist/{chunk-67AGNLTZ.js → chunk-QJGQOAUK.js} +1 -1
  70. package/dist/{chunk-TZKO46SO.js → chunk-QNSTLSVL.js} +2 -2
  71. package/dist/{chunk-CCJE5BG3.js → chunk-SHCFV7PL.js} +3 -3
  72. package/dist/{chunk-QHP3XSS5.js → chunk-UJURPSOP.js} +4 -4
  73. package/dist/{chunk-CFA3LAJJ.js → chunk-V342HTLC.js} +3 -3
  74. package/dist/{chunk-7B5GNQ3G.js → chunk-WJUF7P7N.js} +1 -1
  75. package/dist/{chunk-V4JLKXUO.js → chunk-WTNB7B2K.js} +1 -1
  76. package/dist/{citations-JH3WBX7R.js → citations-A3N7E44V.js} +4 -4
  77. package/dist/{cli-catalog-5HHVSBEH.js → cli-catalog-2IKVWAJ7.js} +3 -3
  78. package/dist/{cli-commands-F77MN4LF.js → cli-commands-5AMQ5NAA.js} +7 -7
  79. package/dist/cli.js +13 -13
  80. package/dist/{competitor-GF7GPQYB.js → competitor-CZV7O3YY.js} +3 -3
  81. package/dist/{content-22RTG35W.js → content-7Y6QZH2G.js} +3 -3
  82. package/dist/{dashboard-PZFD3VQ5.js → dashboard-OOCOW7VZ.js} +6 -6
  83. package/dist/{demo-57K6FDUC.js → demo-72QLTRMQ.js} +1 -1
  84. package/dist/{demo-server-I3XLUSVF.js → demo-server-NFJOZ6ZF.js} +12 -12
  85. package/dist/{discover-ACR3RBZE.js → discover-LUCA6O5X.js} +4 -4
  86. package/dist/{discover-eval-3NVZS6R2.js → discover-eval-U2XY45WE.js} +3 -3
  87. package/dist/{doctor-WS54RVZG.js → doctor-4O3ZZJAG.js} +3 -3
  88. package/dist/{evidence-JHCKHZO3.js → evidence-COM64MWY.js} +3 -3
  89. package/dist/{export-cmd-UIAGRYIA.js → export-cmd-HEQ5TZER.js} +3 -3
  90. package/dist/{ga-6EPQEMVL.js → ga-F5KCSFBL.js} +3 -3
  91. package/dist/{gbp-JJFU6ICP.js → gbp-GNHJKLUF.js} +3 -3
  92. package/dist/{google-TLMZRH3K.js → google-SAW6YWIC.js} +4 -4
  93. package/dist/{google-marketing-YJ4NXFDN.js → google-marketing-SIZWYSL2.js} +1 -1
  94. package/dist/{health-cmd-O25TFAJ4.js → health-cmd-5IZFIQK2.js} +4 -4
  95. package/dist/{history-FR6Q3CBK.js → history-O3VAYWT6.js} +3 -3
  96. package/dist/index.d.ts +159 -75
  97. package/dist/index.js +25 -25
  98. package/dist/{init-YEGTOQMK.js → init-SEFJNN5H.js} +12 -12
  99. package/dist/{insights-IBY5B5OX.js → insights-UFSQCY2N.js} +3 -3
  100. package/dist/intelligence-service-OZIEPTCK.js +16 -0
  101. package/dist/{journeys-KOI5QQFC.js → journeys-XUPV4POH.js} +3 -3
  102. package/dist/{keys-4AHY5IFK.js → keys-MWIC2RAM.js} +3 -3
  103. package/dist/{keyword-EQ6PELW6.js → keyword-BI6JIKFU.js} +3 -3
  104. package/dist/{logs-CE4WXN6H.js → logs-DJAPNQRC.js} +3 -3
  105. package/dist/{mcp-IWWBC34X.js → mcp-K7KJOU2D.js} +4 -4
  106. package/dist/mcp.js +9 -9
  107. package/dist/{measurement-plan-VDPSR7HK.js → measurement-plan-IZ3ONXKO.js} +5 -5
  108. package/dist/{notify-AHUVAGR4.js → notify-23XROT44.js} +3 -3
  109. package/dist/{organic-evidence-MVYEV5X3.js → organic-evidence-MY3YS2FV.js} +3 -3
  110. package/dist/{overview-45CO73FF.js → overview-XF3HRTRP.js} +5 -5
  111. package/dist/{project-7ZWHWZA7.js → project-BTX7G7RS.js} +3 -3
  112. package/dist/{project-setup-2LKZJCVC.js → project-setup-OEF4VHVO.js} +3 -3
  113. package/dist/{query-2JFQQKEN.js → query-67PA6WZ2.js} +3 -3
  114. package/dist/{research-H2F2SEAT.js → research-AFDDYAZS.js} +3 -3
  115. package/dist/{results-export-O4QDL4I4.js → results-export-6BI6P2MI.js} +3 -3
  116. package/dist/{run-AFKDOBRN.js → run-24TJZZXB.js} +5 -5
  117. package/dist/{schedule-YXCZGI3A.js → schedule-J2LIJ52P.js} +3 -3
  118. package/dist/{search-VN7AJZXJ.js → search-6RAWS2IO.js} +3 -3
  119. package/dist/{serve-HLVZ24D4.js → serve-HVYLYGAG.js} +26 -26
  120. package/dist/{session-44KQBO5V.js → session-ZZG6G4D7.js} +13 -13
  121. package/dist/{settings-4MEEQPDN.js → settings-UV6TFSYN.js} +3 -3
  122. package/dist/{sitemaps-MXAXJHNL.js → sitemaps-YVX6NKUG.js} +3 -3
  123. package/dist/{skills-AJBTHIRA.js → skills-6GYQKVDM.js} +2 -2
  124. package/dist/{snapshot-WWC7XSR3.js → snapshot-N6RFEDB5.js} +3 -3
  125. package/dist/{src-LMTA4CFF.js → src-U2E6JQJF.js} +4 -2
  126. package/dist/{status-S6RC3TID.js → status-HZHN6UNX.js} +5 -5
  127. package/dist/{technical-aeo-MCY63IKX.js → technical-aeo-ZQD4Q7DP.js} +3 -3
  128. package/dist/{telemetry-MUVNMEEL.js → telemetry-GQA2LXOM.js} +4 -4
  129. package/dist/{tools-YRHUVB65.js → tools-XH6DGBGV.js} +11 -11
  130. package/dist/{traffic-2SLXGEFN.js → traffic-Y6T2OKJF.js} +5 -5
  131. package/dist/{trends-WKWU755Z.js → trends-DTHOUJUU.js} +3 -3
  132. package/dist/{users-5HHGV66M.js → users-JSG4WKPW.js} +3 -3
  133. package/dist/{visibility-stats-324HLULY.js → visibility-stats-4FW4DZSK.js} +4 -4
  134. package/dist/{wordpress-5VJS7NG5.js → wordpress-AHTU5C7M.js} +3 -3
  135. package/package.json +1 -1
  136. package/dist/intelligence-service-4CAEDHVD.js +0 -16
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-D2KDCPQJ.js";
3
+ } from "./chunk-46QQ3MQC.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-OMIPA5T6.js";
39
+ } from "./chunk-OEV6HQ3X.js";
40
40
 
41
41
  // ../api-client-generated/src/generated/core/bodySerializer.gen.ts
42
42
  var jsonBodySerializer = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CitationStates
3
- } from "./chunk-OMIPA5T6.js";
3
+ } from "./chunk-OEV6HQ3X.js";
4
4
 
5
5
  // src/snapshot-cell.ts
6
6
  var SNAPSHOT_CELL_LEGEND = "(cell = [citation][mention]; C=cited c=not \xB7=not measured, M=mentioned m=not, \u2013=no data)";
@@ -3,7 +3,7 @@ import {
3
3
  resolveCliAccess,
4
4
  resolveCliAccessForInvocation,
5
5
  windowOptions
6
- } from "./chunk-OXRXWDJK.js";
6
+ } from "./chunk-CLWAZBJY.js";
7
7
  import {
8
8
  emitJsonl
9
9
  } from "./chunk-Z7IUAJOF.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HGMYEDAQ.js";
15
15
  import {
16
16
  OperationAccesses
17
- } from "./chunk-OMIPA5T6.js";
17
+ } from "./chunk-OEV6HQ3X.js";
18
18
 
19
19
  // src/cli-catalog.ts
20
20
  import { createRequire } from "module";
@@ -122,7 +122,7 @@ async function dispatchRegisteredCommand(args, fallbackFormat, specs) {
122
122
  const accessValue = accessFilterFromArgs(argsWithoutHelp);
123
123
  validateAccessFilter(accessValue);
124
124
  if (fallbackFormat !== "text") {
125
- const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-5HHVSBEH.js");
125
+ const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-2IKVWAJ7.js");
126
126
  const group2 = argsWithoutHelp.find((arg) => !arg.startsWith("--"));
127
127
  printCliCatalog2(specs, fallbackFormat, group2, accessValue);
128
128
  return true;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  USAGE_TELEMETRY_HEADERS,
3
3
  redactLogString
4
- } from "./chunk-OMIPA5T6.js";
4
+ } from "./chunk-OEV6HQ3X.js";
5
5
 
6
6
  // ../api-routes/src/request-context.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -2,10 +2,10 @@ import {
2
2
  SNAPSHOT_CELL_LEGEND,
3
3
  citationGlyph,
4
4
  mentionGlyph
5
- } from "./chunk-66JQPB3X.js";
5
+ } from "./chunk-HABH5YAF.js";
6
6
  import {
7
7
  createApiClient
8
- } from "./chunk-U5LKR2UV.js";
8
+ } from "./chunk-FU324DV3.js";
9
9
  import {
10
10
  emitJsonl
11
11
  } from "./chunk-Z7IUAJOF.js";
@@ -23,7 +23,7 @@ import {
23
23
  formatMicros,
24
24
  formatRunErrorOneLine,
25
25
  resolveProviderInput
26
- } from "./chunk-OMIPA5T6.js";
26
+ } from "./chunk-OEV6HQ3X.js";
27
27
 
28
28
  // src/commands/run.ts
29
29
  function getClient() {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  trackIntegrationConnection
3
- } from "./chunk-HJNF2N7E.js";
3
+ } from "./chunk-EFY5C7ZJ.js";
4
4
  import {
5
5
  cliRuntimeContext
6
- } from "./chunk-QS2SI5TV.js";
6
+ } from "./chunk-E2ACURKW.js";
7
7
 
8
8
  // src/cli-connection-telemetry.ts
9
9
  function trackCliConnection(properties) {
@@ -5,7 +5,7 @@ import {
5
5
  isStoredPageReadTool,
6
6
  isStoredReadTool,
7
7
  truncateToolResult
8
- } from "./chunk-2IXEJCHX.js";
8
+ } from "./chunk-CORHE557.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-D2KDCPQJ.js";
26
+ } from "./chunk-46QQ3MQC.js";
27
27
  import {
28
28
  CanonryMcpToolNames,
29
29
  canonryMcpTools
30
- } from "./chunk-A3AV433T.js";
30
+ } from "./chunk-3XYCTAL7.js";
31
31
  import {
32
32
  createLogger
33
- } from "./chunk-TZKO46SO.js";
33
+ } from "./chunk-QNSTLSVL.js";
34
34
  import {
35
35
  agentToolEvents,
36
36
  llmUsageEvents
37
- } from "./chunk-6SQCUQ6U.js";
37
+ } from "./chunk-7K3EFBNK.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-OMIPA5T6.js";
48
+ } from "./chunk-OEV6HQ3X.js";
49
49
 
50
50
  // src/agent/session.ts
51
51
  import fs2 from "fs";
@@ -276,6 +276,7 @@ import {
276
276
  getCurrentTools,
277
277
  toToolDeclaration
278
278
  } from "@earendil-works/pi-ai";
279
+ var log = createLogger("AeroTurn");
279
280
  var DISCOVER = "aero_list_toolkits";
280
281
  var MAX_VISIBLE_TOOLS = 128;
281
282
  var LOAD = "aero_load_toolkit";
@@ -693,6 +694,8 @@ function configureAeroRuntime(agent, allowed, limits, progressive = true, pinned
693
694
  state.rounds = 0;
694
695
  state.reason = "completed";
695
696
  state.startedAt = Date.now();
697
+ state.operationId = randomUUID();
698
+ log.info("started", { operationId: state.operationId });
696
699
  state.finishedAt = void 0;
697
700
  const reservedMs = Math.min(15e3, Math.max(250, Math.floor(state.limits.timeoutMs / 10)));
698
701
  state.timer = setTimeout(() => {
@@ -745,6 +748,9 @@ function setAeroSystemPrompt(agent, prompt = agent.state.systemPrompt) {
745
748
  function aeroTurnUsage(agent) {
746
749
  return runtimes.get(agent)?.usage;
747
750
  }
751
+ function aeroTurnOperationId(agent) {
752
+ return runtimes.get(agent)?.operationId;
753
+ }
748
754
  function aeroTurnStatus(agent) {
749
755
  const runtime = runtimes.get(agent);
750
756
  return runtime ? {
@@ -826,13 +832,13 @@ async function readAeroViewEvidence(options) {
826
832
  const evidence = agentVisibilityEvidence(report, projectName, (/* @__PURE__ */ new Date()).toISOString());
827
833
  return { ...evidence, source: { ...evidence.source, href: `${base}/${evidence.source.path}` } };
828
834
  }
829
- var log = createLogger("AeroView");
835
+ var log2 = createLogger("AeroView");
830
836
  async function readAeroViewEvidenceForTurn(options, signal) {
831
837
  try {
832
838
  return await readAeroViewEvidence(options);
833
839
  } catch (err) {
834
840
  if (signal?.aborted || err?.code !== "NOT_FOUND") throw err;
835
- log.warn("view-evidence.not-found", {
841
+ log2.warn("view-evidence.not-found", {
836
842
  projectName: options.projectName,
837
843
  view: options.context?.view ?? "visibility",
838
844
  error: err instanceof Error ? err.message : String(err)
@@ -1103,6 +1109,7 @@ export {
1103
1109
  isRunFailureMessage,
1104
1110
  setAeroSystemPrompt,
1105
1111
  aeroTurnUsage,
1112
+ aeroTurnOperationId,
1106
1113
  aeroTurnStatus,
1107
1114
  readAeroViewEvidenceForTurn,
1108
1115
  buildAeroViewTool,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-U5LKR2UV.js";
3
+ } from "./chunk-FU324DV3.js";
4
4
  import {
5
5
  emitJsonl
6
6
  } from "./chunk-Z7IUAJOF.js";
7
7
  import {
8
8
  measurementDraftOperationSchema,
9
9
  runMeasurementDraftAction
10
- } from "./chunk-5FHMAF6G.js";
10
+ } from "./chunk-7XDDCPZV.js";
11
11
  import {
12
12
  isMachineFormat,
13
13
  systemError
@@ -39,7 +39,7 @@ import {
39
39
  unattributedAnswersLabel,
40
40
  uncheckedSourcesLabel,
41
41
  visibilityReportRequestSchema
42
- } from "./chunk-OMIPA5T6.js";
42
+ } from "./chunk-OEV6HQ3X.js";
43
43
 
44
44
  // src/commands/measurement-plan.ts
45
45
  import crypto from "crypto";
@@ -19,14 +19,14 @@ import {
19
19
  normalizeTrafficPathPattern,
20
20
  sessionizeJourneyRequests,
21
21
  verifyRequestSignature
22
- } from "./chunk-RUKWZBJA.js";
22
+ } from "./chunk-6OBPZ6WK.js";
23
23
  import {
24
24
  currentOutcomeAttribution,
25
25
  getRequestContext,
26
26
  registerRequestContext,
27
27
  requestAuditIdentity,
28
28
  sanitizeRequestContext
29
- } from "./chunk-Z7RXT2DB.js";
29
+ } from "./chunk-HOKR2Q26.js";
30
30
  import {
31
31
  RawEventSampleEventTypes,
32
32
  SentimentIdempotencyConflict,
@@ -190,7 +190,7 @@ import {
190
190
  userSessions,
191
191
  users,
192
192
  writeNegativeReviewMaxStars
193
- } from "./chunk-6SQCUQ6U.js";
193
+ } from "./chunk-7K3EFBNK.js";
194
194
  import {
195
195
  ADS_ACTIVATE_SCOPE,
196
196
  ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
@@ -375,6 +375,8 @@ import {
375
375
  OUTSTANDING_PROVIDER_BATCH_STATUSES,
376
376
  OVERVIEW_WHAT_CHANGED_QUERY_LIMIT,
377
377
  OperationAccesses,
378
+ OutcomeOperationKinds,
379
+ OutcomePhases,
378
380
  OutcomeReasonCodes,
379
381
  OutcomeStatuses,
380
382
  OutcomeTriggers,
@@ -597,6 +599,7 @@ import {
597
599
  buildLevelTrendFigure,
598
600
  buildMeasurementExecutionIdentity,
599
601
  buildMeasurementRunManifestV1,
602
+ buildOutcomeDiagnostics,
600
603
  buildRedactedNotificationUrl,
601
604
  buildStackedDailySeries,
602
605
  businessProfileReviewsCover,
@@ -1364,7 +1367,7 @@ import {
1364
1367
  wordpressSchemaDeployResultDtoSchema,
1365
1368
  wordpressSchemaStatusResultDtoSchema,
1366
1369
  wordpressStatusDtoSchema
1367
- } from "./chunk-OMIPA5T6.js";
1370
+ } from "./chunk-OEV6HQ3X.js";
1368
1371
 
1369
1372
  // ../api-routes/src/user-session.ts
1370
1373
  import crypto2 from "crypto";
@@ -8570,7 +8573,7 @@ function repairAiReferralArrivalsOnStartup(db, now = /* @__PURE__ */ new Date())
8570
8573
  // ../api-routes/src/index.ts
8571
8574
  import rateLimit from "@fastify/rate-limit";
8572
8575
  import fs8 from "fs";
8573
- import { randomUUID as randomUUID3 } from "crypto";
8576
+ import { randomUUID as randomUUID4 } from "crypto";
8574
8577
 
8575
8578
  // ../api-routes/src/sentiment-auth.ts
8576
8579
  function canAdministerSentiment(request) {
@@ -10283,6 +10286,7 @@ import crypto18 from "crypto";
10283
10286
  import { and as and24, eq as eq31, sql as sql13 } from "drizzle-orm";
10284
10287
 
10285
10288
  // ../api-routes/src/feature-outcome.ts
10289
+ import { randomUUID as randomUUID2 } from "crypto";
10286
10290
  function reportFeatureOutcome(app, target, outcome2) {
10287
10291
  try {
10288
10292
  app.emitOutcome({
@@ -10329,13 +10333,18 @@ async function withFeatureOutcome(app, target, run, failureReason) {
10329
10333
  }
10330
10334
  function startRouteOutcome(app, feature, operation, options = {}) {
10331
10335
  const startedAt = Date.now();
10336
+ const operationId = options.operationKind ? randomUUID2() : void 0;
10337
+ if (operationId) app.log.info({ operationId, projectId: options.projectId }, `${feature}.${operation} started`);
10332
10338
  let sent = false;
10333
10339
  const report = (outcome2) => {
10334
10340
  if (sent) return;
10335
10341
  sent = true;
10342
+ if (operationId) app.log.info({ operationId, projectId: options.projectId, errorCode: outcome2.reasonCode, httpStatus: outcome2.diagnostics?.httpStatus }, `${feature}.${operation} ${outcome2.status}; phase ${outcome2.diagnostics?.phase ?? OutcomePhases.unknown}`);
10336
10343
  const counts2 = Object.entries(outcome2.counts ?? {}).filter((entry) => typeof entry[1] === "number");
10337
- reportFeatureOutcome(app, { feature, operation, ...options }, {
10344
+ reportFeatureOutcome(app, { feature, operation, ...options.trigger ? { trigger: options.trigger } : {} }, {
10338
10345
  status: outcome2.status,
10346
+ ...operationId ? { operationId, operationKind: options.operationKind } : {},
10347
+ ...outcome2.diagnostics ? { diagnostics: outcome2.diagnostics } : {},
10339
10348
  ...outcome2.reasonCode ? { reasonCode: outcome2.reasonCode } : {},
10340
10349
  ...outcome2.errorName ? { errorName: outcome2.errorName } : {},
10341
10350
  durationBucket: bucketDuration(Date.now() - startedAt),
@@ -10345,14 +10354,14 @@ function startRouteOutcome(app, feature, operation, options = {}) {
10345
10354
  return {
10346
10355
  report,
10347
10356
  refuse(reasonCode, error) {
10348
- report({ status: OutcomeStatuses.failed, reasonCode });
10357
+ report({ status: OutcomeStatuses.failed, reasonCode, ...operationId ? { diagnostics: buildOutcomeDiagnostics(error, { phase: OutcomePhases.setup }) } : {} });
10349
10358
  return error;
10350
10359
  },
10351
10360
  guard(reasonCode, check) {
10352
10361
  try {
10353
10362
  return check();
10354
10363
  } catch (err) {
10355
- report({ status: OutcomeStatuses.failed, ...classifyOutcomeError(err), reasonCode });
10364
+ report({ status: OutcomeStatuses.failed, ...classifyOutcomeError(err), reasonCode, ...operationId ? { diagnostics: buildOutcomeDiagnostics(err, { phase: OutcomePhases.setup }) } : {} });
10356
10365
  throw err;
10357
10366
  }
10358
10367
  }
@@ -63540,6 +63549,8 @@ var BingApiError = class extends Error {
63540
63549
  isThrottle;
63541
63550
  /** Only the retry header is retained; never retain response credentials. */
63542
63551
  headers;
63552
+ /** Retries actually made by the HTTP client; zero when refused locally. */
63553
+ retryCount = 0;
63543
63554
  constructor(message, status, bingErrorCode = null, retryAfter) {
63544
63555
  super(message);
63545
63556
  this.name = "BingApiError";
@@ -63699,11 +63710,15 @@ async function bingFetch(apiKey, endpoint, opts) {
63699
63710
  bingClientLog("warn", "http.cooldown-skip", { endpoint, remainingMs: cooling });
63700
63711
  throw new BingApiError(
63701
63712
  `Bing API key is in a throttle cooldown for another ${Math.ceil(cooling / 1e3)}s; the account was still throttled after a full retry budget, so this call was not attempted.`,
63702
- 429
63713
+ 429,
63714
+ null,
63715
+ String(Math.ceil(cooling / 1e3))
63703
63716
  );
63704
63717
  }
63718
+ let retryCount = 0;
63719
+ let retryWaitMs = 0;
63705
63720
  try {
63706
- return await withRetry(() => bingFetchOnce(apiKey, endpoint, opts), {
63721
+ const result = await withRetry(() => bingFetchOnce(apiKey, endpoint, opts), {
63707
63722
  maxRetries: BING_MAX_RETRIES,
63708
63723
  baseDelayMs: BING_RETRY_BASE_DELAY_MS,
63709
63724
  maxDelayMs: BING_RETRY_MAX_DELAY_MS,
@@ -63713,6 +63728,8 @@ async function bingFetch(apiKey, endpoint, opts) {
63713
63728
  },
63714
63729
  computeDelayMs: (_attempt, err, defaultMs) => retryAfterDelayMs(err) ?? defaultMs,
63715
63730
  onRetry: ({ attempt, err, delayMs }) => {
63731
+ retryCount += 1;
63732
+ retryWaitMs += delayMs;
63716
63733
  bingClientLog("warn", "http.retry", {
63717
63734
  endpoint,
63718
63735
  attempt,
@@ -63721,8 +63738,13 @@ async function bingFetch(apiKey, endpoint, opts) {
63721
63738
  });
63722
63739
  }
63723
63740
  });
63741
+ if (retryCount > 0) bingClientLog("info", "http.retry-recovered", { endpoint, retryCount, retryWaitMs: Math.round(retryWaitMs) });
63742
+ return result;
63724
63743
  } catch (err) {
63725
- if (err instanceof BingApiError && err.isThrottle) openThrottleCooldown(apiKey, err);
63744
+ if (err instanceof BingApiError) {
63745
+ err.retryCount = retryCount;
63746
+ if (err.isThrottle) openThrottleCooldown(apiKey, err);
63747
+ }
63726
63748
  throw err;
63727
63749
  }
63728
63750
  }
@@ -64786,7 +64808,7 @@ async function bingRoutes(app, opts) {
64786
64808
  app.post("/projects/:name/bing/inspect-url", async (request) => {
64787
64809
  const store = requireConnectionStore();
64788
64810
  const project = resolveProject(app.db, request.params.name);
64789
- const outcome2 = startRouteOutcome(app, FeatureNames.bing, "inspect");
64811
+ const outcome2 = startRouteOutcome(app, FeatureNames.bing, "inspect", { operationKind: OutcomeOperationKinds["url-inspection"], projectId: project.id });
64790
64812
  const conn = outcome2.guard(OutcomeReasonCodes.NOT_CONNECTED, () => requireConnection(store, project.canonicalDomain));
64791
64813
  if (!conn.siteUrl) {
64792
64814
  throw outcome2.refuse(OutcomeReasonCodes.PROPERTY_NOT_FOUND, validationError(NO_SITE_MESSAGE));
@@ -64806,6 +64828,7 @@ async function bingRoutes(app, opts) {
64806
64828
  startedAt,
64807
64829
  createdAt: startedAt
64808
64830
  }).run();
64831
+ let phase = OutcomePhases["provider-request"];
64809
64832
  try {
64810
64833
  const result = await getUrlInfo(conn.apiKey, conn.siteUrl, url);
64811
64834
  bingLog("info", "inspect-url.result", {
@@ -64844,6 +64867,7 @@ async function bingRoutes(app, opts) {
64844
64867
  });
64845
64868
  }
64846
64869
  }
64870
+ phase = OutcomePhases.persistence;
64847
64871
  app.db.insert(bingUrlInspections).values({
64848
64872
  id,
64849
64873
  projectId: project.id,
@@ -64860,7 +64884,7 @@ async function bingRoutes(app, opts) {
64860
64884
  discoveryDate
64861
64885
  }).run();
64862
64886
  app.db.update(runs).set({ status: RunStatuses.completed, finishedAt: now }).where(eq91(runs.id, runId)).run();
64863
- outcome2.report({ status: OutcomeStatuses.succeeded, counts: { urls: 1 } });
64887
+ outcome2.report({ status: OutcomeStatuses.succeeded, counts: { urls: 1 }, diagnostics: { phase, remainingWork: 0 } });
64864
64888
  return {
64865
64889
  id,
64866
64890
  url,
@@ -64881,6 +64905,7 @@ async function bingRoutes(app, opts) {
64881
64905
  outcome2.report({
64882
64906
  status: OutcomeStatuses.failed,
64883
64907
  ...failure,
64908
+ diagnostics: buildOutcomeDiagnostics(e, { phase, remainingWork: 1 }),
64884
64909
  ...e instanceof BingApiError && e.isThrottle ? { reasonCode: OutcomeReasonCodes.RATE_LIMITED } : {}
64885
64910
  });
64886
64911
  throw e;
@@ -70547,7 +70572,7 @@ async function listCloudRunTrafficEvents(accessToken, options) {
70547
70572
  }
70548
70573
 
70549
70574
  // ../integration-wordpress-traffic/src/client.ts
70550
- import { randomUUID as randomUUID2 } from "crypto";
70575
+ import { randomUUID as randomUUID3 } from "crypto";
70551
70576
 
70552
70577
  // ../integration-wordpress-traffic/src/normalize.ts
70553
70578
  function trimOrNull(value) {
@@ -70749,7 +70774,7 @@ async function listWordpressTrafficEvents(options) {
70749
70774
  if (options.until !== void 0 && options.until !== "") {
70750
70775
  url.searchParams.set("until", options.until);
70751
70776
  }
70752
- url.searchParams.set("_cb", randomUUID2());
70777
+ url.searchParams.set("_cb", randomUUID3());
70753
70778
  const response = await fetchImpl(url, {
70754
70779
  method: "GET",
70755
70780
  headers: {
@@ -81719,7 +81744,7 @@ async function apiRoutes(app, opts) {
81719
81744
  await api.register(notificationRoutes, {
81720
81745
  allowLoopbackWebhooks: opts.allowLoopbackWebhooks
81721
81746
  });
81722
- await api.register(sentimentRoutes, opts.sentiment ?? { install: () => ({ enabled: false, ready: false, reason: "install-disabled", model: "jev-1.13.0" }), previewSecret: randomUUID3() });
81747
+ await api.register(sentimentRoutes, opts.sentiment ?? { install: () => ({ enabled: false, ready: false, reason: "install-disabled", model: "jev-1.13.0" }), previewSecret: randomUUID4() });
81723
81748
  await api.register(operationalLogsRoutes, { listOperationalLogs: opts.listOperationalLogs });
81724
81749
  await api.register(telemetryRoutes, {
81725
81750
  getTelemetryStatus: opts.getTelemetryStatus,