@canonry/canonry 7.51.6 → 7.53.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 (138) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +19 -1
  2. package/assets/assets/{AccessControls-B5TqDgeq.js → AccessControls-B-5YUuLE.js} +1 -1
  3. package/assets/assets/{AuditHistoryPanel-DgxiizOW.js → AuditHistoryPanel-BkCUPvPv.js} +1 -1
  4. package/assets/assets/{BacklinksPage-Ay6pdphx.js → BacklinksPage-BMgHZKuw.js} +1 -1
  5. package/assets/assets/{HistoryPage-B11eFH21.js → HistoryPage-D2DOk7ms.js} +1 -1
  6. package/assets/assets/MeasurementPropertyPage-Bwv8nKS7.js +4 -0
  7. package/assets/assets/ProjectPage-CsJfGPx3.js +7 -0
  8. package/assets/assets/RunsPage-DSHDuj9b.js +1 -0
  9. package/assets/assets/SettingsPage-BDRdWk5X.js +1 -0
  10. package/assets/assets/SiteHealthSection-DV06NTxC.js +2 -0
  11. package/assets/assets/TrafficPage-CBMMwRfw.js +40 -0
  12. package/assets/assets/{TrafficSourceDetailPage-DQu0YNt2.js → TrafficSourceDetailPage-Czpt0S7j.js} +1 -1
  13. package/assets/assets/card-CVejjbhs.js +60 -0
  14. package/assets/assets/{extract-error-message-BRM1I_3L.js → extract-error-message-Co6zPipR.js} +1 -1
  15. package/assets/assets/{format-helpers-DrkFERj3.js → format-helpers-B_2jkVGI.js} +1 -1
  16. package/assets/assets/index-BnS2Vuv0.js +40 -0
  17. package/assets/assets/index-DgS5TTSb.css +1 -0
  18. package/assets/assets/{query-client-gRFnU4VF.js → query-client-BKJLgjJd.js} +1 -1
  19. package/assets/assets/react-query-ltP1RErY.js +1 -0
  20. package/assets/assets/{react-sigma_core.esm.min-D09H4byP.js → react-sigma_core.esm.min-Bjux3j_1.js} +1 -1
  21. package/assets/assets/service-CDsqgNrS.js +1 -0
  22. package/assets/index.html +8 -7
  23. package/dist/{ads-ABAT3K4K.js → ads-S4S74OXM.js} +3 -3
  24. package/dist/{agent-5G4DRLYX.js → agent-JZWKCI5V.js} +7 -7
  25. package/dist/{agent-ask-UDVCZRO7.js → agent-ask-N2DG5ZLZ.js} +3 -3
  26. package/dist/{agent-conversations-5E4JP2QZ.js → agent-conversations-7UDNE7YI.js} +3 -3
  27. package/dist/{agent-memory-7IIJ4HGZ.js → agent-memory-I74OWTU7.js} +3 -3
  28. package/dist/{agent-providers-BOXPUXZ4.js → agent-providers-MEMCZPGE.js} +3 -3
  29. package/dist/{agent-transcript-4O56G6PQ.js → agent-transcript-Z7VTL7PY.js} +3 -3
  30. package/dist/{analytics-PKMWX5XL.js → analytics-4NUSNTKT.js} +3 -3
  31. package/dist/{apply-OK4XEBDA.js → apply-OZKQK3YF.js} +3 -3
  32. package/dist/{backfill-2OT56CX2.js → backfill-PLY2NOOY.js} +9 -9
  33. package/dist/{backlinks-547WCHND.js → backlinks-2CMRJFWO.js} +3 -3
  34. package/dist/{bing-ZVBV4ZD5.js → bing-RD3DDESD.js} +3 -3
  35. package/dist/{bootstrap-HUB7XQ73.js → bootstrap-JOYV4SWM.js} +9 -9
  36. package/dist/{cdp-KQKQ4PWJ.js → cdp-LUGL3CT6.js} +7 -7
  37. package/dist/{chunk-HM4NNKLG.js → chunk-23UZNTF4.js} +1 -1
  38. package/dist/{chunk-73P65KPW.js → chunk-2EYBZYDG.js} +2 -2
  39. package/dist/{chunk-D6COIM3U.js → chunk-2GAXZAQJ.js} +5985 -5846
  40. package/dist/{chunk-VBCE4CLX.js → chunk-2HWY4NRQ.js} +3 -3
  41. package/dist/{chunk-ZWJRY5UI.js → chunk-2XDGFHPM.js} +6 -4
  42. package/dist/{chunk-I3A56PFP.js → chunk-3DO3CS7Y.js} +4 -4
  43. package/dist/{chunk-PCXRFT3N.js → chunk-6VSKBVB3.js} +3 -3
  44. package/dist/{chunk-RKIXES2B.js → chunk-6ZCZRZ66.js} +2 -2
  45. package/dist/{chunk-MMEO22MF.js → chunk-BGZL5RCP.js} +1 -1
  46. package/dist/{chunk-63ISSSGX.js → chunk-BH274VEO.js} +32 -4
  47. package/dist/{chunk-HACZUMGM.js → chunk-BQT7VLGM.js} +11 -1
  48. package/dist/{chunk-KFT5LOP2.js → chunk-C5GCRQ66.js} +10 -3
  49. package/dist/{chunk-7B2Q4NJE.js → chunk-DFQHGWPB.js} +1 -1
  50. package/dist/{chunk-TUTKNUMV.js → chunk-F55ER5RQ.js} +3 -3
  51. package/dist/{chunk-I77PLCWG.js → chunk-IWQGZQHE.js} +32 -12
  52. package/dist/{chunk-DGVUTH7W.js → chunk-JZARXJV6.js} +3031 -2283
  53. package/dist/{chunk-ZXUAWVWM.js → chunk-LGU3O5YP.js} +2 -2
  54. package/dist/{chunk-7WZ2FPB4.js → chunk-LYCYSM6O.js} +1 -1
  55. package/dist/chunk-N3WQHLDI.js +1199 -0
  56. package/dist/{chunk-WAULJDKO.js → chunk-N6MS4VG2.js} +226 -5
  57. package/dist/{chunk-B2FR2ZQ4.js → chunk-NKSASP4U.js} +1 -1
  58. package/dist/{chunk-B5J675KK.js → chunk-O3OTW7F4.js} +39 -2
  59. package/dist/{chunk-6G6FTDWC.js → chunk-P4SXRRB4.js} +313 -196
  60. package/dist/{chunk-42D2LE2B.js → chunk-QARV5HVI.js} +26 -240
  61. package/dist/{chunk-VYMZ3QXG.js → chunk-QNU7IIO7.js} +326 -324
  62. package/dist/{chunk-ISOQPVPY.js → chunk-QXJ356KK.js} +4 -4
  63. package/dist/{chunk-QWKPSFGL.js → chunk-RVBGFWJ3.js} +1 -1
  64. package/dist/{chunk-WDFI5YMD.js → chunk-SZG7S7TE.js} +1 -1
  65. package/dist/{chunk-GO2J7SYT.js → chunk-U7JJKXLA.js} +5 -5
  66. package/dist/{chunk-PITHTCAX.js → chunk-VEH4YLWR.js} +1 -1
  67. package/dist/{chunk-NHQ2U5I4.js → chunk-WNXKW3NS.js} +1 -1
  68. package/dist/{chunk-2G6IP3MO.js → chunk-XTIP5WSA.js} +11 -4
  69. package/dist/{chunk-U3AHE2RT.js → chunk-ZXH5IFIA.js} +4 -4
  70. package/dist/{citations-UYB2RU5U.js → citations-GMLBTNLW.js} +3 -3
  71. package/dist/{cli-catalog-F6FI7NB2.js → cli-catalog-WKUCQEWA.js} +3 -3
  72. package/dist/{cli-commands-ZG5ILKDA.js → cli-commands-YCHQWUNK.js} +7 -7
  73. package/dist/cli.js +13 -13
  74. package/dist/{competitor-EKP4R7YY.js → competitor-QNPVJFEI.js} +3 -3
  75. package/dist/{content-DREE6JF3.js → content-NFTC74HD.js} +3 -3
  76. package/dist/{dashboard-ZALEOLLU.js → dashboard-TMUQT5H5.js} +6 -6
  77. package/dist/{demo-JG4Y22O4.js → demo-O5SPVLZZ.js} +1 -1
  78. package/dist/{demo-server-3A4J2C65.js → demo-server-WKZ53RGK.js} +11 -11
  79. package/dist/{discover-W6GMD2HS.js → discover-LTTO7KHN.js} +3 -3
  80. package/dist/{discover-eval-CKFZHRBW.js → discover-eval-QRDNMDUE.js} +3 -3
  81. package/dist/{doctor-TNGBSUMA.js → doctor-SFL5FOW4.js} +3 -3
  82. package/dist/{evidence-3H2GFQBZ.js → evidence-J6WZ767P.js} +3 -3
  83. package/dist/{export-cmd-WUIKU5GK.js → export-cmd-D3JDTBDV.js} +3 -3
  84. package/dist/{ga-JI6REFO4.js → ga-N56LXQUN.js} +3 -3
  85. package/dist/{gbp-4ENDM5NS.js → gbp-7WVJYWDR.js} +3 -3
  86. package/dist/{google-HKQSCLOC.js → google-YLRVXYVJ.js} +4 -4
  87. package/dist/{google-marketing-KQR5J2S4.js → google-marketing-4DGX3RBB.js} +1 -1
  88. package/dist/{health-cmd-TS7EMMCS.js → health-cmd-PK3BASF6.js} +3 -3
  89. package/dist/{history-MSD5DK6K.js → history-UWTEZ626.js} +3 -3
  90. package/dist/index.d.ts +120 -48
  91. package/dist/index.js +23 -23
  92. package/dist/{init-L6WAEOWX.js → init-RBI2IOBY.js} +11 -11
  93. package/dist/{insights-RTZ3IZTD.js → insights-ZUC5XHFD.js} +3 -3
  94. package/dist/intelligence-service-JXXB43RB.js +15 -0
  95. package/dist/{keys-625DZBRM.js → keys-NOG3M76V.js} +3 -3
  96. package/dist/{keyword-CW46RNRR.js → keyword-HD57L76I.js} +3 -3
  97. package/dist/{logs-V33SHBIW.js → logs-VAB7ITBS.js} +3 -3
  98. package/dist/{mcp-DFEDPSEG.js → mcp-HYHIL5FB.js} +2 -2
  99. package/dist/mcp.js +9 -9
  100. package/dist/{measurement-plan-6W37RUOP.js → measurement-plan-GEHOHCH3.js} +5 -5
  101. package/dist/{notify-DSUOT7WO.js → notify-VQ2ZDGN4.js} +3 -3
  102. package/dist/{organic-evidence-BMN6L4OB.js → organic-evidence-6TX627YW.js} +3 -3
  103. package/dist/{overview-WRRMBZ6S.js → overview-XBO7WYAV.js} +4 -4
  104. package/dist/{project-2GJIU3FE.js → project-DR6744WZ.js} +3 -3
  105. package/dist/{query-3XPMGJUA.js → query-OGVTCPG5.js} +3 -3
  106. package/dist/{research-V433CKJ4.js → research-B2TGKSMC.js} +3 -3
  107. package/dist/{results-export-RGBU7QQQ.js → results-export-K7PAYPWQ.js} +3 -3
  108. package/dist/{run-NIAC6OJN.js → run-Y6LUMCVL.js} +4 -4
  109. package/dist/{schedule-KDWXRIE7.js → schedule-PNAUJ5FX.js} +3 -3
  110. package/dist/{search-626MPUJN.js → search-PMVOGL4U.js} +3 -3
  111. package/dist/{serve-73SMMASI.js → serve-PQHXSS5T.js} +67 -26
  112. package/dist/{session-7WWOETZB.js → session-S5NDMMKF.js} +16 -15
  113. package/dist/{settings-VKFQO6F2.js → settings-AL7E7QUK.js} +3 -3
  114. package/dist/{skills-5HC5H7TE.js → skills-GQOOTDR7.js} +2 -2
  115. package/dist/{snapshot-BSJUHFBC.js → snapshot-W3FXRTZM.js} +3 -3
  116. package/dist/{src-F6HM73TN.js → src-WZLTQFCH.js} +2 -2
  117. package/dist/{status-V4OWP7LZ.js → status-MBJVN4W5.js} +4 -4
  118. package/dist/{technical-aeo-TG7CGU3F.js → technical-aeo-Y4RFST72.js} +3 -3
  119. package/dist/{telemetry-O2IUNUBW.js → telemetry-VK6F5QSZ.js} +4 -4
  120. package/dist/{tools-2GJIDKND.js → tools-W3AQY5TY.js} +11 -11
  121. package/dist/{traffic-XV4I3UPH.js → traffic-ER4I6V3B.js} +5 -5
  122. package/dist/{users-VGBLDL5K.js → users-KZK2OF4L.js} +3 -3
  123. package/dist/{visibility-stats-UKJYJ6PP.js → visibility-stats-CR7BUG5G.js} +3 -3
  124. package/dist/{wordpress-JZA7CGC6.js → wordpress-DG5JUCAC.js} +3 -3
  125. package/package.json +2 -1
  126. package/assets/assets/MeasurementPropertyPage-1UYI7mzP.js +0 -4
  127. package/assets/assets/ProjectPage-DoY0hftd.js +0 -8
  128. package/assets/assets/RunsPage-BPBmuQAS.js +0 -1
  129. package/assets/assets/SettingsPage-ClKnP8xy.js +0 -1
  130. package/assets/assets/SiteHealthSection-PWjKMmEn.js +0 -2
  131. package/assets/assets/TrafficPage-DkfGiJXR.js +0 -40
  132. package/assets/assets/card-DYMyvhB9.js +0 -60
  133. package/assets/assets/index-CG1Jox52.js +0 -39
  134. package/assets/assets/index-CsPsaUr7.css +0 -1
  135. package/assets/assets/react-query-lH82FULK.js +0 -1
  136. package/assets/assets/service-Cx0HSnE9.js +0 -1
  137. package/dist/chunk-UQ3MOZGC.js +0 -644
  138. package/dist/intelligence-service-TH52PCNJ.js +0 -15
@@ -3,7 +3,7 @@ import {
3
3
  resolveCliAccess,
4
4
  resolveCliAccessForInvocation,
5
5
  windowOptions
6
- } from "./chunk-7WZ2FPB4.js";
6
+ } from "./chunk-LYCYSM6O.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-D6COIM3U.js";
17
+ } from "./chunk-2GAXZAQJ.js";
18
18
 
19
19
  // src/cli-catalog.ts
20
20
  import { createRequire } from "module";
@@ -111,7 +111,7 @@ async function dispatchRegisteredCommand(args, fallbackFormat, specs) {
111
111
  const accessValue = accessFilterFromArgs(argsWithoutHelp);
112
112
  validateAccessFilter(accessValue);
113
113
  if (fallbackFormat !== "text") {
114
- const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-F6FI7NB2.js");
114
+ const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-WKUCQEWA.js");
115
115
  const group2 = argsWithoutHelp.find((arg) => !arg.startsWith("--"));
116
116
  printCliCatalog2(specs, fallbackFormat, group2, accessValue);
117
117
  return true;
@@ -2,11 +2,11 @@ import {
2
2
  dedupeGscSitemapUrls,
3
3
  resolveDiscoveredGscSitemapUrls,
4
4
  submitGscSitemapBatches
5
- } from "./chunk-HM4NNKLG.js";
5
+ } from "./chunk-23UZNTF4.js";
6
6
  import {
7
7
  measurementDraftOperationSchema,
8
8
  runMeasurementDraftAction
9
- } from "./chunk-HACZUMGM.js";
9
+ } from "./chunk-BQT7VLGM.js";
10
10
  import {
11
11
  CliError
12
12
  } from "./chunk-HGMYEDAQ.js";
@@ -147,7 +147,7 @@ import {
147
147
  trafficSeriesGranularitySchema,
148
148
  visibilityCompareSelectionSchema,
149
149
  visibilityReportRequestSchema
150
- } from "./chunk-D6COIM3U.js";
150
+ } from "./chunk-2GAXZAQJ.js";
151
151
 
152
152
  // src/mcp/tool-registry.ts
153
153
  import { z as z2 } from "zod";
@@ -348,6 +348,8 @@ var measurementDraftActionOpenApiOperations = [
348
348
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/preview-assignments",
349
349
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/replace-assignments",
350
350
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/apply-paired-assignments",
351
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/preview-route-markets",
352
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/route-markets",
351
353
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/remove-assignment",
352
354
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/clear-assignments",
353
355
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/classify-assignments",
@@ -3118,7 +3120,7 @@ var rawCanonryMcpTools = [
3118
3120
  defineTool({
3119
3121
  name: "canonry_run_trigger",
3120
3122
  title: "Trigger run",
3121
- description: `Trigger an answer-visibility run for a Canonry project. Omit both scoping fields for a full sweep. Pass request.queries[] to measure only some of the project's tracked questions. On a project with a published measurement plan, pass request.measurementScope with at least one group or target to measure one slice of that plan \u2014 a group stands for its member Targets, and only the questions those Targets selected are measured. A scope naming nothing is rejected rather than treated as a full sweep, so omit the field entirely when you want everything. Either kind of slice is recorded as a spot check: it never replaces a full sweep in the dashboard, analytics or report. For verification scenarios (testing whether a provider migration worked, reproducing a regression, sanity-checking after a code change), set request.trigger='probe' \u2014 probe runs write a snapshot you can inspect via canonry_runs_get but are EXCLUDED from dashboard, analytics, intelligence, report, and notifications. Use 'probe' whenever you are testing on your own initiative rather than producing data the user/dashboard will consume. request.dispatchMode='batch' sends every provider that can (a full sweep of a published plan, a batch-capable provider enabled in config.yaml, every answer's model frozen) to its asynchronous batch API at the batch price; the rest run sync and the run stays running until the batch ends (up to its deadline, 24h by default). A batch request no provider can honour is refused with each provider's reason. Omit it for the ordinary sync sweep. A run is refused with PROVIDERS_FAILING when every provider it would call failed on its account (rejected key, denied access, no credit) in each of its last ${PROVIDER_ACCOUNT_FAILURE_STREAK} runs; details.providers names each provider's code and details.retryAfter when one run is let through again (${PROVIDER_ACCOUNT_RETRY_HOURS}h after the newest failure). Tell the user to fix the key, access or billing; saving a new key, model or endpoint in the provider's settings lets the next run through at once. A probe (request.trigger='probe') is never refused, and one that succeeds clears the refusal, so use a probe to check a fix. When only some providers keep failing that way, the run is queued without them: skippedProviders on the returned run names each with its code and retryAfter, and the run ends partial. Set request.force=true (call every provider) only when the user asks to run anyway.`,
3123
+ description: `Trigger an answer-visibility run for a Canonry project. request.providers accepts direct provider names and pinned OpenRouter model routes such as openrouter:google/gemini-2.5-flash. Multiple routes share the OpenRouter connection credentials and account limits, while preserving independent observations. The bare openrouter connection is not a sweep model. Omit both scoping fields for a full sweep. Pass request.queries[] to measure only some of the project's tracked questions. On a project with a published measurement plan, pass request.measurementScope with at least one group or target to measure one slice of that plan \u2014 a group stands for its member Targets, and only the questions those Targets selected are measured. A scope naming nothing is rejected rather than treated as a full sweep, so omit the field entirely when you want everything. Either kind of slice is recorded as a spot check: it never replaces a full sweep in the dashboard, analytics or report. For verification scenarios (testing whether a provider migration worked, reproducing a regression, sanity-checking after a code change), set request.trigger='probe' \u2014 probe runs write a snapshot you can inspect via canonry_runs_get but are EXCLUDED from dashboard, analytics, intelligence, report, and notifications. Use 'probe' whenever you are testing on your own initiative rather than producing data the user/dashboard will consume. request.dispatchMode='batch' sends every provider that can (a full sweep of a published plan, a batch-capable provider enabled in config.yaml, every answer's model frozen) to its asynchronous batch API at the batch price; the rest run sync and the run stays running until the batch ends (up to its deadline, 24h by default). A batch request no provider can honour is refused with each provider's reason. Omit it for the ordinary sync sweep. A run is refused with PROVIDERS_FAILING when every provider it would call failed on its account (rejected key, denied access, no credit) in each of its last ${PROVIDER_ACCOUNT_FAILURE_STREAK} runs; details.providers names each provider's code and details.retryAfter when one run is let through again (${PROVIDER_ACCOUNT_RETRY_HOURS}h after the newest failure). Tell the user to fix the key, access or billing; saving a new key, model or endpoint in the provider's settings lets the next run through at once. A probe (request.trigger='probe') is never refused, and one that succeeds clears the refusal, so use a probe to check a fix. When only some providers keep failing that way, the run is queued without them: skippedProviders on the returned run names each with its code and retryAfter, and the run ends partial. Set request.force=true (call every provider) only when the user asks to run anyway.`,
3122
3124
  access: "write",
3123
3125
  tier: "core",
3124
3126
  inputSchema: runTriggerInputSchema,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  registeredProviderNames
3
- } from "./chunk-QWKPSFGL.js";
3
+ } from "./chunk-RVBGFWJ3.js";
4
4
  import {
5
5
  configExists,
6
6
  loadConfigRaw
7
- } from "./chunk-UQ3MOZGC.js";
7
+ } from "./chunk-N3WQHLDI.js";
8
8
 
9
9
  // src/setup-state.ts
10
10
  import fs from "fs";
@@ -28,7 +28,7 @@ async function buildSetupState() {
28
28
  }
29
29
  if (dbPath && fs.existsSync(dbPath)) {
30
30
  try {
31
- const { createClient, projects, queries: queriesTable } = await import("./src-F6HM73TN.js");
31
+ const { createClient, projects, queries: queriesTable } = await import("./src-WZLTQFCH.js");
32
32
  const db = createClient(dbPath);
33
33
  project_count = db.select({ id: projects.id }).from(projects).all().length;
34
34
  const firstQuery = db.select({ id: queriesTable.id }).from(queriesTable).limit(1).all();
@@ -47,7 +47,7 @@ function queueServeHandoff() {
47
47
  async function runPendingServeHandoff(format) {
48
48
  if (!pendingServeHandoff) return;
49
49
  pendingServeHandoff = false;
50
- const { serveCommand } = await import("./serve-73SMMASI.js");
50
+ const { serveCommand } = await import("./serve-PQHXSS5T.js");
51
51
  await serveCommand(format);
52
52
  }
53
53
 
@@ -6,11 +6,11 @@ import {
6
6
  import {
7
7
  createApiClient,
8
8
  runWithUsageTags
9
- } from "./chunk-B5J675KK.js";
9
+ } from "./chunk-O3OTW7F4.js";
10
10
  import {
11
11
  canonryMcpTools,
12
12
  toolOperationAccess
13
- } from "./chunk-ZWJRY5UI.js";
13
+ } from "./chunk-2XDGFHPM.js";
14
14
  import {
15
15
  PACKAGE_VERSION
16
16
  } from "./chunk-AOJU5LKX.js";
@@ -23,7 +23,7 @@ import {
23
23
  isReadOnlyKey,
24
24
  restrictedWriteScopes,
25
25
  upgradeCaveatFor
26
- } from "./chunk-D6COIM3U.js";
26
+ } from "./chunk-2GAXZAQJ.js";
27
27
 
28
28
  // src/mcp/server.ts
29
29
  import { randomUUID } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  loadConfig,
6
6
  loadConfigRaw,
7
7
  saveConfigPatch
8
- } from "./chunk-UQ3MOZGC.js";
8
+ } from "./chunk-N3WQHLDI.js";
9
9
  import {
10
10
  CANONRY_NPM_PACKAGE_URL,
11
11
  compareSemver,
@@ -18,7 +18,7 @@ import {
18
18
  updateCheckEnvOptOut,
19
19
  upgradeCaveatFor,
20
20
  upgradeCommandFor
21
- } from "./chunk-D6COIM3U.js";
21
+ } from "./chunk-2GAXZAQJ.js";
22
22
 
23
23
  // src/runtime-context.ts
24
24
  function cliRuntimeContext(env = process.env, stdio = process) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hostMatchesDomain
3
- } from "./chunk-D6COIM3U.js";
3
+ } from "./chunk-2GAXZAQJ.js";
4
4
 
5
5
  // src/citation-utils.ts
6
6
  function pickProjectCitedDomain(citedDomains, projectDomains) {
@@ -17,7 +17,7 @@ import {
17
17
  templateLinkRatio,
18
18
  templateLinkUbiquityAvailable,
19
19
  validationError
20
- } from "./chunk-D6COIM3U.js";
20
+ } from "./chunk-2GAXZAQJ.js";
21
21
  import {
22
22
  __export
23
23
  } from "./chunk-MLKGABMK.js";
@@ -542,6 +542,15 @@ var querySnapshots = sqliteTable("query_snapshots", {
542
542
  servedModel: text("served_model"),
543
543
  citationState: text("citation_state").notNull(),
544
544
  answerMentioned: integer("answer_mentioned", { mode: "boolean" }),
545
+ // Sentiment's identity verdict on a Simple answer, kept by
546
+ // `refreshSnapshotMentionIdentity` (api-routes) when a verdict is stored:
547
+ // `wrong-subject` means the evaluator found the answer is about another
548
+ // subject, so a name match is not a mention (`countsAsMention`). Null when
549
+ // no completed verdict says so, which includes every answer never assessed.
550
+ mentionIdentity: text("mention_identity").$type(),
551
+ // The Advanced counterpart: stable keys of the Properties whose latest
552
+ // sentiment verdict on this answer is `wrong-subject`. Null when none.
553
+ wrongSubjectTargetKeys: text("wrong_subject_target_keys", { mode: "json" }).$type(),
545
554
  answerText: text("answer_text"),
546
555
  citedDomains: text("cited_domains", { mode: "json" }).$type().notNull().default([]),
547
556
  // Flat capture fields are deliberately nullable: historical rows are not
@@ -7794,6 +7803,18 @@ var MIGRATION_VERSIONS = [
7794
7803
  statements: [
7795
7804
  `ALTER TABLE research_run_queries ADD COLUMN retrieved_sources TEXT`
7796
7805
  ]
7806
+ },
7807
+ {
7808
+ // Sentiment's identity verdicts as they bear on mentions: a Simple answer's
7809
+ // `wrong-subject` verdict, and the Advanced Properties judged wrong-subject.
7810
+ // NULL on every existing row; the local server fills them from stored
7811
+ // sentiment results once on startup (`sentiment-mention-identity`).
7812
+ version: 185,
7813
+ name: "snapshot-sentiment-mention-identity",
7814
+ statements: [
7815
+ `ALTER TABLE query_snapshots ADD COLUMN mention_identity TEXT`,
7816
+ `ALTER TABLE query_snapshots ADD COLUMN wrong_subject_target_keys TEXT`
7817
+ ]
7797
7818
  }
7798
7819
  ];
7799
7820
  var AERO_LEDGER_REBUILDS = [
@@ -8851,20 +8872,26 @@ var SentimentRepository = class {
8851
8872
  projectId: attempt.projectId,
8852
8873
  runId: work.runId,
8853
8874
  feature: "sentiment",
8854
- provider: "typesafe",
8875
+ provider: input.provider ?? "typesafe",
8855
8876
  model: input.returnedModel ?? attempt.requestedModel,
8856
8877
  inputTokens: input.usage.inputTokens,
8857
8878
  outputTokens: input.usage.outputTokens,
8858
8879
  totalTokens: input.usage.inputTokens + input.usage.outputTokens,
8859
8880
  costMillicents: input.usage.costMillicents ?? 0,
8860
- metadata: { sentimentAttemptId: attempt.id, usageStatus: "reported" },
8881
+ metadata: { sentimentAttemptId: attempt.id, usageStatus: "reported", ...input.usage.costMillicents === void 0 ? { costStatus: "unknown" } : {} },
8861
8882
  createdAt: input.now
8862
8883
  }).onConflictDoNothing().run();
8863
8884
  }
8864
8885
  return true;
8865
8886
  }, { behavior: "immediate" });
8866
8887
  }
8867
- completeWork(input) {
8888
+ /**
8889
+ * `onCompleted` runs in the same transaction once a completed result is
8890
+ * stored, so state derived from the verdict (the snapshot's mention identity)
8891
+ * commits with it or not at all. It does not run for work canceled while it
8892
+ * ran: that result stays out of every read.
8893
+ */
8894
+ completeWork(input, onCompleted) {
8868
8895
  return this.db.transaction((tx) => {
8869
8896
  const work = tx.select().from(sentimentWorkItems).where(and(
8870
8897
  eq2(sentimentWorkItems.id, input.workItemId),
@@ -8889,6 +8916,7 @@ var SentimentRepository = class {
8889
8916
  updatedAt: input.now
8890
8917
  }).where(eq2(sentimentWorkItems.id, work.id)).run();
8891
8918
  shiftJobs(tx, work.id, work.status, status, input.now);
8919
+ if (status === "completed") onCompleted?.(tx, work);
8892
8920
  return true;
8893
8921
  }, { behavior: "immediate" });
8894
8922
  }
@@ -18,11 +18,12 @@ import {
18
18
  measurementDraftRemoveGroupRequestSchema,
19
19
  measurementDraftRenameTargetRequestSchema,
20
20
  measurementDraftReplaceAssignmentsRequestSchema,
21
+ measurementDraftRouteMarketsRequestSchema,
21
22
  measurementDraftUpsertCompetitorRequestSchema,
22
23
  measurementDraftUpsertGroupRequestSchema,
23
24
  measurementDraftUpsertMarketRequestSchema,
24
25
  measurementDraftUpsertTargetRequestSchema
25
- } from "./chunk-D6COIM3U.js";
26
+ } from "./chunk-2GAXZAQJ.js";
26
27
 
27
28
  // src/measurement-draft-actions.ts
28
29
  import { z } from "zod";
@@ -60,6 +61,11 @@ var measurementDraftOperationSchema = z.discriminatedUnion("action", [
60
61
  }).strict().describe("Read-semantic assignment impact preview."),
61
62
  mutationOperationSchema("replace-assignments", measurementDraftReplaceAssignmentsRequestSchema),
62
63
  mutationOperationSchema("apply-paired-assignments", measurementDraftApplyPairedAssignmentsRequestSchema),
64
+ z.object({
65
+ action: z.literal("preview-route-markets"),
66
+ request: measurementDraftRouteMarketsRequestSchema
67
+ }).strict().describe("Read-semantic market-routing impact preview."),
68
+ mutationOperationSchema("route-markets", measurementDraftRouteMarketsRequestSchema),
63
69
  mutationOperationSchema("remove-assignment", measurementDraftRemoveAssignmentRequestSchema),
64
70
  mutationOperationSchema("clear-assignments", measurementDraftClearAssignmentsRequestSchema),
65
71
  mutationOperationSchema("classify-assignments", measurementDraftClassifyAssignmentsRequestSchema),
@@ -108,6 +114,10 @@ function runMeasurementDraftAction(client, project, actionInput) {
108
114
  return client.replaceMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
109
115
  case "apply-paired-assignments":
110
116
  return client.applyPairedMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
117
+ case "preview-route-markets":
118
+ return client.previewMeasurementDraftMarketRouting(project, actionInput.request);
119
+ case "route-markets":
120
+ return client.routeMeasurementDraftMarkets(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
111
121
  case "remove-assignment":
112
122
  return client.removeMeasurementDraftAssignment(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
113
123
  case "clear-assignments":
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-B5J675KK.js";
3
+ } from "./chunk-O3OTW7F4.js";
4
4
  import {
5
5
  emitJsonl
6
6
  } from "./chunk-Z7IUAJOF.js";
@@ -11,6 +11,7 @@ import {
11
11
  } from "./chunk-HGMYEDAQ.js";
12
12
  import {
13
13
  CitationStates,
14
+ MentionIdentities,
14
15
  OUTSTANDING_PROVIDER_BATCH_STATUSES,
15
16
  ProviderBatchStatuses,
16
17
  RunStatuses,
@@ -18,7 +19,7 @@ import {
18
19
  formatMicros,
19
20
  formatRunErrorOneLine,
20
21
  resolveProviderInput
21
- } from "./chunk-D6COIM3U.js";
22
+ } from "./chunk-2GAXZAQJ.js";
22
23
 
23
24
  // src/commands/run.ts
24
25
  function getClient() {
@@ -462,11 +463,17 @@ function printRunDetail(run) {
462
463
  if (run.snapshots && run.snapshots.length > 0) {
463
464
  console.log(`
464
465
  Snapshots: ${run.snapshots.length} (cell = [citation][mention]; C=cited c=not, M=mentioned m=not, \u2013=no data)`);
466
+ let differentSubject = 0;
465
467
  for (const s of run.snapshots) {
466
468
  const citationGlyph = s.citationState === CitationStates.cited ? "C" : "c";
467
469
  const mentionGlyph = typeof s.answerMentioned === "boolean" ? s.answerMentioned ? "M" : "m" : "\u2013";
468
470
  const modelLabel = s.model ? ` (${s.model})` : "";
469
- console.log(` [${citationGlyph}${mentionGlyph}] ${s.provider}${modelLabel} ${s.query}`);
471
+ const ruledOut = s.mentionIdentity === MentionIdentities["wrong-subject"];
472
+ if (ruledOut) differentSubject++;
473
+ console.log(` [${citationGlyph}${mentionGlyph}] ${s.provider}${modelLabel} ${s.query}${ruledOut ? " \xB7 different subject" : ""}`);
474
+ }
475
+ if (differentSubject > 0) {
476
+ console.log(" \xB7 different subject: the answer uses your name, but sentiment found it is about something else, so it is not counted as mentioned.");
470
477
  }
471
478
  }
472
479
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  USAGE_TELEMETRY_HEADERS,
3
3
  redactLogString
4
- } from "./chunk-D6COIM3U.js";
4
+ } from "./chunk-2GAXZAQJ.js";
5
5
 
6
6
  // ../api-routes/src/request-context.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -2,18 +2,18 @@ import {
2
2
  configExists,
3
3
  loadConfigRaw,
4
4
  saveConfigPatch
5
- } from "./chunk-UQ3MOZGC.js";
5
+ } from "./chunk-N3WQHLDI.js";
6
6
  import {
7
7
  BUNDLED_SKILL_NAMES,
8
8
  installSkills
9
- } from "./chunk-B2FR2ZQ4.js";
9
+ } from "./chunk-NKSASP4U.js";
10
10
  import {
11
11
  PACKAGE_VERSION
12
12
  } from "./chunk-AOJU5LKX.js";
13
13
  import {
14
14
  SKILL_MANIFEST_FILENAME,
15
15
  SkillsClients
16
- } from "./chunk-D6COIM3U.js";
16
+ } from "./chunk-2GAXZAQJ.js";
17
17
 
18
18
  // src/skills-autosync.ts
19
19
  import fs from "fs";
@@ -1,31 +1,33 @@
1
1
  import {
2
2
  OPENAI_RETRIEVAL_CONTRACT,
3
+ openrouterAdapter,
3
4
  reparseStoredResult,
4
5
  reparseStoredResult2,
5
6
  reparseStoredResult3,
6
7
  reparseStoredResult4,
7
8
  reparseStoredResult5,
8
9
  resolveStoredApiResponse
9
- } from "./chunk-WAULJDKO.js";
10
+ } from "./chunk-N6MS4VG2.js";
10
11
  import {
11
12
  loadConfig
12
- } from "./chunk-UQ3MOZGC.js";
13
+ } from "./chunk-N3WQHLDI.js";
13
14
  import {
14
15
  isMachineFormat
15
16
  } from "./chunk-HGMYEDAQ.js";
16
17
  import {
17
18
  determineCitationState
18
- } from "./chunk-MMEO22MF.js";
19
+ } from "./chunk-BGZL5RCP.js";
19
20
  import {
20
21
  backfillProjectAnswerMentions,
21
22
  competitorIdentityColumns,
22
23
  createRunCompetitorResolver,
23
- readMarketCompetitorNames
24
- } from "./chunk-DGVUTH7W.js";
24
+ readMarketCompetitorNames,
25
+ refreshSnapshotMentionIdentity
26
+ } from "./chunk-JZARXJV6.js";
25
27
  import {
26
28
  classifyAiUserFetch,
27
29
  classifyCrawler
28
- } from "./chunk-PITHTCAX.js";
30
+ } from "./chunk-VEH4YLWR.js";
29
31
  import {
30
32
  aiUserFetchEventsHourly,
31
33
  auditLog,
@@ -40,7 +42,7 @@ import {
40
42
  querySnapshots,
41
43
  rawEventSamples,
42
44
  runs
43
- } from "./chunk-63ISSSGX.js";
45
+ } from "./chunk-BH274VEO.js";
44
46
  import {
45
47
  ProviderNames,
46
48
  RetrievalContracts,
@@ -50,12 +52,14 @@ import {
50
52
  TrafficEvidenceKinds,
51
53
  TrafficSourceTypes,
52
54
  computeCompetitorOverlap,
55
+ countsAsMention,
53
56
  determineAnswerMentioned,
54
57
  effectiveBrandNames,
55
58
  effectiveDomains,
56
59
  extractRecommendedCompetitors,
57
- normalizeUrlPath
58
- } from "./chunk-D6COIM3U.js";
60
+ normalizeUrlPath,
61
+ openRouterRouteModel
62
+ } from "./chunk-2GAXZAQJ.js";
59
63
 
60
64
  // src/commands/backfill.ts
61
65
  import { setImmediate as yieldToEventLoop } from "timers/promises";
@@ -109,6 +113,7 @@ async function backfillAnswerVisibilityCommand(opts) {
109
113
  provider: querySnapshots.provider,
110
114
  citationState: querySnapshots.citationState,
111
115
  answerMentioned: querySnapshots.answerMentioned,
116
+ mentionIdentity: querySnapshots.mentionIdentity,
112
117
  answerText: querySnapshots.answerText,
113
118
  citedDomains: querySnapshots.citedDomains,
114
119
  competitorOverlap: querySnapshots.competitorOverlap,
@@ -118,20 +123,26 @@ async function backfillAnswerVisibilityCommand(opts) {
118
123
  retrievalContract: querySnapshots.retrievalContract
119
124
  }).from(querySnapshots).where(inArray(querySnapshots.runId, batchRunIds)).all();
120
125
  const pendingUpdates = [];
126
+ const rewrittenIds = [];
121
127
  for (const snapshot of snapshotRows) {
122
128
  examined++;
123
129
  const reparsedResult = reparseProviderSnapshot(snapshot.provider, snapshot.rawResponse);
124
130
  if (reparsedResult) reparsed++;
125
131
  if (reparsedResult?.providerError) providerErrors++;
126
132
  const answerText = reparsedResult?.answerText ?? snapshot.answerText ?? "";
127
- const nextValue = determineAnswerMentioned(answerText, projectBrandNames, projectDomains);
133
+ const textChanged = (snapshot.answerText ?? "") !== answerText;
134
+ const nextValue = countsAsMention(
135
+ determineAnswerMentioned(answerText, projectBrandNames, projectDomains),
136
+ textChanged ? null : snapshot.mentionIdentity
137
+ );
128
138
  if (nextValue) mentioned++;
129
139
  const nextPatch = {};
130
140
  if (snapshot.answerMentioned !== nextValue) {
131
141
  nextPatch.answerMentioned = nextValue;
132
142
  }
133
- if ((snapshot.answerText ?? "") !== answerText) {
143
+ if (textChanged) {
134
144
  nextPatch.answerText = answerText;
145
+ rewrittenIds.push(snapshot.id);
135
146
  }
136
147
  if (reparsedResult) {
137
148
  const normalized = {
@@ -194,6 +205,7 @@ async function backfillAnswerVisibilityCommand(opts) {
194
205
  for (const update of pendingUpdates) {
195
206
  tx.update(querySnapshots).set(update.patch).where(eq(querySnapshots.id, update.id)).run();
196
207
  }
208
+ if (rewrittenIds.length > 0) refreshSnapshotMentionIdentity(tx, rewrittenIds);
197
209
  });
198
210
  updated += pendingUpdates.length;
199
211
  }
@@ -425,7 +437,7 @@ No DB writes performed. Re-run without --dry-run to apply.`);
425
437
  }
426
438
  }
427
439
  async function backfillInsightsCommand(project, opts) {
428
- const { IntelligenceService } = await import("./intelligence-service-TH52PCNJ.js");
440
+ const { IntelligenceService } = await import("./intelligence-service-JXXB43RB.js");
429
441
  const config = loadConfig();
430
442
  const db = createClient(config.database);
431
443
  migrate(db);
@@ -726,6 +738,14 @@ function reparseProviderSnapshot(provider, rawResponse) {
726
738
  const envelope = parseJsonColumn(rawResponse, {});
727
739
  const apiResponse = resolveStoredApiResponse(envelope);
728
740
  if (!apiResponse) return null;
741
+ const routedModel = openRouterRouteModel(provider);
742
+ if (routedModel) {
743
+ try {
744
+ return openrouterAdapter.normalizeResult(openrouterAdapter.parseTrackedQueryResponse(apiResponse, routedModel));
745
+ } catch {
746
+ return null;
747
+ }
748
+ }
729
749
  switch (provider) {
730
750
  case ProviderNames.openai:
731
751
  return reparseStoredResult(apiResponse);