@ainyc/canonry 4.186.9 → 4.188.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/README.md +5 -1
  2. package/assets/assets/{AuditHistoryPanel-aXPOAK7n.js → AuditHistoryPanel-TB5U1Ji3.js} +1 -1
  3. package/assets/assets/{BacklinksPage-Bim-7fNk.js → BacklinksPage-DuVo-zE_.js} +1 -1
  4. package/assets/assets/{HistoryPage-B8RyIjRC.js → HistoryPage-Iduo4lBo.js} +1 -1
  5. package/assets/assets/{MeasurementPropertyPage-BlxY3qHW.js → MeasurementPropertyPage-BfyCJOyp.js} +1 -1
  6. package/assets/assets/ProjectPage-B4oBsbvi.js +9 -0
  7. package/assets/assets/{RunRow-B28gp-6g.js → RunRow-mgN1t4Qv.js} +1 -1
  8. package/assets/assets/{RunsPage-BXm6DVdt.js → RunsPage-BigJ3-H2.js} +1 -1
  9. package/assets/assets/{SettingsPage-CJX7c5HH.js → SettingsPage-BT3CFsQo.js} +1 -1
  10. package/assets/assets/SiteHealthSection-hDvnkERi.js +4 -0
  11. package/assets/assets/{TrafficPage-wPdIYn8H.js → TrafficPage-C0QO4XyK.js} +1 -1
  12. package/assets/assets/{TrafficSourceDetailPage-C813qZsA.js → TrafficSourceDetailPage-DfVjnwBG.js} +1 -1
  13. package/assets/assets/{extract-error-message-C3RpUAm_.js → extract-error-message-V9rhOto9.js} +1 -1
  14. package/assets/assets/{index-Dr_-IUJz.js → index-BoPxOwXJ.js} +29 -29
  15. package/assets/assets/index-DTblya6d.css +1 -0
  16. package/assets/assets/{react-sigma_core.esm.min-LmiGNvR6.js → react-sigma_core.esm.min-DOk1TYjb.js} +1 -1
  17. package/assets/index.html +2 -2
  18. package/dist/{chunk-O26JKJXV.js → chunk-6YJQGOR6.js} +27 -10
  19. package/dist/{chunk-XD2ZD2BP.js → chunk-A47HAZDJ.js} +2 -2
  20. package/dist/{chunk-EMSDPSQM.js → chunk-GPTEXYYL.js} +116 -62
  21. package/dist/{chunk-LNBX7RTN.js → chunk-HIIOVQSH.js} +30 -1
  22. package/dist/{chunk-U3M2VALC.js → chunk-QPYMAXLJ.js} +45 -1
  23. package/dist/cli.js +32 -5
  24. package/dist/index.d.ts +4 -2
  25. package/dist/index.js +4 -4
  26. package/dist/{intelligence-service-UZGA24EF.js → intelligence-service-4KMWHEYP.js} +2 -2
  27. package/dist/mcp.js +3 -3
  28. package/package.json +9 -9
  29. package/assets/assets/ProjectPage-BMZrEjBE.js +0 -9
  30. package/assets/assets/SiteHealthSection-Ys8sVumO.js +0 -4
  31. package/assets/assets/index-DJ8_LvRn.css +0 -1
@@ -88,6 +88,7 @@ import {
88
88
  queryTrackingPreviewRequestSchema,
89
89
  reportPeriodSchema,
90
90
  researchRunCreateSchema,
91
+ resultsClearRequestSchema,
91
92
  runTriggerRequestSchema,
92
93
  schedulableRunKindSchema,
93
94
  scheduleUpsertRequestSchema,
@@ -98,7 +99,7 @@ import {
98
99
  trafficEventKindSchema,
99
100
  trafficSeriesGranularitySchema,
100
101
  visibilityReportRequestSchema
101
- } from "./chunk-LNBX7RTN.js";
102
+ } from "./chunk-HIIOVQSH.js";
102
103
 
103
104
  // src/cli-error.ts
104
105
  function isMachineFormat(format) {
@@ -172,6 +173,7 @@ import { z } from "zod";
172
173
  var dashboardManagedSweepsSchema = z.boolean().nullish();
173
174
  var researchAllowViewersSchema = z.boolean().nullish();
174
175
  var researchViewerDailyRunLimitSchema = z.number().int().positive().nullish();
176
+ var dashboardManagedRunKindsSchema = z.array(schedulableRunKindSchema).nullish();
175
177
  var envSchema = z.object({
176
178
  DATABASE_URL: z.string().default("postgresql://aeo:aeo@postgres:5432/aeo_platform"),
177
179
  API_PORT: z.coerce.number().int().positive().default(3e3),
@@ -407,6 +409,12 @@ Do not use "canonry init --force" for recovery. It replaces credentials without
407
409
  message: `Invalid config at ${configPath}: research.allowViewers must be true, false, or left blank.`
408
410
  });
409
411
  }
412
+ if (!dashboardManagedRunKindsSchema.safeParse(parsed.dashboard?.managedRunKinds).success) {
413
+ throw new CliError({
414
+ code: "CONFIG_INVALID",
415
+ message: `Invalid config at ${configPath}: dashboard.managedRunKinds must be a list of schedulable run kinds.`
416
+ });
417
+ }
410
418
  if (!researchViewerDailyRunLimitSchema.safeParse(parsed.research?.viewerDailyRunLimit).success) {
411
419
  throw new CliError({
412
420
  code: "CONFIG_INVALID",
@@ -2335,6 +2343,22 @@ var postApiV1ProjectsByNameQueryTrackingCommit = (options) => {
2335
2343
  }
2336
2344
  });
2337
2345
  };
2346
+ var postApiV1ProjectsByNameResultsClear = (options) => {
2347
+ return (options.client ?? client).post({
2348
+ security: [
2349
+ {
2350
+ scheme: "bearer",
2351
+ type: "http"
2352
+ }
2353
+ ],
2354
+ url: "/api/v1/projects/{name}/results/clear",
2355
+ ...options,
2356
+ headers: {
2357
+ "Content-Type": "application/json",
2358
+ ...options.headers
2359
+ }
2360
+ });
2361
+ };
2338
2362
  var getApiV1ProjectsByNameResearchRunsByRunId = (options) => {
2339
2363
  return (options.client ?? client).get({
2340
2364
  security: [
@@ -8021,6 +8045,14 @@ var ApiClient = class {
8021
8045
  );
8022
8046
  }
8023
8047
  // ── Research query runs ────────────────────────────────────────────────
8048
+ /** Preview or clear exact saved visibility/research run IDs. */
8049
+ async clearResults(project, request) {
8050
+ return this.invoke(() => postApiV1ProjectsByNameResultsClear({
8051
+ client: this.heyClient,
8052
+ path: { name: project },
8053
+ body: request
8054
+ }));
8055
+ }
8024
8056
  /**
8025
8057
  * Start one saved research batch. Research results are deliberately kept
8026
8058
  * outside the tracked-query basket and visibility-run history.
@@ -9859,6 +9891,17 @@ var canonryMcpTools = [
9859
9891
  openApiOperations: ["GET /api/v1/projects/{name}/export"],
9860
9892
  handler: (client2, input) => client2.getExport(input.project)
9861
9893
  }),
9894
+ defineTool({
9895
+ name: "canonry_results_clear",
9896
+ title: "Preview or clear saved results",
9897
+ description: "Clear only explicitly selected visibility runs and research batches. Preview is the default; back up evidence and set confirm=true to delete. Refuses active work and other run kinds. Preserves queries, plans, schedules, Site Health, backlinks, usage, and the audit trail.",
9898
+ access: "write",
9899
+ tier: "monitoring",
9900
+ inputSchema: resultsClearRequestSchema.safeExtend({ project: projectNameSchema }),
9901
+ annotations: writeAnnotations({ idempotentHint: false, destructiveHint: true }),
9902
+ openApiOperations: ["POST /api/v1/projects/{name}/results/clear"],
9903
+ handler: (client2, input) => client2.clearResults(input.project, { runIds: input.runIds, researchRunIds: input.researchRunIds, confirm: input.confirm })
9904
+ }),
9862
9905
  defineTool({
9863
9906
  name: "canonry_project_history",
9864
9907
  title: "Get project history",
@@ -13021,6 +13064,7 @@ function parseSkillsClient(value) {
13021
13064
  }
13022
13065
 
13023
13066
  export {
13067
+ dashboardManagedRunKindsSchema,
13024
13068
  getBootstrapEnv,
13025
13069
  isMachineFormat,
13026
13070
  EXIT_USER_ERROR,
package/dist/cli.js CHANGED
@@ -28,11 +28,11 @@ import {
28
28
  trackCliCommandFinished,
29
29
  trackEvent,
30
30
  waitForServerRuntimeStartup
31
- } from "./chunk-O26JKJXV.js";
31
+ } from "./chunk-6YJQGOR6.js";
32
32
  import {
33
33
  autoSyncSkills,
34
34
  formatAutoSyncNotice
35
- } from "./chunk-XD2ZD2BP.js";
35
+ } from "./chunk-A47HAZDJ.js";
36
36
  import {
37
37
  CliError,
38
38
  EXIT_SYSTEM_ERROR,
@@ -58,7 +58,7 @@ import {
58
58
  saveConfigPatch,
59
59
  systemError,
60
60
  usageError
61
- } from "./chunk-U3M2VALC.js";
61
+ } from "./chunk-QPYMAXLJ.js";
62
62
  import {
63
63
  CLOUDFLARE_WORKER_BINDINGS,
64
64
  CLOUDFLARE_WORKER_GENERATED_MARKER,
@@ -72,7 +72,7 @@ import {
72
72
  projects,
73
73
  queries,
74
74
  renderReportHtml
75
- } from "./chunk-EMSDPSQM.js";
75
+ } from "./chunk-GPTEXYYL.js";
76
76
  import {
77
77
  AdsDeliverySnapshotStatuses,
78
78
  AdsHistoricalCampaignRollupStatuses,
@@ -141,11 +141,12 @@ import {
141
141
  queryTrackingCommitRequestSchema,
142
142
  queryTrackingPreviewRequestSchema,
143
143
  resolveProviderInput,
144
+ resultsClearRequestSchema,
144
145
  shareOfVoiceLabel,
145
146
  shareOfVoiceReason,
146
147
  visibilityReportRequestSchema,
147
148
  winnabilityClassSchema
148
- } from "./chunk-LNBX7RTN.js";
149
+ } from "./chunk-HIIOVQSH.js";
149
150
 
150
151
  // src/cli.ts
151
152
  import { pathToFileURL } from "url";
@@ -11428,6 +11429,18 @@ async function showHistory(project, format, opts = {}) {
11428
11429
  });
11429
11430
  }
11430
11431
  }
11432
+ async function clearResults(project, opts) {
11433
+ const request = resultsClearRequestSchema.safeParse({ runIds: opts.runIds, researchRunIds: opts.researchRunIds, confirm: opts.confirm });
11434
+ if (!request.success) throw new CliError({ code: "INVALID_ARGUMENT", message: request.error.issues.map((issue) => issue.message).join(" "), exitCode: 1 });
11435
+ const result = await getClient20().clearResults(project, request.data);
11436
+ if (opts.format === "jsonl") emitJsonl([result]);
11437
+ else if (opts.format === "json") console.log(JSON.stringify(result, null, 2));
11438
+ else {
11439
+ console.log(`${result.dryRun ? "Would clear" : "Cleared"} ${result.runIds.length} visibility runs and ${result.researchRunIds.length} research batches.`);
11440
+ console.log(`${result.querySnapshots} saved visibility answers; ${result.researchQueries} research queries.`);
11441
+ if (result.dryRun) console.log("Back up the evidence, then repeat with --confirm to delete these exact runs.");
11442
+ }
11443
+ }
11431
11444
 
11432
11445
  // src/commands/status.ts
11433
11446
  function getClient21() {
@@ -11499,7 +11512,21 @@ function parseResultsExportFormat(value) {
11499
11512
 
11500
11513
  Usage: ${RESULTS_EXPORT_USAGE}`);
11501
11514
  }
11515
+ var RESULTS_CLEAR_USAGE = "canonry results clear <project> [--run <id> ...] [--research-run <id> ...] [--confirm] [--format json|jsonl]";
11502
11516
  var OPERATOR_CLI_COMMANDS = [
11517
+ {
11518
+ path: ["results", "clear"],
11519
+ usage: RESULTS_CLEAR_USAGE,
11520
+ options: { run: multiStringOption(), "research-run": multiStringOption(), confirm: { type: "boolean", default: false } },
11521
+ run: async (input) => {
11522
+ await clearResults(requireProject(input, "results.clear", RESULTS_CLEAR_USAGE), {
11523
+ runIds: getStringArray(input.values, "run") ?? [],
11524
+ researchRunIds: getStringArray(input.values, "research-run") ?? [],
11525
+ confirm: getBoolean(input.values, "confirm"),
11526
+ format: input.format
11527
+ });
11528
+ }
11529
+ },
11503
11530
  {
11504
11531
  path: ["results", "export"],
11505
11532
  usage: RESULTS_EXPORT_USAGE,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { FastifyInstance } from 'fastify';
2
2
  import { DatabaseClient } from '@ainyc/canonry-db';
3
- import { ProviderQuotaPolicy, EmbedConfigEntry, AgentPluginState, GoogleAdsCampaignMetricsQuery, GoogleAdsRawSnapshotDto, GoogleAdsEffectiveGoalGraphDto, GoogleMarketingProvider, GoogleAdsAccessibleCustomersResponse, GoogleAdsAccessibleCustomerDto, GtmAccountsResponse, GtmContainerListResponse, GtmWorkspaceListResponse, GtmRawSnapshotDto } from '@ainyc/canonry-contracts';
3
+ import { ProviderQuotaPolicy, SchedulableRunKind, EmbedConfigEntry, AgentPluginState, GoogleAdsCampaignMetricsQuery, GoogleAdsRawSnapshotDto, GoogleAdsEffectiveGoalGraphDto, GoogleMarketingProvider, GoogleAdsAccessibleCustomersResponse, GoogleAdsAccessibleCustomerDto, GtmAccountsResponse, GtmContainerListResponse, GtmWorkspaceListResponse, GtmRawSnapshotDto } from '@ainyc/canonry-contracts';
4
4
  import { GoogleTokenResponse } from '@ainyc/canonry-integration-google';
5
5
 
6
6
  type GoogleConnectionType = 'gsc' | 'ga4' | 'gbp';
@@ -306,8 +306,10 @@ interface DashboardConfigEntry {
306
306
  * or CLI update notice.
307
307
  */
308
308
  showUpdateNotification?: boolean;
309
- /** Hide dashboard sweep controls; operators can still use `canonry run`. Defaults to false. */
309
+ /** Legacy alias for managedRunKinds: ['answer-visibility']. */
310
310
  managedSweeps?: boolean | null;
311
+ /** Presentation only. Managed sweeps hide all launches; managed scans hide viewer launches. */
312
+ managedRunKinds?: SchedulableRunKind[] | null;
311
313
  }
312
314
  interface ResearchConfigEntry {
313
315
  /** Allow signed-in viewers to run paid research queries. Defaults to false. */
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-O26JKJXV.js";
6
+ } from "./chunk-6YJQGOR6.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-U3M2VALC.js";
10
- import "./chunk-EMSDPSQM.js";
11
- import "./chunk-LNBX7RTN.js";
9
+ } from "./chunk-QPYMAXLJ.js";
10
+ import "./chunk-GPTEXYYL.js";
11
+ import "./chunk-HIIOVQSH.js";
12
12
  export {
13
13
  GoogleMarketingRuntimeError,
14
14
  createGoogleMarketingCredentialStore,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-EMSDPSQM.js";
4
- import "./chunk-LNBX7RTN.js";
3
+ } from "./chunk-GPTEXYYL.js";
4
+ import "./chunk-HIIOVQSH.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  autoSyncSkills
3
- } from "./chunk-XD2ZD2BP.js";
3
+ } from "./chunk-A47HAZDJ.js";
4
4
  import {
5
5
  createApiClient,
6
6
  createCanonryMcpServer
7
- } from "./chunk-U3M2VALC.js";
7
+ } from "./chunk-QPYMAXLJ.js";
8
8
  import {
9
9
  isReadOnlyKey
10
- } from "./chunk-LNBX7RTN.js";
10
+ } from "./chunk-HIIOVQSH.js";
11
11
 
12
12
  // src/mcp/cli.ts
13
13
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "4.186.9",
3
+ "version": "4.188.0",
4
4
  "type": "module",
5
5
  "description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
6
6
  "license": "FSL-1.1-ALv2",
@@ -70,32 +70,32 @@
70
70
  "@types/node-cron": "^3.0.11",
71
71
  "tsup": "^8.5.1",
72
72
  "tsx": "^4.19.0",
73
- "@ainyc/canonry-api-client": "0.0.0",
74
- "@ainyc/canonry-api-routes": "0.0.0",
75
73
  "@ainyc/canonry-web": "0.0.0",
74
+ "@ainyc/canonry-api-routes": "0.0.0",
75
+ "@ainyc/canonry-api-client": "0.0.0",
76
76
  "@ainyc/canonry-config": "0.0.0",
77
77
  "@ainyc/canonry-contracts": "0.0.0",
78
78
  "@ainyc/canonry-db": "0.0.0",
79
79
  "@ainyc/canonry-integration-bing": "0.0.0",
80
80
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
81
- "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
82
- "@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
83
81
  "@ainyc/canonry-integration-google": "0.0.0",
84
82
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
83
+ "@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
85
84
  "@ainyc/canonry-integration-google-ads": "0.0.0",
86
85
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
86
+ "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
87
87
  "@ainyc/canonry-integration-google-places": "0.0.0",
88
88
  "@ainyc/canonry-integration-google-tag-manager": "0.0.0",
89
89
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
90
- "@ainyc/canonry-integration-traffic": "0.0.0",
91
90
  "@ainyc/canonry-integration-wordpress": "0.0.0",
92
91
  "@ainyc/canonry-intelligence": "0.0.0",
92
+ "@ainyc/canonry-integration-traffic": "0.0.0",
93
93
  "@ainyc/canonry-provider-cdp": "0.0.0",
94
- "@ainyc/canonry-provider-claude": "0.0.0",
95
- "@ainyc/canonry-provider-openai": "0.0.0",
96
94
  "@ainyc/canonry-provider-perplexity": "0.0.0",
97
95
  "@ainyc/canonry-provider-local": "0.0.0",
98
- "@ainyc/canonry-provider-gemini": "0.0.0"
96
+ "@ainyc/canonry-provider-openai": "0.0.0",
97
+ "@ainyc/canonry-provider-gemini": "0.0.0",
98
+ "@ainyc/canonry-provider-claude": "0.0.0"
99
99
  },
100
100
  "scripts": {
101
101
  "build": "pnpm run build:cli && pnpm run build:web",