@canonry/canonry 7.51.5 → 7.51.6
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.
- package/dist/ads-ABAT3K4K.js +544 -0
- package/dist/agent-5G4DRLYX.js +70 -0
- package/dist/agent-ask-UDVCZRO7.js +139 -0
- package/dist/agent-conversations-5E4JP2QZ.js +52 -0
- package/dist/agent-memory-7IIJ4HGZ.js +92 -0
- package/dist/agent-providers-BOXPUXZ4.js +55 -0
- package/dist/agent-transcript-4O56G6PQ.js +77 -0
- package/dist/analytics-PKMWX5XL.js +240 -0
- package/dist/apply-OK4XEBDA.js +175 -0
- package/dist/backfill-2OT56CX2.js +41 -0
- package/dist/backlinks-547WCHND.js +303 -0
- package/dist/bing-ZVBV4ZD5.js +418 -0
- package/dist/bootstrap-HUB7XQ73.js +326 -0
- package/dist/cdp-KQKQ4PWJ.js +162 -0
- package/dist/chunk-2G6IP3MO.js +517 -0
- package/dist/chunk-42D2LE2B.js +1273 -0
- package/dist/chunk-4MJYGB56.js +124 -0
- package/dist/chunk-63ISSSGX.js +9150 -0
- package/dist/{chunk-PLYJX67A.js → chunk-6G6FTDWC.js} +8080 -13939
- package/dist/chunk-6GO5VVAC.js +15 -0
- package/dist/{chunk-4YCGZGA3.js → chunk-73P65KPW.js} +2 -2
- package/dist/chunk-7B2Q4NJE.js +133 -0
- package/dist/{chunk-JBZZEIM2.js → chunk-7WZ2FPB4.js} +2 -13
- package/dist/chunk-AOJU5LKX.js +8 -0
- package/dist/chunk-B2FR2ZQ4.js +420 -0
- package/dist/{chunk-HAHXPJQ5.js → chunk-B5J675KK.js} +16 -1684
- package/dist/{chunk-SFMWHPMX.js → chunk-D6COIM3U.js} +17128 -17143
- package/dist/{chunk-A3WSAAQS.js → chunk-DGVUTH7W.js} +9086 -34522
- package/dist/chunk-ELCLGWUT.js +83 -0
- package/dist/chunk-GO2J7SYT.js +1034 -0
- package/dist/chunk-HACZUMGM.js +145 -0
- package/dist/chunk-HM4NNKLG.js +94 -0
- package/dist/chunk-I3A56PFP.js +58 -0
- package/dist/chunk-I77PLCWG.js +961 -0
- package/dist/chunk-ISOQPVPY.js +232 -0
- package/dist/chunk-KFT5LOP2.js +610 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-MMEO22MF.js +38 -0
- package/dist/chunk-NHQ2U5I4.js +78 -0
- package/dist/chunk-PCXRFT3N.js +530 -0
- package/dist/chunk-PITHTCAX.js +15376 -0
- package/dist/chunk-QWKPSFGL.js +30 -0
- package/dist/chunk-RKIXES2B.js +609 -0
- package/dist/chunk-TSENU4GG.js +18 -0
- package/dist/{chunk-HLVEB5TB.js → chunk-TUTKNUMV.js} +7 -5
- package/dist/chunk-U3AHE2RT.js +1160 -0
- package/dist/chunk-UQ3MOZGC.js +644 -0
- package/dist/{chunk-AZFPA7JV.js → chunk-VBCE4CLX.js} +6 -4
- package/dist/chunk-VJWDBFSL.js +69 -0
- package/dist/chunk-VYMZ3QXG.js +8264 -0
- package/dist/chunk-WAULJDKO.js +2686 -0
- package/dist/chunk-WDFI5YMD.js +204 -0
- package/dist/chunk-XEBKF4N5.js +8 -0
- package/dist/chunk-Z7IUAJOF.js +13 -0
- package/dist/{chunk-KEATAHXH.js → chunk-ZWJRY5UI.js} +358 -581
- package/dist/chunk-ZXUAWVWM.js +15 -0
- package/dist/citations-UYB2RU5U.js +106 -0
- package/dist/{cli-catalog-MO6Z2CIZ.js → cli-catalog-F6FI7NB2.js} +5 -3
- package/dist/cli-commands-ZG5ILKDA.js +19 -0
- package/dist/cli.js +35 -29
- package/dist/competitor-EKP4R7YY.js +561 -0
- package/dist/content-DREE6JF3.js +257 -0
- package/dist/dashboard-ZALEOLLU.js +71 -0
- package/dist/demo-JG4Y22O4.js +75 -0
- package/dist/{demo-server-GIWDJGJX.js → demo-server-3A4J2C65.js} +22 -9
- package/dist/discover-W6GMD2HS.js +372 -0
- package/dist/discover-eval-CKFZHRBW.js +282 -0
- package/dist/doctor-TNGBSUMA.js +152 -0
- package/dist/evidence-3H2GFQBZ.js +57 -0
- package/dist/export-cmd-WUIKU5GK.js +49 -0
- package/dist/ga-JI6REFO4.js +911 -0
- package/dist/gbp-4ENDM5NS.js +370 -0
- package/dist/google-HKQSCLOC.js +946 -0
- package/dist/google-marketing-KQR5J2S4.js +403 -0
- package/dist/health-cmd-TS7EMMCS.js +64 -0
- package/dist/history-MSD5DK6K.js +90 -0
- package/dist/index.d.ts +47 -47
- package/dist/index.js +29 -6
- package/dist/init-L6WAEOWX.js +432 -0
- package/dist/insights-RTZ3IZTD.js +63 -0
- package/dist/intelligence-service-TH52PCNJ.js +15 -0
- package/dist/keys-625DZBRM.js +116 -0
- package/dist/keyword-CW46RNRR.js +164 -0
- package/dist/logs-V33SHBIW.js +30 -0
- package/dist/mcp-DFEDPSEG.js +14 -0
- package/dist/mcp.js +14 -5
- package/dist/measurement-plan-6W37RUOP.js +42 -0
- package/dist/notify-DSUOT7WO.js +125 -0
- package/dist/organic-evidence-BMN6L4OB.js +53 -0
- package/dist/overview-WRRMBZ6S.js +213 -0
- package/dist/project-2GJIU3FE.js +460 -0
- package/dist/query-3XPMGJUA.js +211 -0
- package/dist/research-V433CKJ4.js +200 -0
- package/dist/results-export-RGBU7QQQ.js +27 -0
- package/dist/run-NIAC6OJN.js +31 -0
- package/dist/schedule-KDWXRIE7.js +177 -0
- package/dist/search-626MPUJN.js +42 -0
- package/dist/serve-73SMMASI.js +557 -0
- package/dist/session-7WWOETZB.js +47 -0
- package/dist/settings-VKFQO6F2.js +107 -0
- package/dist/skills-5HC5H7TE.js +33 -0
- package/dist/snapshot-BSJUHFBC.js +538 -0
- package/dist/src-F6HM73TN.js +316 -0
- package/dist/status-V4OWP7LZ.js +126 -0
- package/dist/support-ARF4HER7.js +24 -0
- package/dist/technical-aeo-TG7CGU3F.js +625 -0
- package/dist/telemetry-O2IUNUBW.js +118 -0
- package/dist/tools-2GJIDKND.js +41 -0
- package/dist/traffic-XV4I3UPH.js +1295 -0
- package/dist/users-VGBLDL5K.js +170 -0
- package/dist/visibility-stats-UKJYJ6PP.js +241 -0
- package/dist/wordpress-JZA7CGC6.js +600 -0
- package/package.json +1 -1
- package/dist/chunk-4QQYYRHV.js +0 -23082
- package/dist/cli-commands-FOJR3HHU.js +0 -15
- package/dist/intelligence-service-XQCNWAPL.js +0 -9
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createApiClient
|
|
3
|
+
} from "./chunk-B5J675KK.js";
|
|
4
|
+
import "./chunk-UQ3MOZGC.js";
|
|
5
|
+
import {
|
|
6
|
+
emitJsonl
|
|
7
|
+
} from "./chunk-Z7IUAJOF.js";
|
|
8
|
+
import "./chunk-AOJU5LKX.js";
|
|
9
|
+
import {
|
|
10
|
+
CliError,
|
|
11
|
+
EXIT_USER_ERROR
|
|
12
|
+
} from "./chunk-HGMYEDAQ.js";
|
|
13
|
+
import {
|
|
14
|
+
CheckScopes,
|
|
15
|
+
CheckStatuses
|
|
16
|
+
} from "./chunk-D6COIM3U.js";
|
|
17
|
+
import "./chunk-MLKGABMK.js";
|
|
18
|
+
|
|
19
|
+
// src/commands/doctor.ts
|
|
20
|
+
async function doctorCommand(opts) {
|
|
21
|
+
if (opts.all) {
|
|
22
|
+
await runDoctorAll(opts);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const client = createApiClient();
|
|
26
|
+
const report = await client.runDoctor({
|
|
27
|
+
project: opts.project,
|
|
28
|
+
checkIds: opts.checks,
|
|
29
|
+
...opts.reportMonth ? { reportMonth: opts.reportMonth } : {}
|
|
30
|
+
});
|
|
31
|
+
if (opts.format === "json") {
|
|
32
|
+
console.log(JSON.stringify(report, null, 2));
|
|
33
|
+
} else if (opts.format === "jsonl") {
|
|
34
|
+
emitJsonl(report.checks.map((check) => ({ project: report.project, ...check })));
|
|
35
|
+
} else {
|
|
36
|
+
printHumanReport(report);
|
|
37
|
+
}
|
|
38
|
+
if (report.summary.fail > 0) {
|
|
39
|
+
throw new CliError({
|
|
40
|
+
code: "DOCTOR_CHECKS_FAILED",
|
|
41
|
+
message: `${report.summary.fail} check${report.summary.fail === 1 ? "" : "s"} failed`,
|
|
42
|
+
exitCode: EXIT_USER_ERROR,
|
|
43
|
+
details: {
|
|
44
|
+
scope: report.scope,
|
|
45
|
+
project: report.project,
|
|
46
|
+
failed: report.checks.filter((c) => c.status === CheckStatuses.fail).map((c) => c.id)
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function runDoctorAll(opts) {
|
|
52
|
+
const client = createApiClient();
|
|
53
|
+
const projects = await client.listProjects();
|
|
54
|
+
const [globalReport, ...projectReports] = await Promise.all([
|
|
55
|
+
client.runDoctor({ checkIds: opts.checks, ...opts.reportMonth ? { reportMonth: opts.reportMonth } : {} }),
|
|
56
|
+
...projects.map((p) => client.runDoctor({ project: p.name, checkIds: opts.checks, ...opts.reportMonth ? { reportMonth: opts.reportMonth } : {} }))
|
|
57
|
+
]);
|
|
58
|
+
const byKey = { __global__: globalReport };
|
|
59
|
+
projects.forEach((p, i) => {
|
|
60
|
+
byKey[p.name] = projectReports[i];
|
|
61
|
+
});
|
|
62
|
+
if (opts.format === "json") {
|
|
63
|
+
console.log(JSON.stringify(byKey, null, 2));
|
|
64
|
+
} else if (opts.format === "jsonl") {
|
|
65
|
+
const scopes = ["__global__", ...projects.map((p) => p.name)];
|
|
66
|
+
emitJsonl(scopes.flatMap((key) => {
|
|
67
|
+
const project = key === "__global__" ? null : key;
|
|
68
|
+
return byKey[key].checks.map((check) => ({ project, ...check }));
|
|
69
|
+
}));
|
|
70
|
+
} else {
|
|
71
|
+
printAllHumanReport(byKey, projects.map((p) => p.name));
|
|
72
|
+
}
|
|
73
|
+
const totalFail = globalReport.summary.fail + projectReports.reduce((s, r) => s + r.summary.fail, 0);
|
|
74
|
+
if (totalFail > 0) {
|
|
75
|
+
const failedByScope = {};
|
|
76
|
+
if (globalReport.summary.fail > 0) {
|
|
77
|
+
failedByScope.__global__ = globalReport.checks.filter((c) => c.status === CheckStatuses.fail).map((c) => c.id);
|
|
78
|
+
}
|
|
79
|
+
projects.forEach((p, i) => {
|
|
80
|
+
const failed = projectReports[i].checks.filter((c) => c.status === CheckStatuses.fail).map((c) => c.id);
|
|
81
|
+
if (failed.length > 0) failedByScope[p.name] = failed;
|
|
82
|
+
});
|
|
83
|
+
throw new CliError({
|
|
84
|
+
code: "DOCTOR_CHECKS_FAILED",
|
|
85
|
+
message: `${totalFail} check${totalFail === 1 ? "" : "s"} failed across ${Object.keys(failedByScope).length} scope${Object.keys(failedByScope).length === 1 ? "" : "s"}`,
|
|
86
|
+
exitCode: EXIT_USER_ERROR,
|
|
87
|
+
details: { failed: failedByScope }
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function printAllHumanReport(byKey, projectNames) {
|
|
92
|
+
const scopes = ["__global__", ...projectNames];
|
|
93
|
+
console.log(`
|
|
94
|
+
canonry doctor \u2014 all scopes (${scopes.length})
|
|
95
|
+
`);
|
|
96
|
+
for (const key of scopes) {
|
|
97
|
+
const report = byKey[key];
|
|
98
|
+
const label = key === "__global__" ? "global" : `project "${key}"`;
|
|
99
|
+
const s = report.summary;
|
|
100
|
+
const tag = s.fail > 0 ? "[FAIL]" : s.warn > 0 ? "[WARN]" : "[OK] ";
|
|
101
|
+
console.log(` ${tag} ${label.padEnd(28)} ${s.ok} ok, ${s.warn} warn, ${s.fail} fail, ${s.skipped} skipped`);
|
|
102
|
+
if (s.fail > 0 || s.warn > 0) {
|
|
103
|
+
const attentionIds = report.checks.filter((c) => c.status === CheckStatuses.fail || c.status === CheckStatuses.warn).map((c) => `${c.id}: ${c.summary}`);
|
|
104
|
+
for (const line of attentionIds) {
|
|
105
|
+
console.log(` \u2717 ${line}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
console.log();
|
|
110
|
+
}
|
|
111
|
+
function statusBadge(status) {
|
|
112
|
+
switch (status) {
|
|
113
|
+
case CheckStatuses.ok:
|
|
114
|
+
return "[ok] ";
|
|
115
|
+
case CheckStatuses.warn:
|
|
116
|
+
return "[warn] ";
|
|
117
|
+
case CheckStatuses.fail:
|
|
118
|
+
return "[fail] ";
|
|
119
|
+
case CheckStatuses.skipped:
|
|
120
|
+
return "[skip] ";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function printHumanReport(report) {
|
|
124
|
+
const header = report.scope === CheckScopes.project && report.project ? `canonry doctor \u2014 project "${report.project}"` : "canonry doctor \u2014 global";
|
|
125
|
+
console.log(`
|
|
126
|
+
${header}`);
|
|
127
|
+
console.log(`(${report.summary.ok} ok, ${report.summary.warn} warn, ${report.summary.fail} fail, ${report.summary.skipped} skipped \u2014 ${report.durationMs}ms)
|
|
128
|
+
`);
|
|
129
|
+
if (report.checks.length === 0) {
|
|
130
|
+
console.log("No checks matched the requested filter.");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
134
|
+
for (const check of report.checks) {
|
|
135
|
+
const bucket = grouped.get(check.category) ?? [];
|
|
136
|
+
bucket.push(check);
|
|
137
|
+
grouped.set(check.category, bucket);
|
|
138
|
+
}
|
|
139
|
+
for (const [category, checks] of grouped) {
|
|
140
|
+
console.log(`${category.toUpperCase()}`);
|
|
141
|
+
for (const check of checks) {
|
|
142
|
+
console.log(` ${statusBadge(check.status)}${check.id} \u2014 ${check.summary}`);
|
|
143
|
+
if (check.remediation) {
|
|
144
|
+
console.log(` \u2192 ${check.remediation}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
console.log();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
doctorCommand
|
|
152
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createApiClient
|
|
3
|
+
} from "./chunk-B5J675KK.js";
|
|
4
|
+
import "./chunk-UQ3MOZGC.js";
|
|
5
|
+
import {
|
|
6
|
+
emitJsonl
|
|
7
|
+
} from "./chunk-Z7IUAJOF.js";
|
|
8
|
+
import "./chunk-AOJU5LKX.js";
|
|
9
|
+
import "./chunk-HGMYEDAQ.js";
|
|
10
|
+
import {
|
|
11
|
+
CitationStates
|
|
12
|
+
} from "./chunk-D6COIM3U.js";
|
|
13
|
+
import "./chunk-MLKGABMK.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/evidence.ts
|
|
16
|
+
function getClient() {
|
|
17
|
+
return createApiClient();
|
|
18
|
+
}
|
|
19
|
+
async function showEvidence(project, format) {
|
|
20
|
+
const client = getClient();
|
|
21
|
+
const timeline = await client.getTimeline(project);
|
|
22
|
+
if (format === "json") {
|
|
23
|
+
const enriched = timeline.map((entry) => ({
|
|
24
|
+
...entry,
|
|
25
|
+
cited: entry.runs[entry.runs.length - 1]?.citationState === CitationStates.cited
|
|
26
|
+
}));
|
|
27
|
+
console.log(JSON.stringify(enriched, null, 2));
|
|
28
|
+
return;
|
|
29
|
+
} else if (format === "jsonl") {
|
|
30
|
+
emitJsonl(timeline.map((entry) => ({
|
|
31
|
+
project,
|
|
32
|
+
...entry,
|
|
33
|
+
cited: entry.runs[entry.runs.length - 1]?.citationState === CitationStates.cited
|
|
34
|
+
})));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (timeline.length === 0) {
|
|
38
|
+
console.log('No query evidence yet. Trigger a run first with "canonry run".');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
console.log(`Evidence: ${project}
|
|
42
|
+
`);
|
|
43
|
+
for (const entry of timeline) {
|
|
44
|
+
const latest = entry.runs[entry.runs.length - 1];
|
|
45
|
+
if (!latest) continue;
|
|
46
|
+
const state = latest.citationState === CitationStates.cited ? "\u2713 cited" : "\u2717 not-cited";
|
|
47
|
+
const transition = latest.transition !== latest.citationState ? ` (${latest.transition})` : "";
|
|
48
|
+
console.log(` ${state}${transition} ${entry.query}`);
|
|
49
|
+
}
|
|
50
|
+
console.log(`
|
|
51
|
+
Queries: ${timeline.length}`);
|
|
52
|
+
const cited = timeline.filter((e) => e.runs[e.runs.length - 1]?.citationState === CitationStates.cited).length;
|
|
53
|
+
console.log(` Cited: ${cited} / ${timeline.length}`);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
showEvidence
|
|
57
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createApiClient
|
|
3
|
+
} from "./chunk-B5J675KK.js";
|
|
4
|
+
import "./chunk-UQ3MOZGC.js";
|
|
5
|
+
import "./chunk-AOJU5LKX.js";
|
|
6
|
+
import {
|
|
7
|
+
isEndpointMissing,
|
|
8
|
+
isMachineFormat
|
|
9
|
+
} from "./chunk-HGMYEDAQ.js";
|
|
10
|
+
import {
|
|
11
|
+
isRedactedNotificationUrl
|
|
12
|
+
} from "./chunk-D6COIM3U.js";
|
|
13
|
+
import "./chunk-MLKGABMK.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/export-cmd.ts
|
|
16
|
+
import { stringify } from "yaml";
|
|
17
|
+
async function exportProject(project, opts) {
|
|
18
|
+
const client = createApiClient();
|
|
19
|
+
const data = opts.includeSecrets ? await client.getExport(project, { includeSecrets: true }) : await client.getExport(project);
|
|
20
|
+
if (data.spec.notifications?.some((notification) => isRedactedNotificationUrl(notification.url))) {
|
|
21
|
+
console.error("Notification webhook URLs are redacted. Use --include-secrets with administrator authority to export them.");
|
|
22
|
+
}
|
|
23
|
+
if (opts.includeResults) {
|
|
24
|
+
const results = await loadLatestRunForExport(client, project);
|
|
25
|
+
if (results) data.results = results;
|
|
26
|
+
}
|
|
27
|
+
if (isMachineFormat(opts.format)) {
|
|
28
|
+
console.log(JSON.stringify(data, null, 2));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
console.log(stringify(data));
|
|
32
|
+
}
|
|
33
|
+
async function loadLatestRunForExport(client, project) {
|
|
34
|
+
try {
|
|
35
|
+
const latest = await client.getLatestRun(project);
|
|
36
|
+
return latest.run ?? null;
|
|
37
|
+
} catch (err) {
|
|
38
|
+
if (!isEndpointMissing(err)) throw err;
|
|
39
|
+
}
|
|
40
|
+
const runs = await client.listRuns(project);
|
|
41
|
+
if (runs.length === 0) return null;
|
|
42
|
+
const latestRun = runs.reduce(
|
|
43
|
+
(current, candidate) => candidate.createdAt > current.createdAt ? candidate : current
|
|
44
|
+
);
|
|
45
|
+
return client.getRun(latestRun.id);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
exportProject
|
|
49
|
+
};
|