@canonry/canonry 4.124.0 → 4.125.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.
- package/assets/assets/{AuditHistoryPanel-fPBADGsr.js → AuditHistoryPanel-C-KSU-dr.js} +1 -1
- package/assets/assets/{BacklinksPage-DKer7s8M.js → BacklinksPage-BH4njwCh.js} +1 -1
- package/assets/assets/{ChartPrimitives-0DFDFhCZ.js → ChartPrimitives-BhB9Kxzc.js} +1 -1
- package/assets/assets/{HistoryPage-BTkTlXg0.js → HistoryPage-BQVNx0eu.js} +1 -1
- package/assets/assets/{ProjectPage-BzqDCkp2.js → ProjectPage-DnkNE1AW.js} +1 -1
- package/assets/assets/{RunRow-DyIeH4_d.js → RunRow-70N3oGz8.js} +1 -1
- package/assets/assets/{RunsPage-KVu_37ds.js → RunsPage-CtuKRP0o.js} +1 -1
- package/assets/assets/{SettingsPage-CCLXSBpq.js → SettingsPage-B1ZGnDz8.js} +1 -1
- package/assets/assets/{TrafficPage-BH7a0sS2.js → TrafficPage-BOGbXHd9.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-kIlf0kCe.js → TrafficSourceDetailPage-5jj7n7W1.js} +1 -1
- package/assets/assets/{arrow-left-jhivZs4g.js → arrow-left-gOf0lyu3.js} +1 -1
- package/assets/assets/{extract-error-message-XU_cbcLD.js → extract-error-message-CZKcwJhv.js} +1 -1
- package/assets/assets/{index-CqFSTLK5.js → index-B_CDPjOg.js} +59 -59
- package/assets/assets/{trash-2-CcmHLt5u.js → trash-2-BnFgG3Wq.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-4D2XUMMV.js → chunk-DN5H2ZN7.js} +42 -7
- package/dist/{chunk-SLCGTOKT.js → chunk-RFLNTI7Y.js} +11 -1
- package/dist/{chunk-WGGB7QBD.js → chunk-WA57WG6W.js} +1 -1
- package/dist/{chunk-BGLBWFMV.js → chunk-YPRUBNUK.js} +137 -3
- package/dist/cli.js +4 -4
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-SACHNNCT.js → intelligence-service-WJ2ZR7GF.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./index-
|
|
1
|
+
import{c}from"./index-B_CDPjOg.js";const a=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h=c("circle-check",a);const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n=c("circle-question-mark",e);const o=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],s=c("download",o);const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r=c("trash-2",t);export{h as C,s as D,r as T,n as a};
|
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-B_CDPjOg.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-Be8JdV5M.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-radix-CQ77EO2y.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-recharts-DSxTZhaH.js">
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
loadConfig,
|
|
11
11
|
loadConfigRaw,
|
|
12
12
|
saveConfigPatch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WA57WG6W.js";
|
|
14
14
|
import {
|
|
15
15
|
CC_CACHE_DIR,
|
|
16
16
|
DUCKDB_SPEC,
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
siteAuditPages,
|
|
116
116
|
siteAuditSnapshots,
|
|
117
117
|
usageCounters
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-YPRUBNUK.js";
|
|
119
119
|
import {
|
|
120
120
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
121
121
|
AGENT_PROVIDER_IDS,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
validationError,
|
|
186
186
|
winnabilityClassLabel,
|
|
187
187
|
withRetry
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-RFLNTI7Y.js";
|
|
189
189
|
|
|
190
190
|
// src/telemetry.ts
|
|
191
191
|
import crypto from "crypto";
|
|
@@ -4612,7 +4612,10 @@ async function fetchAllPages(apiKey, path10, queryPairs) {
|
|
|
4612
4612
|
);
|
|
4613
4613
|
}
|
|
4614
4614
|
function insightsPairs(opts) {
|
|
4615
|
-
return
|
|
4615
|
+
return [
|
|
4616
|
+
...(opts?.fields ?? []).map((field) => `fields[]=${encodeURIComponent(field)}`),
|
|
4617
|
+
...(opts?.timeRanges ?? []).map((range) => `time_ranges[]=${encodeURIComponent(JSON.stringify(range))}`)
|
|
4618
|
+
];
|
|
4616
4619
|
}
|
|
4617
4620
|
async function getAdAccount(apiKey) {
|
|
4618
4621
|
validateApiKey(apiKey);
|
|
@@ -4793,6 +4796,31 @@ function removeOpenAiAdsConnection(config, projectName) {
|
|
|
4793
4796
|
var log4 = createLogger("AdsSync");
|
|
4794
4797
|
var CAMPAIGN_INSIGHT_FIELDS = ["campaign.impressions", "campaign.clicks", "campaign.spend", "campaign.conversions", "metadata.readable_time"];
|
|
4795
4798
|
var AD_GROUP_INSIGHT_FIELDS = ["ad_group.impressions", "ad_group.clicks", "ad_group.spend", "ad_group.conversions", "metadata.readable_time"];
|
|
4799
|
+
var INSIGHTS_LOOKBACK_MS = 90 * 24 * 60 * 60 * 1e3;
|
|
4800
|
+
function accountHour(date, timezone) {
|
|
4801
|
+
const parts = new Intl.DateTimeFormat("en-CA", {
|
|
4802
|
+
timeZone: timezone,
|
|
4803
|
+
year: "numeric",
|
|
4804
|
+
month: "2-digit",
|
|
4805
|
+
day: "2-digit",
|
|
4806
|
+
hour: "2-digit",
|
|
4807
|
+
hourCycle: "h23"
|
|
4808
|
+
}).formatToParts(date);
|
|
4809
|
+
const value = (type) => {
|
|
4810
|
+
const part = parts.find((candidate) => candidate.type === type)?.value;
|
|
4811
|
+
if (!part) throw new Error(`OpenAI Ads account timezone did not produce a ${type}`);
|
|
4812
|
+
return part;
|
|
4813
|
+
};
|
|
4814
|
+
return `${value("year")}-${value("month")}-${value("day")}T${value("hour")}`;
|
|
4815
|
+
}
|
|
4816
|
+
function trailingAdsInsightHourRange(now, timezone) {
|
|
4817
|
+
return {
|
|
4818
|
+
type: "hour_range",
|
|
4819
|
+
since: accountHour(new Date(now.getTime() - INSIGHTS_LOOKBACK_MS), timezone),
|
|
4820
|
+
until: accountHour(now, timezone),
|
|
4821
|
+
timezone
|
|
4822
|
+
};
|
|
4823
|
+
}
|
|
4796
4824
|
function toInsightUpserts(level, entityId, rows) {
|
|
4797
4825
|
const upserts = [];
|
|
4798
4826
|
for (const row of rows) {
|
|
@@ -4830,6 +4858,7 @@ async function executeAdsSync(db, runId, projectId, opts) {
|
|
|
4830
4858
|
log4.info("sync.start", { runId, projectId, adAccountId: connRow.adAccountId });
|
|
4831
4859
|
const account = await getAdAccount(apiKey);
|
|
4832
4860
|
const campaigns = await listCampaigns(apiKey);
|
|
4861
|
+
const insightTimeRanges = [trailingAdsInsightHourRange(/* @__PURE__ */ new Date(), account.timezone)];
|
|
4833
4862
|
const errors = /* @__PURE__ */ new Map();
|
|
4834
4863
|
const adGroupsByCampaign = /* @__PURE__ */ new Map();
|
|
4835
4864
|
const adsByGroup = /* @__PURE__ */ new Map();
|
|
@@ -4839,12 +4868,18 @@ async function executeAdsSync(db, runId, projectId, opts) {
|
|
|
4839
4868
|
try {
|
|
4840
4869
|
const [adGroups, campaignInsights] = await Promise.all([
|
|
4841
4870
|
listAdGroups(apiKey, campaign.id),
|
|
4842
|
-
getCampaignInsights(apiKey, campaign.id, {
|
|
4871
|
+
getCampaignInsights(apiKey, campaign.id, {
|
|
4872
|
+
fields: CAMPAIGN_INSIGHT_FIELDS,
|
|
4873
|
+
timeRanges: insightTimeRanges
|
|
4874
|
+
})
|
|
4843
4875
|
]);
|
|
4844
4876
|
const groupResults = await Promise.all(adGroups.map(async (group) => ({
|
|
4845
4877
|
group,
|
|
4846
4878
|
ads: await listAds(apiKey, group.id),
|
|
4847
|
-
insights: await getAdGroupInsights(apiKey, group.id, {
|
|
4879
|
+
insights: await getAdGroupInsights(apiKey, group.id, {
|
|
4880
|
+
fields: AD_GROUP_INSIGHT_FIELDS,
|
|
4881
|
+
timeRanges: insightTimeRanges
|
|
4882
|
+
})
|
|
4848
4883
|
})));
|
|
4849
4884
|
syncedCampaigns.push(campaign);
|
|
4850
4885
|
adGroupsByCampaign.set(campaign.id, adGroups);
|
|
@@ -6901,7 +6936,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
6901
6936
|
return result;
|
|
6902
6937
|
}
|
|
6903
6938
|
async function backfillInsightsCommand(project, opts) {
|
|
6904
|
-
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-
|
|
6939
|
+
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-WJ2ZR7GF.js");
|
|
6905
6940
|
const config = loadConfig();
|
|
6906
6941
|
const db = createClient(config.database);
|
|
6907
6942
|
migrate(db);
|
|
@@ -6848,10 +6848,19 @@ var adsOperationStepDtoSchema = z35.discriminatedUnion("state", [
|
|
|
6848
6848
|
adsOperationStepRollbackFailedDtoSchema,
|
|
6849
6849
|
adsOperationStepUnknownDtoSchema
|
|
6850
6850
|
]);
|
|
6851
|
+
var AdsActivationVersionPolicies = {
|
|
6852
|
+
exact: "exact",
|
|
6853
|
+
refreshSemanticallyUnchanged: "refresh_semantically_unchanged"
|
|
6854
|
+
};
|
|
6855
|
+
var adsActivationVersionPolicySchema = z35.enum([
|
|
6856
|
+
AdsActivationVersionPolicies.exact,
|
|
6857
|
+
AdsActivationVersionPolicies.refreshSemanticallyUnchanged
|
|
6858
|
+
]);
|
|
6851
6859
|
var adsActivationGrantCreateRequestSchema = z35.object({
|
|
6852
6860
|
manifest: adsActivationManifestSchema,
|
|
6853
6861
|
executorApiKeyId: adsEntityIdSchema,
|
|
6854
|
-
expiresAt: adsActivationIsoTimestampSchema
|
|
6862
|
+
expiresAt: adsActivationIsoTimestampSchema,
|
|
6863
|
+
versionPolicy: adsActivationVersionPolicySchema.default(AdsActivationVersionPolicies.exact)
|
|
6855
6864
|
}).strict();
|
|
6856
6865
|
var adsActivationGrantResponseSchema = z35.object({
|
|
6857
6866
|
grant: adsActivationGrantDtoSchema
|
|
@@ -7441,6 +7450,7 @@ export {
|
|
|
7441
7450
|
adsOperationResponseSchema,
|
|
7442
7451
|
adsActivationGrantDtoSchema,
|
|
7443
7452
|
adsOperationStepDtoSchema,
|
|
7453
|
+
AdsActivationVersionPolicies,
|
|
7444
7454
|
adsActivationGrantCreateRequestSchema,
|
|
7445
7455
|
adsActivationGrantResponseSchema,
|
|
7446
7456
|
adsActivationGrantRevokeRequestSchema,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
AI_PROVIDER_INFRA_DOMAINS,
|
|
8
8
|
AdsActivationEntityTypes,
|
|
9
9
|
AdsActivationGrantStates,
|
|
10
|
+
AdsActivationVersionPolicies,
|
|
10
11
|
AdsAdGroupBillingEventTypes,
|
|
11
12
|
AdsCampaignBiddingTypes,
|
|
12
13
|
AdsEntityStatuses,
|
|
@@ -335,7 +336,7 @@ import {
|
|
|
335
336
|
wordpressSchemaDeployResultDtoSchema,
|
|
336
337
|
wordpressSchemaStatusResultDtoSchema,
|
|
337
338
|
wordpressStatusDtoSchema
|
|
338
|
-
} from "./chunk-
|
|
339
|
+
} from "./chunk-RFLNTI7Y.js";
|
|
339
340
|
|
|
340
341
|
// src/intelligence-service.ts
|
|
341
342
|
import { eq as eq41, desc as desc18, asc as asc9, and as and32, ne as ne6, or as or8, inArray as inArray15, gte as gte10, lte as lte6 } from "drizzle-orm";
|
|
@@ -18623,7 +18624,13 @@ var routeCatalog = [
|
|
|
18623
18624
|
properties: {
|
|
18624
18625
|
manifest: adsActivationManifestSchema2,
|
|
18625
18626
|
executorApiKeyId: adsEntityIdSchema,
|
|
18626
|
-
expiresAt: { type: "string", format: "date-time" }
|
|
18627
|
+
expiresAt: { type: "string", format: "date-time" },
|
|
18628
|
+
versionPolicy: {
|
|
18629
|
+
type: "string",
|
|
18630
|
+
enum: ["exact", "refresh_semantically_unchanged"],
|
|
18631
|
+
default: "exact",
|
|
18632
|
+
description: "Exact rejects any provider version drift. refresh_semantically_unchanged rebinds versions only when the live paused tree still matches its durable create receipts field-for-field."
|
|
18633
|
+
}
|
|
18627
18634
|
}
|
|
18628
18635
|
}
|
|
18629
18636
|
}
|
|
@@ -24948,6 +24955,81 @@ async function preflightAdsActivationApproval(provider, request) {
|
|
|
24948
24955
|
}
|
|
24949
24956
|
return { manifest, manifestHash: hashAdsActivationManifest(manifest) };
|
|
24950
24957
|
}
|
|
24958
|
+
async function refreshSemanticallyUnchangedAdsActivationManifest(provider, request) {
|
|
24959
|
+
const manifest = canonicalManifest(request.manifest);
|
|
24960
|
+
await validateAccount(provider, request.adAccountId);
|
|
24961
|
+
await validateExactDescendants(provider, manifest, {
|
|
24962
|
+
entityType: AdsActivationEntityTypes.campaign,
|
|
24963
|
+
entityId: manifest.campaign.id,
|
|
24964
|
+
parentId: null,
|
|
24965
|
+
expectedUpdatedAt: manifest.campaign.expectedUpdatedAt
|
|
24966
|
+
});
|
|
24967
|
+
const versions = /* @__PURE__ */ new Map();
|
|
24968
|
+
for (const target of activationTargets(manifest)) {
|
|
24969
|
+
let entity;
|
|
24970
|
+
try {
|
|
24971
|
+
entity = await readTarget(provider, target);
|
|
24972
|
+
} catch {
|
|
24973
|
+
throw targetError(
|
|
24974
|
+
AdsActivationErrorCodes.providerReadFailed,
|
|
24975
|
+
"An ads entity could not be verified for version refresh",
|
|
24976
|
+
502,
|
|
24977
|
+
target
|
|
24978
|
+
);
|
|
24979
|
+
}
|
|
24980
|
+
validateIdentity(target, entity);
|
|
24981
|
+
validateAdApproval(target, entity);
|
|
24982
|
+
if (entity.status !== PROVIDER_PAUSED) {
|
|
24983
|
+
throw targetError(AdsActivationErrorCodes.entityNotPaused, "Every approved ads entity must still be paused", 409, target);
|
|
24984
|
+
}
|
|
24985
|
+
if (!Number.isInteger(entity.updatedAt) || entity.updatedAt === null || entity.updatedAt < 0) {
|
|
24986
|
+
throw targetError(
|
|
24987
|
+
AdsActivationErrorCodes.providerReadFailed,
|
|
24988
|
+
"An ads entity did not report a usable provider version",
|
|
24989
|
+
502,
|
|
24990
|
+
target
|
|
24991
|
+
);
|
|
24992
|
+
}
|
|
24993
|
+
if (!request.semanticallyMatchesMaterialization(target.entityType, target.entityId, entity)) {
|
|
24994
|
+
throw targetError(
|
|
24995
|
+
AdsActivationErrorCodes.entityMismatch,
|
|
24996
|
+
"An ads entity no longer matches its materialized approved fields",
|
|
24997
|
+
409,
|
|
24998
|
+
target
|
|
24999
|
+
);
|
|
25000
|
+
}
|
|
25001
|
+
versions.set(`${target.entityType}:${target.entityId}`, entity.updatedAt);
|
|
25002
|
+
}
|
|
25003
|
+
const version = (entityType, entityId) => {
|
|
25004
|
+
const current = versions.get(`${entityType}:${entityId}`);
|
|
25005
|
+
if (current === void 0) {
|
|
25006
|
+
throw new AdsActivationError(
|
|
25007
|
+
AdsActivationErrorCodes.persistenceFailed,
|
|
25008
|
+
"A refreshed ads entity version is missing",
|
|
25009
|
+
500
|
|
25010
|
+
);
|
|
25011
|
+
}
|
|
25012
|
+
return current;
|
|
25013
|
+
};
|
|
25014
|
+
const refreshed = {
|
|
25015
|
+
campaign: {
|
|
25016
|
+
id: manifest.campaign.id,
|
|
25017
|
+
expectedUpdatedAt: version(AdsActivationEntityTypes.campaign, manifest.campaign.id),
|
|
25018
|
+
adGroups: manifest.campaign.adGroups.map((group) => ({
|
|
25019
|
+
id: group.id,
|
|
25020
|
+
expectedUpdatedAt: version(AdsActivationEntityTypes.ad_group, group.id),
|
|
25021
|
+
ads: group.ads.map((ad) => ({
|
|
25022
|
+
id: ad.id,
|
|
25023
|
+
expectedUpdatedAt: version(AdsActivationEntityTypes.ad, ad.id)
|
|
25024
|
+
}))
|
|
25025
|
+
}))
|
|
25026
|
+
}
|
|
25027
|
+
};
|
|
25028
|
+
return preflightAdsActivationApproval(provider, {
|
|
25029
|
+
adAccountId: request.adAccountId,
|
|
25030
|
+
manifest: refreshed
|
|
25031
|
+
});
|
|
25032
|
+
}
|
|
24951
25033
|
function stepTarget(manifest, step) {
|
|
24952
25034
|
const target = activationTargets(manifest).find(
|
|
24953
25035
|
(candidate) => candidate.entityType === step.entityType && candidate.entityId === step.entityId
|
|
@@ -26519,7 +26601,11 @@ function registerAdsActivationRoutes(app, opts) {
|
|
|
26519
26601
|
const runtime = await opts.resolveRuntime(project);
|
|
26520
26602
|
let preflight;
|
|
26521
26603
|
try {
|
|
26522
|
-
preflight = await
|
|
26604
|
+
preflight = body.versionPolicy === AdsActivationVersionPolicies.refreshSemanticallyUnchanged ? await refreshSemanticallyUnchangedAdsActivationManifest(runtime.provider, {
|
|
26605
|
+
adAccountId: runtime.adAccountId,
|
|
26606
|
+
manifest: body.manifest,
|
|
26607
|
+
semanticallyMatchesMaterialization: runtime.semanticallyMatchesMaterialization ?? (() => false)
|
|
26608
|
+
}) : await preflightAdsActivationApproval(runtime.provider, {
|
|
26523
26609
|
adAccountId: runtime.adAccountId,
|
|
26524
26610
|
manifest: body.manifest
|
|
26525
26611
|
});
|
|
@@ -26960,6 +27046,44 @@ function entityMatchesReconcileFields(entity, desired, fingerprint) {
|
|
|
26960
27046
|
const candidateFingerprint = requestHash(selected);
|
|
26961
27047
|
return fingerprint === null ? candidateFingerprint === requestHash(desired) : candidateFingerprint === fingerprint;
|
|
26962
27048
|
}
|
|
27049
|
+
function semanticallyMatchesMaterializedEntity(app, input) {
|
|
27050
|
+
const createKind = (() => {
|
|
27051
|
+
switch (input.entityType) {
|
|
27052
|
+
case AdsActivationEntityTypes.campaign:
|
|
27053
|
+
return AdsOperationKinds.campaign_create;
|
|
27054
|
+
case AdsActivationEntityTypes.ad_group:
|
|
27055
|
+
return AdsOperationKinds.ad_group_create;
|
|
27056
|
+
case AdsActivationEntityTypes.ad:
|
|
27057
|
+
return AdsOperationKinds.ad_create;
|
|
27058
|
+
}
|
|
27059
|
+
})();
|
|
27060
|
+
const updateKind = (() => {
|
|
27061
|
+
switch (input.entityType) {
|
|
27062
|
+
case AdsActivationEntityTypes.campaign:
|
|
27063
|
+
return AdsOperationKinds.campaign_update;
|
|
27064
|
+
case AdsActivationEntityTypes.ad_group:
|
|
27065
|
+
return AdsOperationKinds.ad_group_update;
|
|
27066
|
+
case AdsActivationEntityTypes.ad:
|
|
27067
|
+
return AdsOperationKinds.ad_update;
|
|
27068
|
+
}
|
|
27069
|
+
})();
|
|
27070
|
+
const rows = app.db.select().from(adsOperations).where(and20(
|
|
27071
|
+
eq26(adsOperations.projectId, input.projectId),
|
|
27072
|
+
eq26(adsOperations.entityType, input.entityType),
|
|
27073
|
+
eq26(adsOperations.entityId, input.entityId),
|
|
27074
|
+
inArray12(adsOperations.kind, [createKind, updateKind])
|
|
27075
|
+
)).orderBy(asc6(adsOperations.createdAt), asc6(adsOperations.id)).all();
|
|
27076
|
+
if (rows.some((row) => row.state === AdsOperationStates.pending || row.state === AdsOperationStates.reconciling || row.state === AdsOperationStates.unknown || row.kind === updateKind && row.state === AdsOperationStates.succeeded)) {
|
|
27077
|
+
return false;
|
|
27078
|
+
}
|
|
27079
|
+
const creates = rows.filter((row) => row.kind === createKind && row.state === AdsOperationStates.succeeded);
|
|
27080
|
+
if (creates.length !== 1) return false;
|
|
27081
|
+
const create = creates[0];
|
|
27082
|
+
if (create.adAccountId !== input.adAccountId || create.reconcileStrategy !== AdsReconcileStrategies.create_fingerprint || !create.reconcileFields) {
|
|
27083
|
+
return false;
|
|
27084
|
+
}
|
|
27085
|
+
return entityMatchesReconcileFields(input.entity, create.reconcileFields, null);
|
|
27086
|
+
}
|
|
26963
27087
|
function reconcileFieldsWithoutParent(fields) {
|
|
26964
27088
|
const { campaignId: _campaignId, adGroupId: _adGroupId, ...withoutParent } = fields;
|
|
26965
27089
|
return withoutParent;
|
|
@@ -27743,6 +27867,16 @@ async function adsRoutes(app, opts) {
|
|
|
27743
27867
|
}
|
|
27744
27868
|
return {
|
|
27745
27869
|
adAccountId,
|
|
27870
|
+
semanticallyMatchesMaterialization: (entityType, entityId, entity) => {
|
|
27871
|
+
if (entity.status === null || entity.updatedAt === null) return false;
|
|
27872
|
+
return semanticallyMatchesMaterializedEntity(app, {
|
|
27873
|
+
projectId: project.id,
|
|
27874
|
+
adAccountId,
|
|
27875
|
+
entityType,
|
|
27876
|
+
entityId,
|
|
27877
|
+
entity: { ...entity, status: entity.status, updatedAt: entity.updatedAt }
|
|
27878
|
+
});
|
|
27879
|
+
},
|
|
27746
27880
|
provider: {
|
|
27747
27881
|
getAccount: refreshAccount,
|
|
27748
27882
|
getCampaign: (id) => operator.getCampaign(apiKey, id),
|
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-DN5H2ZN7.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-WA57WG6W.js";
|
|
50
50
|
import {
|
|
51
51
|
apiKeys,
|
|
52
52
|
createClient,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
projects,
|
|
55
55
|
queries,
|
|
56
56
|
renderReportHtml
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-YPRUBNUK.js";
|
|
58
58
|
import {
|
|
59
59
|
AdsOperationKinds,
|
|
60
60
|
AdsOperationStates,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
providerQuotaPolicySchema,
|
|
96
96
|
resolveProviderInput,
|
|
97
97
|
winnabilityClassSchema
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-RFLNTI7Y.js";
|
|
99
99
|
|
|
100
100
|
// src/cli.ts
|
|
101
101
|
import { pathToFileURL } from "url";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DN5H2ZN7.js";
|
|
4
4
|
import {
|
|
5
5
|
loadConfig
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WA57WG6W.js";
|
|
7
|
+
import "./chunk-YPRUBNUK.js";
|
|
8
|
+
import "./chunk-RFLNTI7Y.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-WA57WG6W.js";
|
|
7
7
|
import {
|
|
8
8
|
isReadOnlyKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RFLNTI7Y.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.125.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",
|
|
@@ -66,24 +66,24 @@
|
|
|
66
66
|
"tsup": "^8.5.1",
|
|
67
67
|
"tsx": "^4.19.0",
|
|
68
68
|
"@ainyc/canonry-api-client": "0.0.0",
|
|
69
|
-
"@ainyc/canonry-contracts": "0.0.0",
|
|
70
|
-
"@ainyc/canonry-config": "0.0.0",
|
|
71
69
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
70
|
+
"@ainyc/canonry-config": "0.0.0",
|
|
71
|
+
"@ainyc/canonry-contracts": "0.0.0",
|
|
72
72
|
"@ainyc/canonry-db": "0.0.0",
|
|
73
73
|
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
74
74
|
"@ainyc/canonry-integration-cloud-run": "0.0.0",
|
|
75
|
+
"@ainyc/canonry-integration-google": "0.0.0",
|
|
76
|
+
"@ainyc/canonry-integration-openai-ads": "0.0.0",
|
|
75
77
|
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
76
78
|
"@ainyc/canonry-integration-google-business-profile": "0.0.0",
|
|
77
79
|
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
78
|
-
"@ainyc/canonry-integration-traffic": "0.0.0",
|
|
79
|
-
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
80
80
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
81
81
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
82
|
-
"@ainyc/canonry-integration-openai-ads": "0.0.0",
|
|
83
|
-
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
84
82
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
83
|
+
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
84
|
+
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
85
|
+
"@ainyc/canonry-integration-traffic": "0.0.0",
|
|
85
86
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
86
|
-
"@ainyc/canonry-integration-google": "0.0.0",
|
|
87
87
|
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
88
88
|
"@ainyc/canonry-provider-perplexity": "0.0.0"
|
|
89
89
|
},
|