@canonry/canonry 7.122.0 → 7.123.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 (152) hide show
  1. package/assets/agent-workspace/skills/aero/SKILL.md +6 -4
  2. package/assets/agent-workspace/skills/aero/references/orchestration.md +2 -2
  3. package/assets/agent-workspace/skills/aero/references/reporting.md +1 -1
  4. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +4 -3
  5. package/assets/assets/{AccessControls-CUyRn6C4.js → AccessControls-qKt0MIwz.js} +2 -2
  6. package/assets/assets/{AgentSetupPage-DZpC1KEN.js → AgentSetupPage-CS6TAG_q.js} +4 -4
  7. package/assets/assets/{AuditHistoryPanel--uz8Pwrq.js → AuditHistoryPanel-C9muxa5U.js} +1 -1
  8. package/assets/assets/{BacklinksPage-CO95Zmi-.js → BacklinksPage-YSi04rze.js} +1 -1
  9. package/assets/assets/{ChartPrimitives-Cs6yrwNk.js → ChartPrimitives-DA5ldw5q.js} +1 -1
  10. package/assets/assets/{HistoryPage-jJE-3Cp-.js → HistoryPage-tTCABHZr.js} +1 -1
  11. package/assets/assets/MeasurementPropertyPage-B-eHRFSF.js +4 -0
  12. package/assets/assets/ProjectPage-DK7y3uMN.js +15 -0
  13. package/assets/assets/{RunsPage-BSc3AZzW.js → RunsPage-B6HxjqFp.js} +1 -1
  14. package/assets/assets/{ServerTrafficSection-DVCQnnCe.js → ServerTrafficSection-BCPF6Rxk.js} +3 -3
  15. package/assets/assets/{SettingsPage-Cx3ChDuH.js → SettingsPage-Dlsqc0Xk.js} +1 -1
  16. package/assets/assets/{ToneBadge-D_99MaKo.js → ToneBadge-BekCDc9B.js} +2 -2
  17. package/assets/assets/{TrafficPage-4lFwcOoT.js → TrafficPage-CcZ2VKWS.js} +1 -1
  18. package/assets/assets/{TrafficSourceDetailPage-BEjZCkMr.js → TrafficSourceDetailPage-BUWRBlEj.js} +1 -1
  19. package/assets/assets/{account-context-DHwkScAb.js → account-context-CTgTl_U3.js} +1 -1
  20. package/assets/assets/{agent-trust-copy-B2DSn_wB.js → agent-trust-copy-C3Su6oTh.js} +1 -1
  21. package/assets/assets/{card-DsNIE4Gq.js → card-fF4DLMtN.js} +1 -1
  22. package/assets/assets/index-CZK8ELxf.js +43 -0
  23. package/assets/assets/index-ODrMZLgB.css +1 -0
  24. package/assets/assets/{preload-helper-BHfj17NS.js → preload-helper-D6vLhNAZ.js} +1 -1
  25. package/assets/assets/{query-client-DmL4VdXj.js → query-client-bLCsQvmN.js} +1 -1
  26. package/assets/assets/react-query-DPn84_Mu.js +1 -0
  27. package/assets/assets/{react-sigma_core.esm.min-CE7yMg4d.js → react-sigma_core.esm.min-Dkaqqban.js} +1 -1
  28. package/assets/assets/{server-traffic-CiJh_mR4.js → server-traffic-CCdnHKbu.js} +1 -1
  29. package/assets/assets/{service-Ck0xuYS9.js → service-CUnyHRGl.js} +1 -1
  30. package/assets/index.html +10 -10
  31. package/dist/activity-NEHRLN66.js +13 -0
  32. package/dist/{ads-RVWK3WOT.js → ads-OXZFLKFO.js} +4 -4
  33. package/dist/{agent-OSSTIYD5.js → agent-VMLMGUVU.js} +8 -8
  34. package/dist/{agent-ask-2SPA6RIE.js → agent-ask-IGL7KSBW.js} +4 -4
  35. package/dist/{agent-conversations-36UMFQY6.js → agent-conversations-ZQQJTVLM.js} +4 -4
  36. package/dist/{agent-journeys-TW2CF6JI.js → agent-journeys-Z3ZILTRB.js} +4 -4
  37. package/dist/{agent-memory-GD2X65LE.js → agent-memory-MEFTNQWG.js} +4 -4
  38. package/dist/{agent-providers-A4E2TUJ7.js → agent-providers-ZZ6RN4TB.js} +4 -4
  39. package/dist/{agent-transcript-JLHXL72N.js → agent-transcript-QK3OTZ7B.js} +4 -4
  40. package/dist/{analytics-BZ7FJTK4.js → analytics-VAJT24GQ.js} +4 -4
  41. package/dist/{apply-BJDXDQXK.js → apply-IWCME5ZF.js} +4 -4
  42. package/dist/{backfill-F2OC7F22.js → backfill-WGEXXMFQ.js} +11 -11
  43. package/dist/{backlinks-IGSJG4TC.js → backlinks-QVFDZZCI.js} +4 -4
  44. package/dist/{bing-HHWCD5QU.js → bing-JUCW5FTY.js} +4 -4
  45. package/dist/{bootstrap-5LOT7HNU.js → bootstrap-R2O2TPAR.js} +11 -11
  46. package/dist/{cdp-5XNSVSBE.js → cdp-VTQYZVW5.js} +8 -8
  47. package/dist/chunk-2DT55UKG.js +34 -0
  48. package/dist/{chunk-HGXAKSRX.js → chunk-2J6LXZPK.js} +1 -1
  49. package/dist/{chunk-3LJH6WL6.js → chunk-2RG6CSZB.js} +1 -1
  50. package/dist/{chunk-WKYQ7255.js → chunk-6URM26ZP.js} +2 -2
  51. package/dist/{chunk-UYRC244Y.js → chunk-73AQQAPC.js} +403 -294
  52. package/dist/{chunk-NGTWSJSP.js → chunk-7D735WS6.js} +1 -1
  53. package/dist/{chunk-VXBYTMSM.js → chunk-7KQESJWH.js} +118 -37
  54. package/dist/{chunk-T3HVXCOW.js → chunk-7OYOUVZS.js} +382 -370
  55. package/dist/{chunk-SPNDMTXM.js → chunk-AUMR4UXI.js} +18 -5
  56. package/dist/{chunk-3CT756HO.js → chunk-BNL3BKXK.js} +1 -1
  57. package/dist/{chunk-F5UUN6UB.js → chunk-BSUAO3RJ.js} +1 -1
  58. package/dist/{chunk-RVRQJ2SA.js → chunk-BVJUYSOB.js} +2 -2
  59. package/dist/{chunk-X2WJ563G.js → chunk-CCBFBQFR.js} +3 -3
  60. package/dist/{chunk-QE3PIF67.js → chunk-CQSLBPR2.js} +8 -8
  61. package/dist/{chunk-REDBG2JO.js → chunk-DLJAUCAU.js} +5 -5
  62. package/dist/{chunk-ZA44DK2O.js → chunk-DMFFERXC.js} +1 -1
  63. package/dist/{chunk-XDCXC6DL.js → chunk-F3PBATIZ.js} +1 -1
  64. package/dist/{chunk-EGH7MBFI.js → chunk-F3UXTYXA.js} +4 -4
  65. package/dist/{chunk-S6GBOBNO.js → chunk-HSYZCNXY.js} +2 -2
  66. package/dist/{chunk-TH6JFDUI.js → chunk-LGD3K4G5.js} +4 -4
  67. package/dist/{chunk-LNBJ3ZEK.js → chunk-LQGTGSA5.js} +16 -3
  68. package/dist/{chunk-BB2KXNOG.js → chunk-LWGO6ETW.js} +2 -2
  69. package/dist/{chunk-NJTIZSBH.js → chunk-NDVKLJXW.js} +5 -5
  70. package/dist/{chunk-G56TRFKC.js → chunk-NI5THOYW.js} +6 -6
  71. package/dist/{chunk-HVE7FL2B.js → chunk-NNJ6PD64.js} +4 -4
  72. package/dist/{chunk-LJ3MSVVW.js → chunk-NZOLX55S.js} +1 -1
  73. package/dist/{chunk-LZSY5GNZ.js → chunk-OCL6NZGL.js} +2 -2
  74. package/dist/{chunk-QFPQIPX3.js → chunk-QXUNANMR.js} +2 -2
  75. package/dist/{chunk-NZQWQK4N.js → chunk-RHH2K4BZ.js} +8 -4
  76. package/dist/{chunk-YETOLZWJ.js → chunk-SLHX5HBD.js} +4 -4
  77. package/dist/{chunk-D4G3FP7N.js → chunk-TSCCU54X.js} +5 -5
  78. package/dist/{chunk-M2OSHVTB.js → chunk-TTK6ZZHK.js} +2 -2
  79. package/dist/{chunk-AYXUCVYX.js → chunk-WRWTDHSO.js} +625 -567
  80. package/dist/{chunk-E6WLCHXT.js → chunk-XXSDKDKU.js} +4 -4
  81. package/dist/{chunk-CCFEMZI5.js → chunk-YWLJQ2FY.js} +1 -1
  82. package/dist/{chunk-IQGRGJFP.js → chunk-YXM6FPGD.js} +1 -1
  83. package/dist/{chunk-RHWKLRLF.js → chunk-Z6ZH7N6U.js} +3 -3
  84. package/dist/{chunk-TAFIB6LC.js → chunk-ZP6PZZAW.js} +3 -2
  85. package/dist/{citations-BJKMX32Y.js → citations-HQQQM73E.js} +5 -5
  86. package/dist/{cli-catalog-VK4DK55E.js → cli-catalog-STHVOXXT.js} +4 -4
  87. package/dist/cli-commands-KWRHN6M5.js +18 -0
  88. package/dist/cli.js +14 -14
  89. package/dist/{competitor-ONXSUUEJ.js → competitor-VP52MSQM.js} +4 -4
  90. package/dist/{content-U276NS4F.js → content-IHFS2BRF.js} +4 -4
  91. package/dist/{dashboard-SVYP4JIF.js → dashboard-2DBFBHAU.js} +7 -7
  92. package/dist/{demo-CJEZXMD7.js → demo-UFZBEKZC.js} +3 -3
  93. package/dist/{demo-server-ASS76Y3T.js → demo-server-3YTYVGJU.js} +15 -13
  94. package/dist/{discover-O6MXXTQP.js → discover-X2RATQCF.js} +5 -5
  95. package/dist/{discover-eval-RWCDKTW2.js → discover-eval-FEQ3HAM2.js} +4 -4
  96. package/dist/{doctor-LDHRSYBN.js → doctor-2CM5FVMJ.js} +4 -4
  97. package/dist/{evidence-HCQ3XGR3.js → evidence-5IAVY6JN.js} +4 -4
  98. package/dist/{export-cmd-FCD27XDA.js → export-cmd-LGXY4GIT.js} +4 -4
  99. package/dist/{ga-DNE32K5T.js → ga-KVFZSSFH.js} +4 -4
  100. package/dist/{gbp-BD6N5ZNR.js → gbp-PLSX7QBV.js} +4 -4
  101. package/dist/{google-JGLRBRDJ.js → google-R7HNCZNY.js} +5 -5
  102. package/dist/{google-marketing-VGDUCHDK.js → google-marketing-ZEU6ZNTS.js} +2 -2
  103. package/dist/{health-cmd-SSUFVJXH.js → health-cmd-UNYQIHHZ.js} +5 -5
  104. package/dist/{history-FPNPI3FR.js → history-IR234HUF.js} +4 -4
  105. package/dist/index.d.ts +8 -8
  106. package/dist/index.js +26 -26
  107. package/dist/{init-LE67AJR6.js → init-IZ3ANN2I.js} +13 -13
  108. package/dist/{insights-JXWPCIKX.js → insights-OQ4TYD7O.js} +4 -4
  109. package/dist/intelligence-service-A6B7TKOX.js +15 -0
  110. package/dist/{journeys-ULUM5VHN.js → journeys-G72GTTDS.js} +4 -4
  111. package/dist/{keys-K7LFSZEV.js → keys-A2NSFAJR.js} +4 -4
  112. package/dist/{keyword-FEVMF4GU.js → keyword-4ECZAEFL.js} +4 -4
  113. package/dist/{logs-IFSEC6EG.js → logs-OMBVVMGA.js} +4 -4
  114. package/dist/{mcp-GEHAKVJQ.js → mcp-OALO7GAG.js} +5 -5
  115. package/dist/mcp.js +10 -10
  116. package/dist/{measurement-plan-P3VN75M2.js → measurement-plan-3KJSVBMM.js} +6 -6
  117. package/dist/{notify-J4FVK5NC.js → notify-AYBCSPXF.js} +4 -4
  118. package/dist/{organic-evidence-X53DBTMQ.js → organic-evidence-XMS6WPCR.js} +4 -4
  119. package/dist/{overview-F3LYI5W4.js → overview-K4RBEW7T.js} +52 -29
  120. package/dist/{project-RXT5IJKZ.js → project-KGIYKLEE.js} +4 -4
  121. package/dist/{project-setup-ATO24GGB.js → project-setup-OBS4PSB4.js} +4 -4
  122. package/dist/{query-LGPJDI56.js → query-TJAMHSAJ.js} +4 -4
  123. package/dist/{research-BHOCLEHN.js → research-REDM6KKM.js} +4 -4
  124. package/dist/{results-export-PFKBOBPA.js → results-export-E7P2G3FV.js} +4 -4
  125. package/dist/{run-ASLSXRUQ.js → run-43C6BWTO.js} +6 -6
  126. package/dist/{schedule-SQOLIVNL.js → schedule-B4TSMTC4.js} +4 -4
  127. package/dist/{search-3ZHHJHIN.js → search-VE7DGSD7.js} +4 -4
  128. package/dist/{serve-VOZCS346.js → serve-365C4I42.js} +27 -27
  129. package/dist/{session-KZJB4SN3.js → session-ZB2BI6VG.js} +14 -14
  130. package/dist/{settings-JOPGFAZS.js → settings-W3SCNC25.js} +4 -4
  131. package/dist/{sitemaps-AAEYPCF3.js → sitemaps-YPD7U2ZP.js} +4 -4
  132. package/dist/{skills-IWK7KYBF.js → skills-K6BM2BQV.js} +3 -3
  133. package/dist/{snapshot-N45FCZO3.js → snapshot-GK6G72YF.js} +4 -4
  134. package/dist/{src-D5YFNRUG.js → src-RUWMU4ZS.js} +2 -2
  135. package/dist/{status-O4GQAJV5.js → status-I23DTMWM.js} +6 -6
  136. package/dist/{support-RNNKG6QY.js → support-PEI7R4MY.js} +2 -2
  137. package/dist/{technical-aeo-IMGI4ST7.js → technical-aeo-W5ZF2TPH.js} +4 -4
  138. package/dist/{telemetry-ELCKZQGI.js → telemetry-YV6IHYS7.js} +5 -5
  139. package/dist/{tools-7NYNPJTI.js → tools-57J55S4A.js} +12 -12
  140. package/dist/{traffic-NJ476WXB.js → traffic-SQ4O6QW6.js} +6 -6
  141. package/dist/{trends-ULBZCMKS.js → trends-MCDIYFQB.js} +4 -4
  142. package/dist/{users-TFQRXDHF.js → users-R66ASOSH.js} +4 -4
  143. package/dist/{visibility-stats-Q3F5ORLR.js → visibility-stats-7XTGKFPE.js} +5 -5
  144. package/dist/{wordpress-JPDUJ7ZW.js → wordpress-ZMNF2C2H.js} +4 -4
  145. package/package.json +1 -1
  146. package/assets/assets/MeasurementPropertyPage-DVFgfLBE.js +0 -4
  147. package/assets/assets/ProjectPage-BUMmtHvg.js +0 -15
  148. package/assets/assets/index-BBPDLDlS.js +0 -43
  149. package/assets/assets/index-Dr7ccjP_.css +0 -1
  150. package/assets/assets/react-query-ss3hNF7i.js +0 -1
  151. package/dist/cli-commands-7AIQBJRW.js +0 -18
  152. package/dist/intelligence-service-XCADQRDI.js +0 -15
@@ -28,7 +28,7 @@ import {
28
28
  unknownUsageObservation,
29
29
  usdToMicros,
30
30
  withRetry
31
- } from "./chunk-UYRC244Y.js";
31
+ } from "./chunk-73AQQAPC.js";
32
32
 
33
33
  // ../provider-answer-services/src/core/http.ts
34
34
  var MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
@@ -19,14 +19,14 @@ import {
19
19
  normalizeTrafficPathPattern,
20
20
  sessionizeJourneyRequests,
21
21
  verifyRequestSignature
22
- } from "./chunk-HGXAKSRX.js";
22
+ } from "./chunk-2J6LXZPK.js";
23
23
  import {
24
24
  currentOutcomeAttribution,
25
25
  getRequestContext,
26
26
  registerRequestContext,
27
27
  requestAuditIdentity,
28
28
  sanitizeRequestContext
29
- } from "./chunk-CCFEMZI5.js";
29
+ } from "./chunk-YWLJQ2FY.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-LJ3MSVVW.js";
193
+ } from "./chunk-NZOLX55S.js";
194
194
  import {
195
195
  ADS_ACTIVATE_SCOPE,
196
196
  ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
@@ -377,6 +377,8 @@ import {
377
377
  OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS,
378
378
  OPERATION_ACCESS_HEADER,
379
379
  OUTSTANDING_PROVIDER_BATCH_STATUSES,
380
+ OVERVIEW_ACTIVITY_DEFAULT_DAYS,
381
+ OVERVIEW_ACTIVITY_EXCLUDED_KINDS,
380
382
  OVERVIEW_WHAT_CHANGED_QUERY_LIMIT,
381
383
  OperationAccesses,
382
384
  OutcomeOperationKinds,
@@ -1073,6 +1075,7 @@ import {
1073
1075
  orderLocationsDefaultFirst,
1074
1076
  organicEvidenceDtoSchema,
1075
1077
  outcomeSurfaceSchema,
1078
+ overviewActivityRuns,
1076
1079
  parseBoundedRate,
1077
1080
  parseCitationUrlCategories,
1078
1081
  parseEmbedQueryLimit,
@@ -1196,6 +1199,7 @@ import {
1196
1199
  runStatusSchema,
1197
1200
  runTriggerRequestSchema,
1198
1201
  runTriggerSchema,
1202
+ runsAttentionDtoSchema,
1199
1203
  runtimeStateMissing,
1200
1204
  schedulableRunKindSchema,
1201
1205
  scheduleDtoSchema,
@@ -1391,7 +1395,7 @@ import {
1391
1395
  wordpressSchemaDeployResultDtoSchema,
1392
1396
  wordpressSchemaStatusResultDtoSchema,
1393
1397
  wordpressStatusDtoSchema
1394
- } from "./chunk-UYRC244Y.js";
1398
+ } from "./chunk-73AQQAPC.js";
1395
1399
 
1396
1400
  // ../api-routes/src/user-session.ts
1397
1401
  import crypto2 from "crypto";
@@ -18967,6 +18971,42 @@ async function runRoutes(app, opts) {
18967
18971
  const rows = app.db.select().from(runs).where(and36(...filters)).orderBy(desc14(runs.createdAt), desc14(runs.id)).limit(limit).all();
18968
18972
  return reply.send(rows.map(formatRun));
18969
18973
  });
18974
+ app.get("/runs/attention", async (request, reply) => {
18975
+ const since = parseListSince(request.query.since, new Date(Date.now() - OVERVIEW_ACTIVITY_DEFAULT_DAYS * 24 * 60 * 60 * 1e3).toISOString());
18976
+ const filters = [gte9(runs.createdAt, since), notProbeRun(), notInArray(runs.kind, [...OVERVIEW_ACTIVITY_EXCLUDED_KINDS])];
18977
+ const scopedProjectId = request.apiKey?.projectId;
18978
+ if (scopedProjectId) filters.push(eq45(runs.projectId, scopedProjectId));
18979
+ const candidates = app.db.select({
18980
+ id: runs.id,
18981
+ projectId: runs.projectId,
18982
+ kind: runs.kind,
18983
+ status: runs.status,
18984
+ trigger: runs.trigger,
18985
+ createdAt: runs.createdAt,
18986
+ location: runs.location,
18987
+ sourceId: runs.sourceId,
18988
+ queries: runs.queries,
18989
+ measurementScope: runs.measurementScope
18990
+ }).from(runs).where(and36(...filters)).all();
18991
+ const picked = overviewActivityRuns(candidates.map((row) => ({
18992
+ ...row,
18993
+ kind: row.kind,
18994
+ status: row.status,
18995
+ trigger: row.trigger
18996
+ })));
18997
+ const ids = picked.map((run) => run.id);
18998
+ const rowsById = new Map(ids.length === 0 ? [] : app.db.select().from(runs).where(inArray24(runs.id, ids)).all().map((row) => [row.id, row]));
18999
+ const projectIds = [...new Set(picked.map((run) => run.projectId))];
19000
+ const projectsById = new Map(projectIds.length === 0 ? [] : app.db.select({ id: projects.id, name: projects.name, displayName: projects.displayName }).from(projects).where(inArray24(projects.id, projectIds)).all().map((project) => [project.id, project]));
19001
+ const items = picked.flatMap((run) => {
19002
+ const row = rowsById.get(run.id);
19003
+ const project = projectsById.get(run.projectId);
19004
+ if (!row || !project) return [];
19005
+ const { measurementManifest: _manifest, ...formatted } = formatRun(row);
19006
+ return [{ project, run: formatted }];
19007
+ });
19008
+ return reply.send({ since, items });
19009
+ });
18970
19010
  app.post("/runs", async (request, reply) => {
18971
19011
  const scopedProjectId = request.apiKey?.projectId;
18972
19012
  const allProjects = (scopedProjectId ? app.db.select().from(projects).where(eq45(projects.id, scopedProjectId)) : app.db.select().from(projects)).all();
@@ -38718,26 +38758,32 @@ function readAdvancedSignalTransitions(db, projectId, runId) {
38718
38758
  var PREVIOUS_CHECK_MAX_RUNS = 100;
38719
38759
  var SNAPSHOT_ID_CHUNK = 500;
38720
38760
  function buildOverviewWhatChanged(db, input) {
38721
- const lost = input.advanced === null ? simpleLostSignals(db, input.project, input.latestSweep, input.runs) : advancedLostSignals(input.advanced, input.latestSweep, input.location, input.since);
38761
+ const changes = input.advanced === null ? simpleSignalChanges(db, input.project, input.latestSweep, input.runs) : advancedSignalChanges(input.advanced, input.latestSweep, input.location, input.since);
38722
38762
  const activeRuns = input.runs.filter(isWhatChangedActiveRun);
38723
- const lostMentions = signalDto(lost.mentions);
38724
- const lostCitations = signalDto(lost.citations);
38763
+ const lostMentions = signalDto(changes.lostMentions);
38764
+ const lostCitations = signalDto(changes.lostCitations);
38765
+ const gainedMentions = signalDto(changes.gainedMentions);
38766
+ const gainedCitations = signalDto(changes.gainedCitations);
38725
38767
  return {
38726
38768
  mode: input.advanced === null ? "simple" : "advanced",
38727
- latestCheck: lost.latestCheck,
38728
- comparison: lost.comparison,
38769
+ latestCheck: changes.latestCheck,
38770
+ comparison: changes.comparison,
38729
38771
  lostMentions,
38730
38772
  lostCitations,
38773
+ gainedMentions,
38774
+ gainedCitations,
38731
38775
  activeRuns: { count: activeRuns.length, runIds: activeRuns.map((run) => run.id) },
38732
38776
  items: whatChangedProjectItems(input.project, {
38733
38777
  lostMentionQueries: lostMentions.queryCount,
38778
+ gainedMentionQueries: gainedMentions.queryCount,
38734
38779
  lostCitationQueries: lostCitations.queryCount,
38780
+ gainedCitationQueries: gainedCitations.queryCount,
38735
38781
  activeRuns: activeRuns.length
38736
38782
  })
38737
38783
  };
38738
38784
  }
38739
- function record2(lost, answer) {
38740
- let entry = lost.get(answer.queryKey);
38785
+ function record2(changed, answer) {
38786
+ let entry = changed.get(answer.queryKey);
38741
38787
  if (!entry) {
38742
38788
  entry = {
38743
38789
  queryId: answer.queryId,
@@ -38748,7 +38794,7 @@ function record2(lost, answer) {
38748
38794
  properties: /* @__PURE__ */ new Map(),
38749
38795
  markets: /* @__PURE__ */ new Map()
38750
38796
  };
38751
- lost.set(answer.queryKey, entry);
38797
+ changed.set(answer.queryKey, entry);
38752
38798
  }
38753
38799
  entry.classes.add(answer.queryClass);
38754
38800
  entry.providers.add(answer.provider);
@@ -38759,8 +38805,8 @@ function record2(lost, answer) {
38759
38805
  function unavailable5(reason) {
38760
38806
  return { state: "unavailable", reason };
38761
38807
  }
38762
- function nothingLost(latestCheck, comparison) {
38763
- return { latestCheck, comparison, mentions: /* @__PURE__ */ new Map(), citations: /* @__PURE__ */ new Map() };
38808
+ function nothingChanged(latestCheck, comparison) {
38809
+ return { latestCheck, comparison, lostMentions: /* @__PURE__ */ new Map(), lostCitations: /* @__PURE__ */ new Map(), gainedMentions: /* @__PURE__ */ new Map(), gainedCitations: /* @__PURE__ */ new Map() };
38764
38810
  }
38765
38811
  function sweepCheck(sweep) {
38766
38812
  const first = sweep.at(0);
@@ -38774,6 +38820,7 @@ var SNAPSHOT_SIGNAL_COLUMNS = {
38774
38820
  provider: querySnapshots.provider,
38775
38821
  location: querySnapshots.location,
38776
38822
  citationState: querySnapshots.citationState,
38823
+ retrievalStatus: querySnapshots.retrievalStatus,
38777
38824
  answerMentioned: querySnapshots.answerMentioned,
38778
38825
  answerText: querySnapshots.answerText,
38779
38826
  mentionIdentity: querySnapshots.mentionIdentity
@@ -38804,9 +38851,9 @@ function newestEarlierAnswers(db, runIds) {
38804
38851
  function compareRecency(left, right, runOrder) {
38805
38852
  return (runOrder.get(left.runId) ?? 0) - (runOrder.get(right.runId) ?? 0) || compareText(right.createdAt, left.createdAt) || compareText(left.id, right.id);
38806
38853
  }
38807
- function simpleLostSignals(db, project, latestSweep, overviewRuns) {
38854
+ function simpleSignalChanges(db, project, latestSweep, overviewRuns) {
38808
38855
  const latestCheck = sweepCheck(latestSweep);
38809
- if (latestCheck === null) return nothingLost(null, unavailable5("not-measured"));
38856
+ if (latestCheck === null) return nothingChanged(null, unavailable5("not-measured"));
38810
38857
  const tracked = db.select({ id: queries.id, query: queries.query }).from(queries).where(eq76(queries.projectId, project.id)).all();
38811
38858
  const trackedById = new Map(tracked.map((query2) => [query2.id, query2]));
38812
38859
  const trackedByText = new Map(tracked.map((query2) => [normalizeQueryText(query2.query), query2]));
@@ -38840,9 +38887,11 @@ function simpleLostSignals(db, project, latestSweep, overviewRuns) {
38840
38887
  }
38841
38888
  }
38842
38889
  const classes = readQueryClasses(db, project, tracked);
38843
- const mentioned = (snapshot) => resolveSnapshotAnswerMentioned(snapshot, project);
38844
- const mentions = /* @__PURE__ */ new Map();
38845
- const citations = /* @__PURE__ */ new Map();
38890
+ const mentioned = snapshotMentionObserver(project);
38891
+ const lostMentions = /* @__PURE__ */ new Map();
38892
+ const lostCitations = /* @__PURE__ */ new Map();
38893
+ const gainedMentions = /* @__PURE__ */ new Map();
38894
+ const gainedCitations = /* @__PURE__ */ new Map();
38846
38895
  for (const [key, { query: query2, snapshot }] of current) {
38847
38896
  const chosen = previousIdBySlot.get(key);
38848
38897
  const previous = chosen === void 0 ? void 0 : previousById.get(chosen.id);
@@ -38855,28 +38904,32 @@ function simpleLostSignals(db, project, latestSweep, overviewRuns) {
38855
38904
  provider: snapshot.provider,
38856
38905
  location: snapshot.location
38857
38906
  };
38858
- if (mentioned(previous) && !mentioned(snapshot)) record2(mentions, answer);
38859
- if (previous.citationState === CitationStates.cited && snapshot.citationState !== CitationStates.cited) record2(citations, answer);
38907
+ const [wasMentioned, isMentioned] = [mentioned(previous), mentioned(snapshot)];
38908
+ if (wasMentioned === true && isMentioned === false) record2(lostMentions, answer);
38909
+ if (wasMentioned === false && isMentioned === true) record2(gainedMentions, answer);
38910
+ const [wasCited, isCited] = [readCitationState(previous), readCitationState(snapshot)];
38911
+ if (wasCited === CitationStates.cited && isCited === CitationStates["not-cited"]) record2(lostCitations, answer);
38912
+ if (wasCited === CitationStates["not-cited"] && isCited === CitationStates.cited) record2(gainedCitations, answer);
38860
38913
  }
38861
38914
  const previousRunIds = [...new Set([...previousIdBySlot.values()].map((previous) => previous.runId))].sort((left, right) => (runOrder.get(left) ?? 0) - (runOrder.get(right) ?? 0));
38862
38915
  const comparison = previousRunIds.length === 0 ? unavailable5("no-previous-check") : { state: "available", previousRunIds };
38863
- return { latestCheck, comparison, mentions, citations };
38916
+ return { latestCheck, comparison, lostMentions, lostCitations, gainedMentions, gainedCitations };
38864
38917
  }
38865
- function advancedLostSignals(advanced, latestSweep, location, since) {
38918
+ function advancedSignalChanges(advanced, latestSweep, location, since) {
38866
38919
  if (advanced.plan === "legacy") {
38867
38920
  const latestCheck2 = sweepCheck(latestSweep);
38868
- return nothingLost(latestCheck2, unavailable5(latestCheck2 === null ? "not-measured" : "legacy-plan"));
38921
+ return nothingChanged(latestCheck2, unavailable5(latestCheck2 === null ? "not-measured" : "legacy-plan"));
38869
38922
  }
38870
38923
  const { current } = advanced;
38871
- if (current === null) return nothingLost(null, unavailable5("not-measured"));
38924
+ if (current === null) return nothingChanged(null, unavailable5("not-measured"));
38872
38925
  const latestCheck = { runIds: [current.id], createdAt: current.createdAt };
38873
38926
  const changes = advancedSignalTransitions(advanced, since);
38874
- if (changes.state === "unavailable") return nothingLost(latestCheck, unavailable5(changes.reason));
38875
- const losses = (transitions, lostState) => {
38876
- const lost = /* @__PURE__ */ new Map();
38927
+ if (changes.state === "unavailable") return nothingChanged(latestCheck, unavailable5(changes.reason));
38928
+ const moved = (transitions, toState) => {
38929
+ const changed = /* @__PURE__ */ new Map();
38877
38930
  for (const transition of transitions) {
38878
- if (transition.to !== lostState || !locationMatches(transition.location, location)) continue;
38879
- record2(lost, {
38931
+ if (transition.to !== toState || !locationMatches(transition.location, location)) continue;
38932
+ record2(changed, {
38880
38933
  queryKey: transition.queryId ?? `text:${transition.query}`,
38881
38934
  queryId: transition.queryId,
38882
38935
  query: transition.query,
@@ -38887,11 +38940,16 @@ function advancedLostSignals(advanced, latestSweep, location, since) {
38887
38940
  markets: transition.markets
38888
38941
  });
38889
38942
  }
38890
- return lost;
38943
+ return changed;
38944
+ };
38945
+ return {
38946
+ latestCheck,
38947
+ comparison: { state: "available", previousRunIds: [changes.previousRunId] },
38948
+ lostMentions: moved(changes.mention, MentionStates["not-mentioned"]),
38949
+ lostCitations: moved(changes.citation, CitationStates["not-cited"]),
38950
+ gainedMentions: moved(changes.mention, MentionStates.mentioned),
38951
+ gainedCitations: moved(changes.citation, CitationStates.cited)
38891
38952
  };
38892
- const mentions = losses(changes.mention, MentionStates["not-mentioned"]);
38893
- const citations = losses(changes.citation, CitationStates["not-cited"]);
38894
- return { latestCheck, comparison: { state: "available", previousRunIds: [changes.previousRunId] }, mentions, citations };
38895
38953
  }
38896
38954
  function compareNullableText(left, right) {
38897
38955
  if (left === right) return 0;
@@ -38902,8 +38960,8 @@ function compareNullableText(left, right) {
38902
38960
  function keyedLabels(values) {
38903
38961
  return [...values].map(([key, label]) => ({ key, label })).sort((left, right) => compareText(left.label, right.label) || compareText(left.key, right.key));
38904
38962
  }
38905
- function signalDto(lost) {
38906
- const rows = [...lost.values()].sort((left, right) => compareText(left.query, right.query) || compareNullableText(left.queryId, right.queryId));
38963
+ function signalDto(changed) {
38964
+ const rows = [...changed.values()].sort((left, right) => compareText(left.query, right.query) || compareNullableText(left.queryId, right.queryId));
38907
38965
  return {
38908
38966
  queryCount: rows.length,
38909
38967
  queries: rows.slice(0, OVERVIEW_WHAT_CHANGED_QUERY_LIMIT).map((row) => ({
@@ -40820,6 +40878,7 @@ var SCHEMA_TABLE = {
40820
40878
  RunDetailDto: runDetailDtoSchema,
40821
40879
  RunFillResponseDto: runFillResponseDtoSchema,
40822
40880
  RunDto: runDtoSchema,
40881
+ RunsAttentionDto: runsAttentionDtoSchema,
40823
40882
  SchedulableRunKind: schedulableRunKindSchema,
40824
40883
  CalendarRecurrence: calendarRecurrenceSchema,
40825
40884
  ScheduleDto: scheduleDtoSchema,
@@ -43814,6 +43873,23 @@ var routeCatalog = [
43814
43873
  200: jsonArrayResponse("Runs returned.", "RunDto")
43815
43874
  }
43816
43875
  },
43876
+ {
43877
+ method: "get",
43878
+ path: "/api/v1/runs/attention",
43879
+ summary: "List the jobs that need attention",
43880
+ description: "Overview's Activity across the projects the key can see: each job's latest run, kept when it failed, finished partly, was cancelled, or is still queued or running, newest first, with its project. A job is one project, run kind, location and source, with spot checks apart from full sweeps, so a run elsewhere never hides a failure. Probes and per-URL inspections are left out. `since` bounds the runs read (default 30 days ago); a job with no run since then is not listed. Runs come without their measurement manifests. Stored read: no provider calls.",
43881
+ tags: ["runs"],
43882
+ parameters: [{
43883
+ name: "since",
43884
+ in: "query",
43885
+ description: "Read runs created at or after this ISO 8601 timestamp. Defaults to 30 days ago.",
43886
+ schema: stringSchema
43887
+ }],
43888
+ responses: {
43889
+ 200: jsonResponse("Jobs that need attention returned.", "RunsAttentionDto"),
43890
+ 400: errorResponse("`since` is not a valid timestamp.")
43891
+ }
43892
+ },
43817
43893
  {
43818
43894
  method: "post",
43819
43895
  path: "/api/v1/runs",
@@ -48368,7 +48444,7 @@ var routeCatalog = [
48368
48444
  method: "get",
48369
48445
  path: "/api/v1/projects/{name}/overview",
48370
48446
  summary: "Get a composite overview of project health",
48371
- description: 'Bundles project info, latest run, top undismissed insights, health, independent mention and citation coverage, query-basket comparability, and separate mention/citation movement over the shared query cohort. queryClassScope labels queryCounts, scores (except mentionShare), transitions and the movement fields as pooling branded and non-brand. Answers from an engine that returns no sources (a local model) are not measured for citation: every cited figure leaves them out of numerator and denominator and reports them in `citationNotMeasured` / `citationNotMeasuredQueries`, and a cited rate with nothing measured is null. whatChanged is the dashboard\'s "What changed": the queries that lost a mention and those that lost a citation in the latest check (each query once, the two signals counted apart), the AI Visibility runs in progress (probes excluded), and the rows the dashboard lists. Simple projects compare each engine\'s answer with its previous check of the same query and location; Advanced projects compare each Property\'s answer with the comparable previous sweep. Designed for the "how is project X doing?" question so agents can answer in one call.',
48447
+ description: 'Bundles project info, latest run, top undismissed insights, health, independent mention and citation coverage, query-basket comparability, and separate mention/citation movement over the shared query cohort. queryClassScope labels queryCounts, scores (except mentionShare), transitions and the movement fields as pooling branded and non-brand. Answers from an engine that returns no sources (a local model) are not measured for citation: every cited figure leaves them out of numerator and denominator and reports them in `citationNotMeasured` / `citationNotMeasuredQueries`, and a cited rate with nothing measured is null. whatChanged is the dashboard\'s "What changed": the queries that lost or gained a mention and those that lost or gained a citation in the latest check (each query once per direction, the two signals counted apart; a query can lose on one engine and gain on another), the AI Visibility runs in progress (probes excluded), and the rows the dashboard lists. Simple projects compare each engine\'s answer with its previous check of the same query and location; Advanced projects compare each Property\'s answer with the comparable previous sweep. Designed for the "how is project X doing?" question so agents can answer in one call.',
48372
48448
  tags: ["intelligence"],
48373
48449
  parameters: [nameParameter],
48374
48450
  responses: {
@@ -64373,6 +64449,9 @@ function openThrottleCooldown(apiKey, err) {
64373
64449
  throttleCooldownUntil.set(key, retryAt);
64374
64450
  bingClientLog("error", "http.cooldown-open", { cooldownMs: retryAt - now });
64375
64451
  }
64452
+ function bingThrottleCooldownRemainingMs(apiKey) {
64453
+ return throttleCooldownRemainingMs(apiKey);
64454
+ }
64376
64455
  async function bingFetch(apiKey, endpoint, opts) {
64377
64456
  const isIdempotent = opts?.idempotent ?? (opts?.method ?? "GET") === "GET";
64378
64457
  const cooling = throttleCooldownRemainingMs(apiKey);
@@ -83357,7 +83436,9 @@ export {
83357
83436
  extractPlaceAmenities,
83358
83437
  getPlaceReviewSignals,
83359
83438
  buildGbpSummary,
83439
+ BING_THROTTLE_COOLDOWN_MS,
83360
83440
  BingApiError,
83441
+ bingThrottleCooldownRemainingMs,
83361
83442
  getUrlInfo,
83362
83443
  getCrawlStats,
83363
83444
  getCrawlIssues,