@ainyc/canonry 3.6.4 → 4.1.3

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.
@@ -8,9 +8,11 @@ import {
8
8
  notificationEventSchema,
9
9
  projectConfigSchema,
10
10
  projectUpsertRequestSchema,
11
+ queryBatchRequestSchema,
12
+ queryGenerateRequestSchema,
11
13
  runTriggerRequestSchema,
12
14
  scheduleUpsertRequestSchema
13
- } from "./chunk-O7EVT3AF.js";
15
+ } from "./chunk-O5JZQUPX.js";
14
16
 
15
17
  // src/config.ts
16
18
  import fs from "fs";
@@ -454,6 +456,18 @@ var ApiClient = class {
454
456
  async deleteProject(name) {
455
457
  await this.request("DELETE", `/projects/${encodeURIComponent(name)}`);
456
458
  }
459
+ async putQueries(project, queries) {
460
+ await this.request("PUT", `/projects/${encodeURIComponent(project)}/queries`, { queries });
461
+ }
462
+ async listQueries(project) {
463
+ return this.request("GET", `/projects/${encodeURIComponent(project)}/queries`);
464
+ }
465
+ async deleteQueries(project, queries) {
466
+ await this.request("DELETE", `/projects/${encodeURIComponent(project)}/queries`, { queries });
467
+ }
468
+ async appendQueries(project, queries) {
469
+ await this.request("POST", `/projects/${encodeURIComponent(project)}/queries`, { queries });
470
+ }
457
471
  async putKeywords(project, keywords) {
458
472
  await this.request("PUT", `/projects/${encodeURIComponent(project)}/keywords`, { keywords });
459
473
  }
@@ -567,6 +581,13 @@ var ApiClient = class {
567
581
  async updateTelemetry(enabled) {
568
582
  return this.request("PUT", "/telemetry", { enabled });
569
583
  }
584
+ async generateQueries(project, provider, count) {
585
+ return this.request(
586
+ "POST",
587
+ `/projects/${encodeURIComponent(project)}/queries/generate`,
588
+ { provider, count }
589
+ );
590
+ }
570
591
  async generateKeywords(project, provider, count) {
571
592
  return this.request(
572
593
  "POST",
@@ -1042,6 +1063,14 @@ var gaWindowInputSchema = z2.object({
1042
1063
  var gaTrafficInputSchema = gaWindowInputSchema.extend({
1043
1064
  limit: z2.number().int().positive().max(500).optional()
1044
1065
  });
1066
+ var queriesInputSchema = z2.object({
1067
+ project: projectNameSchema,
1068
+ request: queryBatchRequestSchema
1069
+ });
1070
+ var queryGenerateInputSchema = z2.object({
1071
+ project: projectNameSchema,
1072
+ request: queryGenerateRequestSchema
1073
+ });
1045
1074
  var keywordsInputSchema = z2.object({
1046
1075
  project: projectNameSchema,
1047
1076
  request: keywordBatchRequestSchema
@@ -1124,7 +1153,7 @@ var canonryMcpTools = [
1124
1153
  defineTool({
1125
1154
  name: "canonry_project_overview",
1126
1155
  title: "Get project overview (composite)",
1127
- description: 'One-call summary for "how is project X doing?" \u2014 bundles project info, latest run, top undismissed insights, latest health snapshot, keyword cited rate, per-provider breakdown, and gained/lost/emerging vs the previous run. Prefer this over fanning out to separate tools.',
1156
+ description: 'One-call summary for "how is project X doing?" \u2014 bundles project info, latest run, top undismissed insights, latest health snapshot, query cited rate, per-provider breakdown, and gained/lost/emerging vs the previous run. Prefer this over fanning out to separate tools.',
1128
1157
  access: "read",
1129
1158
  tier: "core",
1130
1159
  inputSchema: projectInputSchema,
@@ -1135,7 +1164,7 @@ var canonryMcpTools = [
1135
1164
  defineTool({
1136
1165
  name: "canonry_report",
1137
1166
  title: "Get aggregated AEO report",
1138
- description: "Returns the full client-facing AEO report bundle for a project \u2014 executive summary, per-keyword \xD7 per-provider citation matrix, competitor landscape, AI citation sources, GSC/GA4 performance, social and AI referrals, indexing health, citations trend, prioritized insights, and recommended next steps. Same payload `canonry report <project>` consumes to render the self-contained HTML.",
1167
+ description: "Returns the full client-facing AEO report bundle for a project \u2014 executive summary, per-query \xD7 per-provider citation matrix, competitor landscape, AI citation sources, GSC/GA4 performance, social and AI referrals, indexing health, citations trend, prioritized insights, and recommended next steps. Same payload `canonry report <project>` consumes to render the self-contained HTML.",
1139
1168
  access: "read",
1140
1169
  tier: "monitoring",
1141
1170
  inputSchema: projectInputSchema,
@@ -1146,7 +1175,7 @@ var canonryMcpTools = [
1146
1175
  defineTool({
1147
1176
  name: "canonry_search",
1148
1177
  title: "Search project (composite)",
1149
- description: "Search query snapshots and intelligence insights for the given text. Looks at snapshot answer text, cited domains, raw provider responses, and insight title/keyword/recommendation/cause. Returns ranked hits with snippets \u2014 use it instead of paginating snapshots when you need to find a competitor mention or term.",
1178
+ description: "Search query snapshots and intelligence insights for the given text. Looks at snapshot answer text, cited domains, raw provider responses, and insight title/query/recommendation/cause. Returns ranked hits with snippets \u2014 use it instead of paginating snapshots when you need to find a competitor mention or term.",
1150
1179
  access: "read",
1151
1180
  tier: "core",
1152
1181
  inputSchema: z2.object({
@@ -1227,7 +1256,7 @@ var canonryMcpTools = [
1227
1256
  defineTool({
1228
1257
  name: "canonry_timeline_get",
1229
1258
  title: "Get project timeline",
1230
- description: "Get per-keyword citation history for a Canonry project.",
1259
+ description: "Get per-query citation history for a Canonry project.",
1231
1260
  access: "read",
1232
1261
  tier: "monitoring",
1233
1262
  inputSchema: timelineInputSchema,
@@ -1308,7 +1337,7 @@ var canonryMcpTools = [
1308
1337
  defineTool({
1309
1338
  name: "canonry_citations_visibility",
1310
1339
  title: "Get citation visibility",
1311
- description: 'Single-call AI citation surface for a Canonry project. Returns the project headline (cited by N of M engines), per-keyword engine coverage rows from the latest snapshot per (keyword \xD7 provider), and a competitor-gap list (keywords where a configured competitor is cited but the project is not). Carries `status: "no-data"` with `reason: "no-keywords"` or `"no-runs-yet"` when inputs are missing.',
1340
+ description: 'Single-call AI citation surface for a Canonry project. Returns the project headline (cited by N of M engines), per-query engine coverage rows from the latest snapshot per (query \xD7 provider), and a competitor-gap list (queries where a configured competitor is cited but the project is not). Carries `status: "no-data"` with `reason: "no-queries"` or `"no-runs-yet"` when inputs are missing.',
1312
1341
  access: "read",
1313
1342
  tier: "monitoring",
1314
1343
  inputSchema: projectInputSchema,
@@ -1352,10 +1381,21 @@ var canonryMcpTools = [
1352
1381
  openApiOperations: ["GET /api/v1/projects/{name}/content/gaps"],
1353
1382
  handler: (client, input) => client.getContentGaps(input.project)
1354
1383
  }),
1384
+ defineTool({
1385
+ name: "canonry_queries_list",
1386
+ title: "List queries",
1387
+ description: "List tracked queries for a Canonry project.",
1388
+ access: "read",
1389
+ tier: "setup",
1390
+ inputSchema: projectInputSchema,
1391
+ annotations: readAnnotations(),
1392
+ openApiOperations: ["GET /api/v1/projects/{name}/queries"],
1393
+ handler: (client, input) => client.listQueries(input.project)
1394
+ }),
1355
1395
  defineTool({
1356
1396
  name: "canonry_keywords_list",
1357
- title: "List keywords",
1358
- description: "List tracked keywords for a Canonry project.",
1397
+ title: "List keywords (legacy alias)",
1398
+ description: "Legacy alias for canonry_queries_list. Returns tracked queries using the pre-queries keyword response shape.",
1359
1399
  access: "read",
1360
1400
  tier: "setup",
1361
1401
  inputSchema: projectInputSchema,
@@ -1609,10 +1649,21 @@ var canonryMcpTools = [
1609
1649
  openApiOperations: ["POST /api/v1/apply"],
1610
1650
  handler: (client, input) => client.apply(input.config)
1611
1651
  }),
1652
+ defineTool({
1653
+ name: "canonry_queries_generate",
1654
+ title: "Generate query suggestions",
1655
+ description: "Generate candidate queries using a configured provider. Returns suggestions only; use canonry_queries_add to persist them.",
1656
+ access: "write",
1657
+ tier: "setup",
1658
+ inputSchema: queryGenerateInputSchema,
1659
+ annotations: writeAnnotations({ idempotentHint: false, openWorldHint: true }),
1660
+ openApiOperations: ["POST /api/v1/projects/{name}/queries/generate"],
1661
+ handler: (client, input) => client.generateQueries(input.project, input.request.provider, input.request.count)
1662
+ }),
1612
1663
  defineTool({
1613
1664
  name: "canonry_keywords_generate",
1614
- title: "Generate keyword suggestions",
1615
- description: "Generate candidate key phrases using a configured provider. Returns suggestions only; use canonry_keywords_add to persist them.",
1665
+ title: "Generate keyword suggestions (legacy alias)",
1666
+ description: "Legacy alias for canonry_queries_generate. Returns suggestions using the pre-queries keyword response shape.",
1616
1667
  access: "write",
1617
1668
  tier: "setup",
1618
1669
  inputSchema: keywordGenerateInputSchema,
@@ -1620,10 +1671,23 @@ var canonryMcpTools = [
1620
1671
  openApiOperations: ["POST /api/v1/projects/{name}/keywords/generate"],
1621
1672
  handler: (client, input) => client.generateKeywords(input.project, input.request.provider, input.request.count)
1622
1673
  }),
1674
+ defineTool({
1675
+ name: "canonry_queries_replace",
1676
+ title: "Replace queries",
1677
+ description: "Replace the tracked query set for a Canonry project.",
1678
+ access: "write",
1679
+ tier: "setup",
1680
+ inputSchema: queriesInputSchema,
1681
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
1682
+ openApiOperations: ["PUT /api/v1/projects/{name}/queries"],
1683
+ handler: async (client, input) => {
1684
+ await client.putQueries(input.project, uniqueStrings(input.request.queries));
1685
+ }
1686
+ }),
1623
1687
  defineTool({
1624
1688
  name: "canonry_keywords_replace",
1625
- title: "Replace keywords",
1626
- description: "Replace the tracked keyword set for a Canonry project.",
1689
+ title: "Replace keywords (legacy alias)",
1690
+ description: "Legacy alias for canonry_queries_replace. Replaces the same canonical tracked query set.",
1627
1691
  access: "write",
1628
1692
  tier: "setup",
1629
1693
  inputSchema: keywordsInputSchema,
@@ -1655,10 +1719,23 @@ var canonryMcpTools = [
1655
1719
  openApiOperations: ["POST /api/v1/runs/{id}/cancel"],
1656
1720
  handler: (client, input) => client.cancelRun(input.runId)
1657
1721
  }),
1722
+ defineTool({
1723
+ name: "canonry_queries_add",
1724
+ title: "Add queries",
1725
+ description: "Append tracked queries to a Canonry project; existing queries are skipped by the API.",
1726
+ access: "write",
1727
+ tier: "setup",
1728
+ inputSchema: queriesInputSchema,
1729
+ annotations: writeAnnotations({ idempotentHint: true }),
1730
+ openApiOperations: ["POST /api/v1/projects/{name}/queries"],
1731
+ handler: async (client, input) => {
1732
+ await client.appendQueries(input.project, uniqueStrings(input.request.queries));
1733
+ }
1734
+ }),
1658
1735
  defineTool({
1659
1736
  name: "canonry_keywords_add",
1660
- title: "Add keywords",
1661
- description: "Append tracked keywords to a Canonry project; existing keywords are skipped by the API.",
1737
+ title: "Add keywords (legacy alias)",
1738
+ description: "Legacy alias for canonry_queries_add. Appends to the same canonical tracked query set.",
1662
1739
  access: "write",
1663
1740
  tier: "setup",
1664
1741
  inputSchema: keywordsInputSchema,
@@ -1668,10 +1745,23 @@ var canonryMcpTools = [
1668
1745
  await client.appendKeywords(input.project, uniqueStrings(input.request.keywords));
1669
1746
  }
1670
1747
  }),
1748
+ defineTool({
1749
+ name: "canonry_queries_remove",
1750
+ title: "Remove queries",
1751
+ description: "Remove tracked queries from a Canonry project.",
1752
+ access: "write",
1753
+ tier: "setup",
1754
+ inputSchema: queriesInputSchema,
1755
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
1756
+ openApiOperations: ["DELETE /api/v1/projects/{name}/queries"],
1757
+ handler: async (client, input) => {
1758
+ await client.deleteQueries(input.project, uniqueStrings(input.request.queries));
1759
+ }
1760
+ }),
1671
1761
  defineTool({
1672
1762
  name: "canonry_keywords_remove",
1673
- title: "Remove keywords",
1674
- description: "Remove tracked keywords from a Canonry project.",
1763
+ title: "Remove keywords (legacy alias)",
1764
+ description: "Legacy alias for canonry_queries_remove. Removes from the same canonical tracked query set.",
1675
1765
  access: "write",
1676
1766
  tier: "setup",
1677
1767
  inputSchema: keywordsInputSchema,
@@ -168,8 +168,8 @@ var groundingSourceSchema = z2.object({
168
168
  var querySnapshotDtoSchema = z2.object({
169
169
  id: z2.string(),
170
170
  runId: z2.string(),
171
- keywordId: z2.string(),
172
- keyword: z2.string().optional(),
171
+ queryId: z2.string(),
172
+ query: z2.string().optional(),
173
173
  provider: providerNameSchema,
174
174
  citationState: citationStateSchema,
175
175
  answerMentioned: z2.boolean().optional(),
@@ -191,8 +191,8 @@ var snapshotListResponseSchema = z2.object({
191
191
  total: z2.number().int().nonnegative()
192
192
  });
193
193
  var snapshotDiffRowSchema = z2.object({
194
- keywordId: z2.string().nullable(),
195
- keyword: z2.string().nullable(),
194
+ queryId: z2.string().nullable(),
195
+ query: z2.string().nullable(),
196
196
  run1State: citationStateSchema.nullable(),
197
197
  run2State: citationStateSchema.nullable(),
198
198
  run1AnswerMentioned: z2.boolean().nullable(),
@@ -311,18 +311,27 @@ var projectDtoSchema = z4.object({
311
311
  createdAt: z4.string().optional(),
312
312
  updatedAt: z4.string().optional()
313
313
  });
314
+ var queryDtoSchema = z4.object({
315
+ id: z4.string(),
316
+ query: z4.string(),
317
+ createdAt: z4.string()
318
+ });
314
319
  var keywordDtoSchema = z4.object({
315
320
  id: z4.string(),
316
321
  keyword: z4.string(),
317
322
  createdAt: z4.string()
318
323
  });
324
+ var queryBatchRequestSchema = z4.object({
325
+ queries: z4.array(z4.string().trim().min(1)).min(1)
326
+ });
319
327
  var keywordBatchRequestSchema = z4.object({
320
328
  keywords: z4.array(z4.string().trim().min(1)).min(1)
321
329
  });
322
- var keywordGenerateRequestSchema = z4.object({
330
+ var queryGenerateRequestSchema = z4.object({
323
331
  provider: providerNameSchema,
324
332
  count: z4.number().int().min(1).max(20).optional()
325
333
  });
334
+ var keywordGenerateRequestSchema = queryGenerateRequestSchema;
326
335
  var competitorDtoSchema = z4.object({
327
336
  id: z4.string(),
328
337
  domain: z4.string(),
@@ -444,13 +453,15 @@ var configGoogleSchema = z5.object({
444
453
  cron: z5.string().optional()
445
454
  }).optional()
446
455
  }).optional();
456
+ var configQueryListSchema = z5.array(z5.string().min(1));
447
457
  var configSpecSchema = z5.object({
448
458
  displayName: z5.string().min(1),
449
459
  canonicalDomain: z5.string().min(1),
450
460
  ownedDomains: z5.array(z5.string().min(1)).optional().default([]),
451
461
  country: z5.string().length(2),
452
462
  language: z5.string().min(2),
453
- keywords: z5.array(z5.string().min(1)).optional().default([]),
463
+ queries: configQueryListSchema.optional(),
464
+ keywords: configQueryListSchema.optional(),
454
465
  competitors: z5.array(z5.string().min(1)).optional().default([]),
455
466
  providers: z5.array(providerNameSchema).optional().default([]),
456
467
  locations: z5.array(locationContextSchema).optional().default([]),
@@ -460,6 +471,13 @@ var configSpecSchema = z5.object({
460
471
  google: configGoogleSchema,
461
472
  autoExtractBacklinks: z5.boolean().optional().default(false)
462
473
  }).superRefine((spec, ctx) => {
474
+ if (spec.queries !== void 0 && spec.keywords !== void 0) {
475
+ ctx.addIssue({
476
+ code: "custom",
477
+ message: "Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",
478
+ path: ["keywords"]
479
+ });
480
+ }
463
481
  const duplicateLabels = findDuplicateLocationLabels(spec.locations);
464
482
  if (duplicateLabels.length > 0) {
465
483
  ctx.addIssue({
@@ -482,6 +500,9 @@ var projectConfigSchema = z5.object({
482
500
  metadata: configMetadataSchema,
483
501
  spec: configSpecSchema
484
502
  });
503
+ function resolveConfigSpecQueries(spec) {
504
+ return spec.queries ?? spec.keywords ?? [];
505
+ }
485
506
 
486
507
  // ../contracts/src/errors.ts
487
508
  var AppError = class extends Error {
@@ -870,12 +891,25 @@ function isAgentProviderId(value) {
870
891
  // ../contracts/src/snapshot.ts
871
892
  import { z as z9 } from "zod";
872
893
  var snapshotAccuracySchema = z9.enum(["yes", "no", "unknown", "not-mentioned"]);
894
+ var snapshotQueryListSchema = z9.array(z9.string().min(1));
873
895
  var snapshotRequestSchema = z9.object({
874
896
  companyName: z9.string().min(1),
875
897
  domain: z9.string().min(1),
876
- phrases: z9.array(z9.string().min(1)).optional().default([]),
898
+ queries: snapshotQueryListSchema.optional(),
899
+ phrases: snapshotQueryListSchema.optional(),
877
900
  competitors: z9.array(z9.string().min(1)).optional().default([])
901
+ }).superRefine((input, ctx) => {
902
+ if (input.queries !== void 0 && input.phrases !== void 0) {
903
+ ctx.addIssue({
904
+ code: "custom",
905
+ message: "Use queries; phrases is accepted only as a legacy alias when queries is omitted",
906
+ path: ["phrases"]
907
+ });
908
+ }
878
909
  });
910
+ function resolveSnapshotRequestQueries(input) {
911
+ return input.queries ?? input.phrases ?? [];
912
+ }
879
913
  var snapshotCompetitorEntrySchema = z9.object({
880
914
  name: z9.string(),
881
915
  count: z9.number().int().nonnegative()
@@ -925,7 +959,7 @@ var snapshotProviderResultSchema = z9.object({
925
959
  error: z9.string().nullable().optional()
926
960
  });
927
961
  var snapshotQueryResultSchema = z9.object({
928
- phrase: z9.string(),
962
+ query: z9.string(),
929
963
  providerResults: z9.array(snapshotProviderResultSchema).default([])
930
964
  });
931
965
  var snapshotSummarySchema = z9.object({
@@ -944,7 +978,7 @@ var snapshotReportSchema = z9.object({
944
978
  domain: z9.string(),
945
979
  homepageUrl: z9.string(),
946
980
  generatedAt: z9.string(),
947
- phrases: z9.array(z9.string()).default([]),
981
+ queries: z9.array(z9.string()).default([]),
948
982
  competitors: z9.array(z9.string()).default([]),
949
983
  profile: snapshotProfileSchema,
950
984
  audit: snapshotAuditSchema,
@@ -1463,11 +1497,11 @@ var projectSearchSnapshotHitSchema = z15.object({
1463
1497
  kind: z15.literal("snapshot"),
1464
1498
  id: z15.string(),
1465
1499
  runId: z15.string(),
1466
- keyword: z15.string(),
1500
+ query: z15.string(),
1467
1501
  provider: z15.string(),
1468
1502
  model: z15.string().nullable(),
1469
1503
  citationState: citationStateSchema,
1470
- matchedField: z15.enum(["answerText", "citedDomains", "searchQueries", "keyword"]),
1504
+ matchedField: z15.enum(["answerText", "citedDomains", "searchQueries", "query"]),
1471
1505
  snippet: z15.string(),
1472
1506
  createdAt: z15.string()
1473
1507
  });
@@ -1478,9 +1512,9 @@ var projectSearchInsightHitSchema = z15.object({
1478
1512
  type: z15.enum(["regression", "gain", "opportunity"]),
1479
1513
  severity: z15.enum(["critical", "high", "medium", "low"]),
1480
1514
  title: z15.string(),
1481
- keyword: z15.string(),
1515
+ query: z15.string(),
1482
1516
  provider: z15.string(),
1483
- matchedField: z15.enum(["title", "keyword", "recommendation", "cause"]),
1517
+ matchedField: z15.enum(["title", "query", "recommendation", "cause"]),
1484
1518
  snippet: z15.string(),
1485
1519
  dismissed: z15.boolean(),
1486
1520
  createdAt: z15.string()
@@ -1793,16 +1827,16 @@ var citationCoverageProviderSchema = z18.object({
1793
1827
  runCreatedAt: z18.string()
1794
1828
  });
1795
1829
  var citationCoverageRowSchema = z18.object({
1796
- keywordId: z18.string(),
1797
- keyword: z18.string(),
1830
+ queryId: z18.string(),
1831
+ query: z18.string(),
1798
1832
  providers: z18.array(citationCoverageProviderSchema),
1799
1833
  citedCount: z18.number().int().nonnegative(),
1800
1834
  mentionedCount: z18.number().int().nonnegative(),
1801
1835
  totalProviders: z18.number().int().nonnegative()
1802
1836
  });
1803
1837
  var competitorGapRowSchema = z18.object({
1804
- keywordId: z18.string(),
1805
- keyword: z18.string(),
1838
+ queryId: z18.string(),
1839
+ query: z18.string(),
1806
1840
  provider: z18.string(),
1807
1841
  citingCompetitors: z18.array(z18.string()),
1808
1842
  runId: z18.string(),
@@ -1812,23 +1846,23 @@ var citationVisibilitySummarySchema = z18.object({
1812
1846
  providersConfigured: z18.number().int().nonnegative(),
1813
1847
  providersCiting: z18.number().int().nonnegative(),
1814
1848
  providersMentioning: z18.number().int().nonnegative(),
1815
- totalKeywords: z18.number().int().nonnegative(),
1816
- // Cross-tab buckets — each tracked keyword with at least one snapshot lands
1817
- // in exactly one of these. Keywords with zero snapshots are not counted in
1818
- // any bucket; (sum of buckets) ≤ totalKeywords.
1819
- keywordsCitedAndMentioned: z18.number().int().nonnegative(),
1820
- keywordsCitedOnly: z18.number().int().nonnegative(),
1821
- keywordsMentionedOnly: z18.number().int().nonnegative(),
1822
- keywordsInvisible: z18.number().int().nonnegative(),
1849
+ totalQueries: z18.number().int().nonnegative(),
1850
+ // Cross-tab buckets — each tracked query with at least one snapshot lands
1851
+ // in exactly one of these. Queries with zero snapshots are not counted in
1852
+ // any bucket; (sum of buckets) ≤ totalQueries.
1853
+ queriesCitedAndMentioned: z18.number().int().nonnegative(),
1854
+ queriesCitedOnly: z18.number().int().nonnegative(),
1855
+ queriesMentionedOnly: z18.number().int().nonnegative(),
1856
+ queriesInvisible: z18.number().int().nonnegative(),
1823
1857
  latestRunId: z18.string().nullable(),
1824
1858
  latestRunAt: z18.string().nullable()
1825
1859
  });
1826
1860
  var citationVisibilityResponseSchema = z18.object({
1827
1861
  summary: citationVisibilitySummarySchema,
1828
- byKeyword: z18.array(citationCoverageRowSchema),
1862
+ byQuery: z18.array(citationCoverageRowSchema),
1829
1863
  competitorGaps: z18.array(competitorGapRowSchema),
1830
1864
  status: z18.enum(["ready", "no-data"]),
1831
- reason: z18.enum(["no-runs-yet", "no-keywords"]).optional()
1865
+ reason: z18.enum(["no-runs-yet", "no-queries"]).optional()
1832
1866
  });
1833
1867
  function emptyCitationVisibility(reason) {
1834
1868
  return {
@@ -1836,15 +1870,15 @@ function emptyCitationVisibility(reason) {
1836
1870
  providersConfigured: 0,
1837
1871
  providersCiting: 0,
1838
1872
  providersMentioning: 0,
1839
- totalKeywords: 0,
1840
- keywordsCitedAndMentioned: 0,
1841
- keywordsCitedOnly: 0,
1842
- keywordsMentionedOnly: 0,
1843
- keywordsInvisible: 0,
1873
+ totalQueries: 0,
1874
+ queriesCitedAndMentioned: 0,
1875
+ queriesCitedOnly: 0,
1876
+ queriesMentionedOnly: 0,
1877
+ queriesInvisible: 0,
1844
1878
  latestRunId: null,
1845
1879
  latestRunAt: null
1846
1880
  },
1847
- byKeyword: [],
1881
+ byQuery: [],
1848
1882
  competitorGaps: [],
1849
1883
  status: "no-data",
1850
1884
  reason
@@ -1873,7 +1907,9 @@ export {
1873
1907
  findDuplicateLocationLabels,
1874
1908
  hasLocationLabel,
1875
1909
  projectUpsertRequestSchema,
1910
+ queryBatchRequestSchema,
1876
1911
  keywordBatchRequestSchema,
1912
+ queryGenerateRequestSchema,
1877
1913
  keywordGenerateRequestSchema,
1878
1914
  competitorBatchRequestSchema,
1879
1915
  normalizeProjectDomain,
@@ -1881,6 +1917,7 @@ export {
1881
1917
  brandLabelFromDomain,
1882
1918
  effectiveDomains,
1883
1919
  projectConfigSchema,
1920
+ resolveConfigSpecQueries,
1884
1921
  AppError,
1885
1922
  notFound,
1886
1923
  validationError,
@@ -1909,6 +1946,7 @@ export {
1909
1946
  serializeRunError,
1910
1947
  formatRunErrorOneLine,
1911
1948
  snapshotRequestSchema,
1949
+ resolveSnapshotRequestQueries,
1912
1950
  scheduleUpsertRequestSchema,
1913
1951
  parseWindow,
1914
1952
  windowCutoff,