@canonry/canonry 4.133.3 → 4.134.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -13
- package/assets/agent-workspace/skills/canonry/references/aeo-analysis.md +3 -2
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +32 -3
- package/assets/assets/{AuditHistoryPanel-DTHQGvkW.js → AuditHistoryPanel-BW7LVMSZ.js} +1 -1
- package/assets/assets/{BacklinksPage-DuPI3wt9.js → BacklinksPage-DU65axM1.js} +1 -1
- package/assets/assets/{ChartPrimitives-T8mxOObc.js → ChartPrimitives-CUZJ7nUb.js} +1 -1
- package/assets/assets/{HistoryPage-T1W40xKG.js → HistoryPage-BswdEXC5.js} +1 -1
- package/assets/assets/ProjectPage-CttTuKKo.js +8 -0
- package/assets/assets/{RunRow-nHr4wW9B.js → RunRow-CBxbfubI.js} +1 -1
- package/assets/assets/{RunsPage-Cbusy_84.js → RunsPage-BQxA05ua.js} +1 -1
- package/assets/assets/{SettingsPage-BVcbl4gn.js → SettingsPage-krEusjc9.js} +1 -1
- package/assets/assets/{TrafficPage-CZ4NTWI6.js → TrafficPage-DMhcA9lg.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-xW-KvZY1.js → TrafficSourceDetailPage-Dm0Gj0HS.js} +1 -1
- package/assets/assets/{arrow-left-flskyFPK.js → arrow-left-_1YaUPbl.js} +1 -1
- package/assets/assets/{extract-error-message-BHfCTm0H.js → extract-error-message-D4XKG37U.js} +1 -1
- package/assets/assets/{index-CQzGDGMB.js → index-V1C3c7nO.js} +100 -100
- package/assets/assets/{trash-2-LGfqtSzZ.js → trash-2-D3LWIGDJ.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-A6BYMSZL.js → chunk-BSU2MI3Y.js} +79 -4
- package/dist/{chunk-YRRQFOAH.js → chunk-CF5WTWXI.js} +257 -2
- package/dist/{chunk-HENMGNLT.js → chunk-DVJGFY3J.js} +684 -74
- package/dist/{chunk-6ON6GUAL.js → chunk-NWVPRV7A.js} +68 -6
- package/dist/cli.js +113 -5
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-OSLFG5S2.js → intelligence-service-NO4FJUYD.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +9 -9
- package/assets/assets/ProjectPage-DYwM8-Rp.js +0 -8
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
loadConfig,
|
|
11
11
|
loadConfigRaw,
|
|
12
12
|
saveConfigPatch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BSU2MI3Y.js";
|
|
14
14
|
import {
|
|
15
15
|
CC_CACHE_DIR,
|
|
16
16
|
DUCKDB_SPEC,
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
classifyAiUserFetch,
|
|
41
41
|
classifyCrawler,
|
|
42
42
|
competitors,
|
|
43
|
+
computeCitedCompetitorDomains,
|
|
43
44
|
computeCompetitorOverlap,
|
|
44
45
|
countAttributes,
|
|
45
46
|
countPopulatedGroups,
|
|
@@ -118,7 +119,7 @@ import {
|
|
|
118
119
|
siteAuditPages,
|
|
119
120
|
siteAuditSnapshots,
|
|
120
121
|
usageCounters
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-DVJGFY3J.js";
|
|
122
123
|
import {
|
|
123
124
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
124
125
|
AGENT_PROVIDER_IDS,
|
|
@@ -188,10 +189,11 @@ import {
|
|
|
188
189
|
serializeRunError,
|
|
189
190
|
skillsClientSchema,
|
|
190
191
|
splitList,
|
|
192
|
+
startOfDayHourInTimeZone,
|
|
191
193
|
validationError,
|
|
192
194
|
winnabilityClassLabel,
|
|
193
195
|
withRetry
|
|
194
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-CF5WTWXI.js";
|
|
195
197
|
|
|
196
198
|
// src/telemetry.ts
|
|
197
199
|
import crypto from "crypto";
|
|
@@ -4877,14 +4879,22 @@ function accountHour(date, timezone) {
|
|
|
4877
4879
|
};
|
|
4878
4880
|
return `${value("year")}-${value("month")}-${value("day")}T${value("hour")}`;
|
|
4879
4881
|
}
|
|
4880
|
-
function trailingAdsInsightHourRange(now, timezone) {
|
|
4882
|
+
function trailingAdsInsightHourRange(now, timezone, lookbackMs = INSIGHTS_LOOKBACK_MS) {
|
|
4881
4883
|
return {
|
|
4882
4884
|
type: "hour_range",
|
|
4883
|
-
since: accountHour(new Date(now.getTime() -
|
|
4885
|
+
since: accountHour(new Date(now.getTime() - lookbackMs), timezone),
|
|
4884
4886
|
until: accountHour(now, timezone),
|
|
4885
4887
|
timezone
|
|
4886
4888
|
};
|
|
4887
4889
|
}
|
|
4890
|
+
function liveAdsInsightHourRange(request) {
|
|
4891
|
+
return {
|
|
4892
|
+
type: "hour_range",
|
|
4893
|
+
since: startOfDayHourInTimeZone(request.startDate, request.timezone),
|
|
4894
|
+
until: accountHour(new Date(request.fetchedAtMs), request.timezone),
|
|
4895
|
+
timezone: request.timezone
|
|
4896
|
+
};
|
|
4897
|
+
}
|
|
4888
4898
|
function toInsightUpserts(level, entityId, rows) {
|
|
4889
4899
|
const upserts = [];
|
|
4890
4900
|
for (const row of rows) {
|
|
@@ -7000,7 +7010,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
7000
7010
|
return result;
|
|
7001
7011
|
}
|
|
7002
7012
|
async function backfillInsightsCommand(project, opts) {
|
|
7003
|
-
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-
|
|
7013
|
+
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-NO4FJUYD.js");
|
|
7004
7014
|
const config = loadConfig();
|
|
7005
7015
|
const db = createClient(config.database);
|
|
7006
7016
|
migrate(db);
|
|
@@ -9114,6 +9124,7 @@ var AERO_ADS_OPERATOR_MCP_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
9114
9124
|
CanonryMcpToolNames.canonry_ads_insights,
|
|
9115
9125
|
CanonryMcpToolNames.canonry_ads_summary,
|
|
9116
9126
|
CanonryMcpToolNames.canonry_ads_delivery_diagnostics,
|
|
9127
|
+
CanonryMcpToolNames.canonry_ads_live_delivery,
|
|
9117
9128
|
CanonryMcpToolNames.canonry_ads_operations_unresolved,
|
|
9118
9129
|
CanonryMcpToolNames.canonry_ads_operation_get,
|
|
9119
9130
|
CanonryMcpToolNames.canonry_ads_operation_reconcile,
|
|
@@ -11592,6 +11603,14 @@ async function executeResearchRun(db, registry, runId, projectId) {
|
|
|
11592
11603
|
return provider.adapter.executeTrackedQuery({ query: row.queryText, canonicalDomains: domains, competitorDomains, ...run.location ? { location: run.location } : {} }, config);
|
|
11593
11604
|
});
|
|
11594
11605
|
const normalized = provider.adapter.normalizeResult(raw);
|
|
11606
|
+
const namedCompetitors = extractRecommendedCompetitors(
|
|
11607
|
+
normalized.answerText,
|
|
11608
|
+
domains,
|
|
11609
|
+
normalized.citedDomains,
|
|
11610
|
+
competitorDomains,
|
|
11611
|
+
brands
|
|
11612
|
+
);
|
|
11613
|
+
const citedCompetitorDomains = computeCitedCompetitorDomains(normalized.citedDomains, competitorDomains);
|
|
11595
11614
|
const completed = db.update(researchRunQueries).set({
|
|
11596
11615
|
status: ResearchQueryStatuses.completed,
|
|
11597
11616
|
servedModel: raw.servedModel ?? null,
|
|
@@ -11599,6 +11618,8 @@ async function executeResearchRun(db, registry, runId, projectId) {
|
|
|
11599
11618
|
groundingSources: normalized.groundingSources,
|
|
11600
11619
|
citedDomains: normalized.citedDomains,
|
|
11601
11620
|
searchQueries: normalized.searchQueries,
|
|
11621
|
+
namedCompetitors,
|
|
11622
|
+
citedCompetitorDomains,
|
|
11602
11623
|
answerMentioned: determineAnswerMentioned(normalized.answerText, brands, domains),
|
|
11603
11624
|
citationState: determineCitationState(normalized, domains),
|
|
11604
11625
|
rawResponse: raw.rawResponse,
|
|
@@ -12204,6 +12225,42 @@ async function createServer(opts) {
|
|
|
12204
12225
|
activateAd: async (apiKey, id) => adsAdEntityResult(await activateAd(apiKey, id)),
|
|
12205
12226
|
pauseAd: async (apiKey, id) => adsAdEntityResult(await pauseAd(apiKey, id))
|
|
12206
12227
|
};
|
|
12228
|
+
const adsLiveEntity = (entity, extra) => ({
|
|
12229
|
+
id: entity.id,
|
|
12230
|
+
name: entity.name,
|
|
12231
|
+
status: entity.status,
|
|
12232
|
+
reviewStatus: extra?.reviewStatus ?? null,
|
|
12233
|
+
mode: extra?.mode ?? null,
|
|
12234
|
+
updatedAt: entity.updated_at
|
|
12235
|
+
});
|
|
12236
|
+
const adsLiveMetricRow = (row) => ({
|
|
12237
|
+
date: row.readable_time ?? null,
|
|
12238
|
+
startTime: row.start_time ?? null,
|
|
12239
|
+
endTime: row.end_time ?? null,
|
|
12240
|
+
impressions: row.impressions ?? null,
|
|
12241
|
+
clicks: row.clicks ?? null,
|
|
12242
|
+
// Provider units: the insights API returns decimal currency for spend.
|
|
12243
|
+
spend: row.spend ?? null,
|
|
12244
|
+
conversions: row.conversions ?? null,
|
|
12245
|
+
ctr: row.ctr ?? null,
|
|
12246
|
+
cpc: row.cpc ?? null,
|
|
12247
|
+
cpm: row.cpm ?? null
|
|
12248
|
+
});
|
|
12249
|
+
const adsLiveDeliveryReader = {
|
|
12250
|
+
listCampaigns: async (apiKey) => (await listCampaigns(apiKey)).map((campaign) => adsLiveEntity(campaign, { mode: campaign.mode })),
|
|
12251
|
+
listAdGroups: async (apiKey, campaignId) => (await listAdGroups(apiKey, campaignId)).map((adGroup) => adsLiveEntity(adGroup)),
|
|
12252
|
+
listAds: async (apiKey, adGroupId) => (await listAds(apiKey, adGroupId)).map(
|
|
12253
|
+
(ad) => adsLiveEntity(ad, { reviewStatus: ad.review_status ?? ad.review?.status ?? null })
|
|
12254
|
+
),
|
|
12255
|
+
campaignInsights: async (apiKey, campaignId, request) => (await getCampaignInsights(apiKey, campaignId, {
|
|
12256
|
+
fields: CAMPAIGN_INSIGHT_FIELDS,
|
|
12257
|
+
timeRanges: [liveAdsInsightHourRange(request)]
|
|
12258
|
+
})).map(adsLiveMetricRow),
|
|
12259
|
+
adGroupInsights: async (apiKey, adGroupId, request) => (await getAdGroupInsights(apiKey, adGroupId, {
|
|
12260
|
+
fields: AD_GROUP_INSIGHT_FIELDS,
|
|
12261
|
+
timeRanges: [liveAdsInsightHourRange(request)]
|
|
12262
|
+
})).map(adsLiveMetricRow)
|
|
12263
|
+
};
|
|
12207
12264
|
const scheduler = new Scheduler(opts.db, {
|
|
12208
12265
|
onRunCreated: (runId, projectId, providers2, location) => {
|
|
12209
12266
|
jobRunner.executeRun(runId, projectId, providers2, location).catch((err) => {
|
|
@@ -12803,6 +12860,11 @@ async function createServer(opts) {
|
|
|
12803
12860
|
adsCredentialStore,
|
|
12804
12861
|
verifyAdsAccount,
|
|
12805
12862
|
adsReader,
|
|
12863
|
+
adsLiveDeliveryReader,
|
|
12864
|
+
// Reporting only: lets the route state the true upstream HTTP ceiling
|
|
12865
|
+
// (reader-call budget x pages per reader call) instead of implying that a
|
|
12866
|
+
// reader call is one request.
|
|
12867
|
+
adsLiveDeliveryMaxPagesPerReaderCall: OPENAI_ADS_MAX_PAGES,
|
|
12806
12868
|
adsOperator,
|
|
12807
12869
|
onAdsSyncRequested: (runId, projectId) => {
|
|
12808
12870
|
runAdsSync(runId, projectId);
|
package/dist/cli.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
setTelemetrySource,
|
|
30
30
|
showFirstRunNotice,
|
|
31
31
|
trackEvent
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-NWVPRV7A.js";
|
|
33
33
|
import {
|
|
34
34
|
CliError,
|
|
35
35
|
EXIT_SYSTEM_ERROR,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
saveConfig,
|
|
47
47
|
saveConfigPatch,
|
|
48
48
|
usageError
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-BSU2MI3Y.js";
|
|
50
50
|
import {
|
|
51
51
|
apiKeys,
|
|
52
52
|
createClient,
|
|
@@ -54,10 +54,11 @@ import {
|
|
|
54
54
|
projects,
|
|
55
55
|
queries,
|
|
56
56
|
renderReportHtml
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-DVJGFY3J.js";
|
|
58
58
|
import {
|
|
59
59
|
AdsDeliverySnapshotStatuses,
|
|
60
60
|
AdsHistoricalCampaignRollupStatuses,
|
|
61
|
+
AdsLiveEntityTypes,
|
|
61
62
|
AdsOperationKinds,
|
|
62
63
|
AdsOperationStates,
|
|
63
64
|
AdsOperationStepStates,
|
|
@@ -99,7 +100,7 @@ import {
|
|
|
99
100
|
providerQuotaPolicySchema,
|
|
100
101
|
resolveProviderInput,
|
|
101
102
|
winnabilityClassSchema
|
|
102
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-CF5WTWXI.js";
|
|
103
104
|
|
|
104
105
|
// src/cli.ts
|
|
105
106
|
import { pathToFileURL } from "url";
|
|
@@ -2692,6 +2693,12 @@ function printDetail(project, detail, format) {
|
|
|
2692
2693
|
console.log(` ${query.query.slice(0, 58).padEnd(58)} ${query.status.padEnd(10)} ${cited.padEnd(5)} ${mentioned}`);
|
|
2693
2694
|
if (query.error) console.log(` Error: ${query.error}`);
|
|
2694
2695
|
if (query.answerText) console.log(` Answer: ${query.answerText}`);
|
|
2696
|
+
if (query.namedCompetitors.length > 0) {
|
|
2697
|
+
console.log(` Named competitors: ${query.namedCompetitors.join(", ")}`);
|
|
2698
|
+
}
|
|
2699
|
+
if (query.citedCompetitorDomains.length > 0) {
|
|
2700
|
+
console.log(` Cited competitor domains: ${query.citedCompetitorDomains.join(", ")}`);
|
|
2701
|
+
}
|
|
2695
2702
|
if (query.groundingSources.length > 0) {
|
|
2696
2703
|
console.log(" Sources:");
|
|
2697
2704
|
for (const source of query.groundingSources) {
|
|
@@ -3414,6 +3421,42 @@ async function adsDeliveryDiagnostics(project, opts) {
|
|
|
3414
3421
|
}
|
|
3415
3422
|
}
|
|
3416
3423
|
}
|
|
3424
|
+
async function adsLiveDelivery(project, opts) {
|
|
3425
|
+
const result = await getClient6().getAdsLiveDelivery(project, {
|
|
3426
|
+
campaignId: opts?.campaignId,
|
|
3427
|
+
lookbackDays: opts?.lookbackDays
|
|
3428
|
+
});
|
|
3429
|
+
if (isMachineFormat(opts?.format)) {
|
|
3430
|
+
console.log(JSON.stringify(result, null, 2));
|
|
3431
|
+
return;
|
|
3432
|
+
}
|
|
3433
|
+
console.log(`Read at: ${result.fetchedAt} (live provider read)`);
|
|
3434
|
+
console.log(`Ad account: ${result.adAccountId}`);
|
|
3435
|
+
console.log(`Snapshot: last synced ${result.storedSnapshotSyncedAt ?? "never"}`);
|
|
3436
|
+
console.log(`Metrics: last ${result.metricsWindow.lookbackDays}d, as the provider reported them`);
|
|
3437
|
+
console.log(`Provider: ${result.bounds.readerCalls}/${result.bounds.maxReaderCalls} reader calls, up to ${result.bounds.maxUpstreamHttpRequests} upstream HTTP requests${result.bounds.truncated ? " (TRUNCATED, walk hit a cap)" : ""}`);
|
|
3438
|
+
console.log(`Drift: ${result.drift.driftedEntities}/${result.drift.entitiesCompared} entities (${result.drift.statusDrifted} status, ${result.drift.metricsDrifted} metrics)`);
|
|
3439
|
+
for (const failure of result.errors) {
|
|
3440
|
+
console.log(`Read failed: ${failure.surface}${failure.entityId ? ` ${failure.entityId}` : ""}${failure.upstreamStatus === null ? "" : ` [HTTP ${failure.upstreamStatus}]`}`);
|
|
3441
|
+
}
|
|
3442
|
+
for (const entity of result.entities) {
|
|
3443
|
+
const indent = entity.entityType === AdsLiveEntityTypes.campaign ? "" : entity.entityType === AdsLiveEntityTypes.ad_group ? " " : " ";
|
|
3444
|
+
const label = entity.live?.name ?? entity.stored?.name ?? entity.id;
|
|
3445
|
+
const liveStatus = entity.live === null ? "absent upstream" : entity.live.status;
|
|
3446
|
+
const storedStatus = entity.stored === null ? "absent locally" : entity.stored.status;
|
|
3447
|
+
const marker = entity.drifted ? "DRIFT" : "match";
|
|
3448
|
+
console.log(`${indent}${label} [${entity.entityType}]: live ${liveStatus} / stored ${storedStatus} (${marker})`);
|
|
3449
|
+
for (const delta of entity.fieldDeltas) {
|
|
3450
|
+
console.log(`${indent} ${delta.field}: live ${delta.live ?? "none"} / stored ${delta.stored ?? "none"}`);
|
|
3451
|
+
}
|
|
3452
|
+
for (const delta of entity.metricDeltas ?? []) {
|
|
3453
|
+
if (!delta.drifted) continue;
|
|
3454
|
+
const live = delta.live === null ? "no provider row" : `${delta.live.impressions} impr / ${delta.live.clicks} clicks / ${formatMicros(delta.live.spendMicros)}`;
|
|
3455
|
+
const stored = delta.stored === null ? "no stored row" : `${delta.stored.impressions} impr / ${delta.stored.clicks} clicks / ${formatMicros(delta.stored.spendMicros)}`;
|
|
3456
|
+
console.log(`${indent} ${delta.date}: live ${live} / stored ${stored}`);
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3417
3460
|
|
|
3418
3461
|
// src/cli-commands/ads.ts
|
|
3419
3462
|
var ADS_CLI_COMMANDS = [
|
|
@@ -3770,6 +3813,27 @@ Usage: ${usage}`, {
|
|
|
3770
3813
|
await adsSummary(project, { format: input.format });
|
|
3771
3814
|
}
|
|
3772
3815
|
},
|
|
3816
|
+
{
|
|
3817
|
+
path: ["ads", "live-delivery"],
|
|
3818
|
+
usage: "canonry ads live-delivery <project> [--campaign <id>] [--lookback-days <n>] [--format json]",
|
|
3819
|
+
options: {
|
|
3820
|
+
campaign: stringOption(),
|
|
3821
|
+
"lookback-days": stringOption()
|
|
3822
|
+
},
|
|
3823
|
+
run: async (input) => {
|
|
3824
|
+
const usage = "canonry ads live-delivery <project> [--campaign <id>] [--lookback-days <n>] [--format json]";
|
|
3825
|
+
const project = requireProject(input, "ads.live-delivery", usage);
|
|
3826
|
+
await adsLiveDelivery(project, {
|
|
3827
|
+
campaignId: getString(input.values, "campaign"),
|
|
3828
|
+
lookbackDays: parseIntegerOption(input, "lookback-days", {
|
|
3829
|
+
command: "ads.live-delivery",
|
|
3830
|
+
message: "--lookback-days must be an integer from 1 to 30",
|
|
3831
|
+
usage
|
|
3832
|
+
}),
|
|
3833
|
+
format: input.format
|
|
3834
|
+
});
|
|
3835
|
+
}
|
|
3836
|
+
},
|
|
3773
3837
|
{
|
|
3774
3838
|
path: ["ads", "delivery-diagnostics"],
|
|
3775
3839
|
usage: "canonry ads delivery-diagnostics <project> [--format json]",
|
|
@@ -4047,6 +4111,36 @@ async function gaAiReferralHistory(project, opts) {
|
|
|
4047
4111
|
);
|
|
4048
4112
|
}
|
|
4049
4113
|
}
|
|
4114
|
+
async function gaAiReferralDaily(project, opts) {
|
|
4115
|
+
const client = getClient7();
|
|
4116
|
+
const result = await client.gaAiReferralDaily(project, opts?.window ? { window: opts.window } : void 0);
|
|
4117
|
+
if (opts?.format === "json") {
|
|
4118
|
+
console.log(JSON.stringify(result, null, 2));
|
|
4119
|
+
return;
|
|
4120
|
+
} else if (opts?.format === "jsonl") {
|
|
4121
|
+
emitJsonl(result.days.map((day) => ({ project, window: opts?.window, ...day })));
|
|
4122
|
+
return;
|
|
4123
|
+
}
|
|
4124
|
+
if (result.days.length === 0) {
|
|
4125
|
+
console.log(`No AI referral sessions.${opts?.window ? " Try a wider window or omit --window." : ' Run "canonry ga sync <project>" first.'}`);
|
|
4126
|
+
return;
|
|
4127
|
+
}
|
|
4128
|
+
const dateWidth = 12;
|
|
4129
|
+
const sourceWidth = Math.min(30, Math.max(10, ...result.sources.map((s) => s.length)));
|
|
4130
|
+
console.log(`GA4 AI Referral Sessions per Day for "${project}":
|
|
4131
|
+
`);
|
|
4132
|
+
console.log(` ${"DATE".padEnd(dateWidth)} ${"SOURCE".padEnd(sourceWidth)} ${"SESSIONS".padEnd(10)}${"PAID".padEnd(8)}${"ORGANIC".padEnd(9)}`);
|
|
4133
|
+
console.log(` ${"\u2500".repeat(dateWidth)} ${"\u2500".repeat(sourceWidth)} ${"\u2500".repeat(10)}${"\u2500".repeat(8)}${"\u2500".repeat(9)}`);
|
|
4134
|
+
for (const day of result.days) {
|
|
4135
|
+
for (const entry of day.bySource) {
|
|
4136
|
+
console.log(
|
|
4137
|
+
` ${day.date.padEnd(dateWidth)} ${entry.source.padEnd(sourceWidth)} ${String(entry.sessions).padEnd(10)}${String(entry.paidSessions).padEnd(8)}${String(entry.organicSessions).padEnd(9)}`
|
|
4138
|
+
);
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
console.log(`
|
|
4142
|
+
Total: ${result.totalSessions} sessions (${result.totalPaidSessions} paid, ${result.totalOrganicSessions} organic)`);
|
|
4143
|
+
}
|
|
4050
4144
|
async function gaSocialReferralHistory(project, opts) {
|
|
4051
4145
|
const client = getClient7();
|
|
4052
4146
|
const result = await client.gaSocialReferralHistory(project, opts?.window ? { window: opts.window } : void 0);
|
|
@@ -4511,6 +4605,20 @@ var GA_CLI_COMMANDS = [
|
|
|
4511
4605
|
});
|
|
4512
4606
|
}
|
|
4513
4607
|
},
|
|
4608
|
+
{
|
|
4609
|
+
path: ["ga", "ai-referral-daily"],
|
|
4610
|
+
usage: "canonry ga ai-referral-daily <project> [--window 30d] [--format json]",
|
|
4611
|
+
options: {
|
|
4612
|
+
window: stringOption()
|
|
4613
|
+
},
|
|
4614
|
+
run: async (input) => {
|
|
4615
|
+
const project = requireProject(input, "ga.ai-referral-daily", "canonry ga ai-referral-daily <project> [--window 30d] [--format json]");
|
|
4616
|
+
await gaAiReferralDaily(project, {
|
|
4617
|
+
window: getString(input.values, "window"),
|
|
4618
|
+
format: input.format
|
|
4619
|
+
});
|
|
4620
|
+
}
|
|
4621
|
+
},
|
|
4514
4622
|
{
|
|
4515
4623
|
path: ["ga", "social-referral-history"],
|
|
4516
4624
|
usage: "canonry ga social-referral-history <project> [--window 30d] [--format json]",
|
|
@@ -4574,7 +4682,7 @@ var GA_CLI_COMMANDS = [
|
|
|
4574
4682
|
unknownSubcommand(input.positionals[0], {
|
|
4575
4683
|
command: "ga",
|
|
4576
4684
|
usage: "canonry ga <subcommand> <project> [args]",
|
|
4577
|
-
available: ["connect", "disconnect", "status", "sync", "measurement-analysis", "traffic", "coverage", "ai-referral-history", "social-referral-history", "session-history", "social-referral-summary", "attribution"]
|
|
4685
|
+
available: ["connect", "disconnect", "status", "sync", "measurement-analysis", "traffic", "coverage", "ai-referral-history", "ai-referral-daily", "social-referral-history", "session-history", "social-referral-summary", "attribution"]
|
|
4578
4686
|
});
|
|
4579
4687
|
}
|
|
4580
4688
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NWVPRV7A.js";
|
|
4
4
|
import {
|
|
5
5
|
loadConfig
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-BSU2MI3Y.js";
|
|
7
|
+
import "./chunk-DVJGFY3J.js";
|
|
8
|
+
import "./chunk-CF5WTWXI.js";
|
|
9
9
|
export {
|
|
10
10
|
createServer,
|
|
11
11
|
loadConfig
|
package/dist/mcp.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
PACKAGE_VERSION,
|
|
4
4
|
canonryMcpTools,
|
|
5
5
|
createApiClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BSU2MI3Y.js";
|
|
7
7
|
import {
|
|
8
8
|
isReadOnlyKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CF5WTWXI.js";
|
|
10
10
|
|
|
11
11
|
// src/mcp/cli.ts
|
|
12
12
|
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.
|
|
3
|
+
"version": "4.134.1",
|
|
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",
|
|
@@ -68,24 +68,24 @@
|
|
|
68
68
|
"@ainyc/canonry-api-client": "0.0.0",
|
|
69
69
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
70
70
|
"@ainyc/canonry-config": "0.0.0",
|
|
71
|
-
"@ainyc/canonry-contracts": "0.0.0",
|
|
72
71
|
"@ainyc/canonry-db": "0.0.0",
|
|
72
|
+
"@ainyc/canonry-contracts": "0.0.0",
|
|
73
73
|
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
74
|
+
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
74
75
|
"@ainyc/canonry-integration-openai-ads": "0.0.0",
|
|
76
|
+
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
75
77
|
"@ainyc/canonry-integration-cloud-run": "0.0.0",
|
|
76
|
-
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
77
78
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
78
|
-
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
79
79
|
"@ainyc/canonry-integration-google-business-profile": "0.0.0",
|
|
80
80
|
"@ainyc/canonry-integration-traffic": "0.0.0",
|
|
81
|
-
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
82
81
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
83
82
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
84
|
-
"@ainyc/canonry-provider-
|
|
85
|
-
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
86
|
-
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
83
|
+
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
87
84
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
88
|
-
"@ainyc/canonry-
|
|
85
|
+
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
86
|
+
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
87
|
+
"@ainyc/canonry-provider-local": "0.0.0",
|
|
88
|
+
"@ainyc/canonry-provider-perplexity": "0.0.0"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
|