@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,133 @@
1
+ import {
2
+ USAGE_TELEMETRY_HEADERS,
3
+ redactLogString
4
+ } from "./chunk-O4RMPA6H.js";
5
+
6
+ // ../api-routes/src/request-context.ts
7
+ import { AsyncLocalStorage } from "async_hooks";
8
+ var requestContext = new AsyncLocalStorage();
9
+ var MAX_REQUEST_CONTEXT_LENGTH = 512;
10
+ var ERROR_CODE_PATTERN = /^[A-Z][A-Z0-9_]{1,39}$/;
11
+ var MAX_ERROR_BODY_BYTES = 16384;
12
+ function errorCodeOfBody(payload) {
13
+ const text = typeof payload === "string" ? payload : Buffer.isBuffer(payload) ? payload.toString("utf8") : void 0;
14
+ if (!text || text.length > MAX_ERROR_BODY_BYTES || !text.trimStart().startsWith("{")) return void 0;
15
+ try {
16
+ const code = JSON.parse(text).error?.code;
17
+ return typeof code === "string" && ERROR_CODE_PATTERN.test(code) ? code : void 0;
18
+ } catch {
19
+ return void 0;
20
+ }
21
+ }
22
+ function getRequestContext(boundRequestId) {
23
+ const context = requestContext.getStore();
24
+ if (!context || context.completed && context.requestId !== boundRequestId) return void 0;
25
+ const { completed: _completed, ...safeContext } = context;
26
+ return safeContext;
27
+ }
28
+ function currentOutcomeAttribution() {
29
+ const context = getRequestContext();
30
+ return context ? { userAgent: context.userAgent, surfaceLabel: context.usageSurface, agentLabel: context.usageAgent } : void 0;
31
+ }
32
+ function requestAuditIdentity(request) {
33
+ const principal = request.principal;
34
+ if (!principal) return {};
35
+ if (principal.delegatedUser) {
36
+ return {
37
+ actor: `user:${principal.delegatedUser.id}`,
38
+ credentialId: request.apiKey?.id ?? principal.id
39
+ };
40
+ }
41
+ if (principal.kind === "user") return { actor: `user:${principal.id}` };
42
+ return {
43
+ actor: `api-key:${principal.id}`,
44
+ credentialId: request.apiKey?.id ?? principal.id
45
+ };
46
+ }
47
+ function headerValue(value) {
48
+ const first = Array.isArray(value) ? value[0] : value;
49
+ return first ? first.slice(0, MAX_REQUEST_CONTEXT_LENGTH) : void 0;
50
+ }
51
+ function registerRequestContext(app, options = {}) {
52
+ app.addHook("onRequest", (request, reply, done) => {
53
+ reply.header("x-request-id", request.id);
54
+ requestContext.run({
55
+ requestId: sanitizeRequestContext(request.id) ?? void 0,
56
+ userAgent: sanitizeRequestContext(request.headers["user-agent"]) ?? void 0,
57
+ actorSession: sanitizeRequestContext(request.headers["x-canonry-actor-session"]) ?? void 0,
58
+ method: request.method,
59
+ // Route template only, never a raw URL, query string, or route parameter.
60
+ route: request.routeOptions.url,
61
+ usageSurface: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.surface]),
62
+ usageAgent: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.agent])
63
+ }, done);
64
+ });
65
+ app.addHook("preHandler", (request, _reply, done) => {
66
+ populateIdentity(request);
67
+ done();
68
+ });
69
+ app.addHook("onError", (request, _reply, error, done) => {
70
+ populateIdentity(request);
71
+ const code = error.code;
72
+ const context = requestContext.getStore();
73
+ if (context && typeof code === "string" && ERROR_CODE_PATTERN.test(code)) context.errorCode = code;
74
+ done();
75
+ });
76
+ app.addHook("onSend", (_request, reply, payload, done) => {
77
+ if (reply.statusCode >= 400) {
78
+ const context = requestContext.getStore();
79
+ const code = context ? errorCodeOfBody(payload) : void 0;
80
+ if (context && code) context.errorCode = code;
81
+ }
82
+ done(null, payload);
83
+ });
84
+ app.addHook("onResponse", (request, reply, done) => {
85
+ populateIdentity(request);
86
+ const context = requestContext.getStore();
87
+ if (context) context.statusCode = reply.statusCode;
88
+ const route = request.routeOptions.url;
89
+ if (options.onRequestCompleted && route) {
90
+ try {
91
+ const kind = request.principal?.kind;
92
+ options.onRequestCompleted({
93
+ method: request.method,
94
+ route,
95
+ statusCode: reply.statusCode,
96
+ durationMs: reply.elapsedTime,
97
+ ...context?.errorCode && reply.statusCode >= 400 ? { errorCode: context.errorCode } : {},
98
+ userAgent: headerValue(request.headers["user-agent"]),
99
+ actorSession: headerValue(request.headers["x-canonry-actor-session"]),
100
+ principalKind: kind === "user" ? "user" : kind ? "api-key" : void 0,
101
+ usageLabels: {
102
+ surface: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.surface]),
103
+ agent: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.agent]),
104
+ mcpClient: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.mcpClient]),
105
+ mcpTool: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.mcpTool]),
106
+ mcpCall: headerValue(request.headers[USAGE_TELEMETRY_HEADERS.mcpCall])
107
+ }
108
+ });
109
+ } catch {
110
+ }
111
+ }
112
+ done();
113
+ if (context) context.completed = true;
114
+ });
115
+ }
116
+ function populateIdentity(request) {
117
+ const context = requestContext.getStore();
118
+ if (context) Object.assign(context, requestAuditIdentity(request));
119
+ }
120
+ function sanitizeRequestContext(value) {
121
+ const joined = Array.isArray(value) ? value.join(", ") : value;
122
+ if (!joined) return null;
123
+ const sanitized = redactLogString(joined).replace(/[\r\n]+/g, " ").trim().slice(0, MAX_REQUEST_CONTEXT_LENGTH);
124
+ return sanitized || null;
125
+ }
126
+
127
+ export {
128
+ getRequestContext,
129
+ currentOutcomeAttribution,
130
+ requestAuditIdentity,
131
+ registerRequestContext,
132
+ sanitizeRequestContext
133
+ };
@@ -0,0 +1,78 @@
1
+ import {
2
+ cloudflareQueueNameSchema
3
+ } from "./chunk-O4RMPA6H.js";
4
+
5
+ // src/cloudflare-traffic-config.ts
6
+ function unsupportedDeliveryMode(deliveryMode) {
7
+ const label = typeof deliveryMode === "string" ? ` "${deliveryMode}"` : "";
8
+ return new Error(`Unsupported Cloudflare traffic delivery mode${label}`);
9
+ }
10
+ function ensureConnections(config) {
11
+ if (!config.cloudflareTraffic) config.cloudflareTraffic = {};
12
+ if (!config.cloudflareTraffic.connections) config.cloudflareTraffic.connections = [];
13
+ return config.cloudflareTraffic.connections;
14
+ }
15
+ function normalizeCloudflareTrafficConnection(connection) {
16
+ const deliveryMode = connection.deliveryMode;
17
+ if (deliveryMode === "queue-pull") {
18
+ const queue = connection;
19
+ if (typeof queue.apiToken !== "string" || queue.apiToken.length === 0 || typeof queue.accountId !== "string" || queue.accountId.length === 0 || typeof queue.queueId !== "string" || queue.queueId.length === 0 || typeof queue.queueName !== "string" || !cloudflareQueueNameSchema.safeParse(queue.queueName).success || typeof queue.retentionSeconds !== "number" || !Number.isInteger(queue.retentionSeconds) || queue.retentionSeconds < 60 || queue.retentionSeconds > 1209600) {
20
+ throw new Error("Invalid Cloudflare queue-pull credential configuration");
21
+ }
22
+ return connection;
23
+ }
24
+ if (deliveryMode === "direct-push") return connection;
25
+ if (deliveryMode === void 0) {
26
+ return { ...connection, deliveryMode: "direct-push" };
27
+ }
28
+ throw unsupportedDeliveryMode(deliveryMode);
29
+ }
30
+ function getCloudflareTrafficConnection(config, projectName) {
31
+ const connection = (config.cloudflareTraffic?.connections ?? []).find((c) => c.projectName === projectName);
32
+ return connection ? normalizeCloudflareTrafficConnection(connection) : void 0;
33
+ }
34
+ function getCloudflareTrafficConnectionBySourceId(config, sourceId) {
35
+ const connection = (config.cloudflareTraffic?.connections ?? []).find((c) => c.sourceId === sourceId);
36
+ return connection ? normalizeCloudflareTrafficConnection(connection) : void 0;
37
+ }
38
+ function upsertCloudflareTrafficConnection(config, connection) {
39
+ normalizeCloudflareTrafficConnection(connection);
40
+ const connections = ensureConnections(config);
41
+ const index = connections.findIndex((c) => c.sourceId === connection.sourceId);
42
+ if (index === -1) {
43
+ connections.push(connection);
44
+ return connection;
45
+ }
46
+ connections[index] = connection;
47
+ return connection;
48
+ }
49
+ function removeCloudflareTrafficConnectionBySourceId(config, sourceId) {
50
+ const connections = config.cloudflareTraffic?.connections;
51
+ if (!connections?.length) return false;
52
+ const next = connections.filter((c) => c.sourceId !== sourceId);
53
+ if (next.length === connections.length) return false;
54
+ if (!config.cloudflareTraffic) return false;
55
+ config.cloudflareTraffic.connections = next;
56
+ if (next.length === 0) delete config.cloudflareTraffic;
57
+ return true;
58
+ }
59
+ function removeCloudflareTrafficConnection(config, projectName) {
60
+ const connections = config.cloudflareTraffic?.connections;
61
+ if (!connections?.length) return false;
62
+ const next = connections.filter((c) => c.projectName !== projectName);
63
+ if (next.length === connections.length) return false;
64
+ if (!config.cloudflareTraffic) return false;
65
+ config.cloudflareTraffic.connections = next;
66
+ if (next.length === 0) {
67
+ delete config.cloudflareTraffic;
68
+ }
69
+ return true;
70
+ }
71
+
72
+ export {
73
+ getCloudflareTrafficConnection,
74
+ getCloudflareTrafficConnectionBySourceId,
75
+ upsertCloudflareTrafficConnection,
76
+ removeCloudflareTrafficConnectionBySourceId,
77
+ removeCloudflareTrafficConnection
78
+ };