@canonry/canonry 4.168.0 → 4.170.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 (27) hide show
  1. package/assets/assets/{AuditHistoryPanel-Dvz6QFtW.js → AuditHistoryPanel-BpIn6E7p.js} +1 -1
  2. package/assets/assets/{BacklinksPage-BHOtOIr5.js → BacklinksPage-BvOWgx1l.js} +1 -1
  3. package/assets/assets/{HistoryPage-Bc5Nx6dX.js → HistoryPage-BXaQyur8.js} +1 -1
  4. package/assets/assets/{MeasurementPropertyPage-D4FIFiWv.js → MeasurementPropertyPage-Buj708lc.js} +1 -1
  5. package/assets/assets/{ProjectPage-CT5ZD7_A.js → ProjectPage-BwC29w2_.js} +1 -1
  6. package/assets/assets/{RunRow-CB2oG45_.js → RunRow-C9hp5yEp.js} +1 -1
  7. package/assets/assets/{RunsPage-OLbocIOY.js → RunsPage-DmkRH1iu.js} +1 -1
  8. package/assets/assets/{SettingsPage-DVdPBrap.js → SettingsPage-BIyuj-gL.js} +1 -1
  9. package/assets/assets/{SiteHealthSection-B1bjMCqY.js → SiteHealthSection-ZlYR3JtG.js} +3 -3
  10. package/assets/assets/{TrafficPage-BUWXjHhw.js → TrafficPage-PxIetTWH.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-DwoFzTu7.js → TrafficSourceDetailPage-BhF_leby.js} +1 -1
  12. package/assets/assets/{extract-error-message-CNH2-nPH.js → extract-error-message-Dd2su-BK.js} +1 -1
  13. package/assets/assets/index-DyjfMyum.js +83 -0
  14. package/assets/assets/{react-sigma_core.esm.min-DLRh4X_G.js → react-sigma_core.esm.min-CsNemdas.js} +1 -1
  15. package/assets/index.html +1 -1
  16. package/dist/{chunk-C4UWZLQX.js → chunk-BMW3AURU.js} +567 -5
  17. package/dist/{chunk-CDACTPTY.js → chunk-CCZNCH7Y.js} +3641 -1154
  18. package/dist/{chunk-TP4KXU3E.js → chunk-HJ7W2LXI.js} +4081 -3069
  19. package/dist/{chunk-76JMZAFZ.js → chunk-HTUI6BSK.js} +2 -2
  20. package/dist/{chunk-R2SZWJDV.js → chunk-NMCLLN5X.js} +3376 -137
  21. package/dist/cli.js +5 -5
  22. package/dist/index.d.ts +132 -2
  23. package/dist/index.js +10 -4
  24. package/dist/{intelligence-service-KBSDKHED.js → intelligence-service-64IPZ4NU.js} +2 -2
  25. package/dist/mcp.js +3 -3
  26. package/package.json +10 -8
  27. package/assets/assets/index-DdXb59Rg.js +0 -83
package/dist/cli.js CHANGED
@@ -26,11 +26,11 @@ import {
26
26
  showFirstRunNotice,
27
27
  trackCliCommandFinished,
28
28
  trackEvent
29
- } from "./chunk-R2SZWJDV.js";
29
+ } from "./chunk-NMCLLN5X.js";
30
30
  import {
31
31
  autoSyncSkills,
32
32
  formatAutoSyncNotice
33
- } from "./chunk-76JMZAFZ.js";
33
+ } from "./chunk-HTUI6BSK.js";
34
34
  import {
35
35
  CliError,
36
36
  EXIT_SYSTEM_ERROR,
@@ -55,7 +55,7 @@ import {
55
55
  saveConfigPatch,
56
56
  systemError,
57
57
  usageError
58
- } from "./chunk-C4UWZLQX.js";
58
+ } from "./chunk-BMW3AURU.js";
59
59
  import {
60
60
  CLOUDFLARE_WORKER_BINDINGS,
61
61
  CLOUDFLARE_WORKER_GENERATED_MARKER,
@@ -69,7 +69,7 @@ import {
69
69
  projects,
70
70
  queries,
71
71
  renderReportHtml
72
- } from "./chunk-CDACTPTY.js";
72
+ } from "./chunk-CCZNCH7Y.js";
73
73
  import {
74
74
  AdsDeliverySnapshotStatuses,
75
75
  AdsHistoricalCampaignRollupStatuses,
@@ -134,7 +134,7 @@ import {
134
134
  providerQuotaPolicySchema,
135
135
  resolveProviderInput,
136
136
  winnabilityClassSchema
137
- } from "./chunk-TP4KXU3E.js";
137
+ } from "./chunk-HJ7W2LXI.js";
138
138
 
139
139
  // src/cli.ts
140
140
  import { pathToFileURL } from "url";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { FastifyInstance } from 'fastify';
2
2
  import { DatabaseClient } from '@ainyc/canonry-db';
3
- import { ProviderQuotaPolicy, EmbedConfigEntry, AgentPluginState } from '@ainyc/canonry-contracts';
3
+ import { ProviderQuotaPolicy, EmbedConfigEntry, AgentPluginState, GoogleAdsCampaignMetricsQuery, GoogleAdsRawSnapshotDto, GoogleAdsEffectiveGoalGraphDto, GoogleMarketingProvider, GoogleAdsAccessibleCustomersResponse, GoogleAdsAccessibleCustomerDto, GtmAccountsResponse, GtmContainerListResponse, GtmWorkspaceListResponse, GtmRawSnapshotDto } from '@ainyc/canonry-contracts';
4
+ import { GoogleTokenResponse } from '@ainyc/canonry-integration-google';
4
5
 
5
6
  type GoogleConnectionType = 'gsc' | 'ga4' | 'gbp';
6
7
  interface ProviderConfigEntry {
@@ -107,6 +108,55 @@ interface OpenAiAdsConnectionConfigEntry {
107
108
  interface OpenAiAdsConfigEntry {
108
109
  connections?: OpenAiAdsConnectionConfigEntry[];
109
110
  }
111
+ /**
112
+ * Private OAuth credentials are bound to the immutable `projects.id`.
113
+ * `projectName` is descriptive only and must never be used for lookup.
114
+ */
115
+ interface GoogleAdsConnectionConfigEntry {
116
+ projectId: string;
117
+ projectName: string;
118
+ /**
119
+ * Opaque, secret-free nonce minted on every OAuth connect/reconnect.
120
+ * Refresh uses it as a compare-and-swap generation so an in-flight token
121
+ * refresh can never restore an older Google principal.
122
+ */
123
+ credentialGeneration?: string;
124
+ accessToken?: string;
125
+ refreshToken?: string | null;
126
+ tokenExpiresAt?: string | null;
127
+ scopes?: string[];
128
+ createdAt: string;
129
+ updatedAt: string;
130
+ }
131
+ interface GoogleAdsConfigEntry {
132
+ developerToken?: string;
133
+ /** Optional dedicated OAuth app. Falls back to the shared `google` app. */
134
+ clientId?: string;
135
+ clientSecret?: string;
136
+ connections?: GoogleAdsConnectionConfigEntry[];
137
+ }
138
+ /**
139
+ * Private OAuth credentials are bound to the immutable `projects.id`.
140
+ * `projectName` is descriptive only and must never be used for lookup.
141
+ */
142
+ interface GtmConnectionConfigEntry {
143
+ projectId: string;
144
+ projectName: string;
145
+ /** See GoogleAdsConnectionConfigEntry.credentialGeneration. */
146
+ credentialGeneration?: string;
147
+ accessToken?: string;
148
+ refreshToken?: string | null;
149
+ tokenExpiresAt?: string | null;
150
+ scopes?: string[];
151
+ createdAt: string;
152
+ updatedAt: string;
153
+ }
154
+ interface GtmConfigEntry {
155
+ /** Optional dedicated OAuth app. Falls back to the shared `google` app. */
156
+ clientId?: string;
157
+ clientSecret?: string;
158
+ connections?: GtmConnectionConfigEntry[];
159
+ }
110
160
  type WordpressEnv = 'live' | 'staging';
111
161
  interface WordpressConnectionConfigEntry {
112
162
  projectName: string;
@@ -294,6 +344,8 @@ interface CanonryConfig {
294
344
  vercelTraffic?: VercelTrafficConfigEntry;
295
345
  cloudflareTraffic?: CloudflareTrafficConfigEntry;
296
346
  openaiAds?: OpenAiAdsConfigEntry;
347
+ googleAds?: GoogleAdsConfigEntry;
348
+ gtm?: GtmConfigEntry;
297
349
  dashboardPasswordHash?: string;
298
350
  dashboard?: DashboardConfigEntry;
299
351
  telemetry?: boolean;
@@ -356,4 +408,82 @@ declare function createServer(opts: {
356
408
  getAgentPluginState?: () => AgentPluginState;
357
409
  }): Promise<FastifyInstance>;
358
410
 
359
- export { type CanonryConfig, createServer, loadConfig };
411
+ interface GoogleMarketingProjectRef {
412
+ id: string;
413
+ name: string;
414
+ }
415
+ interface GoogleMarketingRuntimeOptions {
416
+ config: CanonryConfig;
417
+ saveConfigPatch: (patch: Partial<CanonryConfig>) => void | Promise<void>;
418
+ env?: Readonly<Record<string, string | undefined>>;
419
+ fetch?: typeof globalThis.fetch;
420
+ now?: () => Date;
421
+ randomUUID?: () => string;
422
+ refreshAccessToken?: (clientId: string, clientSecret: string, refreshToken: string) => Promise<GoogleTokenResponse>;
423
+ }
424
+ interface GoogleAdsCustomerDiscoveryOptions {
425
+ loginCustomerId?: string | null;
426
+ maxCustomers?: number;
427
+ }
428
+ interface GoogleAdsCustomerDetailsInput {
429
+ customerId: string;
430
+ loginCustomerId?: string | null;
431
+ }
432
+ interface GoogleMarketingListOptions {
433
+ maxResults?: number;
434
+ }
435
+ interface GoogleAdsSyncInput {
436
+ project: GoogleMarketingProjectRef;
437
+ connectionId: string;
438
+ runId: string;
439
+ selection: {
440
+ customerId: string;
441
+ loginCustomerId?: string | null;
442
+ selectedAt?: string | null;
443
+ };
444
+ /** Omit to use the trailing 31 customer-local calendar days (UTC fallback) and at most 50 campaigns. */
445
+ metricsQuery?: GoogleAdsCampaignMetricsQuery;
446
+ }
447
+ interface GoogleAdsSyncResult {
448
+ accessibleCustomers: GoogleAdsRawSnapshotDto;
449
+ inventory: GoogleAdsRawSnapshotDto;
450
+ metrics: GoogleAdsRawSnapshotDto | null;
451
+ effectiveGoalGraph: GoogleAdsEffectiveGoalGraphDto;
452
+ }
453
+ interface GtmSyncInput {
454
+ project: GoogleMarketingProjectRef;
455
+ connectionId: string;
456
+ runId: string;
457
+ selection: {
458
+ accountId: string;
459
+ containerId: string;
460
+ workspaceId?: string | null;
461
+ };
462
+ expectedEventName?: string;
463
+ expectedHostname?: string;
464
+ }
465
+ interface GoogleMarketingRuntime {
466
+ listGoogleAdsCustomers(project: GoogleMarketingProjectRef, options?: GoogleAdsCustomerDiscoveryOptions): Promise<GoogleAdsAccessibleCustomersResponse>;
467
+ getGoogleAdsCustomer(project: GoogleMarketingProjectRef, input: GoogleAdsCustomerDetailsInput): Promise<GoogleAdsAccessibleCustomerDto>;
468
+ listGtmAccounts(project: GoogleMarketingProjectRef, options?: GoogleMarketingListOptions): Promise<GtmAccountsResponse>;
469
+ listGtmContainers(project: GoogleMarketingProjectRef, accountId: string, options?: GoogleMarketingListOptions): Promise<GtmContainerListResponse>;
470
+ listGtmWorkspaces(project: GoogleMarketingProjectRef, accountId: string, containerId: string, options?: GoogleMarketingListOptions): Promise<GtmWorkspaceListResponse>;
471
+ syncGoogleAds(input: GoogleAdsSyncInput): Promise<GoogleAdsSyncResult>;
472
+ syncGtm(input: GtmSyncInput): Promise<GtmRawSnapshotDto>;
473
+ }
474
+ declare class GoogleMarketingRuntimeError extends Error {
475
+ readonly code: 'INVALID_INPUT' | 'NOT_CONFIGURED' | 'CONNECTION_NOT_FOUND' | 'TOKEN_REFRESH_REQUIRED' | 'INVALID_TOKEN_RESPONSE' | 'RESOURCE_NOT_FOUND';
476
+ readonly name = "GoogleMarketingRuntimeError";
477
+ constructor(message: string, code: 'INVALID_INPUT' | 'NOT_CONFIGURED' | 'CONNECTION_NOT_FOUND' | 'TOKEN_REFRESH_REQUIRED' | 'INVALID_TOKEN_RESPONSE' | 'RESOURCE_NOT_FOUND');
478
+ }
479
+ interface PrivateCredential {
480
+ accessToken: string;
481
+ }
482
+ /** Private runtime seam. Values returned here must never cross an API response boundary. */
483
+ interface GoogleMarketingCredentialStore {
484
+ getCredential(project: GoogleMarketingProjectRef, provider: GoogleMarketingProvider): Promise<PrivateCredential>;
485
+ }
486
+ declare function createGoogleMarketingCredentialStore(options: GoogleMarketingRuntimeOptions): GoogleMarketingCredentialStore;
487
+ declare function createGoogleMarketingRuntime(options: GoogleMarketingRuntimeOptions): GoogleMarketingRuntime;
488
+
489
+ export { type CanonryConfig, type GoogleAdsCustomerDetailsInput, type GoogleAdsCustomerDiscoveryOptions, type GoogleAdsSyncInput, type GoogleAdsSyncResult, type GoogleMarketingCredentialStore, type GoogleMarketingListOptions, type GoogleMarketingProjectRef, type GoogleMarketingRuntime, GoogleMarketingRuntimeError, type GoogleMarketingRuntimeOptions, type GtmSyncInput, createGoogleMarketingCredentialStore, createGoogleMarketingRuntime, createServer, loadConfig };
package/dist/index.js CHANGED
@@ -1,12 +1,18 @@
1
1
  import {
2
+ GoogleMarketingRuntimeError,
3
+ createGoogleMarketingCredentialStore,
4
+ createGoogleMarketingRuntime,
2
5
  createServer
3
- } from "./chunk-R2SZWJDV.js";
6
+ } from "./chunk-NMCLLN5X.js";
4
7
  import {
5
8
  loadConfig
6
- } from "./chunk-C4UWZLQX.js";
7
- import "./chunk-CDACTPTY.js";
8
- import "./chunk-TP4KXU3E.js";
9
+ } from "./chunk-BMW3AURU.js";
10
+ import "./chunk-CCZNCH7Y.js";
11
+ import "./chunk-HJ7W2LXI.js";
9
12
  export {
13
+ GoogleMarketingRuntimeError,
14
+ createGoogleMarketingCredentialStore,
15
+ createGoogleMarketingRuntime,
10
16
  createServer,
11
17
  loadConfig
12
18
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-CDACTPTY.js";
4
- import "./chunk-TP4KXU3E.js";
3
+ } from "./chunk-CCZNCH7Y.js";
4
+ import "./chunk-HJ7W2LXI.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  autoSyncSkills
3
- } from "./chunk-76JMZAFZ.js";
3
+ } from "./chunk-HTUI6BSK.js";
4
4
  import {
5
5
  CliError,
6
6
  PACKAGE_VERSION,
7
7
  canonryMcpTools,
8
8
  createApiClient
9
- } from "./chunk-C4UWZLQX.js";
9
+ } from "./chunk-BMW3AURU.js";
10
10
  import {
11
11
  isReadOnlyKey
12
- } from "./chunk-TP4KXU3E.js";
12
+ } from "./chunk-HJ7W2LXI.js";
13
13
 
14
14
  // src/mcp/cli.ts
15
15
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "4.168.0",
3
+ "version": "4.170.0",
4
4
  "type": "module",
5
5
  "description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
6
6
  "license": "FSL-1.1-ALv2",
@@ -75,24 +75,26 @@
75
75
  "@ainyc/canonry-config": "0.0.0",
76
76
  "@ainyc/canonry-db": "0.0.0",
77
77
  "@ainyc/canonry-contracts": "0.0.0",
78
+ "@ainyc/canonry-integration-bing": "0.0.0",
78
79
  "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
79
80
  "@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
80
81
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
81
- "@ainyc/canonry-integration-bing": "0.0.0",
82
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
83
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
84
82
  "@ainyc/canonry-integration-google": "0.0.0",
85
- "@ainyc/canonry-integration-google-business-profile": "0.0.0",
83
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
84
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
86
85
  "@ainyc/canonry-integration-google-places": "0.0.0",
86
+ "@ainyc/canonry-integration-google-business-profile": "0.0.0",
87
+ "@ainyc/canonry-integration-google-ads": "0.0.0",
88
+ "@ainyc/canonry-integration-google-tag-manager": "0.0.0",
87
89
  "@ainyc/canonry-integration-traffic": "0.0.0",
88
90
  "@ainyc/canonry-integration-wordpress": "0.0.0",
89
91
  "@ainyc/canonry-provider-cdp": "0.0.0",
90
92
  "@ainyc/canonry-intelligence": "0.0.0",
91
- "@ainyc/canonry-provider-local": "0.0.0",
92
93
  "@ainyc/canonry-provider-claude": "0.0.0",
94
+ "@ainyc/canonry-provider-local": "0.0.0",
93
95
  "@ainyc/canonry-provider-openai": "0.0.0",
94
- "@ainyc/canonry-provider-gemini": "0.0.0",
95
- "@ainyc/canonry-provider-perplexity": "0.0.0"
96
+ "@ainyc/canonry-provider-perplexity": "0.0.0",
97
+ "@ainyc/canonry-provider-gemini": "0.0.0"
96
98
  },
97
99
  "scripts": {
98
100
  "build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",