@canonry/canonry 7.87.1 → 7.88.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 (137) hide show
  1. package/assets/agent-workspace/skills/aero/references/ai-traffic-tracking.md +6 -1
  2. package/assets/agent-workspace/skills/canonry/references/ai-traffic-tracking.md +6 -1
  3. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +34 -5
  4. package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +17 -5
  5. package/assets/assets/{AgentSetupPage-_ZP3F_zA.js → AgentSetupPage-DV06oPTd.js} +1 -1
  6. package/assets/assets/{AuditHistoryPanel-9B0XpYsN.js → AuditHistoryPanel-C1JnxBFK.js} +1 -1
  7. package/assets/assets/{BacklinksPage-CsvVgXTZ.js → BacklinksPage-Dw0wgYlg.js} +1 -1
  8. package/assets/assets/{HistoryPage-BCxpCul0.js → HistoryPage-DsDx15am.js} +1 -1
  9. package/assets/assets/{MeasurementPropertyPage-BObvWjVx.js → MeasurementPropertyPage-Bkxt3QcY.js} +1 -1
  10. package/assets/assets/{ProjectPage-y378tOaT.js → ProjectPage-CzrD1lpf.js} +1 -1
  11. package/assets/assets/{RunsPage-CfQ_kqlu.js → RunsPage-BggqKbOG.js} +1 -1
  12. package/assets/assets/{SettingsPage-PIgRvqJc.js → SettingsPage-B7ns_ECx.js} +1 -1
  13. package/assets/assets/{SiteHealthSection-DuUE1cB0.js → SiteHealthSection-B2YibqCs.js} +2 -2
  14. package/assets/assets/{ToneBadge-BgTLSTKp.js → ToneBadge-B8hKcr8p.js} +1 -1
  15. package/assets/assets/{TrafficPage-B_YunwjH.js → TrafficPage-DRTbgzKI.js} +1 -1
  16. package/assets/assets/{TrafficSourceDetailPage-C51W87fU.js → TrafficSourceDetailPage-sgLE2gdJ.js} +1 -1
  17. package/assets/assets/{account-context-CVjb3ZSn.js → account-context-pzV-boTi.js} +1 -1
  18. package/assets/assets/{agent-trust-copy-BlpC8jo5.js → agent-trust-copy-DBtiOpFu.js} +1 -1
  19. package/assets/assets/{card-BnVez9nG.js → card-Mu_5i5fM.js} +1 -1
  20. package/assets/assets/{extract-error-message-Dqirbrl0.js → extract-error-message-D_ptq0tW.js} +1 -1
  21. package/assets/assets/{format-helpers-DVXZD864.js → format-helpers-C8QYorwm.js} +1 -1
  22. package/assets/assets/{index-CsvEqhK4.js → index-fN5qDR8H.js} +6 -6
  23. package/assets/assets/{query-client-CVc7wMKJ.js → query-client-CdG4DC3B.js} +1 -1
  24. package/assets/assets/{react-query-CSlTSOjz.js → react-query-CxeygwoL.js} +1 -1
  25. package/assets/assets/{react-sigma_core.esm.min-CVfGIEIE.js → react-sigma_core.esm.min-BfnfPCis.js} +1 -1
  26. package/assets/assets/{service-BGqeyqhZ.js → service-B85wjZQP.js} +1 -1
  27. package/assets/index.html +7 -7
  28. package/dist/{ads-ZUZWSIBV.js → ads-4TAIMWZC.js} +3 -3
  29. package/dist/{agent-YDS3WY7B.js → agent-C7NKP2TO.js} +7 -7
  30. package/dist/{agent-ask-7VUPXTXL.js → agent-ask-EPH5FDM6.js} +3 -3
  31. package/dist/{agent-conversations-WPEBK3BS.js → agent-conversations-LPBBVRKK.js} +3 -3
  32. package/dist/{agent-journeys-H5CCYLNB.js → agent-journeys-MBORINJA.js} +3 -3
  33. package/dist/{agent-memory-CNPKPIWD.js → agent-memory-NJIZO75R.js} +3 -3
  34. package/dist/{agent-providers-U7FLJO5I.js → agent-providers-ZQVUOCX6.js} +3 -3
  35. package/dist/{agent-transcript-VY3BQNPU.js → agent-transcript-67HFY5GT.js} +3 -3
  36. package/dist/{analytics-PYUNO7C2.js → analytics-TUO6BVB6.js} +3 -3
  37. package/dist/{apply-YNBEYC2G.js → apply-V7A5O7YS.js} +3 -3
  38. package/dist/{backfill-PNHBAV5N.js → backfill-PGKYR6NA.js} +10 -10
  39. package/dist/{backlinks-LVHZ2MQ7.js → backlinks-5GGPQNR4.js} +3 -3
  40. package/dist/bing-PQOLIW2X.js +759 -0
  41. package/dist/{bootstrap-AZYQXBHN.js → bootstrap-IH3XX6PI.js} +10 -10
  42. package/dist/{cdp-HCYY4SXR.js → cdp-B3PFQ5RB.js} +7 -7
  43. package/dist/{chunk-RSPOFH66.js → chunk-2KL2XHS6.js} +4 -4
  44. package/dist/{chunk-DOPUEXMC.js → chunk-4A4X7VXE.js} +2 -2
  45. package/dist/{chunk-2AXFKYJU.js → chunk-4T2VZPDG.js} +2 -2
  46. package/dist/{chunk-W7DHXSXN.js → chunk-4VMHN5LL.js} +4004 -2994
  47. package/dist/{chunk-2FJB3CSS.js → chunk-5KDJJO2N.js} +1 -1
  48. package/dist/{chunk-BJHHD7VE.js → chunk-5WWEZ26Y.js} +2 -2
  49. package/dist/{chunk-2I22IUA3.js → chunk-6DIDDYG6.js} +5 -5
  50. package/dist/{chunk-IBGZ6D6R.js → chunk-BDLC3DFM.js} +2 -2
  51. package/dist/{chunk-IK7QEKKD.js → chunk-CYQCO5NY.js} +1 -1
  52. package/dist/{chunk-FAMCDCVK.js → chunk-D354CQ6T.js} +1 -1
  53. package/dist/{chunk-3KK6FWDF.js → chunk-DILCH7RL.js} +1 -1
  54. package/dist/{chunk-BKZ6PQAE.js → chunk-DVWAA3ES.js} +1088 -646
  55. package/dist/{chunk-ECZGTJIQ.js → chunk-E4DUE2PW.js} +6 -6
  56. package/dist/{chunk-TEQF4ZJA.js → chunk-EGUJNHAZ.js} +162 -2
  57. package/dist/{chunk-JDTKG7KJ.js → chunk-EL4HRIID.js} +3 -3
  58. package/dist/{chunk-UXSWQAVZ.js → chunk-EYSQMZ6L.js} +530 -342
  59. package/dist/{chunk-MNLAIB67.js → chunk-FL76YWYN.js} +1 -1
  60. package/dist/{chunk-INH773FB.js → chunk-FLJVGHTQ.js} +3 -3
  61. package/dist/{chunk-4LNZTL7M.js → chunk-FNQFM3TK.js} +3 -3
  62. package/dist/{chunk-GBWCEOZR.js → chunk-IPOYH4WE.js} +1 -1
  63. package/dist/{chunk-VDYXB6SV.js → chunk-IR3MYKIA.js} +84 -13
  64. package/dist/{chunk-CR54BCUP.js → chunk-LBZYPZAA.js} +7 -7
  65. package/dist/{chunk-4FWDITQG.js → chunk-MCQK432C.js} +1 -1
  66. package/dist/{chunk-CBWGUGME.js → chunk-MEN27RAJ.js} +18 -2
  67. package/dist/{chunk-RHOIR5QY.js → chunk-N6AWKBLY.js} +5 -5
  68. package/dist/{chunk-TN53B5AB.js → chunk-O7OZVZWR.js} +210 -3
  69. package/dist/{chunk-6F5ULQDY.js → chunk-OKLDBQYW.js} +4 -4
  70. package/dist/{chunk-G44S34CE.js → chunk-PBOIN52J.js} +2 -2
  71. package/dist/{chunk-GXTCDNX7.js → chunk-PZLEKWYA.js} +1 -1
  72. package/dist/{chunk-F643WELJ.js → chunk-Q2SJRZA3.js} +297 -5
  73. package/dist/{chunk-ICS2WJ7H.js → chunk-R7K24KY7.js} +3 -3
  74. package/dist/{chunk-J7ITGXCS.js → chunk-TAQHHXBC.js} +4 -4
  75. package/dist/{chunk-JAYUWQAV.js → chunk-TL52ELES.js} +1 -1
  76. package/dist/{chunk-GDU6IMGB.js → chunk-UVXQQZB5.js} +2 -2
  77. package/dist/{chunk-O26FQ7RI.js → chunk-ZQGWB7VJ.js} +260 -1
  78. package/dist/{citations-3EZTHA65.js → citations-J3IGPX4L.js} +3 -3
  79. package/dist/{cli-catalog-CBTM3JKP.js → cli-catalog-2PCRGKPH.js} +3 -3
  80. package/dist/{cli-commands-62QECRBV.js → cli-commands-4MUJZCZO.js} +7 -7
  81. package/dist/cli.js +13 -13
  82. package/dist/{competitor-VH4TXJLT.js → competitor-X7Q2AZGL.js} +3 -3
  83. package/dist/{content-TSMNHXJZ.js → content-HTR3PJPX.js} +3 -3
  84. package/dist/{dashboard-4HOXCUQE.js → dashboard-LSO57ZEE.js} +6 -6
  85. package/dist/{demo-IY7Y7KR3.js → demo-P25N4SKK.js} +1 -1
  86. package/dist/{demo-server-BLLSDILQ.js → demo-server-6Z5XSHFS.js} +12 -12
  87. package/dist/{discover-XTJXTKCI.js → discover-KE6TQPOC.js} +3 -3
  88. package/dist/{discover-eval-IVQI5YEW.js → discover-eval-XKOYGCRW.js} +3 -3
  89. package/dist/{doctor-SJ4SHSQO.js → doctor-RL2J54I3.js} +3 -3
  90. package/dist/{evidence-C6T556YH.js → evidence-CYJ4AKUZ.js} +3 -3
  91. package/dist/{export-cmd-JQZ5ZRSI.js → export-cmd-2YM3PXCW.js} +3 -3
  92. package/dist/{ga-W2WHVRHN.js → ga-XAB66MJO.js} +3 -3
  93. package/dist/{gbp-3AZIV5WF.js → gbp-CDGBLRVV.js} +3 -3
  94. package/dist/{google-3CKWPZT7.js → google-XHCUKQ3J.js} +4 -4
  95. package/dist/{google-marketing-PJBGQYYW.js → google-marketing-ZR6NTWEY.js} +1 -1
  96. package/dist/{health-cmd-4JTQMCXM.js → health-cmd-VS3EIFJD.js} +3 -3
  97. package/dist/{history-TXUJFEO2.js → history-YIGYYNZJ.js} +3 -3
  98. package/dist/index.d.ts +2000 -373
  99. package/dist/index.js +25 -25
  100. package/dist/{init-JY76QAOC.js → init-ST3BXHQF.js} +12 -12
  101. package/dist/{insights-XZQO4B45.js → insights-KZS6TYYL.js} +3 -3
  102. package/dist/intelligence-service-LCTP5BC7.js +16 -0
  103. package/dist/{journeys-VFIV5JYV.js → journeys-USOPWGW5.js} +3 -3
  104. package/dist/{keys-PV23G4LW.js → keys-XY7LSM3S.js} +3 -3
  105. package/dist/{keyword-D76KBIV5.js → keyword-PKBFHHF5.js} +3 -3
  106. package/dist/{logs-DYDZ6IEJ.js → logs-PROW5TQJ.js} +3 -3
  107. package/dist/{mcp-GAR5LDQD.js → mcp-OQGC62QU.js} +4 -4
  108. package/dist/mcp.js +9 -9
  109. package/dist/{measurement-plan-K24EOGMI.js → measurement-plan-AI4NNBTO.js} +5 -5
  110. package/dist/{notify-XQHMPDQQ.js → notify-6HRPNJZ5.js} +3 -3
  111. package/dist/{organic-evidence-UHHE7AO4.js → organic-evidence-IXCSUGGY.js} +3 -3
  112. package/dist/{overview-AUZ3XRS5.js → overview-2WS3CFHK.js} +4 -4
  113. package/dist/{project-FUCPU2BD.js → project-ENUZG62V.js} +3 -3
  114. package/dist/{query-HRMSXDKL.js → query-WE3ZWTIB.js} +3 -3
  115. package/dist/{research-R23XLZJ3.js → research-DZSD5UZ2.js} +3 -3
  116. package/dist/{results-export-N6IV3KG4.js → results-export-JMUMYNUE.js} +3 -3
  117. package/dist/{run-CJLG5EXH.js → run-QXOO7CRK.js} +4 -4
  118. package/dist/{schedule-IPDCQ2I5.js → schedule-3RJKGUDN.js} +3 -3
  119. package/dist/{search-ZU4AKJ76.js → search-SGS4H7I4.js} +3 -3
  120. package/dist/{serve-ZQXMTDE7.js → serve-T24QKEUY.js} +26 -26
  121. package/dist/{session-MGOUDLXN.js → session-HPH2A4AZ.js} +13 -13
  122. package/dist/{settings-4FS5NRKP.js → settings-K44RK2TW.js} +3 -3
  123. package/dist/{skills-GSFHACGN.js → skills-HGPPGBXG.js} +2 -2
  124. package/dist/{snapshot-4NUVPDK3.js → snapshot-FEHHQRY3.js} +3 -3
  125. package/dist/{src-SJYGA7NH.js → src-4PAYI7GE.js} +18 -2
  126. package/dist/{status-ASBLMFP2.js → status-L5HVFWTS.js} +4 -4
  127. package/dist/{technical-aeo-QXHRBGYY.js → technical-aeo-Z43UCW6E.js} +3 -3
  128. package/dist/{telemetry-J2I577I3.js → telemetry-D47SSSG7.js} +4 -4
  129. package/dist/{tools-ZWFLE5UR.js → tools-WCWUY2ZJ.js} +11 -11
  130. package/dist/{traffic-B7Q4WPOV.js → traffic-5KH62P43.js} +5 -5
  131. package/dist/{trends-YOLCJBNM.js → trends-RMAXZKRO.js} +3 -3
  132. package/dist/{users-LPSCZV3M.js → users-WT54XNEI.js} +3 -3
  133. package/dist/{visibility-stats-JJQTZSSK.js → visibility-stats-HU62U5MA.js} +3 -3
  134. package/dist/{wordpress-4IKDT5KT.js → wordpress-BDAKQ4MU.js} +3 -3
  135. package/package.json +1 -1
  136. package/dist/bing-A2MUG6AV.js +0 -418
  137. package/dist/intelligence-service-GJYBEHJE.js +0 -16
@@ -1,418 +0,0 @@
1
- import {
2
- createApiClient
3
- } from "./chunk-TEQF4ZJA.js";
4
- import "./chunk-2FJB3CSS.js";
5
- import {
6
- emitJsonl
7
- } from "./chunk-Z7IUAJOF.js";
8
- import "./chunk-AOJU5LKX.js";
9
- import {
10
- CliError,
11
- isMachineFormat
12
- } from "./chunk-HGMYEDAQ.js";
13
- import {
14
- describeError,
15
- formatPercent
16
- } from "./chunk-F643WELJ.js";
17
- import "./chunk-MLKGABMK.js";
18
-
19
- // src/commands/bing.ts
20
- function getClient() {
21
- return createApiClient();
22
- }
23
- async function waitForRunStatus(client, runId, config) {
24
- const start = Date.now();
25
- process.stderr.write(config.progressLabel);
26
- while (Date.now() - start < config.timeoutMs) {
27
- await new Promise((resolve) => setTimeout(resolve, config.intervalMs));
28
- const current = await client.getRun(runId);
29
- process.stderr.write(".");
30
- if (config.successStatuses.includes(current.status)) {
31
- process.stderr.write("\n");
32
- return current;
33
- }
34
- if (config.failureStatuses.includes(current.status)) {
35
- process.stderr.write("\n");
36
- throw new CliError({
37
- code: config.failureCode,
38
- message: config.failureMessage,
39
- displayMessage: config.failureMessage,
40
- details: { runId, status: current.status, ...config.details ?? {} }
41
- });
42
- }
43
- }
44
- process.stderr.write("\n");
45
- throw new CliError({
46
- code: config.timeoutCode,
47
- message: config.timeoutMessage,
48
- displayMessage: config.timeoutMessage,
49
- details: { runId, ...config.details ?? {} }
50
- });
51
- }
52
- async function bingConnect(project, opts) {
53
- const apiKey = opts?.apiKey;
54
- if (!apiKey) {
55
- throw new CliError({
56
- code: "BING_API_KEY_REQUIRED",
57
- message: "API key is required. Pass --api-key <key>.",
58
- displayMessage: "Error: API key is required. Pass --api-key <key>.",
59
- details: {
60
- project
61
- }
62
- });
63
- }
64
- const client = getClient();
65
- const result = await client.bingConnect(project, { apiKey });
66
- if (isMachineFormat(opts?.format)) {
67
- console.log(JSON.stringify(result, null, 2));
68
- return;
69
- }
70
- console.log(`Bing Webmaster Tools connected for project "${project}".`);
71
- if (result.availableSites.length > 0) {
72
- console.log(`
73
- Registered sites:`);
74
- for (const site of result.availableSites) {
75
- const verified = site.verified ? " (verified)" : "";
76
- console.log(` ${site.url}${verified}`);
77
- }
78
- console.log(`
79
- Set the active site with: canonry bing set-site ${project} <url>`);
80
- } else {
81
- console.log("\nNo sites found. Register your site at https://www.bing.com/webmasters/");
82
- }
83
- }
84
- async function bingDisconnect(project, format) {
85
- const client = getClient();
86
- await client.bingDisconnect(project);
87
- if (isMachineFormat(format)) {
88
- console.log(JSON.stringify({ project, disconnected: true }, null, 2));
89
- return;
90
- }
91
- console.log(`Bing Webmaster Tools disconnected from project "${project}".`);
92
- }
93
- async function bingStatus(project, format) {
94
- const client = getClient();
95
- const result = await client.bingStatus(project);
96
- if (isMachineFormat(format)) {
97
- console.log(JSON.stringify(result, null, 2));
98
- return;
99
- }
100
- if (!result.connected) {
101
- console.log(`No Bing connection for project "${project}".`);
102
- console.log('Run "canonry bing connect <project>" to connect.');
103
- return;
104
- }
105
- console.log(`Bing Webmaster Tools for "${project}":
106
- `);
107
- console.log(` Site URL: ${result.siteUrl ?? "(not set)"}`);
108
- console.log(` Connected: ${result.createdAt}`);
109
- console.log(` Updated: ${result.updatedAt}`);
110
- }
111
- async function bingSites(project, format) {
112
- const client = getClient();
113
- const result = await client.bingSites(project);
114
- if (format === "json") {
115
- console.log(JSON.stringify(result, null, 2));
116
- return;
117
- } else if (format === "jsonl") {
118
- emitJsonl(result.sites.map((site) => ({ project, ...site })));
119
- return;
120
- }
121
- if (result.sites.length === 0) {
122
- console.log("No sites registered in Bing Webmaster Tools.");
123
- console.log("Register your site at https://www.bing.com/webmasters/");
124
- return;
125
- }
126
- console.log("Bing Webmaster Tools sites:\n");
127
- const urlWidth = Math.max(10, ...result.sites.map((s) => s.url.length));
128
- console.log(` ${"URL".padEnd(urlWidth)} VERIFIED`);
129
- console.log(` ${"\u2500".repeat(urlWidth)} ${"\u2500".repeat(8)}`);
130
- for (const site of result.sites) {
131
- console.log(` ${site.url.padEnd(urlWidth)} ${site.verified ? "Yes" : "No"}`);
132
- }
133
- console.log(`
134
- Use "canonry bing set-site <project> <url>" to select a site.`);
135
- }
136
- async function bingSetSite(project, siteUrl, format) {
137
- const client = getClient();
138
- await client.bingSetSite(project, siteUrl);
139
- if (isMachineFormat(format)) {
140
- console.log(JSON.stringify({ project, siteUrl }, null, 2));
141
- return;
142
- }
143
- console.log(`Bing site set to "${siteUrl}" for project "${project}".`);
144
- }
145
- async function bingCoverage(project, format) {
146
- const client = getClient();
147
- const result = await client.bingCoverage(project);
148
- if (isMachineFormat(format)) {
149
- console.log(JSON.stringify(result, null, 2));
150
- return;
151
- }
152
- const { summary } = result;
153
- if (summary.total === 0) {
154
- if ((summary.unknown ?? 0) > 0) {
155
- console.log("No URLs have a definitive Bing index status yet.");
156
- console.log("Run more inspections or use --format json to review the unknown responses.");
157
- return;
158
- }
159
- console.log('No URL inspections found. Run "canonry bing inspect <project> <url>" first.');
160
- return;
161
- }
162
- const reset = "\x1B[0m";
163
- let pctColor;
164
- if (summary.percentage >= 80) pctColor = "\x1B[32m";
165
- else if (summary.percentage >= 50) pctColor = "\x1B[33m";
166
- else pctColor = "\x1B[31m";
167
- const unknownNote = (summary.unknown ?? 0) > 0 ? `, ${summary.unknown} unknown` : "";
168
- console.log(`
169
- Bing Index Coverage for "${project}"
170
- `);
171
- console.log(` SUMMARY: ${pctColor}${summary.indexed} / ${summary.total} pages indexed (${formatPercent(summary.percentage, "percent")})${reset}${unknownNote}
172
- `);
173
- if (result.indexed.length > 0) {
174
- console.log(` INDEXED (${result.indexed.length}):`);
175
- for (const page of result.indexed) {
176
- const crawl = page.lastCrawledDate ? ` (crawled: ${page.lastCrawledDate.split("T")[0]})` : "";
177
- console.log(` ${page.url}${crawl}`);
178
- }
179
- console.log();
180
- }
181
- if (result.notIndexed.length > 0) {
182
- console.log(` NOT INDEXED (${result.notIndexed.length}):`);
183
- for (const page of result.notIndexed) {
184
- const code = page.httpCode ? ` \u2014 HTTP ${page.httpCode}` : "";
185
- console.log(` ${page.url}${code}`);
186
- }
187
- console.log();
188
- }
189
- if (result.lastInspectedAt) {
190
- console.log(` Last inspected: ${result.lastInspectedAt}`);
191
- }
192
- }
193
- async function bingCoverageHistory(project, opts) {
194
- const client = getClient();
195
- const rows = await client.bingCoverageHistory(project, { limit: opts.limit });
196
- if (opts.format === "json") {
197
- console.log(JSON.stringify(rows, null, 2));
198
- return;
199
- } else if (opts.format === "jsonl") {
200
- emitJsonl(rows.map((row) => ({ project, ...row })));
201
- return;
202
- }
203
- if (rows.length === 0) {
204
- console.log('No coverage history found. Run "canonry bing coverage" or "canonry bing refresh" first to capture a snapshot.');
205
- return;
206
- }
207
- console.log(`
208
- Bing Coverage History for "${project}" (${rows.length} snapshots):
209
- `);
210
- console.log(` ${"DATE".padEnd(12)}${"INDEXED".padEnd(10)}${"NOT INDEXED".padEnd(14)}UNKNOWN`);
211
- console.log(` ${"\u2500".repeat(12)}${"\u2500".repeat(10)}${"\u2500".repeat(14)}${"\u2500".repeat(10)}`);
212
- for (const row of rows) {
213
- console.log(` ${row.date.padEnd(12)}${String(row.indexed).padEnd(10)}${String(row.notIndexed).padEnd(14)}${String(row.unknown)}`);
214
- }
215
- }
216
- async function bingInspect(project, url, format) {
217
- const client = getClient();
218
- const result = await client.bingInspectUrl(project, url);
219
- if (isMachineFormat(format)) {
220
- console.log(JSON.stringify(result, null, 2));
221
- return;
222
- }
223
- const indexLabel = result.inIndex === true ? `yes${result.documentSize != null ? ` (document size: ${result.documentSize.toLocaleString()} bytes)` : ""}` : result.inIndex === false ? "no" : "unknown";
224
- console.log(`
225
- Bing URL Inspection: ${result.url}
226
- `);
227
- console.log(` In Index: ${indexLabel}`);
228
- console.log(` Last Crawled: ${result.lastCrawledDate ? result.lastCrawledDate.split("T")[0] : "never"}`);
229
- console.log(` Discovery Date: ${result.discoveryDate ? result.discoveryDate.split("T")[0] : "unknown"}`);
230
- if (result.anchorCount != null) {
231
- console.log(` Inbound Links: ${result.anchorCount}`);
232
- }
233
- console.log(` Inspected At: ${result.inspectedAt}`);
234
- }
235
- async function bingInspections(project, opts) {
236
- const client = getClient();
237
- const params = {};
238
- if (opts.url) params.url = opts.url;
239
- const rows = await client.bingInspections(project, Object.keys(params).length > 0 ? params : void 0);
240
- if (opts.format === "json") {
241
- console.log(JSON.stringify(rows, null, 2));
242
- return;
243
- } else if (opts.format === "jsonl") {
244
- emitJsonl(rows.map((row) => ({ project, ...row })));
245
- return;
246
- }
247
- if (rows.length === 0) {
248
- console.log("No Bing URL inspections found.");
249
- return;
250
- }
251
- console.log(`Bing URL inspection history (${rows.length} records):
252
- `);
253
- const urlWidth = Math.min(50, Math.max(10, ...rows.map((r) => r.url.length)));
254
- console.log(` ${"URL".padEnd(urlWidth)} ${"INDEXED".padEnd(9)}${"HTTP".padEnd(6)}${"INSPECTED".padEnd(22)}`);
255
- console.log(` ${"\u2500".repeat(urlWidth)} ${"\u2500".repeat(9)}${"\u2500".repeat(6)}${"\u2500".repeat(22)}`);
256
- for (const row of rows) {
257
- const url = row.url.length > urlWidth ? row.url.slice(0, urlWidth - 3) + "..." : row.url;
258
- const indexed = row.inIndex === true ? "Yes" : row.inIndex === false ? "No" : "?";
259
- console.log(
260
- ` ${url.padEnd(urlWidth)} ${indexed.padEnd(9)}${String(row.httpCode ?? "?").padEnd(6)}${row.inspectedAt}`
261
- );
262
- }
263
- }
264
- async function bingRefresh(project, format) {
265
- const client = getClient();
266
- const rows = await client.bingInspections(project);
267
- const uniqueUrls = [...new Set(rows.map((r) => r.url))];
268
- if (uniqueUrls.length === 0) {
269
- if (isMachineFormat(format)) {
270
- console.log(JSON.stringify({ refreshed: 0, message: "No previously inspected URLs to refresh." }, null, 2));
271
- return;
272
- }
273
- console.log('No previously inspected URLs to refresh. Run "canonry bing inspect <project> <url>" first.');
274
- return;
275
- }
276
- if (!isMachineFormat(format)) {
277
- process.stderr.write(`Re-inspecting ${uniqueUrls.length} URL(s) via Bing`);
278
- }
279
- const CONCURRENCY = 10;
280
- const errors = [];
281
- for (let i = 0; i < uniqueUrls.length; i += CONCURRENCY) {
282
- const batch = uniqueUrls.slice(i, i + CONCURRENCY);
283
- const results = await Promise.allSettled(
284
- batch.map((url) => client.bingInspectUrl(project, url))
285
- );
286
- for (const r of results) {
287
- if (r.status === "rejected") {
288
- errors.push(describeError(r.reason));
289
- }
290
- }
291
- if (!isMachineFormat(format)) {
292
- process.stderr.write(".");
293
- }
294
- }
295
- if (!isMachineFormat(format)) {
296
- process.stderr.write("\n");
297
- }
298
- if (errors.length > 0) {
299
- process.stderr.write(`${errors.length} URL(s) failed to re-inspect.
300
- `);
301
- }
302
- await bingCoverage(project, format);
303
- }
304
- async function bingRequestIndexing(project, opts) {
305
- const client = getClient();
306
- const body = {};
307
- if (opts.allUnindexed) {
308
- body.allUnindexed = true;
309
- } else if (opts.url) {
310
- body.urls = [opts.url];
311
- } else {
312
- throw new CliError({
313
- code: "CLI_USAGE_ERROR",
314
- message: "provide a URL or use --all-unindexed",
315
- displayMessage: "Error: provide a URL or use --all-unindexed",
316
- details: { command: "bing.request-indexing" }
317
- });
318
- }
319
- const result = await client.bingRequestIndexing(project, body);
320
- if (isMachineFormat(opts.format)) {
321
- console.log(JSON.stringify(result, null, 2));
322
- return;
323
- }
324
- for (const r of result.results) {
325
- if (r.status === "success") {
326
- console.log(`Submitted to Bing: ${r.url}`);
327
- console.log(` Submitted at: ${r.submittedAt}`);
328
- console.log();
329
- } else {
330
- console.error(`Failed: ${r.url}`);
331
- console.error(` Error: ${r.error}`);
332
- console.log();
333
- }
334
- }
335
- if (result.results.length > 1) {
336
- console.log(`Summary: ${result.summary.succeeded} succeeded, ${result.summary.failed} failed (${result.summary.total} total)`);
337
- }
338
- }
339
- async function bingInspectSitemap(project, opts) {
340
- const client = getClient();
341
- const run = await client.bingInspectSitemap(project, {
342
- sitemapUrl: opts.sitemapUrl
343
- });
344
- if (!opts.wait && isMachineFormat(opts.format)) {
345
- console.log(JSON.stringify(run, null, 2));
346
- return;
347
- }
348
- if (!isMachineFormat(opts.format)) {
349
- console.log(`Bing sitemap inspection started (run ${run.id})`);
350
- }
351
- if (opts.wait) {
352
- const current = await waitForRunStatus(client, run.id, {
353
- timeoutMs: 30 * 60 * 1e3,
354
- intervalMs: 3e3,
355
- progressLabel: "Waiting for Bing sitemap inspection to complete",
356
- successStatuses: ["completed", "partial"],
357
- failureStatuses: ["failed"],
358
- timeoutCode: "BING_INSPECT_SITEMAP_TIMEOUT",
359
- failureCode: "BING_INSPECT_SITEMAP_FAILED",
360
- timeoutMessage: "Timed out waiting for Bing sitemap inspection to complete.",
361
- failureMessage: "Bing sitemap inspection failed.",
362
- details: { project }
363
- });
364
- if (isMachineFormat(opts.format)) {
365
- console.log(JSON.stringify(current, null, 2));
366
- return;
367
- }
368
- if (current.status === "partial") {
369
- console.log("Bing sitemap inspection completed with some errors.");
370
- return;
371
- }
372
- console.log("Bing sitemap inspection completed successfully.");
373
- }
374
- }
375
- async function bingPerformance(project, format) {
376
- const client = getClient();
377
- const rows = await client.bingPerformance(project);
378
- if (format === "json") {
379
- console.log(JSON.stringify(rows, null, 2));
380
- return;
381
- } else if (format === "jsonl") {
382
- emitJsonl(rows.map((row) => ({ project, ...row })));
383
- return;
384
- }
385
- if (rows.length === 0) {
386
- console.log("No Bing performance data found.");
387
- return;
388
- }
389
- console.log(`Bing search performance (${rows.length} keywords):
390
- `);
391
- console.log(` ${"QUERY".padEnd(40)}${"CLICKS".padEnd(8)}${"IMPR".padEnd(8)}${"CTR".padEnd(8)}${"POS".padEnd(6)}`);
392
- console.log(` ${"\u2500".repeat(40)}${"\u2500".repeat(8)}${"\u2500".repeat(8)}${"\u2500".repeat(8)}${"\u2500".repeat(6)}`);
393
- for (const row of rows.slice(0, 50)) {
394
- const query = row.query.length > 38 ? row.query.slice(0, 35) + "..." : row.query;
395
- console.log(
396
- ` ${query.padEnd(40)}${String(row.clicks).padEnd(8)}${String(row.impressions).padEnd(8)}${formatPercent(row.ctr).padStart(6)} ${row.averagePosition.toFixed(1).padStart(5)}`
397
- );
398
- }
399
- if (rows.length > 50) {
400
- console.log(`
401
- ... and ${rows.length - 50} more rows (use --format json for full output)`);
402
- }
403
- }
404
- export {
405
- bingConnect,
406
- bingCoverage,
407
- bingCoverageHistory,
408
- bingDisconnect,
409
- bingInspect,
410
- bingInspectSitemap,
411
- bingInspections,
412
- bingPerformance,
413
- bingRefresh,
414
- bingRequestIndexing,
415
- bingSetSite,
416
- bingSites,
417
- bingStatus
418
- };
@@ -1,16 +0,0 @@
1
- import {
2
- HISTORY_WINDOW_RUNS,
3
- IntelligenceService
4
- } from "./chunk-2I22IUA3.js";
5
- import "./chunk-JAYUWQAV.js";
6
- import "./chunk-IBGZ6D6R.js";
7
- import "./chunk-W7DHXSXN.js";
8
- import "./chunk-VDYXB6SV.js";
9
- import "./chunk-GBWCEOZR.js";
10
- import "./chunk-O26FQ7RI.js";
11
- import "./chunk-F643WELJ.js";
12
- import "./chunk-MLKGABMK.js";
13
- export {
14
- HISTORY_WINDOW_RUNS,
15
- IntelligenceService
16
- };