@ainyc/canonry 4.144.0 → 4.146.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 (36) hide show
  1. package/assets/assets/{AuditHistoryPanel-DxRP9WsD.js → AuditHistoryPanel-IDsSUFI3.js} +1 -1
  2. package/assets/assets/{BacklinksPage-yiEbyV67.js → BacklinksPage-BswN-pyj.js} +1 -1
  3. package/assets/assets/{ChartPrimitives-D2hRlMHn.js → ChartPrimitives-CIe-R58_.js} +1 -1
  4. package/assets/assets/{HistoryPage-CW6MJ-dR.js → HistoryPage-B18Jpq8c.js} +1 -1
  5. package/assets/assets/MeasurementPropertyPage-CvmQeoo7.js +1 -0
  6. package/assets/assets/ProjectPage-BE1MUAB5.js +11 -0
  7. package/assets/assets/{RunRow-Dr607W0P.js → RunRow-3ZwTR4Bv.js} +1 -1
  8. package/assets/assets/{RunsPage-CtF3P7CA.js → RunsPage-BCAJulR1.js} +1 -1
  9. package/assets/assets/{SettingsPage-3-uzs2lp.js → SettingsPage-BT2_l0Do.js} +1 -1
  10. package/assets/assets/{TrafficPage-Bww4KUn8.js → TrafficPage-Cux8rj5G.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-DiHxUH2H.js → TrafficSourceDetailPage-DI1Ad8KS.js} +1 -1
  12. package/assets/assets/{arrow-left-D-PcVbQ4.js → arrow-left-BMSx9HQB.js} +1 -1
  13. package/assets/assets/extract-error-message-B-9FdQh8.js +1 -0
  14. package/assets/assets/index-C6E5hp28.css +1 -0
  15. package/assets/assets/index-kOXUzdqD.js +213 -0
  16. package/assets/assets/{trash-2-B6aJTnJl.js → trash-2-CyoJtRAr.js} +1 -1
  17. package/assets/assets/v2-overview-adapter-owDeFdUc.js +1 -0
  18. package/assets/assets/{vendor-markdown-6dwjPOKK.js → vendor-markdown-CpDJch4G.js} +1 -1
  19. package/assets/assets/{vendor-radix-CQ77EO2y.js → vendor-radix-DnzzbllM.js} +1 -1
  20. package/assets/assets/{vendor-recharts-DSxTZhaH.js → vendor-recharts-33ACLxsD.js} +1 -1
  21. package/assets/assets/vendor-tanstack-BjS7iY3g.js +1 -0
  22. package/assets/index.html +6 -6
  23. package/dist/{chunk-WADGZMWT.js → chunk-B5H55ZMA.js} +101 -14
  24. package/dist/{chunk-7D2GZU6O.js → chunk-ED7C5TWT.js} +1747 -1015
  25. package/dist/{chunk-Z672VQ7G.js → chunk-UQOTEIA6.js} +1355 -73
  26. package/dist/{chunk-3NYTF3YC.js → chunk-Z7B6BRPP.js} +4 -4
  27. package/dist/cli.js +156 -4
  28. package/dist/index.js +4 -4
  29. package/dist/{intelligence-service-OLIGR6HE.js → intelligence-service-M5UNHF7X.js} +2 -2
  30. package/dist/mcp.js +5 -5
  31. package/package.json +7 -7
  32. package/assets/assets/ProjectPage-Bnr7I5qu.js +0 -9
  33. package/assets/assets/extract-error-message-BRq0yLWg.js +0 -1
  34. package/assets/assets/index-ANFzZ3nU.css +0 -1
  35. package/assets/assets/index-b5M4QpB0.js +0 -213
  36. package/assets/assets/vendor-tanstack-Be8JdV5M.js +0 -1
@@ -27,8 +27,33 @@ import {
27
27
  keywordBatchRequestSchema,
28
28
  keywordGenerateRequestSchema,
29
29
  measurementDiscoveryRequestSchema,
30
+ measurementDraftApplyAssignmentsRequestSchema,
31
+ measurementDraftApplyPairedAssignmentsRequestSchema,
32
+ measurementDraftApplySitemapSelectionRequestSchema,
33
+ measurementDraftClassifyAssignmentsRequestSchema,
34
+ measurementDraftClearAssignmentsRequestSchema,
35
+ measurementDraftCollectionQuerySchema,
36
+ measurementDraftCreateRequestSchema,
37
+ measurementDraftExcludeTargetRequestSchema,
38
+ measurementDraftImportSitemapRequestSchema,
39
+ measurementDraftMergeTargetsRequestSchema,
40
+ measurementDraftPublishRequestSchema,
41
+ measurementDraftRebindTargetRequestSchema,
42
+ measurementDraftRemoveAssignmentRequestSchema,
43
+ measurementDraftRemoveCompetitorRequestSchema,
44
+ measurementDraftRemoveGroupRequestSchema,
45
+ measurementDraftRenameTargetRequestSchema,
46
+ measurementDraftUpsertCompetitorRequestSchema,
47
+ measurementDraftUpsertGroupRequestSchema,
48
+ measurementDraftUpsertTargetRequestSchema,
49
+ measurementOverviewQuerySchema,
30
50
  measurementPlanAuthoringSchema,
51
+ measurementPlanDeactivateRequestSchema,
31
52
  measurementPlanPublishRequestSchema,
53
+ measurementPropertyEvidenceQuerySchema,
54
+ measurementQuerySetUpsertRequestSchema,
55
+ measurementQueryTemplateApplyRequestSchema,
56
+ measurementQueryTemplateUpsertRequestSchema,
32
57
  notificationCreateRequestSchema,
33
58
  notificationEventSchema,
34
59
  organicEvidencePeriodSchema,
@@ -46,7 +71,7 @@ import {
46
71
  trafficConnectWordpressRequestSchema,
47
72
  trafficEventKindSchema,
48
73
  trafficSeriesGranularitySchema
49
- } from "./chunk-WADGZMWT.js";
74
+ } from "./chunk-B5H55ZMA.js";
50
75
 
51
76
  // src/config.ts
52
77
  import fs from "fs";
@@ -1271,6 +1296,538 @@ var getApiV1ProjectsByNameMeasurementReport = (options) => {
1271
1296
  ...options
1272
1297
  });
1273
1298
  };
1299
+ var getApiV1ProjectsByNameMeasurementSetup = (options) => {
1300
+ return (options.client ?? client).get({
1301
+ security: [
1302
+ {
1303
+ scheme: "bearer",
1304
+ type: "http"
1305
+ }
1306
+ ],
1307
+ url: "/api/v1/projects/{name}/measurement-setup",
1308
+ ...options
1309
+ });
1310
+ };
1311
+ var getApiV1ProjectsByNameMeasurementPlanDraft = (options) => {
1312
+ return (options.client ?? client).get({
1313
+ security: [
1314
+ {
1315
+ scheme: "bearer",
1316
+ type: "http"
1317
+ }
1318
+ ],
1319
+ url: "/api/v1/projects/{name}/measurement-plan/draft",
1320
+ ...options
1321
+ });
1322
+ };
1323
+ var getApiV1ProjectsByNameMeasurementPlanDraftTargets = (options) => {
1324
+ return (options.client ?? client).get({
1325
+ security: [
1326
+ {
1327
+ scheme: "bearer",
1328
+ type: "http"
1329
+ }
1330
+ ],
1331
+ url: "/api/v1/projects/{name}/measurement-plan/draft/targets",
1332
+ ...options
1333
+ });
1334
+ };
1335
+ var getApiV1ProjectsByNameMeasurementPlanDraftAssignments = (options) => {
1336
+ return (options.client ?? client).get({
1337
+ security: [
1338
+ {
1339
+ scheme: "bearer",
1340
+ type: "http"
1341
+ }
1342
+ ],
1343
+ url: "/api/v1/projects/{name}/measurement-plan/draft/assignments",
1344
+ ...options
1345
+ });
1346
+ };
1347
+ var getApiV1ProjectsByNameMeasurementPlanDraftGroups = (options) => {
1348
+ return (options.client ?? client).get({
1349
+ security: [
1350
+ {
1351
+ scheme: "bearer",
1352
+ type: "http"
1353
+ }
1354
+ ],
1355
+ url: "/api/v1/projects/{name}/measurement-plan/draft/groups",
1356
+ ...options
1357
+ });
1358
+ };
1359
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsCreate = (options) => {
1360
+ return (options.client ?? client).post({
1361
+ security: [
1362
+ {
1363
+ scheme: "bearer",
1364
+ type: "http"
1365
+ }
1366
+ ],
1367
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/create",
1368
+ ...options,
1369
+ headers: {
1370
+ "Content-Type": "application/json",
1371
+ ...options.headers
1372
+ }
1373
+ });
1374
+ };
1375
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsImportSitemap = (options) => {
1376
+ return (options.client ?? client).post({
1377
+ security: [
1378
+ {
1379
+ scheme: "bearer",
1380
+ type: "http"
1381
+ }
1382
+ ],
1383
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/import-sitemap",
1384
+ ...options,
1385
+ headers: {
1386
+ "Content-Type": "application/json",
1387
+ ...options.headers
1388
+ }
1389
+ });
1390
+ };
1391
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsApplySitemapSelection = (options) => {
1392
+ return (options.client ?? client).post({
1393
+ security: [
1394
+ {
1395
+ scheme: "bearer",
1396
+ type: "http"
1397
+ }
1398
+ ],
1399
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/apply-sitemap-selection",
1400
+ ...options,
1401
+ headers: {
1402
+ "Content-Type": "application/json",
1403
+ ...options.headers
1404
+ }
1405
+ });
1406
+ };
1407
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsUpsertTarget = (options) => {
1408
+ return (options.client ?? client).post({
1409
+ security: [
1410
+ {
1411
+ scheme: "bearer",
1412
+ type: "http"
1413
+ }
1414
+ ],
1415
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/upsert-target",
1416
+ ...options,
1417
+ headers: {
1418
+ "Content-Type": "application/json",
1419
+ ...options.headers
1420
+ }
1421
+ });
1422
+ };
1423
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsRenameTarget = (options) => {
1424
+ return (options.client ?? client).post({
1425
+ security: [
1426
+ {
1427
+ scheme: "bearer",
1428
+ type: "http"
1429
+ }
1430
+ ],
1431
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/rename-target",
1432
+ ...options,
1433
+ headers: {
1434
+ "Content-Type": "application/json",
1435
+ ...options.headers
1436
+ }
1437
+ });
1438
+ };
1439
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsMergeTargets = (options) => {
1440
+ return (options.client ?? client).post({
1441
+ security: [
1442
+ {
1443
+ scheme: "bearer",
1444
+ type: "http"
1445
+ }
1446
+ ],
1447
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/merge-targets",
1448
+ ...options,
1449
+ headers: {
1450
+ "Content-Type": "application/json",
1451
+ ...options.headers
1452
+ }
1453
+ });
1454
+ };
1455
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsExcludeTarget = (options) => {
1456
+ return (options.client ?? client).post({
1457
+ security: [
1458
+ {
1459
+ scheme: "bearer",
1460
+ type: "http"
1461
+ }
1462
+ ],
1463
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/exclude-target",
1464
+ ...options,
1465
+ headers: {
1466
+ "Content-Type": "application/json",
1467
+ ...options.headers
1468
+ }
1469
+ });
1470
+ };
1471
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsRebindTarget = (options) => {
1472
+ return (options.client ?? client).post({
1473
+ security: [
1474
+ {
1475
+ scheme: "bearer",
1476
+ type: "http"
1477
+ }
1478
+ ],
1479
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/rebind-target",
1480
+ ...options,
1481
+ headers: {
1482
+ "Content-Type": "application/json",
1483
+ ...options.headers
1484
+ }
1485
+ });
1486
+ };
1487
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsApplyAssignments = (options) => {
1488
+ return (options.client ?? client).post({
1489
+ security: [
1490
+ {
1491
+ scheme: "bearer",
1492
+ type: "http"
1493
+ }
1494
+ ],
1495
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/apply-assignments",
1496
+ ...options,
1497
+ headers: {
1498
+ "Content-Type": "application/json",
1499
+ ...options.headers
1500
+ }
1501
+ });
1502
+ };
1503
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsApplyPairedAssignments = (options) => {
1504
+ return (options.client ?? client).post({
1505
+ security: [
1506
+ {
1507
+ scheme: "bearer",
1508
+ type: "http"
1509
+ }
1510
+ ],
1511
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/apply-paired-assignments",
1512
+ ...options,
1513
+ headers: {
1514
+ "Content-Type": "application/json",
1515
+ ...options.headers
1516
+ }
1517
+ });
1518
+ };
1519
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsRemoveAssignment = (options) => {
1520
+ return (options.client ?? client).post({
1521
+ security: [
1522
+ {
1523
+ scheme: "bearer",
1524
+ type: "http"
1525
+ }
1526
+ ],
1527
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/remove-assignment",
1528
+ ...options,
1529
+ headers: {
1530
+ "Content-Type": "application/json",
1531
+ ...options.headers
1532
+ }
1533
+ });
1534
+ };
1535
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsClearAssignments = (options) => {
1536
+ return (options.client ?? client).post({
1537
+ security: [
1538
+ {
1539
+ scheme: "bearer",
1540
+ type: "http"
1541
+ }
1542
+ ],
1543
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/clear-assignments",
1544
+ ...options,
1545
+ headers: {
1546
+ "Content-Type": "application/json",
1547
+ ...options.headers
1548
+ }
1549
+ });
1550
+ };
1551
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsClassifyAssignments = (options) => {
1552
+ return (options.client ?? client).post({
1553
+ security: [
1554
+ {
1555
+ scheme: "bearer",
1556
+ type: "http"
1557
+ }
1558
+ ],
1559
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/classify-assignments",
1560
+ ...options,
1561
+ headers: {
1562
+ "Content-Type": "application/json",
1563
+ ...options.headers
1564
+ }
1565
+ });
1566
+ };
1567
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsUpsertGroup = (options) => {
1568
+ return (options.client ?? client).post({
1569
+ security: [
1570
+ {
1571
+ scheme: "bearer",
1572
+ type: "http"
1573
+ }
1574
+ ],
1575
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/upsert-group",
1576
+ ...options,
1577
+ headers: {
1578
+ "Content-Type": "application/json",
1579
+ ...options.headers
1580
+ }
1581
+ });
1582
+ };
1583
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsRemoveGroup = (options) => {
1584
+ return (options.client ?? client).post({
1585
+ security: [
1586
+ {
1587
+ scheme: "bearer",
1588
+ type: "http"
1589
+ }
1590
+ ],
1591
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/remove-group",
1592
+ ...options,
1593
+ headers: {
1594
+ "Content-Type": "application/json",
1595
+ ...options.headers
1596
+ }
1597
+ });
1598
+ };
1599
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsUpsertCompetitor = (options) => {
1600
+ return (options.client ?? client).post({
1601
+ security: [
1602
+ {
1603
+ scheme: "bearer",
1604
+ type: "http"
1605
+ }
1606
+ ],
1607
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/upsert-competitor",
1608
+ ...options,
1609
+ headers: {
1610
+ "Content-Type": "application/json",
1611
+ ...options.headers
1612
+ }
1613
+ });
1614
+ };
1615
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsRemoveCompetitor = (options) => {
1616
+ return (options.client ?? client).post({
1617
+ security: [
1618
+ {
1619
+ scheme: "bearer",
1620
+ type: "http"
1621
+ }
1622
+ ],
1623
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/remove-competitor",
1624
+ ...options,
1625
+ headers: {
1626
+ "Content-Type": "application/json",
1627
+ ...options.headers
1628
+ }
1629
+ });
1630
+ };
1631
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsCompilePreview = (options) => {
1632
+ return (options.client ?? client).post({
1633
+ security: [
1634
+ {
1635
+ scheme: "bearer",
1636
+ type: "http"
1637
+ }
1638
+ ],
1639
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/compile-preview",
1640
+ ...options
1641
+ });
1642
+ };
1643
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsDiffPreview = (options) => {
1644
+ return (options.client ?? client).post({
1645
+ security: [
1646
+ {
1647
+ scheme: "bearer",
1648
+ type: "http"
1649
+ }
1650
+ ],
1651
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/diff-preview",
1652
+ ...options
1653
+ });
1654
+ };
1655
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsPublish = (options) => {
1656
+ return (options.client ?? client).post({
1657
+ security: [
1658
+ {
1659
+ scheme: "bearer",
1660
+ type: "http"
1661
+ }
1662
+ ],
1663
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/publish",
1664
+ ...options,
1665
+ headers: {
1666
+ "Content-Type": "application/json",
1667
+ ...options.headers
1668
+ }
1669
+ });
1670
+ };
1671
+ var postApiV1ProjectsByNameMeasurementPlanDraftActionsDiscard = (options) => {
1672
+ return (options.client ?? client).post({
1673
+ security: [
1674
+ {
1675
+ scheme: "bearer",
1676
+ type: "http"
1677
+ }
1678
+ ],
1679
+ url: "/api/v1/projects/{name}/measurement-plan/draft/actions/discard",
1680
+ ...options
1681
+ });
1682
+ };
1683
+ var postApiV1ProjectsByNameMeasurementPlanActionsDeactivate = (options) => {
1684
+ return (options.client ?? client).post({
1685
+ security: [
1686
+ {
1687
+ scheme: "bearer",
1688
+ type: "http"
1689
+ }
1690
+ ],
1691
+ url: "/api/v1/projects/{name}/measurement-plan/actions/deactivate",
1692
+ ...options,
1693
+ headers: {
1694
+ "Content-Type": "application/json",
1695
+ ...options.headers
1696
+ }
1697
+ });
1698
+ };
1699
+ var getApiV1ProjectsByNameMeasurementOverview = (options) => {
1700
+ return (options.client ?? client).get({
1701
+ security: [
1702
+ {
1703
+ scheme: "bearer",
1704
+ type: "http"
1705
+ }
1706
+ ],
1707
+ url: "/api/v1/projects/{name}/measurement-overview",
1708
+ ...options
1709
+ });
1710
+ };
1711
+ var getApiV1ProjectsByNameMeasurementPropertyEvidence = (options) => {
1712
+ return (options.client ?? client).get({
1713
+ security: [
1714
+ {
1715
+ scheme: "bearer",
1716
+ type: "http"
1717
+ }
1718
+ ],
1719
+ url: "/api/v1/projects/{name}/measurement-property-evidence",
1720
+ ...options
1721
+ });
1722
+ };
1723
+ var getApiV1ProjectsByNameMeasurementQuerySets = (options) => {
1724
+ return (options.client ?? client).get({
1725
+ security: [
1726
+ {
1727
+ scheme: "bearer",
1728
+ type: "http"
1729
+ }
1730
+ ],
1731
+ url: "/api/v1/projects/{name}/measurement-query-sets",
1732
+ ...options
1733
+ });
1734
+ };
1735
+ var deleteApiV1ProjectsByNameMeasurementQuerySetsBySetId = (options) => {
1736
+ return (options.client ?? client).delete({
1737
+ security: [
1738
+ {
1739
+ scheme: "bearer",
1740
+ type: "http"
1741
+ }
1742
+ ],
1743
+ url: "/api/v1/projects/{name}/measurement-query-sets/{setId}",
1744
+ ...options
1745
+ });
1746
+ };
1747
+ var getApiV1ProjectsByNameMeasurementQuerySetsBySetId = (options) => {
1748
+ return (options.client ?? client).get({
1749
+ security: [
1750
+ {
1751
+ scheme: "bearer",
1752
+ type: "http"
1753
+ }
1754
+ ],
1755
+ url: "/api/v1/projects/{name}/measurement-query-sets/{setId}",
1756
+ ...options
1757
+ });
1758
+ };
1759
+ var putApiV1ProjectsByNameMeasurementQuerySetsBySetId = (options) => {
1760
+ return (options.client ?? client).put({
1761
+ security: [
1762
+ {
1763
+ scheme: "bearer",
1764
+ type: "http"
1765
+ }
1766
+ ],
1767
+ url: "/api/v1/projects/{name}/measurement-query-sets/{setId}",
1768
+ ...options,
1769
+ headers: {
1770
+ "Content-Type": "application/json",
1771
+ ...options.headers
1772
+ }
1773
+ });
1774
+ };
1775
+ var getApiV1ProjectsByNameMeasurementQueryTemplates = (options) => {
1776
+ return (options.client ?? client).get({
1777
+ security: [
1778
+ {
1779
+ scheme: "bearer",
1780
+ type: "http"
1781
+ }
1782
+ ],
1783
+ url: "/api/v1/projects/{name}/measurement-query-templates",
1784
+ ...options
1785
+ });
1786
+ };
1787
+ var deleteApiV1ProjectsByNameMeasurementQueryTemplatesByTemplateId = (options) => {
1788
+ return (options.client ?? client).delete({
1789
+ security: [
1790
+ {
1791
+ scheme: "bearer",
1792
+ type: "http"
1793
+ }
1794
+ ],
1795
+ url: "/api/v1/projects/{name}/measurement-query-templates/{templateId}",
1796
+ ...options
1797
+ });
1798
+ };
1799
+ var putApiV1ProjectsByNameMeasurementQueryTemplatesByTemplateId = (options) => {
1800
+ return (options.client ?? client).put({
1801
+ security: [
1802
+ {
1803
+ scheme: "bearer",
1804
+ type: "http"
1805
+ }
1806
+ ],
1807
+ url: "/api/v1/projects/{name}/measurement-query-templates/{templateId}",
1808
+ ...options,
1809
+ headers: {
1810
+ "Content-Type": "application/json",
1811
+ ...options.headers
1812
+ }
1813
+ });
1814
+ };
1815
+ var postApiV1ProjectsByNameMeasurementQueryTemplatesByTemplateIdApply = (options) => {
1816
+ return (options.client ?? client).post({
1817
+ security: [
1818
+ {
1819
+ scheme: "bearer",
1820
+ type: "http"
1821
+ }
1822
+ ],
1823
+ url: "/api/v1/projects/{name}/measurement-query-templates/{templateId}/apply",
1824
+ ...options,
1825
+ headers: {
1826
+ "Content-Type": "application/json",
1827
+ ...options.headers
1828
+ }
1829
+ });
1830
+ };
1274
1831
  var getApiV1Projects = (options) => {
1275
1832
  return (options?.client ?? client).get({
1276
1833
  security: [
@@ -4426,6 +4983,12 @@ var ApiClient = class {
4426
4983
  }
4427
4984
  return result.data;
4428
4985
  }
4986
+ measurementDraftMutationHeaders(idempotencyKey, etag) {
4987
+ return {
4988
+ "Idempotency-Key": idempotencyKey,
4989
+ ...etag === void 0 ? {} : { "If-Match": etag }
4990
+ };
4991
+ }
4429
4992
  // ── Agent (canonry-local routes — SDK-typed since v4.50.0) ─────────────
4430
4993
  //
4431
4994
  // These endpoints live in `packages/canonry/src/agent/agent-routes.ts` and
@@ -4624,175 +5187,509 @@ var ApiClient = class {
4624
5187
  const filename = /filename\s*=\s*"?([^";]+)"?/i.exec(res.headers.get("content-disposition") ?? "")?.[1] ?? `canonry-results-${project}.${opts.format}`;
4625
5188
  return { content: await res.text(), filename };
4626
5189
  }
4627
- // ── Queries / keywords / competitors ────────────────────────────────────
4628
- async putQueries(project, queries) {
4629
- await this.invoke(
4630
- () => putApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project }, body: { queries } })
5190
+ // ── Queries / keywords / competitors ────────────────────────────────────
5191
+ async putQueries(project, queries) {
5192
+ await this.invoke(
5193
+ () => putApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project }, body: { queries } })
5194
+ );
5195
+ }
5196
+ async previewReplaceQueries(project, queries) {
5197
+ return this.invoke(
5198
+ () => postApiV1ProjectsByNameQueriesReplacePreview({
5199
+ client: this.heyClient,
5200
+ path: { name: project },
5201
+ body: { queries }
5202
+ })
5203
+ );
5204
+ }
5205
+ async listQueries(project) {
5206
+ return this.invoke(
5207
+ () => getApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project } })
5208
+ );
5209
+ }
5210
+ async deleteQueries(project, queries) {
5211
+ await this.invoke(
5212
+ () => deleteApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project }, body: { queries } })
5213
+ );
5214
+ }
5215
+ async appendQueries(project, queries) {
5216
+ await this.invoke(
5217
+ () => postApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project }, body: { queries } })
5218
+ );
5219
+ }
5220
+ async generateQueries(project, provider, count) {
5221
+ return this.invoke(
5222
+ () => postApiV1ProjectsByNameQueriesGenerate({
5223
+ client: this.heyClient,
5224
+ path: { name: project },
5225
+ body: { provider, count }
5226
+ })
5227
+ );
5228
+ }
5229
+ async putKeywords(project, keywords) {
5230
+ await this.invoke(
5231
+ () => putApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project }, body: { keywords } })
5232
+ );
5233
+ }
5234
+ async listKeywords(project) {
5235
+ return this.invoke(
5236
+ () => getApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project } })
5237
+ );
5238
+ }
5239
+ async deleteKeywords(project, keywords) {
5240
+ await this.invoke(
5241
+ () => deleteApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project }, body: { keywords } })
5242
+ );
5243
+ }
5244
+ async appendKeywords(project, keywords) {
5245
+ await this.invoke(
5246
+ () => postApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project }, body: { keywords } })
5247
+ );
5248
+ }
5249
+ async generateKeywords(project, provider, count) {
5250
+ return this.invoke(
5251
+ () => postApiV1ProjectsByNameKeywordsGenerate({
5252
+ client: this.heyClient,
5253
+ path: { name: project },
5254
+ body: { provider, count }
5255
+ })
5256
+ );
5257
+ }
5258
+ async listCompetitors(project) {
5259
+ return this.invoke(
5260
+ () => getApiV1ProjectsByNameCompetitors({ client: this.heyClient, path: { name: project } })
5261
+ );
5262
+ }
5263
+ async appendCompetitors(project, competitors) {
5264
+ return this.invoke(
5265
+ () => postApiV1ProjectsByNameCompetitors({
5266
+ client: this.heyClient,
5267
+ path: { name: project },
5268
+ body: { competitors }
5269
+ })
5270
+ );
5271
+ }
5272
+ async deleteCompetitors(project, competitors) {
5273
+ return this.invoke(
5274
+ () => deleteApiV1ProjectsByNameCompetitors({
5275
+ client: this.heyClient,
5276
+ path: { name: project },
5277
+ body: { competitors }
5278
+ })
5279
+ );
5280
+ }
5281
+ // ── Runs / timeline / history / snapshots ───────────────────────────────
5282
+ async triggerRun(project, body) {
5283
+ return this.invoke(
5284
+ () => postApiV1ProjectsByNameRuns({
5285
+ client: this.heyClient,
5286
+ path: { name: project },
5287
+ body: body ?? {}
5288
+ })
5289
+ );
5290
+ }
5291
+ async getMeasurementPlan(project) {
5292
+ return this.invoke(
5293
+ () => getApiV1ProjectsByNameMeasurementPlan({ client: this.heyClient, path: { name: project } })
5294
+ );
5295
+ }
5296
+ async listMeasurementPlanVersions(project) {
5297
+ return this.invoke(
5298
+ () => getApiV1ProjectsByNameMeasurementPlanVersions({ client: this.heyClient, path: { name: project } })
5299
+ );
5300
+ }
5301
+ async getMeasurementPlanVersion(project, revision) {
5302
+ return this.invoke(
5303
+ () => getApiV1ProjectsByNameMeasurementPlanVersionsByRevision({
5304
+ client: this.heyClient,
5305
+ path: { name: project, revision }
5306
+ })
5307
+ );
5308
+ }
5309
+ async compileMeasurementPlanPreview(project, plan) {
5310
+ return this.invoke(
5311
+ () => postApiV1ProjectsByNameMeasurementPlanCompilePreview({
5312
+ client: this.heyClient,
5313
+ path: { name: project },
5314
+ body: plan
5315
+ })
5316
+ );
5317
+ }
5318
+ async diffMeasurementPlanPreview(project, plan) {
5319
+ return this.invoke(
5320
+ () => postApiV1ProjectsByNameMeasurementPlanDiffPreview({
5321
+ client: this.heyClient,
5322
+ path: { name: project },
5323
+ body: plan
5324
+ })
5325
+ );
5326
+ }
5327
+ async publishMeasurementPlan(project, request) {
5328
+ return this.invoke(
5329
+ () => putApiV1ProjectsByNameMeasurementPlan({
5330
+ client: this.heyClient,
5331
+ path: { name: project },
5332
+ body: request
5333
+ })
5334
+ );
5335
+ }
5336
+ async retireMeasurementPlanSegment(project, stableKey) {
5337
+ return this.invoke(
5338
+ () => postApiV1ProjectsByNameMeasurementPlanSegmentsByStableKeyRetire({
5339
+ client: this.heyClient,
5340
+ path: { name: project, stableKey }
5341
+ })
5342
+ );
5343
+ }
5344
+ async discoverMeasurementTargets(project, request) {
5345
+ return this.invoke(
5346
+ () => postApiV1ProjectsByNameMeasurementDiscovery({
5347
+ client: this.heyClient,
5348
+ path: { name: project },
5349
+ body: request
5350
+ })
5351
+ );
5352
+ }
5353
+ async getMeasurementReport(project, revision, runId) {
5354
+ return this.invoke(
5355
+ () => getApiV1ProjectsByNameMeasurementReport({
5356
+ client: this.heyClient,
5357
+ path: { name: project },
5358
+ query: { revision, runId }
5359
+ })
5360
+ );
5361
+ }
5362
+ // ── Advanced Measurement v2 ───────────────────────────────────────────
5363
+ async getMeasurementSetup(project) {
5364
+ return this.invoke(
5365
+ () => getApiV1ProjectsByNameMeasurementSetup({ client: this.heyClient, path: { name: project } })
5366
+ );
5367
+ }
5368
+ async getMeasurementOverview(project, query) {
5369
+ return this.invoke(
5370
+ () => getApiV1ProjectsByNameMeasurementOverview({
5371
+ client: this.heyClient,
5372
+ path: { name: project },
5373
+ query
5374
+ })
5375
+ );
5376
+ }
5377
+ async getMeasurementPropertyEvidence(project, query) {
5378
+ return this.invoke(
5379
+ () => getApiV1ProjectsByNameMeasurementPropertyEvidence({
5380
+ client: this.heyClient,
5381
+ path: { name: project },
5382
+ query
5383
+ })
5384
+ );
5385
+ }
5386
+ async getMeasurementPlanDraft(project) {
5387
+ return this.invoke(
5388
+ () => getApiV1ProjectsByNameMeasurementPlanDraft({ client: this.heyClient, path: { name: project } })
5389
+ );
5390
+ }
5391
+ async getMeasurementDraftTargets(project, query) {
5392
+ return this.invoke(
5393
+ () => getApiV1ProjectsByNameMeasurementPlanDraftTargets({
5394
+ client: this.heyClient,
5395
+ path: { name: project },
5396
+ query
5397
+ })
5398
+ );
5399
+ }
5400
+ async getMeasurementDraftAssignments(project, query) {
5401
+ return this.invoke(
5402
+ () => getApiV1ProjectsByNameMeasurementPlanDraftAssignments({
5403
+ client: this.heyClient,
5404
+ path: { name: project },
5405
+ query
5406
+ })
5407
+ );
5408
+ }
5409
+ async getMeasurementDraftGroups(project, query) {
5410
+ return this.invoke(
5411
+ () => getApiV1ProjectsByNameMeasurementPlanDraftGroups({
5412
+ client: this.heyClient,
5413
+ path: { name: project },
5414
+ query
5415
+ })
5416
+ );
5417
+ }
5418
+ async createMeasurementPlanDraft(project, request, idempotencyKey) {
5419
+ return this.invoke(
5420
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsCreate({
5421
+ client: this.heyClient,
5422
+ path: { name: project },
5423
+ body: request,
5424
+ // No draft exists yet, so create has no ETag to match.
5425
+ headers: this.measurementDraftMutationHeaders(idempotencyKey)
5426
+ })
4631
5427
  );
4632
5428
  }
4633
- async previewReplaceQueries(project, queries) {
5429
+ async importMeasurementDraftSitemap(project, request, idempotencyKey, etag) {
4634
5430
  return this.invoke(
4635
- () => postApiV1ProjectsByNameQueriesReplacePreview({
5431
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsImportSitemap({
4636
5432
  client: this.heyClient,
4637
5433
  path: { name: project },
4638
- body: { queries }
5434
+ body: request,
5435
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4639
5436
  })
4640
5437
  );
4641
5438
  }
4642
- async listQueries(project) {
5439
+ async applyMeasurementDraftSitemapSelection(project, request, idempotencyKey, etag) {
4643
5440
  return this.invoke(
4644
- () => getApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project } })
5441
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsApplySitemapSelection({
5442
+ client: this.heyClient,
5443
+ path: { name: project },
5444
+ body: request,
5445
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5446
+ })
4645
5447
  );
4646
5448
  }
4647
- async deleteQueries(project, queries) {
4648
- await this.invoke(
4649
- () => deleteApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project }, body: { queries } })
5449
+ async upsertMeasurementDraftTarget(project, request, idempotencyKey, etag) {
5450
+ return this.invoke(
5451
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsUpsertTarget({
5452
+ client: this.heyClient,
5453
+ path: { name: project },
5454
+ body: request,
5455
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5456
+ })
4650
5457
  );
4651
5458
  }
4652
- async appendQueries(project, queries) {
4653
- await this.invoke(
4654
- () => postApiV1ProjectsByNameQueries({ client: this.heyClient, path: { name: project }, body: { queries } })
5459
+ async renameMeasurementDraftTarget(project, request, idempotencyKey, etag) {
5460
+ return this.invoke(
5461
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsRenameTarget({
5462
+ client: this.heyClient,
5463
+ path: { name: project },
5464
+ body: request,
5465
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5466
+ })
4655
5467
  );
4656
5468
  }
4657
- async generateQueries(project, provider, count) {
5469
+ async mergeMeasurementDraftTargets(project, request, idempotencyKey, etag) {
4658
5470
  return this.invoke(
4659
- () => postApiV1ProjectsByNameQueriesGenerate({
5471
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsMergeTargets({
4660
5472
  client: this.heyClient,
4661
5473
  path: { name: project },
4662
- body: { provider, count }
5474
+ body: request,
5475
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4663
5476
  })
4664
5477
  );
4665
5478
  }
4666
- async putKeywords(project, keywords) {
4667
- await this.invoke(
4668
- () => putApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project }, body: { keywords } })
5479
+ async excludeMeasurementDraftTarget(project, request, idempotencyKey, etag) {
5480
+ return this.invoke(
5481
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsExcludeTarget({
5482
+ client: this.heyClient,
5483
+ path: { name: project },
5484
+ body: request,
5485
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5486
+ })
4669
5487
  );
4670
5488
  }
4671
- async listKeywords(project) {
5489
+ async rebindMeasurementDraftTarget(project, request, idempotencyKey, etag) {
4672
5490
  return this.invoke(
4673
- () => getApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project } })
5491
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsRebindTarget({
5492
+ client: this.heyClient,
5493
+ path: { name: project },
5494
+ body: request,
5495
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5496
+ })
4674
5497
  );
4675
5498
  }
4676
- async deleteKeywords(project, keywords) {
4677
- await this.invoke(
4678
- () => deleteApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project }, body: { keywords } })
5499
+ async applyMeasurementDraftAssignments(project, request, idempotencyKey, etag) {
5500
+ return this.invoke(
5501
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsApplyAssignments({
5502
+ client: this.heyClient,
5503
+ path: { name: project },
5504
+ body: request,
5505
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5506
+ })
4679
5507
  );
4680
5508
  }
4681
- async appendKeywords(project, keywords) {
4682
- await this.invoke(
4683
- () => postApiV1ProjectsByNameKeywords({ client: this.heyClient, path: { name: project }, body: { keywords } })
5509
+ async applyPairedMeasurementDraftAssignments(project, request, idempotencyKey, etag) {
5510
+ return this.invoke(
5511
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsApplyPairedAssignments({
5512
+ client: this.heyClient,
5513
+ path: { name: project },
5514
+ body: request,
5515
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5516
+ })
4684
5517
  );
4685
5518
  }
4686
- async generateKeywords(project, provider, count) {
5519
+ async removeMeasurementDraftAssignment(project, request, idempotencyKey, etag) {
4687
5520
  return this.invoke(
4688
- () => postApiV1ProjectsByNameKeywordsGenerate({
5521
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsRemoveAssignment({
4689
5522
  client: this.heyClient,
4690
5523
  path: { name: project },
4691
- body: { provider, count }
5524
+ body: request,
5525
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4692
5526
  })
4693
5527
  );
4694
5528
  }
4695
- async listCompetitors(project) {
5529
+ async clearMeasurementDraftAssignments(project, request, idempotencyKey, etag) {
4696
5530
  return this.invoke(
4697
- () => getApiV1ProjectsByNameCompetitors({ client: this.heyClient, path: { name: project } })
5531
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsClearAssignments({
5532
+ client: this.heyClient,
5533
+ path: { name: project },
5534
+ body: request,
5535
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5536
+ })
4698
5537
  );
4699
5538
  }
4700
- async appendCompetitors(project, competitors) {
5539
+ async classifyMeasurementDraftAssignments(project, request, idempotencyKey, etag) {
4701
5540
  return this.invoke(
4702
- () => postApiV1ProjectsByNameCompetitors({
5541
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsClassifyAssignments({
4703
5542
  client: this.heyClient,
4704
5543
  path: { name: project },
4705
- body: { competitors }
5544
+ body: request,
5545
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4706
5546
  })
4707
5547
  );
4708
5548
  }
4709
- async deleteCompetitors(project, competitors) {
5549
+ async upsertMeasurementDraftGroup(project, request, idempotencyKey, etag) {
4710
5550
  return this.invoke(
4711
- () => deleteApiV1ProjectsByNameCompetitors({
5551
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsUpsertGroup({
4712
5552
  client: this.heyClient,
4713
5553
  path: { name: project },
4714
- body: { competitors }
5554
+ body: request,
5555
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4715
5556
  })
4716
5557
  );
4717
5558
  }
4718
- // ── Runs / timeline / history / snapshots ───────────────────────────────
4719
- async triggerRun(project, body) {
5559
+ async removeMeasurementDraftGroup(project, request, idempotencyKey, etag) {
4720
5560
  return this.invoke(
4721
- () => postApiV1ProjectsByNameRuns({
5561
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsRemoveGroup({
4722
5562
  client: this.heyClient,
4723
5563
  path: { name: project },
4724
- body: body ?? {}
5564
+ body: request,
5565
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4725
5566
  })
4726
5567
  );
4727
5568
  }
4728
- async getMeasurementPlan(project) {
5569
+ async upsertMeasurementDraftCompetitor(project, request, idempotencyKey, etag) {
4729
5570
  return this.invoke(
4730
- () => getApiV1ProjectsByNameMeasurementPlan({ client: this.heyClient, path: { name: project } })
5571
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsUpsertCompetitor({
5572
+ client: this.heyClient,
5573
+ path: { name: project },
5574
+ body: request,
5575
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5576
+ })
4731
5577
  );
4732
5578
  }
4733
- async listMeasurementPlanVersions(project) {
5579
+ async removeMeasurementDraftCompetitor(project, request, idempotencyKey, etag) {
4734
5580
  return this.invoke(
4735
- () => getApiV1ProjectsByNameMeasurementPlanVersions({ client: this.heyClient, path: { name: project } })
5581
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsRemoveCompetitor({
5582
+ client: this.heyClient,
5583
+ path: { name: project },
5584
+ body: request,
5585
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
5586
+ })
4736
5587
  );
4737
5588
  }
4738
- async getMeasurementPlanVersion(project, revision) {
5589
+ async compileMeasurementDraftPreview(project) {
4739
5590
  return this.invoke(
4740
- () => getApiV1ProjectsByNameMeasurementPlanVersionsByRevision({
5591
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsCompilePreview({
4741
5592
  client: this.heyClient,
4742
- path: { name: project, revision }
5593
+ path: { name: project }
4743
5594
  })
4744
5595
  );
4745
5596
  }
4746
- async compileMeasurementPlanPreview(project, plan) {
5597
+ async diffMeasurementDraftPreview(project) {
4747
5598
  return this.invoke(
4748
- () => postApiV1ProjectsByNameMeasurementPlanCompilePreview({
5599
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsDiffPreview({
5600
+ client: this.heyClient,
5601
+ path: { name: project }
5602
+ })
5603
+ );
5604
+ }
5605
+ async publishMeasurementDraft(project, request, idempotencyKey, etag) {
5606
+ return this.invoke(
5607
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsPublish({
4749
5608
  client: this.heyClient,
4750
5609
  path: { name: project },
4751
- body: plan
5610
+ body: request,
5611
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4752
5612
  })
4753
5613
  );
4754
5614
  }
4755
- async diffMeasurementPlanPreview(project, plan) {
5615
+ async discardMeasurementDraft(project, idempotencyKey, etag) {
4756
5616
  return this.invoke(
4757
- () => postApiV1ProjectsByNameMeasurementPlanDiffPreview({
5617
+ () => postApiV1ProjectsByNameMeasurementPlanDraftActionsDiscard({
4758
5618
  client: this.heyClient,
4759
5619
  path: { name: project },
4760
- body: plan
5620
+ headers: this.measurementDraftMutationHeaders(idempotencyKey, etag)
4761
5621
  })
4762
5622
  );
4763
5623
  }
4764
- async publishMeasurementPlan(project, request) {
5624
+ async deactivateMeasurementPlan(project, request, idempotencyKey) {
4765
5625
  return this.invoke(
4766
- () => putApiV1ProjectsByNameMeasurementPlan({
5626
+ () => postApiV1ProjectsByNameMeasurementPlanActionsDeactivate({
4767
5627
  client: this.heyClient,
4768
5628
  path: { name: project },
5629
+ body: request,
5630
+ headers: { "Idempotency-Key": idempotencyKey }
5631
+ })
5632
+ );
5633
+ }
5634
+ async listMeasurementQuerySets(project) {
5635
+ return this.invoke(
5636
+ () => getApiV1ProjectsByNameMeasurementQuerySets({ client: this.heyClient, path: { name: project } })
5637
+ );
5638
+ }
5639
+ async getMeasurementQuerySet(project, setId) {
5640
+ return this.invoke(
5641
+ () => getApiV1ProjectsByNameMeasurementQuerySetsBySetId({
5642
+ client: this.heyClient,
5643
+ path: { name: project, setId }
5644
+ })
5645
+ );
5646
+ }
5647
+ async upsertMeasurementQuerySet(project, setId, request) {
5648
+ return this.invoke(
5649
+ () => putApiV1ProjectsByNameMeasurementQuerySetsBySetId({
5650
+ client: this.heyClient,
5651
+ path: { name: project, setId },
4769
5652
  body: request
4770
5653
  })
4771
5654
  );
4772
5655
  }
4773
- async retireMeasurementPlanSegment(project, stableKey) {
5656
+ async deleteMeasurementQuerySet(project, setId) {
4774
5657
  return this.invoke(
4775
- () => postApiV1ProjectsByNameMeasurementPlanSegmentsByStableKeyRetire({
5658
+ () => deleteApiV1ProjectsByNameMeasurementQuerySetsBySetId({
4776
5659
  client: this.heyClient,
4777
- path: { name: project, stableKey }
5660
+ path: { name: project, setId }
4778
5661
  })
4779
5662
  );
4780
5663
  }
4781
- async discoverMeasurementTargets(project, request) {
5664
+ async listMeasurementQueryTemplates(project) {
4782
5665
  return this.invoke(
4783
- () => postApiV1ProjectsByNameMeasurementDiscovery({
5666
+ () => getApiV1ProjectsByNameMeasurementQueryTemplates({ client: this.heyClient, path: { name: project } })
5667
+ );
5668
+ }
5669
+ async upsertMeasurementQueryTemplate(project, templateId, request) {
5670
+ return this.invoke(
5671
+ () => putApiV1ProjectsByNameMeasurementQueryTemplatesByTemplateId({
4784
5672
  client: this.heyClient,
4785
- path: { name: project },
5673
+ path: { name: project, templateId },
4786
5674
  body: request
4787
5675
  })
4788
5676
  );
4789
5677
  }
4790
- async getMeasurementReport(project, revision) {
5678
+ async deleteMeasurementQueryTemplate(project, templateId) {
4791
5679
  return this.invoke(
4792
- () => getApiV1ProjectsByNameMeasurementReport({
5680
+ () => deleteApiV1ProjectsByNameMeasurementQueryTemplatesByTemplateId({
4793
5681
  client: this.heyClient,
4794
- path: { name: project },
4795
- query: { revision }
5682
+ path: { name: project, templateId }
5683
+ })
5684
+ );
5685
+ }
5686
+ async applyMeasurementQueryTemplate(project, templateId, request, idempotencyKey) {
5687
+ return this.invoke(
5688
+ () => postApiV1ProjectsByNameMeasurementQueryTemplatesByTemplateIdApply({
5689
+ client: this.heyClient,
5690
+ path: { name: project, templateId },
5691
+ body: request,
5692
+ headers: { "Idempotency-Key": idempotencyKey }
4796
5693
  })
4797
5694
  );
4798
5695
  }
@@ -6361,10 +7258,186 @@ var runTriggerInputSchema = z2.object({
6361
7258
  request: runTriggerRequestSchema.optional()
6362
7259
  });
6363
7260
  var measurementPlanVersionInputSchema = z2.object({ project: projectNameSchema, revision: z2.number().int().positive() });
7261
+ var measurementReportInputSchema = measurementPlanVersionInputSchema.extend({
7262
+ runId: runIdSchema.optional().describe("Exact eligible full measurement run to reconstruct. Omit for the latest run in the revision.")
7263
+ });
6364
7264
  var measurementPlanPreviewInputSchema = z2.object({ project: projectNameSchema, plan: measurementPlanAuthoringSchema });
6365
7265
  var measurementPlanPublishInputSchema = measurementPlanPublishRequestSchema.extend({ project: projectNameSchema });
6366
7266
  var measurementPlanRetireInputSchema = z2.object({ project: projectNameSchema, stableKey: z2.string().min(1) });
6367
7267
  var measurementDiscoveryInputSchema = measurementDiscoveryRequestSchema.extend({ project: projectNameSchema });
7268
+ var idempotencyKeyInputSchema = z2.string().trim().min(1).describe("A fresh request key. Reuse it only when retrying the identical request.");
7269
+ var measurementDraftEtagInputSchema = z2.string().trim().min(1).optional().describe(
7270
+ "Current draft ETag from canonry_measurement_draft_get. The API requires it for draft edits, publish, and discard; omit it only to receive the API\u2019s actionable 428 response."
7271
+ );
7272
+ var measurementOverviewInputSchema = z2.object({
7273
+ project: projectNameSchema,
7274
+ scope: measurementOverviewQuerySchema.shape.scope.describe("Read all Properties, one reporting group, or one Property."),
7275
+ groupKey: measurementOverviewQuerySchema.shape.groupKey.describe("Group stable key. Required only for group scope."),
7276
+ targetKey: measurementOverviewQuerySchema.shape.targetKey.describe("Property stable key. Required only for property scope."),
7277
+ queryClass: measurementOverviewQuerySchema.shape.queryClass,
7278
+ provider: measurementOverviewQuerySchema.shape.provider,
7279
+ location: measurementOverviewQuerySchema.shape.location,
7280
+ from: measurementOverviewQuerySchema.shape.from,
7281
+ to: measurementOverviewQuerySchema.shape.to,
7282
+ runId: measurementOverviewQuerySchema.shape.runId,
7283
+ search: measurementOverviewQuerySchema.shape.search,
7284
+ sort: measurementOverviewQuerySchema.shape.sort,
7285
+ cursor: measurementOverviewQuerySchema.shape.cursor,
7286
+ limit: measurementOverviewQuerySchema.shape.limit
7287
+ }).strict().superRefine((input, context) => {
7288
+ if (input.scope === "group" && !input.groupKey) {
7289
+ context.addIssue({ code: "custom", path: ["groupKey"], message: "Group scope requires groupKey." });
7290
+ }
7291
+ if (input.scope === "property" && !input.targetKey) {
7292
+ context.addIssue({ code: "custom", path: ["targetKey"], message: "Property scope requires targetKey." });
7293
+ }
7294
+ if (input.scope !== "group" && input.groupKey) {
7295
+ context.addIssue({ code: "custom", path: ["groupKey"], message: `${input.scope} scope does not accept groupKey.` });
7296
+ }
7297
+ if (input.scope !== "property" && input.targetKey) {
7298
+ context.addIssue({ code: "custom", path: ["targetKey"], message: `${input.scope} scope does not accept targetKey.` });
7299
+ }
7300
+ });
7301
+ var measurementPropertyEvidenceInputSchema = measurementPropertyEvidenceQuerySchema.extend({
7302
+ project: projectNameSchema,
7303
+ targetKey: measurementPropertyEvidenceQuerySchema.shape.targetKey.describe("Property stable key. Required \u2014 this read is scoped to exactly one Property.")
7304
+ }).strict();
7305
+ var measurementDraftCollectionInputSchema = measurementDraftCollectionQuerySchema.extend({ project: projectNameSchema });
7306
+ var measurementQuerySetInputSchema = z2.object({
7307
+ project: projectNameSchema,
7308
+ setId: z2.string().trim().min(1)
7309
+ }).strict();
7310
+ var measurementQuerySetUpsertInputSchema = measurementQuerySetInputSchema.extend({
7311
+ request: measurementQuerySetUpsertRequestSchema
7312
+ }).strict();
7313
+ var measurementQueryTemplateInputSchema = z2.object({
7314
+ project: projectNameSchema,
7315
+ templateId: z2.string().trim().min(1)
7316
+ }).strict();
7317
+ var measurementQueryTemplateUpsertInputSchema = measurementQueryTemplateInputSchema.extend({
7318
+ request: measurementQueryTemplateUpsertRequestSchema
7319
+ }).strict();
7320
+ var measurementQueryTemplateApplyInputSchema = measurementQueryTemplateInputSchema.extend({
7321
+ request: measurementQueryTemplateApplyRequestSchema,
7322
+ idempotencyKey: idempotencyKeyInputSchema
7323
+ }).strict();
7324
+ var measurementPlanDeactivateInputSchema = measurementPlanDeactivateRequestSchema.extend({
7325
+ project: projectNameSchema,
7326
+ idempotencyKey: idempotencyKeyInputSchema
7327
+ }).strict();
7328
+ function measurementDraftMutationOperationSchema(action, request) {
7329
+ return z2.object({
7330
+ action: z2.literal(action),
7331
+ request,
7332
+ etag: measurementDraftEtagInputSchema,
7333
+ idempotencyKey: idempotencyKeyInputSchema
7334
+ }).strict().describe(`Operation for ${action}.`);
7335
+ }
7336
+ var measurementDraftOperationSchema = z2.discriminatedUnion("action", [
7337
+ z2.object({
7338
+ action: z2.literal("create"),
7339
+ request: measurementDraftCreateRequestSchema,
7340
+ idempotencyKey: idempotencyKeyInputSchema
7341
+ }).strict().describe("Operation for create."),
7342
+ measurementDraftMutationOperationSchema("import-sitemap", measurementDraftImportSitemapRequestSchema),
7343
+ measurementDraftMutationOperationSchema("apply-sitemap-selection", measurementDraftApplySitemapSelectionRequestSchema),
7344
+ measurementDraftMutationOperationSchema("upsert-target", measurementDraftUpsertTargetRequestSchema),
7345
+ measurementDraftMutationOperationSchema("rename-target", measurementDraftRenameTargetRequestSchema),
7346
+ measurementDraftMutationOperationSchema("merge-targets", measurementDraftMergeTargetsRequestSchema),
7347
+ measurementDraftMutationOperationSchema("exclude-target", measurementDraftExcludeTargetRequestSchema),
7348
+ measurementDraftMutationOperationSchema("rebind-target", measurementDraftRebindTargetRequestSchema),
7349
+ measurementDraftMutationOperationSchema("apply-assignments", measurementDraftApplyAssignmentsRequestSchema),
7350
+ measurementDraftMutationOperationSchema("apply-paired-assignments", measurementDraftApplyPairedAssignmentsRequestSchema),
7351
+ measurementDraftMutationOperationSchema("remove-assignment", measurementDraftRemoveAssignmentRequestSchema),
7352
+ measurementDraftMutationOperationSchema("clear-assignments", measurementDraftClearAssignmentsRequestSchema),
7353
+ measurementDraftMutationOperationSchema("classify-assignments", measurementDraftClassifyAssignmentsRequestSchema),
7354
+ measurementDraftMutationOperationSchema("upsert-group", measurementDraftUpsertGroupRequestSchema),
7355
+ measurementDraftMutationOperationSchema("remove-group", measurementDraftRemoveGroupRequestSchema),
7356
+ measurementDraftMutationOperationSchema("upsert-competitor", measurementDraftUpsertCompetitorRequestSchema),
7357
+ measurementDraftMutationOperationSchema("remove-competitor", measurementDraftRemoveCompetitorRequestSchema),
7358
+ z2.object({ action: z2.literal("compile-preview") }).strict().describe("Operation for compile-preview."),
7359
+ z2.object({ action: z2.literal("diff-preview") }).strict().describe("Operation for diff-preview."),
7360
+ measurementDraftMutationOperationSchema("publish", measurementDraftPublishRequestSchema),
7361
+ z2.object({
7362
+ action: z2.literal("discard"),
7363
+ etag: measurementDraftEtagInputSchema,
7364
+ idempotencyKey: idempotencyKeyInputSchema
7365
+ }).strict().describe("Operation for discard.")
7366
+ ]);
7367
+ var measurementDraftActionInputSchema = z2.object({
7368
+ project: projectNameSchema,
7369
+ operation: measurementDraftOperationSchema.describe("Typed draft operation. Select exactly one action branch.")
7370
+ }).strict();
7371
+ var measurementDraftActionOpenApiOperations = [
7372
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/create",
7373
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/import-sitemap",
7374
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/apply-sitemap-selection",
7375
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/upsert-target",
7376
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/rename-target",
7377
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/merge-targets",
7378
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/exclude-target",
7379
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/rebind-target",
7380
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/apply-assignments",
7381
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/apply-paired-assignments",
7382
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/remove-assignment",
7383
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/clear-assignments",
7384
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/classify-assignments",
7385
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/upsert-group",
7386
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/remove-group",
7387
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/upsert-competitor",
7388
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/remove-competitor",
7389
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/compile-preview",
7390
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/diff-preview",
7391
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/publish",
7392
+ "POST /api/v1/projects/{name}/measurement-plan/draft/actions/discard"
7393
+ ];
7394
+ function runMeasurementDraftAction(client2, input) {
7395
+ const { project, operation: actionInput } = input;
7396
+ switch (actionInput.action) {
7397
+ case "create":
7398
+ return client2.createMeasurementPlanDraft(project, actionInput.request, actionInput.idempotencyKey);
7399
+ case "import-sitemap":
7400
+ return client2.importMeasurementDraftSitemap(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7401
+ case "apply-sitemap-selection":
7402
+ return client2.applyMeasurementDraftSitemapSelection(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7403
+ case "upsert-target":
7404
+ return client2.upsertMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7405
+ case "rename-target":
7406
+ return client2.renameMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7407
+ case "merge-targets":
7408
+ return client2.mergeMeasurementDraftTargets(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7409
+ case "exclude-target":
7410
+ return client2.excludeMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7411
+ case "rebind-target":
7412
+ return client2.rebindMeasurementDraftTarget(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7413
+ case "apply-assignments":
7414
+ return client2.applyMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7415
+ case "apply-paired-assignments":
7416
+ return client2.applyPairedMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7417
+ case "remove-assignment":
7418
+ return client2.removeMeasurementDraftAssignment(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7419
+ case "clear-assignments":
7420
+ return client2.clearMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7421
+ case "classify-assignments":
7422
+ return client2.classifyMeasurementDraftAssignments(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7423
+ case "upsert-group":
7424
+ return client2.upsertMeasurementDraftGroup(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7425
+ case "remove-group":
7426
+ return client2.removeMeasurementDraftGroup(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7427
+ case "upsert-competitor":
7428
+ return client2.upsertMeasurementDraftCompetitor(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7429
+ case "remove-competitor":
7430
+ return client2.removeMeasurementDraftCompetitor(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7431
+ case "compile-preview":
7432
+ return client2.compileMeasurementDraftPreview(project);
7433
+ case "diff-preview":
7434
+ return client2.diffMeasurementDraftPreview(project);
7435
+ case "publish":
7436
+ return client2.publishMeasurementDraft(project, actionInput.request, actionInput.idempotencyKey, actionInput.etag);
7437
+ case "discard":
7438
+ return client2.discardMeasurementDraft(project, actionInput.idempotencyKey, actionInput.etag);
7439
+ }
7440
+ }
6368
7441
  var runsListInputSchema = z2.object({
6369
7442
  project: projectNameSchema,
6370
7443
  limit: z2.number().int().positive().max(500).optional()
@@ -8021,16 +9094,225 @@ var canonryMcpTools = [
8021
9094
  openApiOperations: ["POST /api/v1/projects/{name}/measurement-plan/segments/{stableKey}/retire"],
8022
9095
  handler: (client2, input) => client2.retireMeasurementPlanSegment(input.project, input.stableKey)
8023
9096
  }),
9097
+ defineTool({
9098
+ name: "canonry_measurement_setup",
9099
+ title: "Get Advanced Measurement setup state",
9100
+ description: "Return the project\u2019s stored Advanced Measurement setup state, mode, active revision, draft freshness, and next action. It never starts provider work or incurs provider cost, and refuses an unknown project.",
9101
+ access: "read",
9102
+ tier: "setup",
9103
+ inputSchema: projectInputSchema,
9104
+ annotations: readAnnotations(),
9105
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-setup"],
9106
+ handler: (client2, input) => client2.getMeasurementSetup(input.project)
9107
+ }),
9108
+ defineTool({
9109
+ name: "canonry_measurement_overview",
9110
+ title: "Get Advanced Measurement overview",
9111
+ description: "Return stored, revision-pinned Advanced Measurement metrics and a bounded page of Property rows for all Properties, one reporting group, or one Property. Filter by query class, provider, location, date window, run, or Property search; search filters rows without changing metric denominators. It ranks one run snapshot only and never infers a trend or compares across revisions. Choose label-asc (default), label-desc, citationCoverage-asc/desc, or mentionCoverage-asc/desc. For a coverage sort, unavailable rows form the first bucket in either direction; available rows then follow the requested numeric direction. The cursor is sort-aware, pins pagination to the active revision, displayed run, evidence snapshot, and filters even if a newer run completes, and must be reused unchanged with the same sort and filters. Legacy label cursors work only when sort is omitted, while any explicit sort needs a new sort-bound cursor. It never starts provider work or incurs provider cost; page size is at most 100, and it refuses invalid scope keys, cursor combinations, appended evidence, or a run pinned to another revision.",
9112
+ access: "read",
9113
+ tier: "setup",
9114
+ inputSchema: measurementOverviewInputSchema,
9115
+ annotations: readAnnotations(),
9116
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-overview"],
9117
+ handler: (client2, input) => {
9118
+ const { project, ...query } = input;
9119
+ return client2.getMeasurementOverview(project, query);
9120
+ }
9121
+ }),
9122
+ defineTool({
9123
+ name: "canonry_measurement_property_evidence",
9124
+ title: "Page one Property's measurement evidence",
9125
+ description: "Return the stored source-evidence rows for exactly one Property out of one revision-pinned run, optionally narrowed to a question class, provider, or location. Prefer this over canonry_measurement_report when you want one Property: the report reconstructs every group and every Target for a revision and does not paginate. Run selection matches canonry_measurement_overview \u2014 the most recent completed run pinned to the active revision unless runId names another, and a run pinned to a different revision is refused rather than joined. The cursor pins the active revision, displayed run, evidence snapshot, and filters; reuse it unchanged. Not available for a schema v1 revision, which records no question class to scope by. It never starts provider work; page size is at most 100. An empty page under measurement.state = not_measured means the Property has not been measured at all, which is NOT a measured result of zero.",
9126
+ access: "read",
9127
+ tier: "setup",
9128
+ inputSchema: measurementPropertyEvidenceInputSchema,
9129
+ annotations: readAnnotations(),
9130
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-property-evidence"],
9131
+ handler: (client2, input) => {
9132
+ const { project, ...query } = input;
9133
+ return client2.getMeasurementPropertyEvidence(project, query);
9134
+ }
9135
+ }),
9136
+ defineTool({
9137
+ name: "canonry_measurement_draft_get",
9138
+ title: "Get Advanced Measurement draft",
9139
+ description: "Return the stored v2 draft and its current ETag, or draft:null when none exists. It never starts provider work or incurs provider cost, and refuses an unknown project.",
9140
+ access: "read",
9141
+ tier: "setup",
9142
+ inputSchema: projectInputSchema,
9143
+ annotations: readAnnotations(),
9144
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-plan/draft"],
9145
+ handler: (client2, input) => client2.getMeasurementPlanDraft(input.project)
9146
+ }),
9147
+ defineTool({
9148
+ name: "canonry_measurement_draft_targets",
9149
+ title: "List Advanced Measurement draft Targets",
9150
+ description: "Return one stored, cursor-paged set of draft Targets. It never starts provider work or incurs provider cost; pages are capped at 100 rows and it refuses a missing draft or unknown project.",
9151
+ access: "read",
9152
+ tier: "setup",
9153
+ inputSchema: measurementDraftCollectionInputSchema,
9154
+ annotations: readAnnotations(),
9155
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-plan/draft/targets"],
9156
+ handler: (client2, input) => {
9157
+ const { project, ...query } = input;
9158
+ return client2.getMeasurementDraftTargets(project, query);
9159
+ }
9160
+ }),
9161
+ defineTool({
9162
+ name: "canonry_measurement_draft_assignments",
9163
+ title: "List Advanced Measurement draft assignments",
9164
+ description: "Return one stored, cursor-paged set of draft Target-to-query assignments. It never starts provider work or incurs provider cost; pages are capped at 100 rows and it refuses a missing draft or unknown project.",
9165
+ access: "read",
9166
+ tier: "setup",
9167
+ inputSchema: measurementDraftCollectionInputSchema,
9168
+ annotations: readAnnotations(),
9169
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-plan/draft/assignments"],
9170
+ handler: (client2, input) => {
9171
+ const { project, ...query } = input;
9172
+ return client2.getMeasurementDraftAssignments(project, query);
9173
+ }
9174
+ }),
9175
+ defineTool({
9176
+ name: "canonry_measurement_draft_groups",
9177
+ title: "List Advanced Measurement draft groups",
9178
+ description: "Return one stored, cursor-paged set of draft reporting groups and competitors. It never starts provider work or incurs provider cost; pages are capped at 100 rows and it refuses a missing draft or unknown project.",
9179
+ access: "read",
9180
+ tier: "setup",
9181
+ inputSchema: measurementDraftCollectionInputSchema,
9182
+ annotations: readAnnotations(),
9183
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-plan/draft/groups"],
9184
+ handler: (client2, input) => {
9185
+ const { project, ...query } = input;
9186
+ return client2.getMeasurementDraftGroups(project, query);
9187
+ }
9188
+ }),
9189
+ defineTool({
9190
+ name: "canonry_measurement_query_sets",
9191
+ title: "List Advanced Measurement query sets",
9192
+ description: "Return stored query-set metadata for one project. It never starts provider work or incurs provider cost, and refuses an unknown project.",
9193
+ access: "read",
9194
+ tier: "setup",
9195
+ inputSchema: projectInputSchema,
9196
+ annotations: readAnnotations(),
9197
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-query-sets"],
9198
+ handler: (client2, input) => client2.listMeasurementQuerySets(input.project)
9199
+ }),
9200
+ defineTool({
9201
+ name: "canonry_measurement_query_set_get",
9202
+ title: "Get Advanced Measurement query set",
9203
+ description: "Return one stored query set with its ordered query members. It never starts provider work or incurs provider cost, and refuses an unknown project or query-set ID.",
9204
+ access: "read",
9205
+ tier: "setup",
9206
+ inputSchema: measurementQuerySetInputSchema,
9207
+ annotations: readAnnotations(),
9208
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-query-sets/{setId}"],
9209
+ handler: (client2, input) => client2.getMeasurementQuerySet(input.project, input.setId)
9210
+ }),
9211
+ defineTool({
9212
+ name: "canonry_measurement_query_templates",
9213
+ title: "List Advanced Measurement query templates",
9214
+ description: "Return stored query-template metadata for one project. It never starts provider work or incurs provider cost, and refuses an unknown project.",
9215
+ access: "read",
9216
+ tier: "setup",
9217
+ inputSchema: projectInputSchema,
9218
+ annotations: readAnnotations(),
9219
+ openApiOperations: ["GET /api/v1/projects/{name}/measurement-query-templates"],
9220
+ handler: (client2, input) => client2.listMeasurementQueryTemplates(input.project)
9221
+ }),
9222
+ defineTool({
9223
+ name: "canonry_measurement_draft_action",
9224
+ title: "Act on an Advanced Measurement draft",
9225
+ description: "Create, edit, inspect, publish, or discard one v2 draft. Pass project plus exactly one typed operation branch; each operation correlates its action with the required request, ETag, and idempotency key so the live schema is self-describing. Requires measurement-plan write authority. Every mutating action needs idempotencyKey: reuse it only for an identical retry; a changed request with the same key is refused. Create has no ETag. Draft edits, publish, and discard should pass the latest ETag from canonry_measurement_draft_get; a missing ETag reaches the API as actionable 428, while a stale ETag returns 412. Compile-preview and diff-preview never mutate or start provider work and require neither header. Import-sitemap performs a bounded public sitemap fetch but does not publish or run measurement; publish replaces the active plan after validation, and discard permanently removes the draft.",
9226
+ access: "write",
9227
+ tier: "setup",
9228
+ inputSchema: measurementDraftActionInputSchema,
9229
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true, openWorldHint: true }),
9230
+ openApiOperations: measurementDraftActionOpenApiOperations,
9231
+ handler: runMeasurementDraftAction
9232
+ }),
9233
+ defineTool({
9234
+ name: "canonry_measurement_plan_deactivate",
9235
+ title: "Deactivate Advanced Measurement plan",
9236
+ description: "Remove the active Advanced Measurement plan pointer while retaining immutable revisions. Requires measurement-plan write authority, the active revision you reviewed, and idempotencyKey; reuse that key only to retry the identical request. It does not use a draft ETag and refuses a moved or missing active plan.",
9237
+ access: "write",
9238
+ tier: "setup",
9239
+ inputSchema: measurementPlanDeactivateInputSchema,
9240
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
9241
+ openApiOperations: ["POST /api/v1/projects/{name}/measurement-plan/actions/deactivate"],
9242
+ handler: (client2, input) => client2.deactivateMeasurementPlan(input.project, {
9243
+ expectedActiveRevision: input.expectedActiveRevision
9244
+ }, input.idempotencyKey)
9245
+ }),
9246
+ defineTool({
9247
+ name: "canonry_measurement_query_set_upsert",
9248
+ title: "Create or replace Advanced Measurement query set",
9249
+ description: "Create or replace one query set and its ordered query references. Requires measurement-plan write authority. This is an idempotent PUT with no mutation headers; safely retry the same request. It replaces the named query-set contents but never deletes project queries or published plans.",
9250
+ access: "write",
9251
+ tier: "setup",
9252
+ inputSchema: measurementQuerySetUpsertInputSchema,
9253
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
9254
+ openApiOperations: ["PUT /api/v1/projects/{name}/measurement-query-sets/{setId}"],
9255
+ handler: (client2, input) => client2.upsertMeasurementQuerySet(input.project, input.setId, input.request)
9256
+ }),
9257
+ defineTool({
9258
+ name: "canonry_measurement_query_set_delete",
9259
+ title: "Delete Advanced Measurement query set",
9260
+ description: "Delete one query set without deleting its project queries or published plans. Requires measurement-plan write authority. DELETE is idempotent and uses no mutation headers; retrying the same request is safe, while an unknown query-set ID is refused.",
9261
+ access: "write",
9262
+ tier: "setup",
9263
+ inputSchema: measurementQuerySetInputSchema,
9264
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
9265
+ openApiOperations: ["DELETE /api/v1/projects/{name}/measurement-query-sets/{setId}"],
9266
+ handler: (client2, input) => client2.deleteMeasurementQuerySet(input.project, input.setId)
9267
+ }),
9268
+ defineTool({
9269
+ name: "canonry_measurement_query_template_upsert",
9270
+ title: "Create or replace Advanced Measurement query template",
9271
+ description: "Create or replace one query template. Requires measurement-plan write authority. This is an idempotent PUT with no mutation headers; safely retry the same request. It replaces only the named template and does not create queries until an explicit apply.",
9272
+ access: "write",
9273
+ tier: "setup",
9274
+ inputSchema: measurementQueryTemplateUpsertInputSchema,
9275
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
9276
+ openApiOperations: ["PUT /api/v1/projects/{name}/measurement-query-templates/{templateId}"],
9277
+ handler: (client2, input) => client2.upsertMeasurementQueryTemplate(input.project, input.templateId, input.request)
9278
+ }),
9279
+ defineTool({
9280
+ name: "canonry_measurement_query_template_delete",
9281
+ title: "Delete Advanced Measurement query template",
9282
+ description: "Delete one query template without deleting previously expanded project queries. Requires measurement-plan write authority. DELETE is idempotent and uses no mutation headers; retrying the same request is safe, while an unknown template ID is refused.",
9283
+ access: "write",
9284
+ tier: "setup",
9285
+ inputSchema: measurementQueryTemplateInputSchema,
9286
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
9287
+ openApiOperations: ["DELETE /api/v1/projects/{name}/measurement-query-templates/{templateId}"],
9288
+ handler: (client2, input) => client2.deleteMeasurementQueryTemplate(input.project, input.templateId)
9289
+ }),
9290
+ defineTool({
9291
+ name: "canonry_measurement_query_template_apply",
9292
+ title: "Apply Advanced Measurement query template",
9293
+ description: "Expand one query template into project queries and optionally add them to a query set. Requires measurement-plan write authority and idempotencyKey; reuse that key only to retry the identical apply. This additive action returns created and already-existing queries, does not use a draft ETag, and never removes prior queries.",
9294
+ access: "write",
9295
+ tier: "setup",
9296
+ inputSchema: measurementQueryTemplateApplyInputSchema,
9297
+ annotations: writeAnnotations({ idempotentHint: true }),
9298
+ openApiOperations: ["POST /api/v1/projects/{name}/measurement-query-templates/{templateId}/apply"],
9299
+ handler: (client2, input) => client2.applyMeasurementQueryTemplate(
9300
+ input.project,
9301
+ input.templateId,
9302
+ input.request,
9303
+ input.idempotencyKey
9304
+ )
9305
+ }),
8024
9306
  defineTool({
8025
9307
  name: "canonry_measurement_report",
8026
9308
  title: "Get measurement report",
8027
- description: "Get a revision-pinned Target and group measurement report from stored runs. Never starts live provider work.",
9309
+ description: "Get a revision-pinned Target and group measurement report from stored runs. Optionally pin the evidence to an exact eligible full run. Never starts live provider work.",
8028
9310
  access: "read",
8029
9311
  tier: "setup",
8030
- inputSchema: measurementPlanVersionInputSchema,
9312
+ inputSchema: measurementReportInputSchema,
8031
9313
  annotations: readAnnotations(),
8032
9314
  openApiOperations: ["GET /api/v1/projects/{name}/measurement-report"],
8033
- handler: (client2, input) => client2.getMeasurementReport(input.project, input.revision)
9315
+ handler: (client2, input) => client2.getMeasurementReport(input.project, input.revision, input.runId)
8034
9316
  }),
8035
9317
  defineTool({
8036
9318
  name: "canonry_run_trigger",