@canonry/canonry 7.51.5 → 7.52.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 (141) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +8 -0
  2. package/assets/assets/{AccessControls-B5TqDgeq.js → AccessControls-CteIuEGI.js} +1 -1
  3. package/assets/assets/{AuditHistoryPanel-DgxiizOW.js → AuditHistoryPanel-DqJGiLsf.js} +1 -1
  4. package/assets/assets/{BacklinksPage-Ay6pdphx.js → BacklinksPage-DotWEPQt.js} +1 -1
  5. package/assets/assets/{HistoryPage-B11eFH21.js → HistoryPage-aOd198dT.js} +1 -1
  6. package/assets/assets/MeasurementPropertyPage-CuaKVK8x.js +4 -0
  7. package/assets/assets/{ProjectPage-DoY0hftd.js → ProjectPage-O9oufMgi.js} +4 -4
  8. package/assets/assets/{RunsPage-BPBmuQAS.js → RunsPage-DIXMrc-N.js} +1 -1
  9. package/assets/assets/{SettingsPage-ClKnP8xy.js → SettingsPage-BuGb6AGa.js} +1 -1
  10. package/assets/assets/SiteHealthSection-CweaKjCo.js +2 -0
  11. package/assets/assets/TrafficPage-B7MaQalp.js +40 -0
  12. package/assets/assets/{TrafficSourceDetailPage-DQu0YNt2.js → TrafficSourceDetailPage-BPtjnF9s.js} +1 -1
  13. package/assets/assets/{card-DYMyvhB9.js → card-DoV-8Txo.js} +1 -1
  14. package/assets/assets/{extract-error-message-BRM1I_3L.js → extract-error-message-DKQJJlZ-.js} +1 -1
  15. package/assets/assets/{format-helpers-DrkFERj3.js → format-helpers-BWnMmkiO.js} +1 -1
  16. package/assets/assets/index-Z63c4PeO.js +39 -0
  17. package/assets/assets/{query-client-gRFnU4VF.js → query-client-vB35tVTz.js} +1 -1
  18. package/assets/assets/{react-query-lH82FULK.js → react-query-BI0567qs.js} +1 -1
  19. package/assets/assets/{react-sigma_core.esm.min-D09H4byP.js → react-sigma_core.esm.min-hGyOC4V_.js} +1 -1
  20. package/assets/assets/{service-Cx0HSnE9.js → service-c4YvpVKX.js} +1 -1
  21. package/assets/index.html +6 -6
  22. package/dist/ads-MREK2AGL.js +544 -0
  23. package/dist/agent-4RUZ3MC4.js +70 -0
  24. package/dist/agent-ask-YLTYBEYH.js +139 -0
  25. package/dist/agent-conversations-QA6IKDGR.js +52 -0
  26. package/dist/agent-memory-MEQAJOB3.js +92 -0
  27. package/dist/agent-providers-AXYPDJHL.js +55 -0
  28. package/dist/agent-transcript-SMNQNYCD.js +77 -0
  29. package/dist/analytics-4OR64IGV.js +240 -0
  30. package/dist/apply-CQXCFXAH.js +175 -0
  31. package/dist/backfill-TMXCNVOB.js +41 -0
  32. package/dist/backlinks-6KFAQGYV.js +303 -0
  33. package/dist/bing-HFCACTAC.js +418 -0
  34. package/dist/bootstrap-SQVQXOJC.js +326 -0
  35. package/dist/cdp-IACL7EXU.js +162 -0
  36. package/dist/chunk-4MJYGB56.js +124 -0
  37. package/dist/chunk-5N6245R7.js +1160 -0
  38. package/dist/chunk-6BPZHNDC.js +617 -0
  39. package/dist/chunk-6GO5VVAC.js +15 -0
  40. package/dist/chunk-7244X3K6.js +609 -0
  41. package/dist/chunk-7XE2IRBG.js +204 -0
  42. package/dist/chunk-AOJU5LKX.js +8 -0
  43. package/dist/chunk-AWCWIQAU.js +2686 -0
  44. package/dist/{chunk-JBZZEIM2.js → chunk-BBOHY2DQ.js} +2 -13
  45. package/dist/{chunk-AZFPA7JV.js → chunk-BU3VAG5J.js} +6 -4
  46. package/dist/{chunk-4YCGZGA3.js → chunk-BYOK6Z4F.js} +2 -2
  47. package/dist/chunk-DSNSD5J3.js +971 -0
  48. package/dist/chunk-EGIZNSDA.js +94 -0
  49. package/dist/chunk-ELCLGWUT.js +83 -0
  50. package/dist/chunk-FC4XND45.js +38 -0
  51. package/dist/chunk-GNKOBKPW.js +58 -0
  52. package/dist/chunk-HEGXGCGL.js +524 -0
  53. package/dist/chunk-I6KNMZ77.js +232 -0
  54. package/dist/{chunk-HLVEB5TB.js → chunk-IIOEAJTV.js} +7 -5
  55. package/dist/chunk-ILDT4LPB.js +1273 -0
  56. package/dist/chunk-JY3RLZGB.js +30 -0
  57. package/dist/{chunk-PLYJX67A.js → chunk-K5I45PZI.js} +8084 -13939
  58. package/dist/chunk-KXAOMTXN.js +1034 -0
  59. package/dist/chunk-LK2BG6EX.js +145 -0
  60. package/dist/chunk-MJNUSPO4.js +15 -0
  61. package/dist/chunk-MKAC7HKH.js +9178 -0
  62. package/dist/chunk-MLKGABMK.js +9 -0
  63. package/dist/{chunk-SFMWHPMX.js → chunk-O4RMPA6H.js} +13765 -13737
  64. package/dist/chunk-O77IBNVO.js +8264 -0
  65. package/dist/chunk-OFL4PTYU.js +644 -0
  66. package/dist/chunk-QLPLENDT.js +133 -0
  67. package/dist/chunk-R2J4SNKF.js +78 -0
  68. package/dist/{chunk-KEATAHXH.js → chunk-RVUCY4ZV.js} +358 -581
  69. package/dist/chunk-SNFBJKAW.js +530 -0
  70. package/dist/chunk-TALC5DX5.js +420 -0
  71. package/dist/chunk-TSENU4GG.js +18 -0
  72. package/dist/{chunk-HAHXPJQ5.js → chunk-V5D4XNWV.js} +16 -1684
  73. package/dist/chunk-VJWDBFSL.js +69 -0
  74. package/dist/chunk-XEBKF4N5.js +8 -0
  75. package/dist/chunk-Y4GK7GCV.js +15376 -0
  76. package/dist/{chunk-A3WSAAQS.js → chunk-YSEC6TIB.js} +7917 -33199
  77. package/dist/chunk-Z7IUAJOF.js +13 -0
  78. package/dist/citations-NSBBWRZ4.js +106 -0
  79. package/dist/{cli-catalog-MO6Z2CIZ.js → cli-catalog-OFWJMNMD.js} +5 -3
  80. package/dist/cli-commands-WVBL337U.js +19 -0
  81. package/dist/cli.js +35 -29
  82. package/dist/competitor-V4OHORBC.js +561 -0
  83. package/dist/content-RUXRI5IC.js +257 -0
  84. package/dist/dashboard-JXB2YAQJ.js +71 -0
  85. package/dist/demo-55ZNUOXU.js +75 -0
  86. package/dist/{demo-server-GIWDJGJX.js → demo-server-XO7PHM4I.js} +22 -9
  87. package/dist/discover-JJQ564HS.js +372 -0
  88. package/dist/discover-eval-KLEKZ6U4.js +282 -0
  89. package/dist/doctor-JAMQZCMZ.js +152 -0
  90. package/dist/evidence-YRSB7GFE.js +57 -0
  91. package/dist/export-cmd-MHML4OYU.js +49 -0
  92. package/dist/ga-LSXPE2MN.js +911 -0
  93. package/dist/gbp-RMKMLOC7.js +370 -0
  94. package/dist/google-JQ4T6JTQ.js +946 -0
  95. package/dist/google-marketing-J6SEODYC.js +403 -0
  96. package/dist/health-cmd-MV2JM2C3.js +64 -0
  97. package/dist/history-SRRH7A2E.js +90 -0
  98. package/dist/index.d.ts +43 -4
  99. package/dist/index.js +29 -6
  100. package/dist/init-ZJZFUERV.js +432 -0
  101. package/dist/insights-PMMGNWZH.js +63 -0
  102. package/dist/intelligence-service-KCSU6ZUJ.js +15 -0
  103. package/dist/keys-TS7NZANS.js +116 -0
  104. package/dist/keyword-VNCKDUGC.js +164 -0
  105. package/dist/logs-VH3WOTZJ.js +30 -0
  106. package/dist/mcp-DG2RROB3.js +14 -0
  107. package/dist/mcp.js +14 -5
  108. package/dist/measurement-plan-4T35TUGG.js +42 -0
  109. package/dist/notify-BWHUSKL7.js +125 -0
  110. package/dist/organic-evidence-QX4SXXJP.js +53 -0
  111. package/dist/overview-7IHUTKUV.js +213 -0
  112. package/dist/project-JXLSWDE2.js +460 -0
  113. package/dist/query-S75EL25H.js +211 -0
  114. package/dist/research-KFTV3IP4.js +200 -0
  115. package/dist/results-export-GTKVBU34.js +27 -0
  116. package/dist/run-26HDIRHF.js +31 -0
  117. package/dist/schedule-N6G4SVHQ.js +177 -0
  118. package/dist/search-MI32EPYM.js +42 -0
  119. package/dist/serve-XLGE42AG.js +598 -0
  120. package/dist/session-W5DXWIYM.js +47 -0
  121. package/dist/settings-T7WI2UVE.js +107 -0
  122. package/dist/skills-F3WPKPTK.js +33 -0
  123. package/dist/snapshot-PD3EAVEX.js +538 -0
  124. package/dist/src-XDUXMJC3.js +316 -0
  125. package/dist/status-PUH7JFZ4.js +126 -0
  126. package/dist/support-ARF4HER7.js +24 -0
  127. package/dist/technical-aeo-AUFWWJIP.js +625 -0
  128. package/dist/telemetry-XBYT7G2K.js +118 -0
  129. package/dist/tools-GVHIRWSN.js +41 -0
  130. package/dist/traffic-B3HW2ZWG.js +1295 -0
  131. package/dist/users-M5HNQZYI.js +170 -0
  132. package/dist/visibility-stats-Y7GJKMHN.js +241 -0
  133. package/dist/wordpress-GCIURYPN.js +600 -0
  134. package/package.json +1 -1
  135. package/assets/assets/MeasurementPropertyPage-1UYI7mzP.js +0 -4
  136. package/assets/assets/SiteHealthSection-PWjKMmEn.js +0 -2
  137. package/assets/assets/TrafficPage-DkfGiJXR.js +0 -40
  138. package/assets/assets/index-CG1Jox52.js +0 -39
  139. package/dist/chunk-4QQYYRHV.js +0 -23082
  140. package/dist/cli-commands-FOJR3HHU.js +0 -15
  141. package/dist/intelligence-service-XQCNWAPL.js +0 -9
@@ -0,0 +1,600 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-V5D4XNWV.js";
4
+ import "./chunk-OFL4PTYU.js";
5
+ import "./chunk-AOJU5LKX.js";
6
+ import {
7
+ CliError,
8
+ isMachineFormat
9
+ } from "./chunk-HGMYEDAQ.js";
10
+ import "./chunk-O4RMPA6H.js";
11
+ import "./chunk-MLKGABMK.js";
12
+
13
+ // src/commands/wordpress.ts
14
+ function getClient() {
15
+ return createApiClient();
16
+ }
17
+ async function loadYamlModule() {
18
+ return await import("yaml").catch(() => null);
19
+ }
20
+ function printJson(value) {
21
+ console.log(JSON.stringify(value, null, 2));
22
+ }
23
+ function printSiteStatus(label, status) {
24
+ if (!status) {
25
+ console.log(` ${label}: not configured`);
26
+ return;
27
+ }
28
+ console.log(` ${label}: ${status.url}`);
29
+ console.log(` Reachable: ${status.reachable ? "yes" : "no"}`);
30
+ console.log(` WordPress: ${status.version ?? "unknown"}`);
31
+ console.log(` Pages: ${status.pageCount ?? "unknown"}`);
32
+ console.log(` Plugins: ${status.plugins?.length ? status.plugins.join(", ") : "(not visible)"}`);
33
+ if (status.error) {
34
+ console.log(` Error: ${status.error}`);
35
+ }
36
+ }
37
+ function printWordpressStatus(project, status) {
38
+ if (!status.connected) {
39
+ console.log(`No WordPress connection for project "${project}".`);
40
+ console.log(`Run "canonry wordpress connect ${project} --url <url> --user <user>" to connect.`);
41
+ return;
42
+ }
43
+ console.log(`WordPress for "${project}":
44
+ `);
45
+ console.log(` Default env: ${status.defaultEnv}`);
46
+ printSiteStatus("Live", status.live);
47
+ if (status.staging || status.defaultEnv === "staging") {
48
+ printSiteStatus("Staging", status.staging);
49
+ }
50
+ if (status.adminUrl) {
51
+ console.log(`
52
+ WP STAGING admin: ${status.adminUrl}`);
53
+ }
54
+ }
55
+ function printPages(project, env, pages) {
56
+ if (pages.length === 0) {
57
+ console.log(`No WordPress pages found for "${project}" (${env}).`);
58
+ return;
59
+ }
60
+ const slugWidth = Math.max(4, ...pages.map((page) => page.slug.length));
61
+ const statusWidth = Math.max(6, ...pages.map((page) => page.status.length));
62
+ console.log(`WordPress pages for "${project}" (${env}):
63
+ `);
64
+ console.log(` ${"SLUG".padEnd(slugWidth)} ${"STATUS".padEnd(statusWidth)} MODIFIED`);
65
+ console.log(` ${"\u2500".repeat(slugWidth)} ${"\u2500".repeat(statusWidth)} ${"\u2500".repeat(20)}`);
66
+ for (const page of pages) {
67
+ console.log(` ${page.slug.padEnd(slugWidth)} ${page.status.padEnd(statusWidth)} ${page.modifiedAt ?? "-"}`);
68
+ }
69
+ }
70
+ function printSchemaBlocks(blocks) {
71
+ if (blocks.length === 0) {
72
+ console.log("No JSON-LD schema blocks detected.");
73
+ return;
74
+ }
75
+ console.log(`Detected ${blocks.length} JSON-LD block(s):
76
+ `);
77
+ for (const [index, block] of blocks.entries()) {
78
+ console.log(` [${index + 1}] ${block.type}`);
79
+ console.log(JSON.stringify(block.json, null, 2));
80
+ if (index < blocks.length - 1) {
81
+ console.log();
82
+ }
83
+ }
84
+ }
85
+ function printPageDetail(page) {
86
+ console.log(`Title: ${page.title}`);
87
+ console.log(`Slug: ${page.slug}`);
88
+ console.log(`Status: ${page.status}`);
89
+ console.log(`Env: ${page.env}`);
90
+ console.log(`Modified: ${page.modifiedAt ?? "-"}`);
91
+ console.log(`Link: ${page.link ?? "-"}`);
92
+ console.log(`SEO title: ${page.seo.title ?? "-"}`);
93
+ console.log(`SEO description: ${page.seo.description ?? "-"}`);
94
+ console.log(`Noindex: ${page.seo.noindex == null ? "-" : page.seo.noindex ? "yes" : "no"}`);
95
+ console.log(`Writable SEO: ${page.seo.writable ? "yes" : "no"}`);
96
+ console.log(`Schema blocks: ${page.schemaBlocks.length}`);
97
+ console.log("\nContent:\n");
98
+ console.log(page.content);
99
+ }
100
+ function printManualAssist(label, payload) {
101
+ console.log(`${label} requires a manual step.
102
+ `);
103
+ console.log(`Target URL: ${payload.targetUrl}`);
104
+ if (payload.adminUrl) {
105
+ console.log(`Admin URL: ${payload.adminUrl}`);
106
+ }
107
+ console.log(`
108
+ Content:
109
+ `);
110
+ console.log(payload.content);
111
+ if (payload.nextSteps.length > 0) {
112
+ console.log("\nNext steps:");
113
+ for (const step of payload.nextSteps) {
114
+ console.log(` - ${step}`);
115
+ }
116
+ }
117
+ }
118
+ function printAuditIssues(issues) {
119
+ if (issues.length === 0) {
120
+ console.log("No audit issues found.");
121
+ return;
122
+ }
123
+ for (const issue of issues) {
124
+ console.log(` [${issue.severity.toUpperCase()}] ${issue.slug}: ${issue.message}`);
125
+ }
126
+ }
127
+ function printDiff(diff) {
128
+ const changed = Object.entries(diff.differences).filter(([, value]) => value).map(([key]) => key);
129
+ console.log(`WordPress diff for "${diff.slug}":
130
+ `);
131
+ console.log(` Has differences: ${diff.hasDifferences ? "yes" : "no"}`);
132
+ console.log(` Changed fields: ${changed.length > 0 ? changed.join(", ") : "none"}`);
133
+ console.log(`
134
+ Live:`);
135
+ console.log(` Title: ${diff.live.title}`);
136
+ console.log(` Slug: ${diff.live.slug}`);
137
+ console.log(` Content hash: ${diff.live.contentHash}`);
138
+ console.log(` SEO title: ${diff.live.seo.title ?? "-"}`);
139
+ console.log(` Description: ${diff.live.seo.description ?? "-"}`);
140
+ console.log(` Noindex: ${diff.live.seo.noindex == null ? "-" : diff.live.seo.noindex ? "yes" : "no"}`);
141
+ console.log(` Schema: ${diff.live.schemaBlocks.length} block(s)`);
142
+ console.log(` Snippet: ${diff.live.contentSnippet || "(empty)"}`);
143
+ console.log(`
144
+ Staging:`);
145
+ console.log(` Title: ${diff.staging.title}`);
146
+ console.log(` Slug: ${diff.staging.slug}`);
147
+ console.log(` Content hash: ${diff.staging.contentHash}`);
148
+ console.log(` SEO title: ${diff.staging.seo.title ?? "-"}`);
149
+ console.log(` Description: ${diff.staging.seo.description ?? "-"}`);
150
+ console.log(` Noindex: ${diff.staging.seo.noindex == null ? "-" : diff.staging.seo.noindex ? "yes" : "no"}`);
151
+ console.log(` Schema: ${diff.staging.schemaBlocks.length} block(s)`);
152
+ console.log(` Snippet: ${diff.staging.contentSnippet || "(empty)"}`);
153
+ }
154
+ async function wordpressConnect(project, opts) {
155
+ const appPassword = opts.appPassword;
156
+ if (!appPassword) {
157
+ throw new CliError({
158
+ code: "WORDPRESS_APP_PASSWORD_REQUIRED",
159
+ message: "WordPress Application Password is required",
160
+ displayMessage: "Error: WordPress Application Password is required. Pass --app-password <password>.",
161
+ details: { project }
162
+ });
163
+ }
164
+ const client = getClient();
165
+ const result = await client.wordpressConnect(project, {
166
+ url: opts.url,
167
+ stagingUrl: opts.stagingUrl,
168
+ username: opts.user,
169
+ appPassword,
170
+ defaultEnv: opts.defaultEnv
171
+ });
172
+ if (isMachineFormat(opts.format)) {
173
+ printJson(result);
174
+ return;
175
+ }
176
+ console.log(`WordPress connected for project "${project}".
177
+ `);
178
+ printWordpressStatus(project, result);
179
+ }
180
+ async function wordpressDisconnect(project, format) {
181
+ const client = getClient();
182
+ await client.wordpressDisconnect(project);
183
+ if (isMachineFormat(format)) {
184
+ printJson({ project, disconnected: true });
185
+ return;
186
+ }
187
+ console.log(`WordPress disconnected from project "${project}".`);
188
+ }
189
+ async function wordpressStatus(project, format) {
190
+ const client = getClient();
191
+ const result = await client.wordpressStatus(project);
192
+ if (isMachineFormat(format)) {
193
+ printJson(result);
194
+ return;
195
+ }
196
+ printWordpressStatus(project, result);
197
+ }
198
+ async function wordpressPages(project, opts) {
199
+ const client = getClient();
200
+ const result = await client.wordpressPages(project, opts.env);
201
+ if (isMachineFormat(opts.format)) {
202
+ printJson(result);
203
+ return;
204
+ }
205
+ printPages(project, result.env, result.pages);
206
+ }
207
+ async function wordpressPage(project, slug, opts) {
208
+ const client = getClient();
209
+ const result = await client.wordpressPage(project, slug, opts.env);
210
+ if (isMachineFormat(opts.format)) {
211
+ printJson(result);
212
+ return;
213
+ }
214
+ printPageDetail(result);
215
+ }
216
+ async function wordpressCreatePage(project, body) {
217
+ const client = getClient();
218
+ const result = await client.wordpressCreatePage(project, body);
219
+ if (isMachineFormat(body.format)) {
220
+ printJson(result);
221
+ return;
222
+ }
223
+ console.log(`Created WordPress page "${result.slug}" in ${result.env}.
224
+ `);
225
+ printPageDetail(result);
226
+ }
227
+ async function wordpressUpdatePage(project, body) {
228
+ const client = getClient();
229
+ const result = await client.wordpressUpdatePage(project, body);
230
+ if (isMachineFormat(body.format)) {
231
+ printJson(result);
232
+ return;
233
+ }
234
+ console.log(`Updated WordPress page "${body.currentSlug}" in ${result.env}.
235
+ `);
236
+ printPageDetail(result);
237
+ }
238
+ async function wordpressSetMeta(project, body) {
239
+ const client = getClient();
240
+ const result = await client.wordpressSetMeta(project, body);
241
+ if (isMachineFormat(body.format)) {
242
+ printJson(result);
243
+ return;
244
+ }
245
+ console.log(`Updated SEO meta for "${body.slug}" in ${result.env}.
246
+ `);
247
+ printPageDetail(result);
248
+ }
249
+ async function wordpressBulkSetMeta(project, opts) {
250
+ const fs = await import("fs/promises");
251
+ const path = await import("path");
252
+ const filePath = path.resolve(opts.from);
253
+ let raw;
254
+ try {
255
+ raw = await fs.readFile(filePath, "utf8");
256
+ } catch {
257
+ throw new CliError({
258
+ code: "FILE_READ_ERROR",
259
+ message: `Cannot read file: ${filePath}`,
260
+ displayMessage: `Error: cannot read file "${opts.from}". Check the path and permissions.`,
261
+ details: { path: filePath }
262
+ });
263
+ }
264
+ let parsed;
265
+ try {
266
+ parsed = JSON.parse(raw);
267
+ } catch {
268
+ throw new CliError({
269
+ code: "INVALID_JSON",
270
+ message: `File is not valid JSON: ${filePath}`,
271
+ displayMessage: `Error: "${opts.from}" is not valid JSON.`,
272
+ details: { path: filePath }
273
+ });
274
+ }
275
+ const entries = Object.entries(parsed).map(([slug, meta]) => ({
276
+ slug,
277
+ title: meta.title,
278
+ description: meta.description,
279
+ noindex: meta.noindex
280
+ }));
281
+ if (entries.length === 0) {
282
+ throw new CliError({
283
+ code: "EMPTY_META_FILE",
284
+ message: "Meta file contains no entries",
285
+ displayMessage: `Error: "${opts.from}" contains no entries. Expected JSON object keyed by slug.`,
286
+ details: { path: filePath }
287
+ });
288
+ }
289
+ const client = getClient();
290
+ const result = await client.wordpressBulkSetMeta(project, { entries, env: opts.env });
291
+ if (isMachineFormat(opts.format)) {
292
+ printJson(result);
293
+ return;
294
+ }
295
+ const applied = result.results.filter((r) => r.status === "applied");
296
+ const skipped = result.results.filter((r) => r.status === "skipped");
297
+ const manual = result.results.filter((r) => r.status === "manual");
298
+ console.log(`Bulk SEO meta update (${result.env}, strategy: ${result.strategy}):
299
+ `);
300
+ if (applied.length > 0) {
301
+ console.log(` Applied (${applied.length}):`);
302
+ for (const r of applied) {
303
+ console.log(` ${r.slug}`);
304
+ }
305
+ }
306
+ if (skipped.length > 0) {
307
+ console.log(`
308
+ Skipped (${skipped.length}):`);
309
+ for (const r of skipped) {
310
+ console.log(` ${r.slug}: ${r.error ?? "unknown reason"}`);
311
+ }
312
+ }
313
+ if (manual.length > 0) {
314
+ console.log(`
315
+ Manual action required (${manual.length}):`);
316
+ console.log(" No SEO plugin with REST-writable meta fields was detected.");
317
+ console.log(" Install Yoast SEO, Rank Math, or AIOSEO, or update these pages manually:\n");
318
+ for (const r of manual) {
319
+ if (r.manualAssist) {
320
+ console.log(` ${r.slug}:`);
321
+ console.log(` Admin: ${r.manualAssist.adminUrl ?? "-"}`);
322
+ console.log(` Values: ${r.manualAssist.content}`);
323
+ } else {
324
+ console.log(` ${r.slug}`);
325
+ }
326
+ }
327
+ }
328
+ console.log(`
329
+ Total: ${applied.length} applied, ${skipped.length} skipped, ${manual.length} manual`);
330
+ }
331
+ async function wordpressSchema(project, slug, opts) {
332
+ const client = getClient();
333
+ const result = await client.wordpressSchema(project, slug, opts.env);
334
+ if (isMachineFormat(opts.format)) {
335
+ printJson(result);
336
+ return;
337
+ }
338
+ console.log(`Schema for "${slug}" (${result.env}):
339
+ `);
340
+ printSchemaBlocks(result.blocks);
341
+ }
342
+ async function wordpressSetSchema(project, body) {
343
+ const client = getClient();
344
+ const result = await client.wordpressSetSchema(project, body);
345
+ if (isMachineFormat(body.format)) {
346
+ printJson(result);
347
+ return;
348
+ }
349
+ printManualAssist(`Schema update for "${body.slug}"`, result);
350
+ }
351
+ async function wordpressSchemaDeploy(project, opts) {
352
+ const fs = await import("fs/promises");
353
+ const path = await import("path");
354
+ const yaml = await loadYamlModule();
355
+ const filePath = path.resolve(opts.profile);
356
+ let raw;
357
+ try {
358
+ raw = await fs.readFile(filePath, "utf8");
359
+ } catch {
360
+ throw new CliError({
361
+ code: "FILE_READ_ERROR",
362
+ message: `Cannot read file: ${filePath}`,
363
+ displayMessage: `Error: cannot read file "${opts.profile}". Check the path and permissions.`,
364
+ details: { path: filePath }
365
+ });
366
+ }
367
+ let parsed;
368
+ try {
369
+ if (yaml) {
370
+ parsed = yaml.parse(raw);
371
+ } else {
372
+ parsed = JSON.parse(raw);
373
+ }
374
+ } catch {
375
+ throw new CliError({
376
+ code: "INVALID_PROFILE",
377
+ message: `File is not valid YAML or JSON: ${filePath}`,
378
+ displayMessage: `Error: "${opts.profile}" is not valid YAML or JSON.`,
379
+ details: { path: filePath }
380
+ });
381
+ }
382
+ const profile = parsed;
383
+ if (!profile?.business?.name || !profile?.pages || Object.keys(profile.pages).length === 0) {
384
+ throw new CliError({
385
+ code: "INVALID_PROFILE",
386
+ message: "Profile must have business.name and non-empty pages",
387
+ displayMessage: "Error: profile file must contain business.name and at least one page entry.",
388
+ details: { path: filePath }
389
+ });
390
+ }
391
+ const client = getClient();
392
+ const result = await client.wordpressSchemaDeploy(project, { profile: parsed, env: opts.env });
393
+ if (isMachineFormat(opts.format)) {
394
+ printJson(result);
395
+ return;
396
+ }
397
+ console.log(`Schema deploy (${result.env}):
398
+ `);
399
+ for (const r of result.results) {
400
+ const types = r.schemasInjected?.join(", ") ?? "";
401
+ switch (r.status) {
402
+ case "deployed":
403
+ console.log(` ${r.slug}: deployed (${types})`);
404
+ break;
405
+ case "stripped":
406
+ console.log(` ${r.slug}: STRIPPED \u2014 WordPress removed <script> tags. Manual action required.`);
407
+ if (r.manualAssist) {
408
+ console.log(` Admin: ${r.manualAssist.adminUrl ?? "-"}`);
409
+ for (const step of r.manualAssist.nextSteps) {
410
+ console.log(` - ${step}`);
411
+ }
412
+ }
413
+ break;
414
+ case "skipped":
415
+ console.log(` ${r.slug}: skipped \u2014 ${r.error ?? "unknown"}`);
416
+ break;
417
+ case "failed":
418
+ console.log(` ${r.slug}: FAILED \u2014 ${r.error ?? "unknown"}`);
419
+ break;
420
+ }
421
+ }
422
+ const deployed = result.results.filter((r) => r.status === "deployed").length;
423
+ const stripped = result.results.filter((r) => r.status === "stripped").length;
424
+ const skipped = result.results.filter((r) => r.status === "skipped").length;
425
+ const failed = result.results.filter((r) => r.status === "failed").length;
426
+ console.log(`
427
+ Total: ${deployed} deployed, ${stripped} stripped, ${skipped} skipped, ${failed} failed`);
428
+ }
429
+ async function wordpressSchemaStatus(project, opts) {
430
+ const client = getClient();
431
+ const result = await client.wordpressSchemaStatus(project, opts.env);
432
+ if (isMachineFormat(opts.format)) {
433
+ printJson(result);
434
+ return;
435
+ }
436
+ console.log(`Schema status (${result.env}):
437
+ `);
438
+ if (result.pages.length === 0) {
439
+ console.log(" No pages found.");
440
+ return;
441
+ }
442
+ const slugWidth = Math.max(4, ...result.pages.map((p) => p.slug.length));
443
+ console.log(` ${"SLUG".padEnd(slugWidth)} CANONRY THIRD-PARTY`);
444
+ console.log(` ${"\u2500".repeat(slugWidth)} ${"\u2500".repeat(17)} ${"\u2500".repeat(20)}`);
445
+ for (const page of result.pages) {
446
+ const canonry = page.canonrySchemas.length > 0 ? page.canonrySchemas.join(", ") : "-";
447
+ const thirdParty = page.thirdPartySchemas.length > 0 ? page.thirdPartySchemas.join(", ") : "-";
448
+ console.log(` ${page.slug.padEnd(slugWidth)} ${canonry.padEnd(17)} ${thirdParty}`);
449
+ }
450
+ }
451
+ async function wordpressOnboard(project, opts) {
452
+ const appPassword = opts.appPassword;
453
+ if (!appPassword) {
454
+ throw new CliError({
455
+ code: "WORDPRESS_APP_PASSWORD_REQUIRED",
456
+ message: "WordPress Application Password is required",
457
+ displayMessage: "Error: WordPress Application Password is required. Pass --app-password <password>.",
458
+ details: { project }
459
+ });
460
+ }
461
+ let profileData;
462
+ if (opts.profile) {
463
+ const fs = await import("fs/promises");
464
+ const path = await import("path");
465
+ const yaml = await loadYamlModule();
466
+ const filePath = path.resolve(opts.profile);
467
+ let raw;
468
+ try {
469
+ raw = await fs.readFile(filePath, "utf8");
470
+ } catch {
471
+ throw new CliError({
472
+ code: "FILE_READ_ERROR",
473
+ message: `Cannot read file: ${filePath}`,
474
+ displayMessage: `Error: cannot read file "${opts.profile}".`,
475
+ details: { path: filePath }
476
+ });
477
+ }
478
+ try {
479
+ profileData = yaml ? yaml.parse(raw) : JSON.parse(raw);
480
+ } catch {
481
+ throw new CliError({
482
+ code: "INVALID_PROFILE",
483
+ message: `File is not valid YAML or JSON: ${filePath}`,
484
+ displayMessage: `Error: "${opts.profile}" is not valid YAML or JSON.`,
485
+ details: { path: filePath }
486
+ });
487
+ }
488
+ }
489
+ const client = getClient();
490
+ const result = await client.wordpressOnboard(project, {
491
+ url: opts.url,
492
+ username: opts.user,
493
+ appPassword,
494
+ stagingUrl: opts.stagingUrl,
495
+ defaultEnv: opts.defaultEnv,
496
+ profile: profileData,
497
+ skipSchema: opts.skipSchema,
498
+ skipSubmit: opts.skipSubmit
499
+ });
500
+ if (isMachineFormat(opts.format)) {
501
+ printJson(result);
502
+ return;
503
+ }
504
+ console.log(`WordPress onboarding for "${project}":
505
+ `);
506
+ for (const step of result.steps) {
507
+ const icon = step.status === "completed" ? "+" : step.status === "skipped" ? "-" : "x";
508
+ console.log(` [${icon}] ${step.name}: ${step.status}`);
509
+ if (step.summary) console.log(` ${step.summary}`);
510
+ if (step.error) console.log(` Error: ${step.error}`);
511
+ }
512
+ }
513
+ async function wordpressLlmsTxt(project, opts) {
514
+ const client = getClient();
515
+ const result = await client.wordpressLlmsTxt(project, opts.env);
516
+ if (isMachineFormat(opts.format)) {
517
+ printJson(result);
518
+ return;
519
+ }
520
+ console.log(`llms.txt for "${project}" (${result.env}): ${result.url}
521
+ `);
522
+ console.log(result.content ?? "(not found)");
523
+ }
524
+ async function wordpressSetLlmsTxt(project, body) {
525
+ const client = getClient();
526
+ const result = await client.wordpressSetLlmsTxt(project, body);
527
+ if (isMachineFormat(body.format)) {
528
+ printJson(result);
529
+ return;
530
+ }
531
+ printManualAssist(`llms.txt update for "${project}"`, result);
532
+ }
533
+ async function wordpressAudit(project, opts) {
534
+ const client = getClient();
535
+ const result = await client.wordpressAudit(project, opts.env);
536
+ if (isMachineFormat(opts.format)) {
537
+ printJson(result);
538
+ return;
539
+ }
540
+ console.log(`WordPress audit for "${project}" (${result.env}):
541
+ `);
542
+ console.log(` Pages scanned: ${result.pages.length}`);
543
+ console.log(` Issues found: ${result.issues.length}
544
+ `);
545
+ printAuditIssues(result.issues);
546
+ }
547
+ async function wordpressDiff(project, slug, format) {
548
+ const client = getClient();
549
+ const result = await client.wordpressDiff(project, slug);
550
+ if (isMachineFormat(format)) {
551
+ printJson(result);
552
+ return;
553
+ }
554
+ printDiff(result);
555
+ }
556
+ async function wordpressStagingStatus(project, format) {
557
+ const client = getClient();
558
+ const result = await client.wordpressStagingStatus(project);
559
+ if (isMachineFormat(format)) {
560
+ printJson(result);
561
+ return;
562
+ }
563
+ console.log(`WordPress staging status for "${project}":
564
+ `);
565
+ console.log(` Configured: ${result.stagingConfigured ? "yes" : "no"}`);
566
+ console.log(` Staging URL: ${result.stagingUrl ?? "-"}`);
567
+ console.log(` WP STAGING active: ${result.wpStagingActive ? "yes" : "no"}`);
568
+ console.log(` Admin URL: ${result.adminUrl}`);
569
+ }
570
+ async function wordpressStagingPush(project, format) {
571
+ const client = getClient();
572
+ const result = await client.wordpressStagingPush(project);
573
+ if (isMachineFormat(format)) {
574
+ printJson(result);
575
+ return;
576
+ }
577
+ printManualAssist(`Staging push for "${project}"`, result);
578
+ }
579
+ export {
580
+ wordpressAudit,
581
+ wordpressBulkSetMeta,
582
+ wordpressConnect,
583
+ wordpressCreatePage,
584
+ wordpressDiff,
585
+ wordpressDisconnect,
586
+ wordpressLlmsTxt,
587
+ wordpressOnboard,
588
+ wordpressPage,
589
+ wordpressPages,
590
+ wordpressSchema,
591
+ wordpressSchemaDeploy,
592
+ wordpressSchemaStatus,
593
+ wordpressSetLlmsTxt,
594
+ wordpressSetMeta,
595
+ wordpressSetSchema,
596
+ wordpressStagingPush,
597
+ wordpressStagingStatus,
598
+ wordpressStatus,
599
+ wordpressUpdatePage
600
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "7.51.5",
3
+ "version": "7.52.0",
4
4
  "type": "module",
5
5
  "description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
6
6
  "keywords": [