@ainyc/canonry 4.183.1 → 4.185.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 (31) hide show
  1. package/assets/assets/{AuditHistoryPanel-DM-2GC2i.js → AuditHistoryPanel-N0RYtAB2.js} +1 -1
  2. package/assets/assets/{BacklinksPage-YJU9B2RQ.js → BacklinksPage-Bou9tizz.js} +1 -1
  3. package/assets/assets/{HistoryPage-DcFzvVRB.js → HistoryPage-CXhga4Ph.js} +1 -1
  4. package/assets/assets/MeasurementPropertyPage-XvZ5N7OJ.js +1 -0
  5. package/assets/assets/ProjectPage-HRI4qMI7.js +9 -0
  6. package/assets/assets/{RunRow-6SFvSqhK.js → RunRow-C3D8VQYJ.js} +1 -1
  7. package/assets/assets/RunsPage-CpgzRa0M.js +1 -0
  8. package/assets/assets/{SettingsPage-DSS1eunM.js → SettingsPage-Bmx9pUOn.js} +1 -1
  9. package/assets/assets/{SiteHealthSection-CewNWjGo.js → SiteHealthSection-NLM9j7Eg.js} +3 -3
  10. package/assets/assets/{TrafficPage-DRZ1aqnG.js → TrafficPage-BYZhOBmP.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-vaBD4zHK.js → TrafficSourceDetailPage-D9H8w5_Y.js} +1 -1
  12. package/assets/assets/{extract-error-message-DD4JJz8j.js → extract-error-message-CH5Z1tok.js} +1 -1
  13. package/assets/assets/index-D2ciQ6Rc.js +86 -0
  14. package/assets/assets/{index-DwdK2e4e.css → index-D5UC9w71.css} +1 -1
  15. package/assets/assets/{react-sigma_core.esm.min-B8Wmi5Ko.js → react-sigma_core.esm.min-D6BeZvg8.js} +1 -1
  16. package/assets/index.html +2 -2
  17. package/dist/{chunk-AZJOCWZ4.js → chunk-4EMNAQR6.js} +11 -4
  18. package/dist/{chunk-VXPM6O4R.js → chunk-OVJJDBZY.js} +2 -2
  19. package/dist/{chunk-3SFCUICM.js → chunk-SCNSP2GV.js} +677 -391
  20. package/dist/{chunk-DU5Q5ZOX.js → chunk-U7XFRKLH.js} +5009 -4411
  21. package/dist/{chunk-7ATZMDG2.js → chunk-UXZCO5WK.js} +5377 -2339
  22. package/dist/cli.js +7687 -7787
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +4 -4
  25. package/dist/{intelligence-service-BQIIWWQJ.js → intelligence-service-WTRLQG5V.js} +2 -2
  26. package/dist/mcp.js +3 -3
  27. package/package.json +8 -8
  28. package/assets/assets/MeasurementPropertyPage-OQ3X0KHU.js +0 -1
  29. package/assets/assets/ProjectPage-CMZO1xb2.js +0 -9
  30. package/assets/assets/RunsPage-Chk_-IOW.js +0 -1
  31. package/assets/assets/index-BdR4Vlu6.js +0 -86
@@ -80,8 +80,11 @@ import {
80
80
  organicEvidencePeriodSchema,
81
81
  projectConfigSchema,
82
82
  projectUpsertRequestSchema,
83
+ providerQuotaPolicySchema,
83
84
  queryBatchRequestSchema,
84
85
  queryGenerateRequestSchema,
86
+ queryTrackingCommitRequestSchema,
87
+ queryTrackingPreviewRequestSchema,
85
88
  reportPeriodSchema,
86
89
  researchRunCreateSchema,
87
90
  runTriggerRequestSchema,
@@ -92,8 +95,69 @@ import {
92
95
  trafficConnectVercelRequestSchema,
93
96
  trafficConnectWordpressRequestSchema,
94
97
  trafficEventKindSchema,
95
- trafficSeriesGranularitySchema
96
- } from "./chunk-DU5Q5ZOX.js";
98
+ trafficSeriesGranularitySchema,
99
+ visibilityReportRequestSchema
100
+ } from "./chunk-U7XFRKLH.js";
101
+
102
+ // src/cli-error.ts
103
+ function isMachineFormat(format) {
104
+ return format === "json" || format === "jsonl";
105
+ }
106
+ var EXIT_USER_ERROR = 1;
107
+ var EXIT_SYSTEM_ERROR = 2;
108
+ var CliError = class extends Error {
109
+ code;
110
+ displayMessage;
111
+ details;
112
+ exitCode;
113
+ constructor(options) {
114
+ super(options.message);
115
+ this.name = "CliError";
116
+ this.code = options.code;
117
+ this.displayMessage = options.displayMessage;
118
+ this.details = options.details;
119
+ this.exitCode = options.exitCode ?? EXIT_USER_ERROR;
120
+ }
121
+ };
122
+ function usageError(displayMessage, options) {
123
+ const firstLine = displayMessage.split("\n", 1)[0] ?? "Error: invalid command usage";
124
+ return new CliError({
125
+ code: "CLI_USAGE_ERROR",
126
+ message: options?.message ?? firstLine.replace(/^Error:\s*/, ""),
127
+ displayMessage,
128
+ details: options?.details
129
+ });
130
+ }
131
+ function isEndpointMissing(err) {
132
+ if (!(err instanceof CliError)) return false;
133
+ const status = err.details?.httpStatus;
134
+ return status === 404 || status === 405;
135
+ }
136
+ function systemError(message, options) {
137
+ return new CliError({
138
+ code: "CLI_SYSTEM_ERROR",
139
+ message,
140
+ displayMessage: options?.displayMessage,
141
+ details: options?.details,
142
+ exitCode: EXIT_SYSTEM_ERROR
143
+ });
144
+ }
145
+ function printCliError(err, format) {
146
+ if (isMachineFormat(format)) {
147
+ const envelope = err instanceof CliError ? { error: { code: err.code, message: err.message, ...err.details ? { details: err.details } : {} } } : { error: { code: "CLI_ERROR", message: err instanceof Error ? err.message : "An unexpected error occurred" } };
148
+ console.error(JSON.stringify(envelope, null, format === "jsonl" ? 0 : 2));
149
+ return;
150
+ }
151
+ if (err instanceof CliError && err.displayMessage) {
152
+ console.error(err.displayMessage);
153
+ return;
154
+ }
155
+ if (err instanceof Error) {
156
+ console.error(`Error: ${err.message}`);
157
+ return;
158
+ }
159
+ console.error("An unexpected error occurred");
160
+ }
97
161
 
98
162
  // src/config.ts
99
163
  import fs from "fs";
@@ -101,6 +165,151 @@ import path from "path";
101
165
  import os from "os";
102
166
  import crypto from "crypto";
103
167
  import { parse, stringify } from "yaml";
168
+
169
+ // ../config/src/index.ts
170
+ import { z } from "zod";
171
+ var dashboardManagedSweepsSchema = z.boolean().nullish();
172
+ var envSchema = z.object({
173
+ DATABASE_URL: z.string().default("postgresql://aeo:aeo@postgres:5432/aeo_platform"),
174
+ API_PORT: z.coerce.number().int().positive().default(3e3),
175
+ WORKER_PORT: z.coerce.number().int().positive().default(3001),
176
+ WEB_PORT: z.coerce.number().int().positive().default(4173),
177
+ BOOTSTRAP_SECRET: z.string().default("change-me"),
178
+ CANONRY_BASE_PATH: z.string().default("/"),
179
+ // Gemini
180
+ GEMINI_API_KEY: z.string().optional(),
181
+ GEMINI_MODEL: z.string().optional(),
182
+ GEMINI_BASE_URL: z.string().optional(),
183
+ GEMINI_MAX_CONCURRENCY: z.coerce.number().int().positive().default(2),
184
+ GEMINI_MAX_REQUESTS_PER_MINUTE: z.coerce.number().int().positive().default(10),
185
+ GEMINI_MAX_REQUESTS_PER_DAY: z.coerce.number().int().positive().default(1e3),
186
+ // Gemini Vertex AI (alternative to API key auth)
187
+ GEMINI_VERTEX_PROJECT: z.string().optional(),
188
+ GEMINI_VERTEX_REGION: z.string().optional(),
189
+ GEMINI_VERTEX_CREDENTIALS: z.string().optional(),
190
+ // OpenAI
191
+ OPENAI_API_KEY: z.string().optional(),
192
+ OPENAI_MODEL: z.string().optional(),
193
+ OPENAI_BASE_URL: z.string().optional(),
194
+ OPENAI_MAX_CONCURRENCY: z.coerce.number().int().positive().default(2),
195
+ OPENAI_MAX_REQUESTS_PER_MINUTE: z.coerce.number().int().positive().default(10),
196
+ OPENAI_MAX_REQUESTS_PER_DAY: z.coerce.number().int().positive().default(1e3),
197
+ // Anthropic / Claude
198
+ ANTHROPIC_API_KEY: z.string().optional(),
199
+ ANTHROPIC_MODEL: z.string().optional(),
200
+ ANTHROPIC_MAX_CONCURRENCY: z.coerce.number().int().positive().default(2),
201
+ ANTHROPIC_MAX_REQUESTS_PER_MINUTE: z.coerce.number().int().positive().default(10),
202
+ ANTHROPIC_MAX_REQUESTS_PER_DAY: z.coerce.number().int().positive().default(1e3),
203
+ // Perplexity
204
+ PERPLEXITY_API_KEY: z.string().optional(),
205
+ PERPLEXITY_MODEL: z.string().optional(),
206
+ PERPLEXITY_MAX_CONCURRENCY: z.coerce.number().int().positive().default(2),
207
+ PERPLEXITY_MAX_REQUESTS_PER_MINUTE: z.coerce.number().int().positive().default(10),
208
+ PERPLEXITY_MAX_REQUESTS_PER_DAY: z.coerce.number().int().positive().default(1e3),
209
+ // Secret for HMAC-signing Google OAuth state parameters. Required for
210
+ // cloud deployments that mount googleRoutes; the plugin refuses to register
211
+ // without it (see packages/api-routes/src/google.ts).
212
+ GOOGLE_STATE_SECRET: z.string().optional()
213
+ });
214
+ var bootstrapEnvSchema = z.object({
215
+ CANONRY_API_KEY: z.string().optional(),
216
+ CANONRY_API_URL: z.string().optional(),
217
+ CANONRY_DATABASE_PATH: z.string().optional(),
218
+ GEMINI_API_KEY: z.string().optional(),
219
+ GEMINI_MODEL: z.string().optional(),
220
+ GEMINI_BASE_URL: z.string().optional(),
221
+ GEMINI_VERTEX_PROJECT: z.string().optional(),
222
+ GEMINI_VERTEX_REGION: z.string().optional(),
223
+ GEMINI_VERTEX_CREDENTIALS: z.string().optional(),
224
+ OPENAI_API_KEY: z.string().optional(),
225
+ OPENAI_MODEL: z.string().optional(),
226
+ OPENAI_BASE_URL: z.string().optional(),
227
+ ANTHROPIC_API_KEY: z.string().optional(),
228
+ ANTHROPIC_MODEL: z.string().optional(),
229
+ PERPLEXITY_API_KEY: z.string().optional(),
230
+ PERPLEXITY_MODEL: z.string().optional(),
231
+ LOCAL_BASE_URL: z.string().optional(),
232
+ LOCAL_API_KEY: z.string().optional(),
233
+ LOCAL_MODEL: z.string().optional(),
234
+ GOOGLE_CLIENT_ID: z.string().optional(),
235
+ GOOGLE_CLIENT_SECRET: z.string().optional()
236
+ });
237
+ function getBootstrapEnv(source, overrides) {
238
+ const filtered = overrides ? Object.fromEntries(Object.entries(overrides).filter(([, v]) => v != null)) : {};
239
+ const parsed = bootstrapEnvSchema.parse({ ...source, ...filtered });
240
+ const providers = {};
241
+ if (parsed.GEMINI_API_KEY || parsed.GEMINI_VERTEX_PROJECT) {
242
+ providers.gemini = {
243
+ apiKey: parsed.GEMINI_API_KEY ?? "",
244
+ model: parsed.GEMINI_MODEL || "gemini-2.5-flash",
245
+ baseUrl: parsed.GEMINI_BASE_URL,
246
+ quota: providerQuotaPolicySchema.parse({
247
+ maxConcurrency: 2,
248
+ maxRequestsPerMinute: 10,
249
+ maxRequestsPerDay: 500
250
+ }),
251
+ vertexProject: parsed.GEMINI_VERTEX_PROJECT,
252
+ vertexRegion: parsed.GEMINI_VERTEX_REGION,
253
+ vertexCredentials: parsed.GEMINI_VERTEX_CREDENTIALS
254
+ };
255
+ }
256
+ if (parsed.OPENAI_API_KEY) {
257
+ providers.openai = {
258
+ apiKey: parsed.OPENAI_API_KEY,
259
+ model: parsed.OPENAI_MODEL || "gpt-5.4",
260
+ baseUrl: parsed.OPENAI_BASE_URL,
261
+ quota: providerQuotaPolicySchema.parse({
262
+ maxConcurrency: 2,
263
+ maxRequestsPerMinute: 10,
264
+ maxRequestsPerDay: 500
265
+ })
266
+ };
267
+ }
268
+ if (parsed.ANTHROPIC_API_KEY) {
269
+ providers.claude = {
270
+ apiKey: parsed.ANTHROPIC_API_KEY,
271
+ model: parsed.ANTHROPIC_MODEL || "claude-sonnet-4-6",
272
+ quota: providerQuotaPolicySchema.parse({
273
+ maxConcurrency: 2,
274
+ maxRequestsPerMinute: 10,
275
+ maxRequestsPerDay: 500
276
+ })
277
+ };
278
+ }
279
+ if (parsed.PERPLEXITY_API_KEY) {
280
+ providers.perplexity = {
281
+ apiKey: parsed.PERPLEXITY_API_KEY,
282
+ model: parsed.PERPLEXITY_MODEL || "sonar",
283
+ quota: providerQuotaPolicySchema.parse({
284
+ maxConcurrency: 2,
285
+ maxRequestsPerMinute: 10,
286
+ maxRequestsPerDay: 500
287
+ })
288
+ };
289
+ }
290
+ if (parsed.LOCAL_BASE_URL) {
291
+ providers.local = {
292
+ baseUrl: parsed.LOCAL_BASE_URL,
293
+ apiKey: parsed.LOCAL_API_KEY,
294
+ model: parsed.LOCAL_MODEL || "llama3",
295
+ quota: providerQuotaPolicySchema.parse({
296
+ maxConcurrency: 2,
297
+ maxRequestsPerMinute: 10,
298
+ maxRequestsPerDay: 500
299
+ })
300
+ };
301
+ }
302
+ return {
303
+ apiKey: parsed.CANONRY_API_KEY,
304
+ apiUrl: parsed.CANONRY_API_URL,
305
+ databasePath: parsed.CANONRY_DATABASE_PATH,
306
+ googleClientId: parsed.GOOGLE_CLIENT_ID,
307
+ googleClientSecret: parsed.GOOGLE_CLIENT_SECRET,
308
+ providers
309
+ };
310
+ }
311
+
312
+ // src/config.ts
104
313
  function normalizeGoogleConfig(config) {
105
314
  if (!config.google) return;
106
315
  config.google.connections = (config.google.connections ?? []).map((connection) => ({
@@ -181,6 +390,12 @@ Keep the original API key and database path. Do not share secrets.
181
390
  Do not use "canonry init --force" for recovery. It replaces credentials without a backup.`
182
391
  );
183
392
  }
393
+ if (!dashboardManagedSweepsSchema.safeParse(parsed.dashboard?.managedSweeps).success) {
394
+ throw new CliError({
395
+ code: "CONFIG_INVALID",
396
+ message: `Invalid config at ${configPath}: dashboard.managedSweeps must be true, false, or left blank.`
397
+ });
398
+ }
184
399
  if (parsed.geminiApiKey && !parsed.providers?.gemini) {
185
400
  parsed.providers = {
186
401
  ...parsed.providers,
@@ -346,66 +561,6 @@ function configExists() {
346
561
  return fs.existsSync(getConfigPath());
347
562
  }
348
563
 
349
- // src/cli-error.ts
350
- function isMachineFormat(format) {
351
- return format === "json" || format === "jsonl";
352
- }
353
- var EXIT_USER_ERROR = 1;
354
- var EXIT_SYSTEM_ERROR = 2;
355
- var CliError = class extends Error {
356
- code;
357
- displayMessage;
358
- details;
359
- exitCode;
360
- constructor(options) {
361
- super(options.message);
362
- this.name = "CliError";
363
- this.code = options.code;
364
- this.displayMessage = options.displayMessage;
365
- this.details = options.details;
366
- this.exitCode = options.exitCode ?? EXIT_USER_ERROR;
367
- }
368
- };
369
- function usageError(displayMessage, options) {
370
- const firstLine = displayMessage.split("\n", 1)[0] ?? "Error: invalid command usage";
371
- return new CliError({
372
- code: "CLI_USAGE_ERROR",
373
- message: options?.message ?? firstLine.replace(/^Error:\s*/, ""),
374
- displayMessage,
375
- details: options?.details
376
- });
377
- }
378
- function isEndpointMissing(err) {
379
- if (!(err instanceof CliError)) return false;
380
- const status = err.details?.httpStatus;
381
- return status === 404 || status === 405;
382
- }
383
- function systemError(message, options) {
384
- return new CliError({
385
- code: "CLI_SYSTEM_ERROR",
386
- message,
387
- displayMessage: options?.displayMessage,
388
- details: options?.details,
389
- exitCode: EXIT_SYSTEM_ERROR
390
- });
391
- }
392
- function printCliError(err, format) {
393
- if (isMachineFormat(format)) {
394
- const envelope = err instanceof CliError ? { error: { code: err.code, message: err.message, ...err.details ? { details: err.details } : {} } } : { error: { code: "CLI_ERROR", message: err instanceof Error ? err.message : "An unexpected error occurred" } };
395
- console.error(JSON.stringify(envelope, null, format === "jsonl" ? 0 : 2));
396
- return;
397
- }
398
- if (err instanceof CliError && err.displayMessage) {
399
- console.error(err.displayMessage);
400
- return;
401
- }
402
- if (err instanceof Error) {
403
- console.error(`Error: ${err.message}`);
404
- return;
405
- }
406
- console.error("An unexpected error occurred");
407
- }
408
-
409
564
  // ../api-client-generated/src/generated/core/bodySerializer.gen.ts
410
565
  var jsonBodySerializer = {
411
566
  bodySerializer: (body) => JSON.stringify(
@@ -1875,6 +2030,18 @@ var getApiV1ProjectsByNameMeasurementOverview = (options) => {
1875
2030
  ...options
1876
2031
  });
1877
2032
  };
2033
+ var getApiV1ProjectsByNameVisibilityReport = (options) => {
2034
+ return (options.client ?? client).get({
2035
+ security: [
2036
+ {
2037
+ scheme: "bearer",
2038
+ type: "http"
2039
+ }
2040
+ ],
2041
+ url: "/api/v1/projects/{name}/visibility-report",
2042
+ ...options
2043
+ });
2044
+ };
1878
2045
  var getApiV1ProjectsByNameMeasurementPropertyEvidence = (options) => {
1879
2046
  return (options.client ?? client).get({
1880
2047
  security: [
@@ -2107,6 +2274,50 @@ var postApiV1ProjectsByNameResearchRuns = (options) => {
2107
2274
  }
2108
2275
  });
2109
2276
  };
2277
+ var getApiV1ProjectsByNameQueryTracking = (options) => {
2278
+ return (options.client ?? client).get({
2279
+ security: [
2280
+ {
2281
+ scheme: "bearer",
2282
+ type: "http"
2283
+ }
2284
+ ],
2285
+ url: "/api/v1/projects/{name}/query-tracking",
2286
+ ...options
2287
+ });
2288
+ };
2289
+ var postApiV1ProjectsByNameQueryTrackingPreview = (options) => {
2290
+ return (options.client ?? client).post({
2291
+ security: [
2292
+ {
2293
+ scheme: "bearer",
2294
+ type: "http"
2295
+ }
2296
+ ],
2297
+ url: "/api/v1/projects/{name}/query-tracking/preview",
2298
+ ...options,
2299
+ headers: {
2300
+ "Content-Type": "application/json",
2301
+ ...options.headers
2302
+ }
2303
+ });
2304
+ };
2305
+ var postApiV1ProjectsByNameQueryTrackingCommit = (options) => {
2306
+ return (options.client ?? client).post({
2307
+ security: [
2308
+ {
2309
+ scheme: "bearer",
2310
+ type: "http"
2311
+ }
2312
+ ],
2313
+ url: "/api/v1/projects/{name}/query-tracking/commit",
2314
+ ...options,
2315
+ headers: {
2316
+ "Content-Type": "application/json",
2317
+ ...options.headers
2318
+ }
2319
+ });
2320
+ };
2110
2321
  var getApiV1ProjectsByNameResearchRunsByRunId = (options) => {
2111
2322
  return (options.client ?? client).get({
2112
2323
  security: [
@@ -7823,6 +8034,33 @@ var ApiClient = class {
7823
8034
  })
7824
8035
  );
7825
8036
  }
8037
+ async getVisibilityReport(project, request) {
8038
+ return this.invoke(() => getApiV1ProjectsByNameVisibilityReport({
8039
+ client: this.heyClient,
8040
+ path: { name: project },
8041
+ query: request
8042
+ }));
8043
+ }
8044
+ async getQueryTrackingWorkspace(project) {
8045
+ return this.invoke(() => getApiV1ProjectsByNameQueryTracking({
8046
+ client: this.heyClient,
8047
+ path: { name: project }
8048
+ }));
8049
+ }
8050
+ async previewQueryTracking(project, request) {
8051
+ return this.invoke(() => postApiV1ProjectsByNameQueryTrackingPreview({
8052
+ client: this.heyClient,
8053
+ path: { name: project },
8054
+ body: request
8055
+ }));
8056
+ }
8057
+ async commitQueryTracking(project, request) {
8058
+ return this.invoke(() => postApiV1ProjectsByNameQueryTrackingCommit({
8059
+ client: this.heyClient,
8060
+ path: { name: project },
8061
+ body: request
8062
+ }));
8063
+ }
7826
8064
  async getDiscoveryHarvest(project, sessionId, opts) {
7827
8065
  return this.invoke(
7828
8066
  () => getApiV1ProjectsByNameDiscoverSessionsByIdHarvest({
@@ -8445,7 +8683,7 @@ var ApiClient = class {
8445
8683
 
8446
8684
  // src/mcp/server.ts
8447
8685
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8448
- import { z as z4 } from "zod";
8686
+ import { z as z5 } from "zod";
8449
8687
 
8450
8688
  // src/package-version.ts
8451
8689
  import { createRequire } from "module";
@@ -8453,27 +8691,27 @@ var _require = createRequire(import.meta.url);
8453
8691
  var PACKAGE_VERSION = _require("../package.json").version;
8454
8692
 
8455
8693
  // src/mcp/tool-registry.ts
8456
- import { z as z3 } from "zod";
8694
+ import { z as z4 } from "zod";
8457
8695
 
8458
8696
  // src/measurement-draft-actions.ts
8459
- import { z } from "zod";
8460
- var idempotencyKeySchema = z.string().trim().min(1).describe(
8697
+ import { z as z2 } from "zod";
8698
+ var idempotencyKeySchema = z2.string().trim().min(1).describe(
8461
8699
  "A fresh request key. Reuse it only when retrying the identical request."
8462
8700
  );
8463
- var draftEtagSchema = z.string().trim().min(1).optional().describe(
8701
+ var draftEtagSchema = z2.string().trim().min(1).optional().describe(
8464
8702
  "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."
8465
8703
  );
8466
8704
  function mutationOperationSchema(action, request) {
8467
- return z.object({
8468
- action: z.literal(action),
8705
+ return z2.object({
8706
+ action: z2.literal(action),
8469
8707
  request,
8470
8708
  etag: draftEtagSchema,
8471
8709
  idempotencyKey: idempotencyKeySchema
8472
8710
  }).strict().describe(`Operation for ${action}.`);
8473
8711
  }
8474
- var measurementDraftOperationSchema = z.discriminatedUnion("action", [
8475
- z.object({
8476
- action: z.literal("create"),
8712
+ var measurementDraftOperationSchema = z2.discriminatedUnion("action", [
8713
+ z2.object({
8714
+ action: z2.literal("create"),
8477
8715
  request: measurementDraftCreateRequestSchema,
8478
8716
  idempotencyKey: idempotencyKeySchema
8479
8717
  }).strict().describe("Operation for create."),
@@ -8485,8 +8723,8 @@ var measurementDraftOperationSchema = z.discriminatedUnion("action", [
8485
8723
  mutationOperationSchema("exclude-target", measurementDraftExcludeTargetRequestSchema),
8486
8724
  mutationOperationSchema("rebind-target", measurementDraftRebindTargetRequestSchema),
8487
8725
  mutationOperationSchema("apply-assignments", measurementDraftApplyAssignmentsRequestSchema),
8488
- z.object({
8489
- action: z.literal("preview-assignments"),
8726
+ z2.object({
8727
+ action: z2.literal("preview-assignments"),
8490
8728
  request: measurementDraftPreviewAssignmentsRequestSchema
8491
8729
  }).strict().describe("Read-semantic assignment impact preview."),
8492
8730
  mutationOperationSchema("replace-assignments", measurementDraftReplaceAssignmentsRequestSchema),
@@ -8496,18 +8734,18 @@ var measurementDraftOperationSchema = z.discriminatedUnion("action", [
8496
8734
  mutationOperationSchema("classify-assignments", measurementDraftClassifyAssignmentsRequestSchema),
8497
8735
  mutationOperationSchema("upsert-group", measurementDraftUpsertGroupRequestSchema),
8498
8736
  mutationOperationSchema("remove-group", measurementDraftRemoveGroupRequestSchema),
8499
- z.object({
8500
- action: z.literal("preview-group-membership"),
8737
+ z2.object({
8738
+ action: z2.literal("preview-group-membership"),
8501
8739
  request: measurementDraftPreviewGroupMembershipRequestSchema
8502
8740
  }).strict().describe("Read-semantic CSV group-membership preview."),
8503
8741
  mutationOperationSchema("apply-group-membership", measurementDraftApplyGroupMembershipRequestSchema),
8504
8742
  mutationOperationSchema("upsert-competitor", measurementDraftUpsertCompetitorRequestSchema),
8505
8743
  mutationOperationSchema("remove-competitor", measurementDraftRemoveCompetitorRequestSchema),
8506
- z.object({ action: z.literal("compile-preview") }).strict().describe("Operation for compile-preview."),
8507
- z.object({ action: z.literal("diff-preview") }).strict().describe("Operation for diff-preview."),
8744
+ z2.object({ action: z2.literal("compile-preview") }).strict().describe("Operation for compile-preview."),
8745
+ z2.object({ action: z2.literal("diff-preview") }).strict().describe("Operation for diff-preview."),
8508
8746
  mutationOperationSchema("publish", measurementDraftPublishRequestSchema),
8509
- z.object({
8510
- action: z.literal("discard"),
8747
+ z2.object({
8748
+ action: z2.literal("discard"),
8511
8749
  etag: draftEtagSchema,
8512
8750
  idempotencyKey: idempotencyKeySchema
8513
8751
  }).strict().describe("Operation for discard.")
@@ -8568,18 +8806,18 @@ function runMeasurementDraftAction(client2, project, actionInput) {
8568
8806
  }
8569
8807
 
8570
8808
  // src/mcp/schema.ts
8571
- import { z as z2 } from "zod";
8572
- var projectNameSchema = z2.string().min(1).describe("Canonry project name.");
8573
- var runIdSchema = z2.string().min(1).describe("Canonry run ID.");
8574
- var insightIdSchema = z2.string().min(1).describe("Canonry insight ID.");
8575
- var analyticsWindowSchema = z2.enum(["7d", "30d", "90d", "all"]).describe("Analytics time window.");
8576
- var emptyInputSchema = z2.object({});
8577
- var projectInputSchema = z2.object({
8809
+ import { z as z3 } from "zod";
8810
+ var projectNameSchema = z3.string().min(1).describe("Canonry project name.");
8811
+ var runIdSchema = z3.string().min(1).describe("Canonry run ID.");
8812
+ var insightIdSchema = z3.string().min(1).describe("Canonry insight ID.");
8813
+ var analyticsWindowSchema = z3.enum(["7d", "30d", "90d", "all"]).describe("Analytics time window.");
8814
+ var emptyInputSchema = z3.object({});
8815
+ var projectInputSchema = z3.object({
8578
8816
  project: projectNameSchema
8579
8817
  });
8580
8818
  function toJsonSchema(schema, name) {
8581
8819
  return {
8582
- ...z2.toJSONSchema(schema, { target: "draft-7" }),
8820
+ ...z3.toJSONSchema(schema, { target: "draft-7" }),
8583
8821
  title: name
8584
8822
  };
8585
8823
  }
@@ -8625,20 +8863,20 @@ function defineTool(tool) {
8625
8863
  inputJsonSchema: toJsonSchema(tool.inputSchema, tool.name)
8626
8864
  };
8627
8865
  }
8628
- var runTriggerInputSchema = z3.object({
8866
+ var runTriggerInputSchema = z4.object({
8629
8867
  project: projectNameSchema,
8630
8868
  request: runTriggerRequestSchema.optional()
8631
8869
  });
8632
- var measurementPlanVersionInputSchema = z3.object({ project: projectNameSchema, revision: z3.number().int().positive() });
8870
+ var measurementPlanVersionInputSchema = z4.object({ project: projectNameSchema, revision: z4.number().int().positive() });
8633
8871
  var measurementReportInputSchema = measurementPlanVersionInputSchema.extend({
8634
8872
  runId: runIdSchema.optional().describe("Exact eligible full measurement run to reconstruct. Omit for the latest run in the revision.")
8635
8873
  });
8636
- var measurementPlanPreviewInputSchema = z3.object({ project: projectNameSchema, plan: measurementPlanAuthoringSchema });
8874
+ var measurementPlanPreviewInputSchema = z4.object({ project: projectNameSchema, plan: measurementPlanAuthoringSchema });
8637
8875
  var measurementPlanPublishInputSchema = measurementPlanPublishRequestSchema.extend({ project: projectNameSchema });
8638
- var measurementPlanRetireInputSchema = z3.object({ project: projectNameSchema, stableKey: z3.string().min(1) });
8876
+ var measurementPlanRetireInputSchema = z4.object({ project: projectNameSchema, stableKey: z4.string().min(1) });
8639
8877
  var measurementDiscoveryInputSchema = measurementDiscoveryRequestSchema.extend({ project: projectNameSchema });
8640
- var idempotencyKeyInputSchema = z3.string().trim().min(1).describe("A fresh request key. Reuse it only when retrying the identical request.");
8641
- var measurementOverviewInputSchema = z3.object({
8878
+ var idempotencyKeyInputSchema = z4.string().trim().min(1).describe("A fresh request key. Reuse it only when retrying the identical request.");
8879
+ var measurementOverviewInputSchema = z4.object({
8642
8880
  project: projectNameSchema,
8643
8881
  scope: measurementOverviewQuerySchema.shape.scope.describe("Read all Properties, one reporting group, or one Property."),
8644
8882
  groupKey: measurementOverviewQuerySchema.shape.groupKey.describe("Group stable key. Required only for group scope."),
@@ -8693,16 +8931,16 @@ var measurementDataQualityInputSchema = measurementDataQualityQuerySchema.extend
8693
8931
  project: projectNameSchema
8694
8932
  }).strict();
8695
8933
  var measurementDraftCollectionInputSchema = measurementDraftCollectionQuerySchema.extend({ project: projectNameSchema });
8696
- var measurementQuerySetInputSchema = z3.object({
8934
+ var measurementQuerySetInputSchema = z4.object({
8697
8935
  project: projectNameSchema,
8698
- setId: z3.string().trim().min(1)
8936
+ setId: z4.string().trim().min(1)
8699
8937
  }).strict();
8700
8938
  var measurementQuerySetUpsertInputSchema = measurementQuerySetInputSchema.extend({
8701
8939
  request: measurementQuerySetUpsertRequestSchema
8702
8940
  }).strict();
8703
- var measurementQueryTemplateInputSchema = z3.object({
8941
+ var measurementQueryTemplateInputSchema = z4.object({
8704
8942
  project: projectNameSchema,
8705
- templateId: z3.string().trim().min(1)
8943
+ templateId: z4.string().trim().min(1)
8706
8944
  }).strict();
8707
8945
  var measurementQueryTemplateUpsertInputSchema = measurementQueryTemplateInputSchema.extend({
8708
8946
  request: measurementQueryTemplateUpsertRequestSchema
@@ -8715,7 +8953,7 @@ var measurementPlanDeactivateInputSchema = measurementPlanDeactivateRequestSchem
8715
8953
  project: projectNameSchema,
8716
8954
  idempotencyKey: idempotencyKeyInputSchema
8717
8955
  }).strict();
8718
- var measurementDraftActionInputSchema = z3.object({
8956
+ var measurementDraftActionInputSchema = z4.object({
8719
8957
  project: projectNameSchema,
8720
8958
  operation: measurementDraftOperationSchema.describe("Typed draft operation. Select exactly one action branch.")
8721
8959
  }).strict();
@@ -8746,97 +8984,97 @@ var measurementDraftActionOpenApiOperations = [
8746
8984
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/publish",
8747
8985
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/discard"
8748
8986
  ];
8749
- var runsListInputSchema = z3.object({
8987
+ var runsListInputSchema = z4.object({
8750
8988
  project: projectNameSchema,
8751
- limit: z3.number().int().positive().max(500).optional()
8989
+ limit: z4.number().int().positive().max(500).optional()
8752
8990
  });
8753
- var runGetInputSchema = z3.object({
8991
+ var runGetInputSchema = z4.object({
8754
8992
  runId: runIdSchema
8755
8993
  });
8756
- var timelineInputSchema = z3.object({
8994
+ var timelineInputSchema = z4.object({
8757
8995
  project: projectNameSchema,
8758
- location: z3.string().optional().describe("Location label. Use an empty string for locationless results."),
8759
- limit: z3.number().int().positive().max(100).optional().describe("Restrict history to the most recent N project runs.")
8996
+ location: z4.string().optional().describe("Location label. Use an empty string for locationless results."),
8997
+ limit: z4.number().int().positive().max(100).optional().describe("Restrict history to the most recent N project runs.")
8760
8998
  });
8761
8999
  var historyFilterShape = {
8762
- limit: z3.number().int().positive().max(500).optional(),
8763
- offset: z3.number().int().nonnegative().optional(),
8764
- since: z3.string().optional().describe("ISO 8601 lower bound."),
8765
- action: z3.string().optional().describe("Exact audit action filter."),
8766
- actor: z3.string().optional().describe("Exact actor filter."),
8767
- entityType: z3.string().optional().describe("Exact entity type filter.")
8768
- };
8769
- var projectHistoryInputSchema = z3.object({ project: projectNameSchema, ...historyFilterShape });
8770
- var globalHistoryInputSchema = z3.object(historyFilterShape);
8771
- var snapshotsListInputSchema = z3.object({
9000
+ limit: z4.number().int().positive().max(500).optional(),
9001
+ offset: z4.number().int().nonnegative().optional(),
9002
+ since: z4.string().optional().describe("ISO 8601 lower bound."),
9003
+ action: z4.string().optional().describe("Exact audit action filter."),
9004
+ actor: z4.string().optional().describe("Exact actor filter."),
9005
+ entityType: z4.string().optional().describe("Exact entity type filter.")
9006
+ };
9007
+ var projectHistoryInputSchema = z4.object({ project: projectNameSchema, ...historyFilterShape });
9008
+ var globalHistoryInputSchema = z4.object(historyFilterShape);
9009
+ var snapshotsListInputSchema = z4.object({
8772
9010
  project: projectNameSchema,
8773
- limit: z3.number().int().positive().max(500).optional(),
8774
- offset: z3.number().int().nonnegative().optional(),
8775
- location: z3.string().optional().describe("Location label. Use an empty string for locationless results.")
9011
+ limit: z4.number().int().positive().max(500).optional(),
9012
+ offset: z4.number().int().nonnegative().optional(),
9013
+ location: z4.string().optional().describe("Location label. Use an empty string for locationless results.")
8776
9014
  });
8777
- var snapshotsDiffInputSchema = z3.object({
9015
+ var snapshotsDiffInputSchema = z4.object({
8778
9016
  project: projectNameSchema,
8779
9017
  run1: runIdSchema,
8780
9018
  run2: runIdSchema
8781
9019
  });
8782
- var insightsListInputSchema = z3.object({
9020
+ var insightsListInputSchema = z4.object({
8783
9021
  project: projectNameSchema,
8784
- dismissed: z3.boolean().optional(),
9022
+ dismissed: z4.boolean().optional(),
8785
9023
  runId: runIdSchema.optional()
8786
9024
  });
8787
- var insightInputSchema = z3.object({
9025
+ var insightInputSchema = z4.object({
8788
9026
  project: projectNameSchema,
8789
9027
  insightId: insightIdSchema
8790
9028
  });
8791
- var healthHistoryInputSchema = z3.object({
9029
+ var healthHistoryInputSchema = z4.object({
8792
9030
  project: projectNameSchema,
8793
- limit: z3.number().int().positive().max(100).optional()
9031
+ limit: z4.number().int().positive().max(100).optional()
8794
9032
  });
8795
- var gscPerformanceInputSchema = z3.object({
9033
+ var gscPerformanceInputSchema = z4.object({
8796
9034
  project: projectNameSchema,
8797
- startDate: z3.string().optional(),
8798
- endDate: z3.string().optional(),
8799
- query: z3.string().optional(),
8800
- page: z3.string().optional(),
8801
- limit: z3.number().int().positive().max(5e3).optional(),
8802
- offset: z3.number().int().nonnegative().optional(),
9035
+ startDate: z4.string().optional(),
9036
+ endDate: z4.string().optional(),
9037
+ query: z4.string().optional(),
9038
+ page: z4.string().optional(),
9039
+ limit: z4.number().int().positive().max(5e3).optional(),
9040
+ offset: z4.number().int().nonnegative().optional(),
8803
9041
  orderBy: gscPerformanceOrderBySchema.optional(),
8804
9042
  window: analyticsWindowSchema.optional()
8805
9043
  });
8806
- var gscPerformanceDailyInputSchema = z3.object({
9044
+ var gscPerformanceDailyInputSchema = z4.object({
8807
9045
  project: projectNameSchema,
8808
- startDate: z3.string().optional(),
8809
- endDate: z3.string().optional(),
9046
+ startDate: z4.string().optional(),
9047
+ endDate: z4.string().optional(),
8810
9048
  window: analyticsWindowSchema.optional()
8811
9049
  });
8812
- var gscTopPagesInputSchema = z3.object({
9050
+ var gscTopPagesInputSchema = z4.object({
8813
9051
  project: projectNameSchema,
8814
- startDate: z3.string().optional(),
8815
- endDate: z3.string().optional(),
8816
- limit: z3.number().int().positive().max(500).optional(),
9052
+ startDate: z4.string().optional(),
9053
+ endDate: z4.string().optional(),
9054
+ limit: z4.number().int().positive().max(500).optional(),
8817
9055
  window: analyticsWindowSchema.optional()
8818
9056
  });
8819
- var gscInspectionsInputSchema = z3.object({
9057
+ var gscInspectionsInputSchema = z4.object({
8820
9058
  project: projectNameSchema,
8821
- url: z3.string().optional(),
8822
- limit: z3.number().int().positive().max(500).optional()
9059
+ url: z4.string().optional(),
9060
+ limit: z4.number().int().positive().max(500).optional()
8823
9061
  });
8824
- var gscCoverageHistoryInputSchema = z3.object({
9062
+ var gscCoverageHistoryInputSchema = z4.object({
8825
9063
  project: projectNameSchema,
8826
- limit: z3.number().int().positive().max(500).optional()
9064
+ limit: z4.number().int().positive().max(500).optional()
8827
9065
  });
8828
- var gscSitemapsInputSchema = z3.object({
9066
+ var gscSitemapsInputSchema = z4.object({
8829
9067
  project: projectNameSchema,
8830
- sitemapIndex: z3.string().url().optional()
9068
+ sitemapIndex: z4.string().url().optional()
8831
9069
  });
8832
- var gscSitemapsSubmitInputSchema = z3.union([
8833
- z3.object({
9070
+ var gscSitemapsSubmitInputSchema = z4.union([
9071
+ z4.object({
8834
9072
  project: projectNameSchema,
8835
- sitemapUrls: z3.array(z3.string().url()).min(1).max(50)
9073
+ sitemapUrls: z4.array(z4.string().url()).min(1).max(50)
8836
9074
  }).strict(),
8837
- z3.object({
9075
+ z4.object({
8838
9076
  project: projectNameSchema,
8839
- mode: z3.enum(["indexes", "all-files"])
9077
+ mode: z4.enum(["indexes", "all-files"])
8840
9078
  }).strict()
8841
9079
  ]);
8842
9080
  async function submitGscSitemapsFromMcp(client2, input) {
@@ -8911,82 +9149,82 @@ async function submitGscSitemapsFromMcp(client2, input) {
8911
9149
  }
8912
9150
  return aggregate;
8913
9151
  }
8914
- var gaWindowInputSchema = z3.object({
9152
+ var gaWindowInputSchema = z4.object({
8915
9153
  project: projectNameSchema,
8916
9154
  window: analyticsWindowSchema.optional(),
8917
- startDate: z3.string().optional(),
8918
- endDate: z3.string().optional()
9155
+ startDate: z4.string().optional(),
9156
+ endDate: z4.string().optional()
8919
9157
  });
8920
9158
  var GA_RANGE_PARAMS = ["window", "startDate", "endDate"];
8921
9159
  var gaTrafficInputSchema = gaWindowInputSchema.extend({
8922
- limit: z3.number().int().positive().max(500).optional()
9160
+ limit: z4.number().int().positive().max(500).optional()
8923
9161
  });
8924
- var gaMeasurementAnalysisInputSchema = z3.object({
9162
+ var gaMeasurementAnalysisInputSchema = z4.object({
8925
9163
  project: projectNameSchema,
8926
9164
  window: gaMeasurementAnalysisWindowSchema.optional(),
8927
9165
  hostScope: gaMeasurementHostScopeSchema.optional(),
8928
- pathPrefix: z3.string().min(1).optional(),
8929
- limit: z3.number().int().positive().max(100).optional()
9166
+ pathPrefix: z4.string().min(1).optional(),
9167
+ limit: z4.number().int().positive().max(100).optional()
8930
9168
  });
8931
- var queriesInputSchema = z3.object({
9169
+ var queriesInputSchema = z4.object({
8932
9170
  project: projectNameSchema,
8933
9171
  request: queryBatchRequestSchema
8934
9172
  });
8935
- var queryGenerateInputSchema = z3.object({
9173
+ var queryGenerateInputSchema = z4.object({
8936
9174
  project: projectNameSchema,
8937
9175
  request: queryGenerateRequestSchema
8938
9176
  });
8939
- var gbpListLocationsInputSchema = z3.object({
9177
+ var gbpListLocationsInputSchema = z4.object({
8940
9178
  project: projectNameSchema,
8941
- selected: z3.boolean().optional()
9179
+ selected: z4.boolean().optional()
8942
9180
  });
8943
- var gbpDiscoverInputSchema = z3.object({
9181
+ var gbpDiscoverInputSchema = z4.object({
8944
9182
  project: projectNameSchema,
8945
- selectAllNew: z3.boolean().optional().default(true),
8946
- accountName: z3.string().regex(/^accounts\//, 'accountName must be a Google resource name like "accounts/12345"').optional(),
8947
- switchAccount: z3.boolean().optional().default(false)
9183
+ selectAllNew: z4.boolean().optional().default(true),
9184
+ accountName: z4.string().regex(/^accounts\//, 'accountName must be a Google resource name like "accounts/12345"').optional(),
9185
+ switchAccount: z4.boolean().optional().default(false)
8948
9186
  });
8949
- var gbpLocationSelectionInputSchema = z3.object({
9187
+ var gbpLocationSelectionInputSchema = z4.object({
8950
9188
  project: projectNameSchema,
8951
- locationName: z3.string().min(1).regex(/^locations\//, 'locationName must be a Google resource name like "locations/12345"'),
8952
- selected: z3.boolean()
9189
+ locationName: z4.string().min(1).regex(/^locations\//, 'locationName must be a Google resource name like "locations/12345"'),
9190
+ selected: z4.boolean()
8953
9191
  });
8954
- var gbpSyncInputSchema = z3.object({
9192
+ var gbpSyncInputSchema = z4.object({
8955
9193
  project: projectNameSchema,
8956
- locationNames: z3.array(z3.string()).optional(),
8957
- daysOfMetrics: z3.number().int().positive().max(540).optional(),
8958
- monthsOfKeywords: z3.number().int().positive().max(18).optional()
9194
+ locationNames: z4.array(z4.string()).optional(),
9195
+ daysOfMetrics: z4.number().int().positive().max(540).optional(),
9196
+ monthsOfKeywords: z4.number().int().positive().max(18).optional()
8959
9197
  });
8960
- var gbpMetricsInputSchema = z3.object({
9198
+ var gbpMetricsInputSchema = z4.object({
8961
9199
  project: projectNameSchema,
8962
- locationName: z3.string().optional(),
8963
- metric: z3.string().optional()
9200
+ locationName: z4.string().optional(),
9201
+ metric: z4.string().optional()
8964
9202
  });
8965
- var gbpLocationScopedInputSchema = z3.object({
9203
+ var gbpLocationScopedInputSchema = z4.object({
8966
9204
  project: projectNameSchema,
8967
- locationName: z3.string().optional()
9205
+ locationName: z4.string().optional()
8968
9206
  });
8969
- var gbpAccountsInputSchema = z3.object({
9207
+ var gbpAccountsInputSchema = z4.object({
8970
9208
  project: projectNameSchema
8971
9209
  });
8972
- var adsInsightsInputSchema = z3.object({
9210
+ var adsInsightsInputSchema = z4.object({
8973
9211
  project: projectNameSchema,
8974
- level: z3.enum(["campaign", "ad_group"]).optional(),
8975
- entityId: z3.string().optional(),
8976
- from: z3.string().optional(),
8977
- to: z3.string().optional()
9212
+ level: z4.enum(["campaign", "ad_group"]).optional(),
9213
+ entityId: z4.string().optional(),
9214
+ from: z4.string().optional(),
9215
+ to: z4.string().optional()
8978
9216
  });
8979
9217
  var adsGeoSearchInputSchema = adsGeoSearchQuerySchema.extend({
8980
9218
  project: projectNameSchema
8981
9219
  });
8982
- var adsLiveDeliveryInputSchema = z3.object({
9220
+ var adsLiveDeliveryInputSchema = z4.object({
8983
9221
  project: projectNameSchema,
8984
- campaignId: z3.string().min(1).max(200).optional(),
8985
- lookbackDays: z3.number().int().min(1).max(30).optional()
9222
+ campaignId: z4.string().min(1).max(200).optional(),
9223
+ lookbackDays: z4.number().int().min(1).max(30).optional()
8986
9224
  });
8987
- var adsOperationInputSchema = z3.object({
9225
+ var adsOperationInputSchema = z4.object({
8988
9226
  project: projectNameSchema,
8989
- operationKey: z3.string().min(8).max(128)
9227
+ operationKey: z4.string().min(8).max(128)
8990
9228
  });
8991
9229
  var adsOperationResumeActivationInputSchema = adsOperationInputSchema.strict();
8992
9230
  var adsUnresolvedOperationsInputSchema = adsUnresolvedOperationListQuerySchema.extend({
@@ -8994,92 +9232,92 @@ var adsUnresolvedOperationsInputSchema = adsUnresolvedOperationListQuerySchema.e
8994
9232
  });
8995
9233
  var adsOperationReconcileInputSchema = adsOperationReconcileRequestSchema.extend({
8996
9234
  project: projectNameSchema,
8997
- operationKey: z3.string().min(8).max(128)
9235
+ operationKey: z4.string().min(8).max(128)
8998
9236
  });
8999
- var adsImageUploadInputSchema = z3.object({
9237
+ var adsImageUploadInputSchema = z4.object({
9000
9238
  project: projectNameSchema,
9001
9239
  request: adsImageUploadRequestSchema
9002
9240
  });
9003
- var adsCampaignCreateInputSchema = z3.object({
9241
+ var adsCampaignCreateInputSchema = z4.object({
9004
9242
  project: projectNameSchema,
9005
9243
  request: adsCampaignCreateRequestSchema
9006
9244
  });
9007
- var adsCampaignUpdateInputSchema = z3.object({
9245
+ var adsCampaignUpdateInputSchema = z4.object({
9008
9246
  project: projectNameSchema,
9009
- campaignId: z3.string().min(1),
9247
+ campaignId: z4.string().min(1),
9010
9248
  request: adsCampaignUpdateRequestSchema
9011
9249
  });
9012
- var adsCampaignActivateTreeInputSchema = z3.object({
9250
+ var adsCampaignActivateTreeInputSchema = z4.object({
9013
9251
  project: projectNameSchema,
9014
- campaignId: z3.string().min(1),
9252
+ campaignId: z4.string().min(1),
9015
9253
  request: adsActivateTreeRequestSchema
9016
9254
  });
9017
- var adsCampaignPauseInputSchema = z3.object({
9255
+ var adsCampaignPauseInputSchema = z4.object({
9018
9256
  project: projectNameSchema,
9019
- campaignId: z3.string().min(1),
9257
+ campaignId: z4.string().min(1),
9020
9258
  request: adsPauseRequestSchema
9021
9259
  });
9022
- var adsAdGroupCreateInputSchema = z3.object({
9260
+ var adsAdGroupCreateInputSchema = z4.object({
9023
9261
  project: projectNameSchema,
9024
9262
  request: adsAdGroupCreateRequestSchema
9025
9263
  });
9026
- var adsAdGroupUpdateInputSchema = z3.object({
9264
+ var adsAdGroupUpdateInputSchema = z4.object({
9027
9265
  project: projectNameSchema,
9028
- adGroupId: z3.string().min(1),
9266
+ adGroupId: z4.string().min(1),
9029
9267
  request: adsAdGroupUpdateRequestSchema
9030
9268
  });
9031
- var adsAdGroupPauseInputSchema = z3.object({
9269
+ var adsAdGroupPauseInputSchema = z4.object({
9032
9270
  project: projectNameSchema,
9033
- adGroupId: z3.string().min(1),
9271
+ adGroupId: z4.string().min(1),
9034
9272
  request: adsPauseRequestSchema
9035
9273
  });
9036
- var adsAdCreateInputSchema = z3.object({
9274
+ var adsAdCreateInputSchema = z4.object({
9037
9275
  project: projectNameSchema,
9038
9276
  request: adsAdCreateRequestSchema
9039
9277
  });
9040
- var adsAdUpdateInputSchema = z3.object({
9278
+ var adsAdUpdateInputSchema = z4.object({
9041
9279
  project: projectNameSchema,
9042
- adId: z3.string().min(1),
9280
+ adId: z4.string().min(1),
9043
9281
  request: adsAdUpdateRequestSchema
9044
9282
  });
9045
- var adsAdPauseInputSchema = z3.object({
9283
+ var adsAdPauseInputSchema = z4.object({
9046
9284
  project: projectNameSchema,
9047
- adId: z3.string().min(1),
9285
+ adId: z4.string().min(1),
9048
9286
  request: adsPauseRequestSchema
9049
9287
  });
9050
- var googleMarketingSnapshotPageInputSchema = z3.object({
9288
+ var googleMarketingSnapshotPageInputSchema = z4.object({
9051
9289
  project: projectNameSchema,
9052
- limit: z3.number().int().min(1).max(GOOGLE_MARKETING_STORED_SNAPSHOT_PAGE_MAX).optional(),
9053
- cursor: z3.string().trim().min(1).optional()
9290
+ limit: z4.number().int().min(1).max(GOOGLE_MARKETING_STORED_SNAPSHOT_PAGE_MAX).optional(),
9291
+ cursor: z4.string().trim().min(1).optional()
9054
9292
  }).strict();
9055
- var googleAdsPerformanceInputSchema = z3.object({
9293
+ var googleAdsPerformanceInputSchema = z4.object({
9056
9294
  project: projectNameSchema,
9057
9295
  window: googleAdsMetricsWindowSchema.optional()
9058
9296
  }).strict();
9059
- var googleMarketingSnapshotInputSchema = z3.object({
9297
+ var googleMarketingSnapshotInputSchema = z4.object({
9060
9298
  project: projectNameSchema,
9061
- snapshotId: z3.string().trim().min(1)
9299
+ snapshotId: z4.string().trim().min(1)
9062
9300
  }).strict();
9063
- var gtmAccountInputSchema = z3.object({
9301
+ var gtmAccountInputSchema = z4.object({
9064
9302
  project: projectNameSchema,
9065
- accountId: z3.string().trim().min(1)
9303
+ accountId: z4.string().trim().min(1)
9066
9304
  }).strict().superRefine((input, context) => {
9067
9305
  if (!canonicalizeGtmAccountId(input.accountId)) {
9068
9306
  context.addIssue({
9069
- code: z3.ZodIssueCode.custom,
9307
+ code: z4.ZodIssueCode.custom,
9070
9308
  path: ["accountId"],
9071
9309
  message: "Expected a safe GTM account ID or accounts/{id} resource path."
9072
9310
  });
9073
9311
  }
9074
9312
  });
9075
- var gtmContainerInputSchema = z3.object({
9313
+ var gtmContainerInputSchema = z4.object({
9076
9314
  project: projectNameSchema,
9077
- accountId: z3.string().trim().min(1),
9078
- containerId: z3.string().trim().min(1)
9315
+ accountId: z4.string().trim().min(1),
9316
+ containerId: z4.string().trim().min(1)
9079
9317
  }).strict().superRefine((input, context) => {
9080
9318
  if (!canonicalizeGtmResourceSelection(input)) {
9081
9319
  context.addIssue({
9082
- code: z3.ZodIssueCode.custom,
9320
+ code: z4.ZodIssueCode.custom,
9083
9321
  path: ["containerId"],
9084
9322
  message: "Expected matching safe GTM account/container IDs or resource paths."
9085
9323
  });
@@ -9095,197 +9333,197 @@ function canonicalGtmMcpSelection(accountId, containerId) {
9095
9333
  if (!canonical) throw new Error("Invalid GTM account/container input.");
9096
9334
  return canonical;
9097
9335
  }
9098
- var conversionTrackingContractInputSchema = z3.object({
9336
+ var conversionTrackingContractInputSchema = z4.object({
9099
9337
  project: projectNameSchema,
9100
- contractId: z3.string().trim().min(1)
9338
+ contractId: z4.string().trim().min(1)
9101
9339
  }).strict();
9102
- var keywordsInputSchema = z3.object({
9340
+ var keywordsInputSchema = z4.object({
9103
9341
  project: projectNameSchema,
9104
9342
  request: keywordBatchRequestSchema
9105
9343
  });
9106
- var keywordGenerateInputSchema = z3.object({
9344
+ var keywordGenerateInputSchema = z4.object({
9107
9345
  project: projectNameSchema,
9108
9346
  request: keywordGenerateRequestSchema
9109
9347
  });
9110
- var competitorsInputSchema = z3.object({
9348
+ var competitorsInputSchema = z4.object({
9111
9349
  project: projectNameSchema,
9112
9350
  request: competitorBatchRequestSchema
9113
9351
  });
9114
9352
  var competitorLandscapeInputSchema = competitorLandscapeQuerySchema.safeExtend({
9115
9353
  project: projectNameSchema
9116
9354
  }).strict();
9117
- var projectUpsertInputSchema = z3.object({
9355
+ var projectUpsertInputSchema = z4.object({
9118
9356
  project: projectNameSchema,
9119
9357
  request: projectUpsertRequestSchema
9120
9358
  });
9121
- var applyConfigInputSchema = z3.object({
9359
+ var applyConfigInputSchema = z4.object({
9122
9360
  config: projectConfigSchema
9123
9361
  });
9124
- var scheduleSetInputSchema = z3.object({
9362
+ var scheduleSetInputSchema = z4.object({
9125
9363
  project: projectNameSchema,
9126
9364
  schedule: scheduleUpsertRequestSchema
9127
9365
  });
9128
- var scheduleReadInputSchema = z3.object({
9366
+ var scheduleReadInputSchema = z4.object({
9129
9367
  project: projectNameSchema,
9130
9368
  kind: schedulableRunKindSchema.optional().describe('Schedulable run kind. Defaults to "answer-visibility" if omitted.')
9131
9369
  });
9132
- var agentWebhookAttachInputSchema = z3.object({
9370
+ var agentWebhookAttachInputSchema = z4.object({
9133
9371
  project: projectNameSchema,
9134
- url: z3.string().url()
9372
+ url: z4.string().url()
9135
9373
  });
9136
- var doctorInputSchema = z3.object({
9374
+ var doctorInputSchema = z4.object({
9137
9375
  project: projectNameSchema.optional().describe("Project name to scope project-level checks. Omit to run global checks (provider keys, config, etc.)."),
9138
- checks: z3.array(z3.string().min(1)).optional().describe('Optional check IDs or wildcard prefixes (e.g. "google.auth.*", "config.providers"). Empty/omitted runs all matching checks for the chosen scope.')
9376
+ checks: z4.array(z4.string().min(1)).optional().describe('Optional check IDs or wildcard prefixes (e.g. "google.auth.*", "config.providers"). Empty/omitted runs all matching checks for the chosen scope.')
9139
9377
  });
9140
- var contentTargetsInputSchema = z3.object({
9378
+ var contentTargetsInputSchema = z4.object({
9141
9379
  project: projectNameSchema,
9142
- limit: z3.number().int().positive().max(500).optional().describe("Max rows. Defaults to all. Use a small number (3-10) when summarizing for the user."),
9143
- includeInProgress: z3.boolean().optional().describe("Include rows that already have an in-flight tracked action. Default false."),
9144
- winnabilityClass: z3.enum(["ownable", "ceded"]).optional().describe('Filter by winnability: "ownable" (worth a brief) or "ceded" (aggregator/editorial head term to skip).'),
9145
- ownable: z3.boolean().optional().describe('Convenience: when true, return only ownable targets (same as winnabilityClass="ownable").')
9380
+ limit: z4.number().int().positive().max(500).optional().describe("Max rows. Defaults to all. Use a small number (3-10) when summarizing for the user."),
9381
+ includeInProgress: z4.boolean().optional().describe("Include rows that already have an in-flight tracked action. Default false."),
9382
+ winnabilityClass: z4.enum(["ownable", "ceded"]).optional().describe('Filter by winnability: "ownable" (worth a brief) or "ceded" (aggregator/editorial head term to skip).'),
9383
+ ownable: z4.boolean().optional().describe('Convenience: when true, return only ownable targets (same as winnabilityClass="ownable").')
9146
9384
  });
9147
- var contentBriefInputSchema = z3.object({
9385
+ var contentBriefInputSchema = z4.object({
9148
9386
  project: projectNameSchema,
9149
- targetRef: z3.string().min(1).describe("Stable target ref from canonry_content_targets. The target must be ownable; ceded targets are rejected."),
9150
- provider: z3.string().optional().describe("Optional provider override (claude|openai|gemini|zai|deepinfra)."),
9151
- model: z3.string().optional().describe("Optional model override within the chosen provider."),
9152
- forceRefresh: z3.boolean().optional().describe("Force a fresh synthesis even if a cached brief exists.")
9387
+ targetRef: z4.string().min(1).describe("Stable target ref from canonry_content_targets. The target must be ownable; ceded targets are rejected."),
9388
+ provider: z4.string().optional().describe("Optional provider override (claude|openai|gemini|zai|deepinfra)."),
9389
+ model: z4.string().optional().describe("Optional model override within the chosen provider."),
9390
+ forceRefresh: z4.boolean().optional().describe("Force a fresh synthesis even if a cached brief exists.")
9153
9391
  });
9154
- var contentMapInputSchema = z3.object({
9392
+ var contentMapInputSchema = z4.object({
9155
9393
  project: projectNameSchema
9156
9394
  });
9157
- var backlinksDomainsInputSchema = z3.object({
9395
+ var backlinksDomainsInputSchema = z4.object({
9158
9396
  project: projectNameSchema,
9159
- limit: z3.number().int().positive().max(200).optional().describe("Max linking-domain rows. Default 50, max 200."),
9160
- release: z3.string().optional().describe("Common Crawl release id, e.g. cc-main-2026-jan-feb-mar. Omit for the most recent release with data."),
9397
+ limit: z4.number().int().positive().max(200).optional().describe("Max linking-domain rows. Default 50, max 200."),
9398
+ release: z4.string().optional().describe("Common Crawl release id, e.g. cc-main-2026-jan-feb-mar. Omit for the most recent release with data."),
9161
9399
  source: backlinkSourceSchema.optional().describe("Stored source. Common Crawl is active; bing-webmaster is historical-only.")
9162
9400
  });
9163
- var backlinksSourcesInputSchema = z3.object({
9401
+ var backlinksSourcesInputSchema = z4.object({
9164
9402
  project: projectNameSchema
9165
9403
  });
9166
- var memoryUpsertInputSchema = z3.object({
9404
+ var memoryUpsertInputSchema = z4.object({
9167
9405
  project: projectNameSchema,
9168
- key: z3.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH).describe(`Stable identifier for the note (max ${AGENT_MEMORY_KEY_MAX_LENGTH} chars). Writing the same key overwrites the prior value.`),
9169
- value: z3.string().min(1).describe(`Plain-text note body (max ${AGENT_MEMORY_VALUE_MAX_BYTES} bytes). Use for durable operator preferences, migration context, or non-obvious reasoning that should survive future sessions.`)
9406
+ key: z4.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH).describe(`Stable identifier for the note (max ${AGENT_MEMORY_KEY_MAX_LENGTH} chars). Writing the same key overwrites the prior value.`),
9407
+ value: z4.string().min(1).describe(`Plain-text note body (max ${AGENT_MEMORY_VALUE_MAX_BYTES} bytes). Use for durable operator preferences, migration context, or non-obvious reasoning that should survive future sessions.`)
9170
9408
  });
9171
- var memoryForgetInputSchema = z3.object({
9409
+ var memoryForgetInputSchema = z4.object({
9172
9410
  project: projectNameSchema,
9173
- key: z3.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH).describe("Exact key of the note to remove. No-op (status=missing) when no note exists for that key.")
9411
+ key: z4.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH).describe("Exact key of the note to remove. No-op (status=missing) when no note exists for that key.")
9174
9412
  });
9175
- var trafficConnectCloudRunInputSchema = z3.object({
9413
+ var trafficConnectCloudRunInputSchema = z4.object({
9176
9414
  project: projectNameSchema,
9177
9415
  request: trafficConnectCloudRunRequestSchema
9178
9416
  });
9179
- var trafficConnectWordpressInputSchema = z3.object({
9417
+ var trafficConnectWordpressInputSchema = z4.object({
9180
9418
  project: projectNameSchema,
9181
9419
  request: trafficConnectWordpressRequestSchema
9182
9420
  });
9183
- var trafficConnectVercelInputSchema = z3.object({
9421
+ var trafficConnectVercelInputSchema = z4.object({
9184
9422
  project: projectNameSchema,
9185
9423
  request: trafficConnectVercelRequestSchema
9186
9424
  });
9187
- var trafficSyncInputSchema = z3.object({
9425
+ var trafficSyncInputSchema = z4.object({
9188
9426
  project: projectNameSchema,
9189
- sourceId: z3.string().min(1).describe("Traffic source ID returned by canonry_traffic_connect_cloud_run or canonry_traffic_sources_list."),
9190
- sinceMinutes: z3.number().int().positive().max(365 * 24 * 60).optional().describe("Optional lookback in minutes. Defaults are adapter-specific and clamp forward to lastSyncedAt; a new or idle WordPress source uses 365d to cover the plugin\u2019s maximum configurable retention.")
9427
+ sourceId: z4.string().min(1).describe("Traffic source ID returned by canonry_traffic_connect_cloud_run or canonry_traffic_sources_list."),
9428
+ sinceMinutes: z4.number().int().positive().max(365 * 24 * 60).optional().describe("Optional lookback in minutes. Defaults are adapter-specific and clamp forward to lastSyncedAt; a new or idle WordPress source uses 365d to cover the plugin\u2019s maximum configurable retention.")
9191
9429
  });
9192
- var trafficBackfillInputSchema = z3.object({
9430
+ var trafficBackfillInputSchema = z4.object({
9193
9431
  project: projectNameSchema,
9194
- sourceId: z3.string().min(1).describe("Traffic source ID returned by canonry_traffic_sources_list."),
9195
- days: z3.number().int().positive().max(90).optional().describe("Lookback window in days. Default 30, capped by the adapter at 90d. Generic WordPress replace backfill is unavailable because retained coverage is unproven.")
9432
+ sourceId: z4.string().min(1).describe("Traffic source ID returned by canonry_traffic_sources_list."),
9433
+ days: z4.number().int().positive().max(90).optional().describe("Lookback window in days. Default 30, capped by the adapter at 90d. Generic WordPress replace backfill is unavailable because retained coverage is unproven.")
9196
9434
  });
9197
- var trafficResetInputSchema = z3.object({
9435
+ var trafficResetInputSchema = z4.object({
9198
9436
  project: projectNameSchema,
9199
- sourceId: z3.string().min(1).describe("Traffic source ID returned by canonry_traffic_sources_list."),
9200
- advanceToNow: z3.literal(true).describe("Must be `true`. Explicit gate against accidental resets. Advances lastSyncedAt to NOW and clears the source's error state; WordPress also clears its continuation state and records an unrecovered span that needs retention-aware repair.")
9437
+ sourceId: z4.string().min(1).describe("Traffic source ID returned by canonry_traffic_sources_list."),
9438
+ advanceToNow: z4.literal(true).describe("Must be `true`. Explicit gate against accidental resets. Advances lastSyncedAt to NOW and clears the source's error state; WordPress also clears its continuation state and records an unrecovered span that needs retention-aware repair.")
9201
9439
  });
9202
- var trafficEventsInputSchema = z3.object({
9440
+ var trafficEventsInputSchema = z4.object({
9203
9441
  project: projectNameSchema,
9204
- since: z3.string().optional().describe("ISO 8601 lower bound. Defaults to 24h ago when omitted."),
9205
- until: z3.string().optional().describe("ISO 8601 upper bound. Defaults to now when omitted."),
9206
- kind: z3.union([trafficEventKindSchema, z3.literal("all")]).optional().describe('Filter to one traffic kind; "all" (default) returns every kind.'),
9207
- sourceId: z3.string().min(1).optional().describe("Restrict to a single traffic source ID."),
9208
- limit: z3.number().int().positive().max(5e3).optional().describe("Max combined rows. Defaults to 500, max 5000. Totals always reflect the full window."),
9442
+ since: z4.string().optional().describe("ISO 8601 lower bound. Defaults to 24h ago when omitted."),
9443
+ until: z4.string().optional().describe("ISO 8601 upper bound. Defaults to now when omitted."),
9444
+ kind: z4.union([trafficEventKindSchema, z4.literal("all")]).optional().describe('Filter to one traffic kind; "all" (default) returns every kind.'),
9445
+ sourceId: z4.string().min(1).optional().describe("Restrict to a single traffic source ID."),
9446
+ limit: z4.number().int().positive().max(5e3).optional().describe("Max combined rows. Defaults to 500, max 5000. Totals always reflect the full window."),
9209
9447
  granularity: trafficSeriesGranularitySchema.optional().describe("Full-window chart series bucket size: hour (default) or day.")
9210
9448
  });
9211
- var trafficSourceIdInputSchema = z3.object({
9449
+ var trafficSourceIdInputSchema = z4.object({
9212
9450
  project: projectNameSchema,
9213
- sourceId: z3.string().min(1).describe("Traffic source ID.")
9451
+ sourceId: z4.string().min(1).describe("Traffic source ID.")
9214
9452
  });
9215
- var discoveryRunInputSchema = z3.object({
9453
+ var discoveryRunInputSchema = z4.object({
9216
9454
  project: projectNameSchema,
9217
9455
  request: discoveryRunRequestSchema.extend({
9218
9456
  // Stronger descriptions for the LLM. The base Zod schema enforces the
9219
9457
  // upper bound; this just clarifies the meaning of each knob.
9220
- icpDescription: z3.string().min(1).optional().describe("Free-text ICP description. If omitted, the project must already have spec.icpDescription stored."),
9221
- buyerDescription: z3.string().min(1).optional().describe("Who evaluates or buys the offering, separate from the ICP. When present, every generated query is anchored on this buyer."),
9222
- seedProviders: z3.array(z3.enum(["gemini", "openai"])).min(1).optional().describe('Which providers generate seed candidates. Omit for the Gemini-only default; ["gemini","openai"] merges both phrasing distributions before dedup.'),
9223
- dedupThreshold: z3.number().min(0).max(1).optional().describe("Cosine similarity threshold for clustering seed candidates. Defaults to 0.85. Lower values dedupe more aggressively."),
9224
- maxProbes: z3.number().int().positive().max(DISCOVERY_MAX_PROBES_CAP).optional().describe(`Max canonical queries to probe in this session. Default 100, hard cap ${DISCOVERY_MAX_PROBES_CAP}.`),
9225
- probeConcurrency: z3.number().int().min(1).max(DISCOVERY_PROBE_CONCURRENCY_CAP).optional().describe(`How many probes may run in parallel. Default 1 (strictly serial), hard cap ${DISCOVERY_PROBE_CONCURRENCY_CAP}. Probe rows are persisted in canonical order regardless of concurrency, so this only shortens wall-clock time.`)
9458
+ icpDescription: z4.string().min(1).optional().describe("Free-text ICP description. If omitted, the project must already have spec.icpDescription stored."),
9459
+ buyerDescription: z4.string().min(1).optional().describe("Who evaluates or buys the offering, separate from the ICP. When present, every generated query is anchored on this buyer."),
9460
+ seedProviders: z4.array(z4.enum(["gemini", "openai"])).min(1).optional().describe('Which providers generate seed candidates. Omit for the Gemini-only default; ["gemini","openai"] merges both phrasing distributions before dedup.'),
9461
+ dedupThreshold: z4.number().min(0).max(1).optional().describe("Cosine similarity threshold for clustering seed candidates. Defaults to 0.85. Lower values dedupe more aggressively."),
9462
+ maxProbes: z4.number().int().positive().max(DISCOVERY_MAX_PROBES_CAP).optional().describe(`Max canonical queries to probe in this session. Default 100, hard cap ${DISCOVERY_MAX_PROBES_CAP}.`),
9463
+ probeConcurrency: z4.number().int().min(1).max(DISCOVERY_PROBE_CONCURRENCY_CAP).optional().describe(`How many probes may run in parallel. Default 1 (strictly serial), hard cap ${DISCOVERY_PROBE_CONCURRENCY_CAP}. Probe rows are persisted in canonical order regardless of concurrency, so this only shortens wall-clock time.`)
9226
9464
  }).optional()
9227
9465
  });
9228
- var discoverySessionsListInputSchema = z3.object({
9466
+ var discoverySessionsListInputSchema = z4.object({
9229
9467
  project: projectNameSchema,
9230
- limit: z3.number().int().positive().max(200).optional().describe("Max sessions returned. Default 50.")
9468
+ limit: z4.number().int().positive().max(200).optional().describe("Max sessions returned. Default 50.")
9231
9469
  });
9232
- var discoverySessionIdInputSchema = z3.object({
9470
+ var discoverySessionIdInputSchema = z4.object({
9233
9471
  project: projectNameSchema,
9234
- sessionId: z3.string().min(1).describe("Discovery session ID returned by canonry_discover_run_start.")
9472
+ sessionId: z4.string().min(1).describe("Discovery session ID returned by canonry_discover_run_start.")
9235
9473
  });
9236
- var researchRunStartInputSchema = z3.object({
9474
+ var researchRunStartInputSchema = z4.object({
9237
9475
  project: projectNameSchema,
9238
9476
  request: researchRunCreateSchema.describe("One shared provider/model/location context for every free-form query in this saved research batch.")
9239
9477
  });
9240
- var researchRunsListInputSchema = z3.object({
9478
+ var researchRunsListInputSchema = z4.object({
9241
9479
  project: projectNameSchema,
9242
- limit: z3.number().int().positive().max(100).optional().describe("Max saved research runs returned. Default 20.")
9480
+ limit: z4.number().int().positive().max(100).optional().describe("Max saved research runs returned. Default 20.")
9243
9481
  });
9244
- var researchRunIdInputSchema = z3.object({
9482
+ var researchRunIdInputSchema = z4.object({
9245
9483
  project: projectNameSchema,
9246
- runId: z3.string().min(1).describe("Research run ID returned by canonry_research_run_start.")
9484
+ runId: z4.string().min(1).describe("Research run ID returned by canonry_research_run_start.")
9247
9485
  });
9248
- var discoveryHarvestInputSchema = z3.object({
9486
+ var discoveryHarvestInputSchema = z4.object({
9249
9487
  project: projectNameSchema,
9250
- sessionId: z3.string().min(1).describe("Discovery session ID returned by canonry_discover_run_start."),
9251
- minProbeHits: z3.number().int().positive().optional().describe("Recurrence floor \u2014 a candidate must have appeared in at least this many distinct probes to be admitted. Default 1."),
9252
- anchor: z3.boolean().optional().describe("Apply the subject-anchor filter that drops off-topic acronym collisions. Default true; pass false for new-subject discovery on a well-scoped project.")
9488
+ sessionId: z4.string().min(1).describe("Discovery session ID returned by canonry_discover_run_start."),
9489
+ minProbeHits: z4.number().int().positive().optional().describe("Recurrence floor \u2014 a candidate must have appeared in at least this many distinct probes to be admitted. Default 1."),
9490
+ anchor: z4.boolean().optional().describe("Apply the subject-anchor filter that drops off-topic acronym collisions. Default true; pass false for new-subject discovery on a well-scoped project.")
9253
9491
  });
9254
- var discoveryPromoteInputSchema = z3.object({
9492
+ var discoveryPromoteInputSchema = z4.object({
9255
9493
  project: projectNameSchema,
9256
- sessionId: z3.string().min(1).describe("Discovery session ID returned by canonry_discover_run_start."),
9494
+ sessionId: z4.string().min(1).describe("Discovery session ID returned by canonry_discover_run_start."),
9257
9495
  request: discoveryPromoteRequestSchema.extend({
9258
9496
  // Stronger descriptions for the LLM. The base Zod schema enforces the shape.
9259
- buckets: z3.array(discoveryBucketSchema).min(1).optional().describe("Which probe buckets to adopt into the tracked basket. Omitted promotes cited + aspirational; include wasted-surface explicitly for off-ICP competitor gaps."),
9260
- includeCompetitors: z3.boolean().optional().describe("Whether to also merge recurring discovered competitor domains into the project. Defaults to true."),
9261
- competitorTypes: z3.array(discoveryCompetitorTypeSchema).min(1).optional().describe("Which classified competitor types to merge. Omitted promotes direct-competitor only; pass an explicit list to also adopt editorial-media channels or to recover legacy unknown entries. Ignored when includeCompetitors is false.")
9497
+ buckets: z4.array(discoveryBucketSchema).min(1).optional().describe("Which probe buckets to adopt into the tracked basket. Omitted promotes cited + aspirational; include wasted-surface explicitly for off-ICP competitor gaps."),
9498
+ includeCompetitors: z4.boolean().optional().describe("Whether to also merge recurring discovered competitor domains into the project. Defaults to true."),
9499
+ competitorTypes: z4.array(discoveryCompetitorTypeSchema).min(1).optional().describe("Which classified competitor types to merge. Omitted promotes direct-competitor only; pass an explicit list to also adopt editorial-media channels or to recover legacy unknown entries. Ignored when includeCompetitors is false.")
9262
9500
  }).optional()
9263
9501
  });
9264
- var technicalAeoScoreInputSchema = z3.object({
9502
+ var technicalAeoScoreInputSchema = z4.object({
9265
9503
  project: projectNameSchema,
9266
9504
  runId: runIdSchema.optional().describe("Historical site-audit run ID. Omit for the latest audit.")
9267
9505
  });
9268
- var technicalAeoPagesInputSchema = z3.object({
9506
+ var technicalAeoPagesInputSchema = z4.object({
9269
9507
  project: projectNameSchema,
9270
9508
  runId: runIdSchema.optional().describe("Historical site-audit run ID. Omit for the latest audit."),
9271
- status: z3.enum(["success", "error"]).optional().describe("Filter to successfully-audited or errored pages."),
9272
- sort: z3.enum(["score-asc", "score-desc", "url"]).optional().describe("Sort order. Defaults to score-asc (worst pages first)."),
9273
- limit: z3.number().int().positive().max(500).optional(),
9274
- offset: z3.number().int().nonnegative().optional()
9509
+ status: z4.enum(["success", "error"]).optional().describe("Filter to successfully-audited or errored pages."),
9510
+ sort: z4.enum(["score-asc", "score-desc", "url"]).optional().describe("Sort order. Defaults to score-asc (worst pages first)."),
9511
+ limit: z4.number().int().positive().max(500).optional(),
9512
+ offset: z4.number().int().nonnegative().optional()
9275
9513
  });
9276
- var technicalAeoTrendInputSchema = z3.object({
9514
+ var technicalAeoTrendInputSchema = z4.object({
9277
9515
  project: projectNameSchema,
9278
- limit: z3.number().int().positive().max(365).optional()
9516
+ limit: z4.number().int().positive().max(365).optional()
9279
9517
  });
9280
- var technicalAeoCrawlInputSchema = z3.object({
9518
+ var technicalAeoCrawlInputSchema = z4.object({
9281
9519
  project: projectNameSchema,
9282
9520
  runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest persisted crawl.")
9283
9521
  });
9284
- var siteHealthPageAuditInputSchema = z3.object({
9522
+ var siteHealthPageAuditInputSchema = z4.object({
9285
9523
  project: projectNameSchema,
9286
9524
  runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest persisted crawl."),
9287
- nodeKey: z3.string().min(1).optional().describe("Exact crawl node key, as returned by Site Health page or subgraph reads."),
9288
- url: z3.string().url().optional().describe("Exact page URL. Use this only when a crawl node key is unavailable.")
9525
+ nodeKey: z4.string().min(1).optional().describe("Exact crawl node key, as returned by Site Health page or subgraph reads."),
9526
+ url: z4.string().url().optional().describe("Exact page URL. Use this only when a crawl node key is unavailable.")
9289
9527
  }).refine((value) => Boolean(value.nodeKey || value.url), {
9290
9528
  message: "Provide nodeKey or url.",
9291
9529
  path: ["nodeKey"]
@@ -9295,26 +9533,26 @@ var siteHealthPageAuditInputSchema = z3.object({
9295
9533
  });
9296
9534
  var SITE_HEALTH_MCP_MAX_NODES = 25;
9297
9535
  var SITE_HEALTH_MCP_MAX_EDGES = 50;
9298
- var siteHealthSubgraphInputSchema = z3.object({
9536
+ var siteHealthSubgraphInputSchema = z4.object({
9299
9537
  project: projectNameSchema,
9300
9538
  runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest complete crawl."),
9301
- nodeKey: z3.string().min(1).optional().describe("Focus crawl node key. Omit with url to focus the crawl root."),
9302
- url: z3.string().url().optional().describe("Focus canonical URL. Omit with nodeKey to focus the crawl root."),
9303
- hops: z3.number().int().min(0).max(3).optional().describe("Neighborhood depth from the focus node. Keep this small."),
9304
- maxNodes: z3.number().int().positive().max(SITE_HEALTH_MCP_MAX_NODES).default(SITE_HEALTH_MCP_MAX_NODES).describe("Hard MCP cap: at most 25 nodes. Narrow or refocus instead of loading the site."),
9305
- maxEdges: z3.number().int().positive().max(SITE_HEALTH_MCP_MAX_EDGES).default(SITE_HEALTH_MCP_MAX_EDGES).describe("Hard MCP cap: at most 50 edges. Narrow or refocus instead of loading the site.")
9539
+ nodeKey: z4.string().min(1).optional().describe("Focus crawl node key. Omit with url to focus the crawl root."),
9540
+ url: z4.string().url().optional().describe("Focus canonical URL. Omit with nodeKey to focus the crawl root."),
9541
+ hops: z4.number().int().min(0).max(3).optional().describe("Neighborhood depth from the focus node. Keep this small."),
9542
+ maxNodes: z4.number().int().positive().max(SITE_HEALTH_MCP_MAX_NODES).default(SITE_HEALTH_MCP_MAX_NODES).describe("Hard MCP cap: at most 25 nodes. Narrow or refocus instead of loading the site."),
9543
+ maxEdges: z4.number().int().positive().max(SITE_HEALTH_MCP_MAX_EDGES).default(SITE_HEALTH_MCP_MAX_EDGES).describe("Hard MCP cap: at most 50 edges. Narrow or refocus instead of loading the site.")
9306
9544
  }).refine((value) => !(value.nodeKey && value.url), {
9307
9545
  message: "Provide nodeKey or url, not both.",
9308
9546
  path: ["nodeKey"]
9309
9547
  });
9310
- var siteHealthPathInputSchema = z3.object({
9548
+ var siteHealthPathInputSchema = z4.object({
9311
9549
  project: projectNameSchema,
9312
9550
  runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest complete crawl."),
9313
- fromNodeKey: z3.string().min(1).optional().describe("Origin node key. Omit with fromUrl to start at the crawl root."),
9314
- fromUrl: z3.string().url().optional().describe("Origin URL. Omit with fromNodeKey to start at the crawl root."),
9315
- toNodeKey: z3.string().min(1).optional().describe("Required destination node key."),
9316
- toUrl: z3.string().url().optional().describe("Required destination URL."),
9317
- maxDepth: z3.number().int().positive().max(24).optional().describe("Maximum directed-link depth to search.")
9551
+ fromNodeKey: z4.string().min(1).optional().describe("Origin node key. Omit with fromUrl to start at the crawl root."),
9552
+ fromUrl: z4.string().url().optional().describe("Origin URL. Omit with fromNodeKey to start at the crawl root."),
9553
+ toNodeKey: z4.string().min(1).optional().describe("Required destination node key."),
9554
+ toUrl: z4.string().url().optional().describe("Required destination URL."),
9555
+ maxDepth: z4.number().int().positive().max(24).optional().describe("Maximum directed-link depth to search.")
9318
9556
  }).refine((value) => !(value.fromNodeKey && value.fromUrl), {
9319
9557
  message: "Provide fromNodeKey or fromUrl, not both.",
9320
9558
  path: ["fromNodeKey"]
@@ -9325,71 +9563,71 @@ var siteHealthPathInputSchema = z3.object({
9325
9563
  message: "Provide toNodeKey or toUrl, not both.",
9326
9564
  path: ["toNodeKey"]
9327
9565
  });
9328
- var siteHealthChangesInputSchema = z3.object({
9566
+ var siteHealthChangesInputSchema = z4.object({
9329
9567
  project: projectNameSchema,
9330
9568
  fromRunId: runIdSchema.optional().describe("Earlier complete crawl run ID. Omit to compare the previous complete crawl."),
9331
9569
  toRunId: runIdSchema.optional().describe("Later complete crawl run ID. Omit to compare the latest complete crawl."),
9332
- scope: z3.enum(["all", "pages", "links"]).optional().describe("Limit the diff to page or link changes. Omit or use all for both."),
9333
- change: z3.enum(["all", "added", "removed", "changed"]).optional().describe("Limit the diff to one change kind. Omit or use all for every kind."),
9334
- cursor: z3.string().min(1).optional().describe("Opaque cursor from the previous Site Health changes result."),
9335
- limit: z3.number().int().positive().max(25).default(25).describe("Hard MCP cap: 25 records, because each change carries before and after DTOs.")
9570
+ scope: z4.enum(["all", "pages", "links"]).optional().describe("Limit the diff to page or link changes. Omit or use all for both."),
9571
+ change: z4.enum(["all", "added", "removed", "changed"]).optional().describe("Limit the diff to one change kind. Omit or use all for every kind."),
9572
+ cursor: z4.string().min(1).optional().describe("Opaque cursor from the previous Site Health changes result."),
9573
+ limit: z4.number().int().positive().max(25).default(25).describe("Hard MCP cap: 25 records, because each change carries before and after DTOs.")
9336
9574
  });
9337
- var technicalAeoCrawlPagesInputSchema = z3.object({
9575
+ var technicalAeoCrawlPagesInputSchema = z4.object({
9338
9576
  project: projectNameSchema,
9339
9577
  runId: runIdSchema.optional(),
9340
- inventoryEligible: z3.boolean().optional().describe("Filter Canonry technical-inventory eligibility. This is not actual Google index coverage."),
9341
- fetchState: z3.string().min(1).optional().describe("Filter crawler fetch state, for example html, redirect, non-html, or fetch-error."),
9342
- indexabilityState: z3.string().min(1).optional().describe("Filter crawler-derived indexability state. This is not Google index coverage."),
9343
- auditState: z3.string().min(1).optional().describe("Filter audit state."),
9344
- sort: z3.enum(["url", "path", "score-asc", "score-desc"]).optional(),
9345
- cursor: z3.string().min(1).optional().describe("Opaque cursor from the previous crawl-pages result."),
9346
- limit: z3.number().int().positive().max(200).optional()
9578
+ inventoryEligible: z4.boolean().optional().describe("Filter Canonry technical-inventory eligibility. This is not actual Google index coverage."),
9579
+ fetchState: z4.string().min(1).optional().describe("Filter crawler fetch state, for example html, redirect, non-html, or fetch-error."),
9580
+ indexabilityState: z4.string().min(1).optional().describe("Filter crawler-derived indexability state. This is not Google index coverage."),
9581
+ auditState: z4.string().min(1).optional().describe("Filter audit state."),
9582
+ sort: z4.enum(["url", "path", "score-asc", "score-desc"]).optional(),
9583
+ cursor: z4.string().min(1).optional().describe("Opaque cursor from the previous crawl-pages result."),
9584
+ limit: z4.number().int().positive().max(200).optional()
9347
9585
  });
9348
- var technicalAeoStructureInputSchema = z3.object({
9586
+ var technicalAeoStructureInputSchema = z4.object({
9349
9587
  project: projectNameSchema,
9350
9588
  runId: runIdSchema.optional(),
9351
- parentPath: z3.string().min(1).optional().describe("Path whose immediate children to list. Defaults to /. This never returns a whole site tree."),
9352
- cursor: z3.string().min(1).optional().describe("Opaque cursor from the previous structure result."),
9353
- limit: z3.number().int().positive().max(100).optional()
9589
+ parentPath: z4.string().min(1).optional().describe("Path whose immediate children to list. Defaults to /. This never returns a whole site tree."),
9590
+ cursor: z4.string().min(1).optional().describe("Opaque cursor from the previous structure result."),
9591
+ limit: z4.number().int().positive().max(100).optional()
9354
9592
  });
9355
- var linkKindSchema = z3.enum(["all", "content", "template"]).optional().describe(
9593
+ var linkKindSchema = z4.enum(["all", "content", "template"]).optional().describe(
9356
9594
  "Restrict to content links (excludes nav, header, and footer links) or to template links only. Defaults to all. Check templateDetection before reading an empty content list as a real zero, and before comparing a count with an older scan: it says whether the split came from where each link sits in the page or from how many pages repeat it."
9357
9595
  );
9358
- var technicalAeoInternalLinksInputSchema = z3.object({
9596
+ var technicalAeoInternalLinksInputSchema = z4.object({
9359
9597
  project: projectNameSchema,
9360
9598
  runId: runIdSchema.optional(),
9361
- sourceUrl: z3.string().url().optional(),
9362
- targetUrl: z3.string().url().optional(),
9363
- followable: z3.boolean().optional(),
9599
+ sourceUrl: z4.string().url().optional(),
9600
+ targetUrl: z4.string().url().optional(),
9601
+ followable: z4.boolean().optional(),
9364
9602
  linkKind: linkKindSchema,
9365
- cursor: z3.string().min(1).optional().describe("Opaque cursor from the previous internal-links result."),
9366
- limit: z3.number().int().positive().max(200).optional()
9603
+ cursor: z4.string().min(1).optional().describe("Opaque cursor from the previous internal-links result."),
9604
+ limit: z4.number().int().positive().max(200).optional()
9367
9605
  });
9368
- var technicalAeoLinkNeighborsInputSchema = z3.object({
9606
+ var technicalAeoLinkNeighborsInputSchema = z4.object({
9369
9607
  project: projectNameSchema,
9370
9608
  runId: runIdSchema.optional(),
9371
- nodeKey: z3.string().min(1).optional(),
9372
- url: z3.string().url().optional(),
9609
+ nodeKey: z4.string().min(1).optional(),
9610
+ url: z4.string().url().optional(),
9373
9611
  linkKind: linkKindSchema,
9374
- limit: z3.number().int().positive().max(100).optional()
9612
+ limit: z4.number().int().positive().max(100).optional()
9375
9613
  }).refine((value) => Boolean(value.nodeKey || value.url), {
9376
9614
  message: "Provide nodeKey or url.",
9377
9615
  path: ["nodeKey"]
9378
9616
  });
9379
- var technicalAeoDeadLinksInputSchema = z3.object({
9617
+ var technicalAeoDeadLinksInputSchema = z4.object({
9380
9618
  project: projectNameSchema,
9381
9619
  runId: runIdSchema.optional(),
9382
- cursor: z3.string().min(1).optional().describe("Opaque cursor from the previous dead-links result."),
9383
- limit: z3.number().int().positive().max(200).optional()
9620
+ cursor: z4.string().min(1).optional().describe("Opaque cursor from the previous dead-links result."),
9621
+ limit: z4.number().int().positive().max(200).optional()
9384
9622
  });
9385
- var technicalAeoRunInputSchema = z3.object({
9623
+ var technicalAeoRunInputSchema = z4.object({
9386
9624
  project: projectNameSchema,
9387
- sitemapUrl: z3.string().url().optional().describe("Override the sitemap URL. Defaults to https://<canonicalDomain>/sitemap.xml."),
9388
- limit: z3.number().int().positive().max(2e3).optional().describe("Deprecated compatibility alias for maxPages."),
9389
- maxPages: z3.number().int().positive().max(5e4).optional().describe("Maximum pages crawled and audited. Defaults to 1,000; hard maximum 50,000."),
9390
- maxEdges: z3.number().int().positive().max(1e6).optional().describe("Maximum link observations retained for this crawl. When omitted the crawl engine derives the budget from the page count; hard maximum 1,000,000."),
9391
- maxDepth: z3.number().int().min(0).max(100).optional().describe("Maximum internal-link depth from the root page."),
9392
- checkDeadLinks: z3.boolean().optional().describe("Opt in to internal dead-link checks. Omitted and false both disable checks.")
9625
+ sitemapUrl: z4.string().url().optional().describe("Override the sitemap URL. Defaults to https://<canonicalDomain>/sitemap.xml."),
9626
+ limit: z4.number().int().positive().max(2e3).optional().describe("Deprecated compatibility alias for maxPages."),
9627
+ maxPages: z4.number().int().positive().max(5e4).optional().describe("Maximum pages crawled and audited. Defaults to 1,000; hard maximum 50,000."),
9628
+ maxEdges: z4.number().int().positive().max(1e6).optional().describe("Maximum link observations retained for this crawl. When omitted the crawl engine derives the budget from the page count; hard maximum 1,000,000."),
9629
+ maxDepth: z4.number().int().min(0).max(100).optional().describe("Maximum internal-link depth from the root page."),
9630
+ checkDeadLinks: z4.boolean().optional().describe("Opt in to internal dead-link checks. Omitted and false both disable checks.")
9393
9631
  });
9394
9632
  var AGENT_WEBHOOK_EVENTS = [
9395
9633
  notificationEventSchema.enum["run.completed"],
@@ -9398,6 +9636,53 @@ var AGENT_WEBHOOK_EVENTS = [
9398
9636
  notificationEventSchema.enum["citation.gained"]
9399
9637
  ];
9400
9638
  var canonryMcpTools = [
9639
+ defineTool({
9640
+ name: "canonry_visibility_report",
9641
+ title: "Read scoped AI visibility",
9642
+ description: "Read stored visibility for a site, group, market or property. Branded, non-brand and unclassified answers remain separate populations. The response owns rates, trends, query performance, answers and competitors under one frozen measured definition. Material plan changes retain the prior measured revision; pending assignments are explicit. Search filters the query list only. Reuse cursors with identical selection. Never starts a sweep.",
9643
+ access: "read",
9644
+ tier: "monitoring",
9645
+ inputSchema: visibilityReportRequestSchema.safeExtend({ project: projectNameSchema }),
9646
+ annotations: readAnnotations(),
9647
+ openApiOperations: ["GET /api/v1/projects/{name}/visibility-report"],
9648
+ handler: (client2, input) => {
9649
+ const { project, ...selection } = input;
9650
+ return client2.getVisibilityReport(project, selection);
9651
+ }
9652
+ }),
9653
+ defineTool({
9654
+ name: "canonry_query_tracking_workspace",
9655
+ title: "Read query assignments",
9656
+ description: "Read tracked queries, exact assignments, saved research sources and the current workspace version for a simple site or advanced portfolio.",
9657
+ access: "read",
9658
+ tier: "setup",
9659
+ inputSchema: projectInputSchema,
9660
+ annotations: readAnnotations(),
9661
+ openApiOperations: ["GET /api/v1/projects/{name}/query-tracking"],
9662
+ handler: (client2, input) => client2.getQueryTrackingWorkspace(input.project)
9663
+ }),
9664
+ defineTool({
9665
+ name: "canonry_query_tracking_preview",
9666
+ title: "Preview query assignments",
9667
+ description: "Preview manual, template or saved research additions and assignment removals against the exact workspace version. Returns a review token, deduplicated change and next-sweep workload. Does not publish or start provider work. This POST requires write access.",
9668
+ access: "write",
9669
+ tier: "setup",
9670
+ inputSchema: z4.object({ project: projectNameSchema, request: queryTrackingPreviewRequestSchema }).strict(),
9671
+ annotations: readAnnotations(),
9672
+ openApiOperations: ["POST /api/v1/projects/{name}/query-tracking/preview"],
9673
+ handler: (client2, input) => client2.previewQueryTracking(input.project, input.request)
9674
+ }),
9675
+ defineTool({
9676
+ name: "canonry_query_tracking_commit",
9677
+ title: "Publish reviewed query assignments",
9678
+ description: "Commit the exact reviewed mutation using its workspace version and preview token. No-op changes do not publish a revision. A successful publication starts zero provider calls; new assignments await the next project-wide sweep. Use the returned revision rather than predicting one.",
9679
+ access: "write",
9680
+ tier: "setup",
9681
+ inputSchema: z4.object({ project: projectNameSchema, request: queryTrackingCommitRequestSchema }).strict(),
9682
+ annotations: writeAnnotations({ idempotentHint: true, destructiveHint: true }),
9683
+ openApiOperations: ["POST /api/v1/projects/{name}/query-tracking/commit"],
9684
+ handler: (client2, input) => client2.commitQueryTracking(input.project, input.request)
9685
+ }),
9401
9686
  defineTool({
9402
9687
  name: "canonry_projects_list",
9403
9688
  title: "List Canonry projects",
@@ -9437,10 +9722,10 @@ var canonryMcpTools = [
9437
9722
  description: 'One-call summary for "how is project X doing?". Returns independent mention and citation coverage, separate query-level movement for each signal, query-basket comparability with added/removed counts, latest run and health, insights, provider/model breakdowns, competitors, attention items, and recent history. Movement excludes queries not shared by both sweeps. Filterable by location and time window. Prefer this over fanning out to separate tools.',
9438
9723
  access: "read",
9439
9724
  tier: "core",
9440
- inputSchema: z3.object({
9725
+ inputSchema: z4.object({
9441
9726
  project: projectNameSchema,
9442
- location: z3.string().optional().describe('Filter to runs from this location label (e.g. "Boston, MA, US"). Omit for all locations.'),
9443
- since: z3.string().optional().describe("ISO 8601 datetime \u2014 only include runs at or after this time. Omit for full history.")
9727
+ location: z4.string().optional().describe('Filter to runs from this location label (e.g. "Boston, MA, US"). Omit for all locations.'),
9728
+ since: z4.string().optional().describe("ISO 8601 datetime \u2014 only include runs at or after this time. Omit for full history.")
9444
9729
  }),
9445
9730
  annotations: readAnnotations(),
9446
9731
  openApiOperations: ["GET /api/v1/projects/{name}/overview"],
@@ -9455,7 +9740,7 @@ var canonryMcpTools = [
9455
9740
  description: "Returns the full canonical AEO report bundle for a project \u2014 executive summary, client summary, agency diagnostics, action plan, per-query \xD7 per-provider citation matrix, competitor landscape, AI citation sources, GSC/GA4 performance, social and AI referrals, indexing health, citations trend, prioritized insights, and recommended next steps. Same payload `canonry report <project>` consumes to render audience-specific HTML. Pass `period` (7/14/30/90 days, default 30) to scope the GSC/GA4/server-activity sections and the period-over-period comparisons.",
9456
9741
  access: "read",
9457
9742
  tier: "monitoring",
9458
- inputSchema: z3.object({
9743
+ inputSchema: z4.object({
9459
9744
  project: projectNameSchema,
9460
9745
  period: reportPeriodSchema.optional()
9461
9746
  }),
@@ -9469,7 +9754,7 @@ var canonryMcpTools = [
9469
9754
  description: "One-call investigation of whether organic work is gaining visibility, traffic, or AI attention. Returns source-specific 30-day GSC and GA4 cohorts, URL-agnostic page evidence, available GA4 lead-event evidence (not lead attribution), server-observed AI crawling/user-fetch/referral evidence, the latest answer-visibility sweep, source coverage, findings, and limitations. It preserves native units. Prefer this over fanning out across GSC, GA, traffic, and visibility tools.",
9470
9755
  access: "read",
9471
9756
  tier: "monitoring",
9472
- inputSchema: z3.object({
9757
+ inputSchema: z4.object({
9473
9758
  project: projectNameSchema,
9474
9759
  period: organicEvidencePeriodSchema.optional().describe("Evidence window: 60 or 90 days (default 90).")
9475
9760
  }),
@@ -9483,7 +9768,7 @@ var canonryMcpTools = [
9483
9768
  description: "Citation and mention rates over time for a project, bucketed adaptively (daily \u2192 monthly by span) and probe-excluded. Returns overall + per-provider window aggregates AND a per-bucket `byProvider` breakdown so you can read how each engine's cited/mentioned rate moved run-over-run \u2014 the same data the dashboard's \"Citations & mentions over time\" chart plots. Includes trend direction (improving/declining/stable) for both signals and query-set-change annotations. Filter the range with `window` (7d/30d/90d/all).",
9484
9769
  access: "read",
9485
9770
  tier: "monitoring",
9486
- inputSchema: z3.object({
9771
+ inputSchema: z4.object({
9487
9772
  project: projectNameSchema,
9488
9773
  window: analyticsWindowSchema.optional().describe("Time range: 7d, 30d, 90d, or all (default all).")
9489
9774
  }),
@@ -9497,10 +9782,10 @@ var canonryMcpTools = [
9497
9782
  description: "Where AI engines get the facts they cite for a project. Returns the FULL ranked list of cited domains (not truncated) \u2014 each tagged with a category and an actionable surface class (own / direct-competitor / ota-aggregator / editorial-media / other) \u2014 plus a surface-class roll-up and a per-provider breakdown (each provider's cited-domain mix + total cited slots). The surface class is deterministic (own/competitor from project data, the rest from the source allow-list) and enriched by discovery's stored per-domain classifications when present \u2014 no new LLM calls. Probe-excluded, window-filterable (7d/30d/90d/all). Use `limit` to cap each ranked list to the top N domains (an explicit long-tail rollup preserves the totals). All counts/shares/classification are computed server-side.",
9498
9783
  access: "read",
9499
9784
  tier: "monitoring",
9500
- inputSchema: z3.object({
9785
+ inputSchema: z4.object({
9501
9786
  project: projectNameSchema,
9502
9787
  window: analyticsWindowSchema.optional().describe("Time range: 7d, 30d, 90d, or all (default all)."),
9503
- limit: z3.number().int().positive().optional().describe("Cap each ranked list to the top N domains. Omit for the full list.")
9788
+ limit: z4.number().int().positive().optional().describe("Cap each ranked list to the top N domains. Omit for the full list.")
9504
9789
  }),
9505
9790
  annotations: readAnnotations(),
9506
9791
  openApiOperations: ["GET /api/v1/projects/{name}/analytics/sources"],
@@ -9526,10 +9811,10 @@ var canonryMcpTools = [
9526
9811
  description: "Search query snapshots and intelligence insights for the given text. Looks at snapshot answer text, cited domains, raw provider responses, and insight title/query/recommendation/cause. Returns ranked hits with snippets \u2014 use it instead of paginating snapshots when you need to find a competitor mention or term.",
9527
9812
  access: "read",
9528
9813
  tier: "core",
9529
- inputSchema: z3.object({
9814
+ inputSchema: z4.object({
9530
9815
  project: projectNameSchema,
9531
- q: z3.string().min(2).describe("Search term, at least 2 characters."),
9532
- limit: z3.number().int().positive().max(50).optional().describe("Max combined hits (1-50, default 25).")
9816
+ q: z4.string().min(2).describe("Search term, at least 2 characters."),
9817
+ limit: z4.number().int().positive().max(50).optional().describe("Max combined hits (1-50, default 25).")
9533
9818
  }),
9534
9819
  annotations: readAnnotations(),
9535
9820
  openApiOperations: ["GET /api/v1/projects/{name}/search"],
@@ -9717,15 +10002,15 @@ var canonryMcpTools = [
9717
10002
  description: 'Per-query mention (answer-text) and citation (source-list) counts WITH a sample size, pooled across many answer-visibility runs (probe-excluded) \u2014 the data to compute a confidence-aware (Wilson) proportion or detect drift without fetching every run. Tri-state aware: `checked` (the n for the mention proportion) counts only snapshots where answerMentioned was recorded; `null` ("not checked") is excluded, never counted as not-mentioned. Returns per-query `total`/`checked`/`mentioned`/`cited` + derived `mentionRate` (mentioned/checked) and `citedRate` (cited/total), `firstObserved`/`lastObserved`, and pooled `totals`. Window with `since`/`until` (ISO), `lastRuns`, or `month=YYYY-MM` (mutually exclusive); with none set, EVERY completed/partial run is pooled (`window.runCount` says how many) \u2014 pass `lastRuns` for a recent sample. Set `groupBy=provider` for a per-provider breakdown whose counts sum to the pooled counts (`groupBy` is omitted from the response otherwise). Set `shareOfVoice=true` for project-vs-tracked-competitor brand-mention share across the same attributed snapshot set \u2014 scoped to NON-BRAND queries by default, because a branded query names the project (it is mentioned on nearly all of them and a competitor cannot be), so a pooled figure reports brand recall as category placement. Pass `queryClass="branded"` for the recall figure; the response echoes which class it served.',
9718
10003
  access: "read",
9719
10004
  tier: "monitoring",
9720
- inputSchema: z3.object({
10005
+ inputSchema: z4.object({
9721
10006
  project: projectNameSchema,
9722
- since: z3.string().optional().describe("Inclusive lower bound on run createdAt (ISO 8601). A date-only value (YYYY-MM-DD) is the start of that UTC day. Mutually exclusive with lastRuns/month."),
9723
- until: z3.string().optional().describe("Inclusive upper bound on run createdAt (ISO 8601). A date-only value (YYYY-MM-DD) covers the whole UTC day (through 23:59:59.999). Mutually exclusive with lastRuns/month."),
9724
- lastRuns: z3.number().int().positive().optional().describe("Aggregate only the most recent N answer-visibility runs. Mutually exclusive with since/until/month."),
9725
- month: z3.string().optional().describe("Aggregate one calendar month (YYYY-MM), expanded to that month's inclusive UTC bounds. Mutually exclusive with since/until/lastRuns."),
9726
- groupBy: z3.enum(["provider"]).optional().describe('Set to "provider" for a per-provider breakdown.'),
9727
- shareOfVoice: z3.boolean().optional().describe("Include project-vs-tracked-competitor brand-mention share across the same window (non-brand queries unless queryClass says otherwise)."),
9728
- queryClass: z3.enum(["branded", "non-brand"]).optional().describe('Query class for shareOfVoice. Defaults to non-brand. There is no "all": branded and non-brand never share a denominator.')
10007
+ since: z4.string().optional().describe("Inclusive lower bound on run createdAt (ISO 8601). A date-only value (YYYY-MM-DD) is the start of that UTC day. Mutually exclusive with lastRuns/month."),
10008
+ until: z4.string().optional().describe("Inclusive upper bound on run createdAt (ISO 8601). A date-only value (YYYY-MM-DD) covers the whole UTC day (through 23:59:59.999). Mutually exclusive with lastRuns/month."),
10009
+ lastRuns: z4.number().int().positive().optional().describe("Aggregate only the most recent N answer-visibility runs. Mutually exclusive with since/until/month."),
10010
+ month: z4.string().optional().describe("Aggregate one calendar month (YYYY-MM), expanded to that month's inclusive UTC bounds. Mutually exclusive with since/until/lastRuns."),
10011
+ groupBy: z4.enum(["provider"]).optional().describe('Set to "provider" for a per-provider breakdown.'),
10012
+ shareOfVoice: z4.boolean().optional().describe("Include project-vs-tracked-competitor brand-mention share across the same window (non-brand queries unless queryClass says otherwise)."),
10013
+ queryClass: z4.enum(["branded", "non-brand"]).optional().describe('Query class for shareOfVoice. Defaults to non-brand. There is no "all": branded and non-brand never share a denominator.')
9729
10014
  }),
9730
10015
  annotations: readAnnotations(),
9731
10016
  openApiOperations: ["GET /api/v1/projects/{name}/visibility-stats"],
@@ -9745,10 +10030,10 @@ var canonryMcpTools = [
9745
10030
  description: "Statistically honest month-over-month AEO comparison in ONE call \u2014 use this instead of hand-computing deltas from two visibility-stats calls. Share of voice (`mention-share-of-voice`, `driftRobust: true`) is less exposed to broad model-wide naming propensity than absolute rates, but it never overrides model continuity. The response restricts to common query/provider pairs, then includes only providers with exactly one known, identical configured model id in both months. `continuity` surfaces every provider, its model evidence, and whether it was excluded for a changed, mixed mid-month, or unknown model. When no provider remains, metrics return `model-discontinuous` or `model-unknown`, never a directional call. A silent upstream version bump under an unchanged configured id remains undetectable. `from` must be a month strictly before `to`.",
9746
10031
  access: "read",
9747
10032
  tier: "monitoring",
9748
- inputSchema: z3.object({
10033
+ inputSchema: z4.object({
9749
10034
  project: projectNameSchema,
9750
- from: z3.string().describe('Earlier calendar month (YYYY-MM), the baseline. Must be strictly before "to".'),
9751
- to: z3.string().describe('Later calendar month (YYYY-MM), compared against "from".')
10035
+ from: z4.string().describe('Earlier calendar month (YYYY-MM), the baseline. Must be strictly before "to".'),
10036
+ to: z4.string().describe('Later calendar month (YYYY-MM), compared against "from".')
9752
10037
  }),
9753
10038
  annotations: readAnnotations(),
9754
10039
  openApiOperations: ["GET /api/v1/projects/{name}/visibility-compare"],
@@ -12304,8 +12589,8 @@ function createCanonryMcpServerWithCatalog(options = {}) {
12304
12589
  registerMetaTools(server, catalog, { includeToolkitLoader: options.tiers === void 0 });
12305
12590
  return { server, catalog };
12306
12591
  }
12307
- var loadToolkitInputSchema = z4.object({
12308
- name: z4.enum(CANONRY_MCP_TOOLKIT_NAMES).describe("Toolkit name. List options with canonry_help.")
12592
+ var loadToolkitInputSchema = z5.object({
12593
+ name: z5.enum(CANONRY_MCP_TOOLKIT_NAMES).describe("Toolkit name. List options with canonry_help.")
12309
12594
  });
12310
12595
  function registerMetaTools(server, catalog, opts) {
12311
12596
  server.registerTool(
@@ -12719,13 +13004,7 @@ function parseSkillsClient(value) {
12719
13004
  }
12720
13005
 
12721
13006
  export {
12722
- getConfigDir,
12723
- getConfigPath,
12724
- loadConfig,
12725
- loadConfigRaw,
12726
- saveConfig,
12727
- saveConfigPatch,
12728
- configExists,
13007
+ getBootstrapEnv,
12729
13008
  isMachineFormat,
12730
13009
  EXIT_USER_ERROR,
12731
13010
  EXIT_SYSTEM_ERROR,
@@ -12734,6 +13013,13 @@ export {
12734
13013
  isEndpointMissing,
12735
13014
  systemError,
12736
13015
  printCliError,
13016
+ getConfigDir,
13017
+ getConfigPath,
13018
+ loadConfig,
13019
+ loadConfigRaw,
13020
+ saveConfig,
13021
+ saveConfigPatch,
13022
+ configExists,
12737
13023
  PACKAGE_VERSION,
12738
13024
  BUNDLED_SKILL_NAMES,
12739
13025
  getBundledSkillSnapshots,