@koda-sl/baker-cli 0.111.0-dev.cddbc8759 → 0.111.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/README.md +2 -35
- package/dist/{chunk-26K7V346.js → chunk-3JVYU72O.js} +4 -4
- package/dist/chunk-3JVYU72O.js.map +1 -0
- package/dist/cli.js +500 -1855
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-26K7V346.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
defaultRegistry,
|
|
10
10
|
generateCatalog,
|
|
11
11
|
validateCanvasDeep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3JVYU72O.js";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
|
-
import { defineCommand as
|
|
15
|
+
import { defineCommand as defineCommand154, runMain } from "citty";
|
|
16
16
|
|
|
17
17
|
// src/commands/actions/index.ts
|
|
18
18
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -2843,10 +2843,10 @@ Examples:
|
|
|
2843
2843
|
});
|
|
2844
2844
|
|
|
2845
2845
|
// src/commands/ads/index.ts
|
|
2846
|
-
import { defineCommand as
|
|
2846
|
+
import { defineCommand as defineCommand80 } from "citty";
|
|
2847
2847
|
|
|
2848
2848
|
// src/commands/ads/google/index.ts
|
|
2849
|
-
import { defineCommand as
|
|
2849
|
+
import { defineCommand as defineCommand29 } from "citty";
|
|
2850
2850
|
|
|
2851
2851
|
// src/commands/ads/google/accounts.ts
|
|
2852
2852
|
import { defineCommand as defineCommand19 } from "citty";
|
|
@@ -3831,865 +3831,11 @@ Examples:
|
|
|
3831
3831
|
}
|
|
3832
3832
|
});
|
|
3833
3833
|
|
|
3834
|
-
// src/commands/ads/google/draft.ts
|
|
3835
|
-
import { defineCommand as defineCommand22 } from "citty";
|
|
3836
|
-
|
|
3837
|
-
// src/commands/ads/google/write-shared.ts
|
|
3838
|
-
import { readFileSync as readFileSync3 } from "fs";
|
|
3839
|
-
|
|
3840
|
-
// ../api/src/ads-google/limits.ts
|
|
3841
|
-
var GOOGLE_ADS_LIMITS = {
|
|
3842
|
-
budget: {
|
|
3843
|
-
nameMax: 255,
|
|
3844
|
-
amountMicrosMin: 1
|
|
3845
|
-
},
|
|
3846
|
-
campaign: {
|
|
3847
|
-
nameMax: 255
|
|
3848
|
-
},
|
|
3849
|
-
adGroup: {
|
|
3850
|
-
nameMax: 255
|
|
3851
|
-
},
|
|
3852
|
-
keyword: {
|
|
3853
|
-
textMax: 80,
|
|
3854
|
-
wordsMax: 10
|
|
3855
|
-
},
|
|
3856
|
-
responsiveSearchAd: {
|
|
3857
|
-
headlinesMin: 3,
|
|
3858
|
-
headlinesMax: 15,
|
|
3859
|
-
headlineTextMax: 30,
|
|
3860
|
-
descriptionsMin: 2,
|
|
3861
|
-
descriptionsMax: 4,
|
|
3862
|
-
descriptionTextMax: 90,
|
|
3863
|
-
pathMax: 15
|
|
3864
|
-
},
|
|
3865
|
-
responsiveDisplayAd: {
|
|
3866
|
-
headlinesMin: 1,
|
|
3867
|
-
headlinesMax: 5,
|
|
3868
|
-
headlineTextMax: 30,
|
|
3869
|
-
longHeadlineTextMax: 90,
|
|
3870
|
-
descriptionsMin: 1,
|
|
3871
|
-
descriptionsMax: 5,
|
|
3872
|
-
descriptionTextMax: 90,
|
|
3873
|
-
businessNameMax: 25
|
|
3874
|
-
},
|
|
3875
|
-
sharedSet: {
|
|
3876
|
-
nameMax: 255
|
|
3877
|
-
},
|
|
3878
|
-
asset: {
|
|
3879
|
-
sitelinkLinkTextMax: 25,
|
|
3880
|
-
sitelinkDescriptionMax: 35,
|
|
3881
|
-
calloutTextMax: 25,
|
|
3882
|
-
structuredSnippetHeaderMax: 25,
|
|
3883
|
-
structuredSnippetValuesMin: 3,
|
|
3884
|
-
structuredSnippetValuesMax: 10
|
|
3885
|
-
},
|
|
3886
|
-
conversionAction: {
|
|
3887
|
-
nameMax: 255
|
|
3888
|
-
},
|
|
3889
|
-
audience: {
|
|
3890
|
-
nameMax: 255
|
|
3891
|
-
},
|
|
3892
|
-
biddingStrategy: {
|
|
3893
|
-
nameMax: 255
|
|
3894
|
-
},
|
|
3895
|
-
label: {
|
|
3896
|
-
nameMax: 255
|
|
3897
|
-
}
|
|
3898
|
-
};
|
|
3899
|
-
var KEYWORD_MATCH_TYPES = ["EXACT", "PHRASE", "BROAD"];
|
|
3900
|
-
var ADVERTISING_CHANNEL_TYPES = [
|
|
3901
|
-
"SEARCH",
|
|
3902
|
-
"DISPLAY",
|
|
3903
|
-
"SHOPPING",
|
|
3904
|
-
"VIDEO",
|
|
3905
|
-
"PERFORMANCE_MAX",
|
|
3906
|
-
"DEMAND_GEN",
|
|
3907
|
-
"MULTI_CHANNEL",
|
|
3908
|
-
"LOCAL",
|
|
3909
|
-
"SMART",
|
|
3910
|
-
"TRAVEL",
|
|
3911
|
-
"HOTEL",
|
|
3912
|
-
"DISCOVERY"
|
|
3913
|
-
];
|
|
3914
|
-
var ADVERTISING_CHANNEL_SUB_TYPES = [
|
|
3915
|
-
"SEARCH_MOBILE_APP",
|
|
3916
|
-
"DISPLAY_MOBILE_APP",
|
|
3917
|
-
"SEARCH_EXPRESS",
|
|
3918
|
-
"DISPLAY_EXPRESS",
|
|
3919
|
-
"SHOPPING_SMART_ADS",
|
|
3920
|
-
"DISPLAY_GMAIL_AD",
|
|
3921
|
-
"DISPLAY_SMART_CAMPAIGN",
|
|
3922
|
-
"VIDEO_OUTSTREAM",
|
|
3923
|
-
"VIDEO_ACTION",
|
|
3924
|
-
"VIDEO_NON_SKIPPABLE",
|
|
3925
|
-
"APP_CAMPAIGN",
|
|
3926
|
-
"APP_CAMPAIGN_FOR_ENGAGEMENT",
|
|
3927
|
-
"LOCAL_CAMPAIGN",
|
|
3928
|
-
"SHOPPING_COMPARISON_LISTING_ADS",
|
|
3929
|
-
"SEARCH_MOBILE_APP_ENGAGEMENT",
|
|
3930
|
-
"TRAVEL_ACTIVITIES"
|
|
3931
|
-
];
|
|
3932
|
-
var BIDDING_STRATEGY_TYPES = [
|
|
3933
|
-
"MANUAL_CPC",
|
|
3934
|
-
"MAXIMIZE_CONVERSIONS",
|
|
3935
|
-
"MAXIMIZE_CONVERSION_VALUE",
|
|
3936
|
-
"TARGET_SPEND",
|
|
3937
|
-
"TARGET_CPA",
|
|
3938
|
-
"TARGET_ROAS",
|
|
3939
|
-
"TARGET_IMPRESSION_SHARE",
|
|
3940
|
-
"MANUAL_CPM",
|
|
3941
|
-
"MANUAL_CPV",
|
|
3942
|
-
"PERCENT_CPC"
|
|
3943
|
-
];
|
|
3944
|
-
var BUDGET_DELIVERY_METHODS = ["STANDARD", "ACCELERATED"];
|
|
3945
|
-
var AD_GROUP_TYPES = [
|
|
3946
|
-
"SEARCH_STANDARD",
|
|
3947
|
-
"DISPLAY_STANDARD",
|
|
3948
|
-
"SHOPPING_PRODUCT_ADS",
|
|
3949
|
-
"VIDEO_BUMPER",
|
|
3950
|
-
"VIDEO_TRUE_VIEW_IN_STREAM",
|
|
3951
|
-
"VIDEO_TRUE_VIEW_IN_DISPLAY",
|
|
3952
|
-
"VIDEO_NON_SKIPPABLE_IN_STREAM",
|
|
3953
|
-
"VIDEO_OUTSTREAM",
|
|
3954
|
-
"DEMAND_GEN_AD"
|
|
3955
|
-
];
|
|
3956
|
-
var SHARED_SET_TYPES = [
|
|
3957
|
-
"NEGATIVE_KEYWORDS",
|
|
3958
|
-
"NEGATIVE_PLACEMENTS",
|
|
3959
|
-
"ACCOUNT_LEVEL_NEGATIVE_KEYWORDS"
|
|
3960
|
-
];
|
|
3961
|
-
var STAGEABLE_CREATE_STATUSES2 = ["ENABLED", "PAUSED"];
|
|
3962
|
-
var PINNED_FIELDS = ["HEADLINE_1", "HEADLINE_2", "HEADLINE_3", "DESCRIPTION_1", "DESCRIPTION_2"];
|
|
3963
|
-
var CONVERSION_ACTION_CATEGORIES = [
|
|
3964
|
-
"DEFAULT",
|
|
3965
|
-
"PAGE_VIEW",
|
|
3966
|
-
"PURCHASE",
|
|
3967
|
-
"SIGNUP",
|
|
3968
|
-
"LEAD",
|
|
3969
|
-
"DOWNLOAD",
|
|
3970
|
-
"ADD_TO_CART",
|
|
3971
|
-
"BEGIN_CHECKOUT",
|
|
3972
|
-
"SUBSCRIBE_PAID",
|
|
3973
|
-
"PHONE_CALL_LEAD",
|
|
3974
|
-
"SUBMIT_LEAD_FORM",
|
|
3975
|
-
"BOOK_APPOINTMENT",
|
|
3976
|
-
"REQUEST_QUOTE",
|
|
3977
|
-
"CONTACT"
|
|
3978
|
-
];
|
|
3979
|
-
var CONVERSION_ACTION_TYPES = [
|
|
3980
|
-
"WEBPAGE",
|
|
3981
|
-
"UPLOAD_CLICKS",
|
|
3982
|
-
"UPLOAD_CALLS",
|
|
3983
|
-
"WEBSITE_CALL",
|
|
3984
|
-
"GOOGLE_ANALYTICS_4_CUSTOM"
|
|
3985
|
-
];
|
|
3986
|
-
var CONVERSION_COUNTING_TYPES = ["ONE_PER_CLICK", "MANY_PER_CLICK"];
|
|
3987
|
-
var USER_LIST_TYPES = ["CRM_BASED", "RULE_BASED", "LOGICAL", "BASIC", "LOOKALIKE"];
|
|
3988
|
-
var ASSET_FIELD_TYPES = [
|
|
3989
|
-
"SITELINK",
|
|
3990
|
-
"CALLOUT",
|
|
3991
|
-
"STRUCTURED_SNIPPET",
|
|
3992
|
-
"CALL",
|
|
3993
|
-
"PRICE",
|
|
3994
|
-
"PROMOTION",
|
|
3995
|
-
"MOBILE_APP",
|
|
3996
|
-
"HEADLINE",
|
|
3997
|
-
"DESCRIPTION",
|
|
3998
|
-
"LOGO",
|
|
3999
|
-
"MARKETING_IMAGE",
|
|
4000
|
-
"BUSINESS_NAME"
|
|
4001
|
-
];
|
|
4002
|
-
var DEVICE_TYPES = ["MOBILE", "TABLET", "DESKTOP", "CONNECTED_TV", "OTHER"];
|
|
4003
|
-
var DAYS_OF_WEEK = ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"];
|
|
4004
|
-
var CAMPAIGN_OBJECTIVES = [
|
|
4005
|
-
"SALES",
|
|
4006
|
-
"LEADS",
|
|
4007
|
-
"WEBSITE_TRAFFIC",
|
|
4008
|
-
"PRODUCT_BRAND_CONSIDERATION",
|
|
4009
|
-
"BRAND_AWARENESS_REACH",
|
|
4010
|
-
"APP_PROMOTION",
|
|
4011
|
-
"LOCAL_STORE_VISITS"
|
|
4012
|
-
];
|
|
4013
|
-
var MICROS_PER_UNIT = 1e6;
|
|
4014
|
-
function toMicros(amount) {
|
|
4015
|
-
return Math.round(amount * MICROS_PER_UNIT);
|
|
4016
|
-
}
|
|
4017
|
-
var PLAYBOOK_DAILY_BUDGET_FLOOR_MICROS = 10 * MICROS_PER_UNIT;
|
|
4018
|
-
var TEMP_REF_REGEX2 = /^g_temp_[A-Za-z0-9_-]{2,}$/;
|
|
4019
|
-
var NUMERIC_ID_REGEX2 = /^\d+$/;
|
|
4020
|
-
var RESOURCE_NAME_REGEX = /^customers\/\d+\/[A-Za-z]+\/[-\w~]+$/;
|
|
4021
|
-
var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
4022
|
-
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4023
|
-
|
|
4024
|
-
// ../api/src/ads-google/ops.ts
|
|
4025
|
-
import { z as z8 } from "zod";
|
|
4026
|
-
var tempRefSchema2 = z8.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
4027
|
-
var refSchema = z8.union([
|
|
4028
|
-
z8.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
4029
|
-
z8.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4030
|
-
tempRefSchema2
|
|
4031
|
-
]);
|
|
4032
|
-
var targetRefSchema = refSchema;
|
|
4033
|
-
var microsSchema = z8.number().int().positive("expected a positive micros amount");
|
|
4034
|
-
var httpsUrlSchema2 = z8.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
4035
|
-
var customerIdSchema = z8.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
4036
|
-
var stageableStatusSchema2 = z8.enum(STAGEABLE_CREATE_STATUSES2);
|
|
4037
|
-
var matchTypeSchema = z8.enum(KEYWORD_MATCH_TYPES);
|
|
4038
|
-
var keywordTextSchema = z8.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
|
|
4039
|
-
var budgetCreateSchema = z8.object({
|
|
4040
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4041
|
-
amountMicros: microsSchema,
|
|
4042
|
-
deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
4043
|
-
explicitlyShared: z8.boolean().default(false)
|
|
4044
|
-
});
|
|
4045
|
-
var budgetUpdateSchema = z8.object({
|
|
4046
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4047
|
-
amountMicros: microsSchema.optional(),
|
|
4048
|
-
deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4049
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4050
|
-
var biddingConfigSchema = z8.object({
|
|
4051
|
-
type: z8.enum(BIDDING_STRATEGY_TYPES),
|
|
4052
|
-
targetCpaMicros: microsSchema.optional(),
|
|
4053
|
-
targetRoas: z8.number().positive().optional(),
|
|
4054
|
-
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4055
|
-
enhancedCpcEnabled: z8.boolean().optional()
|
|
4056
|
-
}).superRefine((p, ctx) => {
|
|
4057
|
-
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4058
|
-
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
4059
|
-
}
|
|
4060
|
-
if (p.type === "TARGET_ROAS" && p.targetRoas === void 0) {
|
|
4061
|
-
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4062
|
-
}
|
|
4063
|
-
});
|
|
4064
|
-
var networkSettingsSchema = z8.object({
|
|
4065
|
-
targetGoogleSearch: z8.boolean().optional(),
|
|
4066
|
-
targetSearchNetwork: z8.boolean().optional(),
|
|
4067
|
-
targetContentNetwork: z8.boolean().optional(),
|
|
4068
|
-
targetPartnerSearchNetwork: z8.boolean().optional()
|
|
4069
|
-
});
|
|
4070
|
-
var dateSchema = z8.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4071
|
-
var campaignCreateSchema2 = z8.object({
|
|
4072
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4073
|
-
channelType: z8.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4074
|
-
channelSubType: z8.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4075
|
-
budget: refSchema,
|
|
4076
|
-
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4077
|
-
bidding: biddingConfigSchema.optional(),
|
|
4078
|
-
biddingStrategy: refSchema.optional(),
|
|
4079
|
-
networkSettings: networkSettingsSchema.optional(),
|
|
4080
|
-
startDate: dateSchema.optional(),
|
|
4081
|
-
endDate: dateSchema.optional(),
|
|
4082
|
-
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4083
|
-
objective: z8.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4084
|
-
status: stageableStatusSchema2.default("PAUSED")
|
|
4085
|
-
}).superRefine((p, ctx) => {
|
|
4086
|
-
if (!p.bidding && !p.biddingStrategy) {
|
|
4087
|
-
ctx.addIssue({
|
|
4088
|
-
code: "custom",
|
|
4089
|
-
path: ["bidding"],
|
|
4090
|
-
message: "set an inline bidding strategy or reference a portfolio biddingStrategy"
|
|
4091
|
-
});
|
|
4092
|
-
}
|
|
4093
|
-
if (p.bidding && p.biddingStrategy) {
|
|
4094
|
-
ctx.addIssue({
|
|
4095
|
-
code: "custom",
|
|
4096
|
-
path: ["bidding"],
|
|
4097
|
-
message: "use inline bidding OR a portfolio biddingStrategy, not both"
|
|
4098
|
-
});
|
|
4099
|
-
}
|
|
4100
|
-
if (p.channelType === "PERFORMANCE_MAX" && p.bidding && p.bidding.type === "MANUAL_CPC") {
|
|
4101
|
-
ctx.addIssue({ code: "custom", path: ["bidding"], message: "Performance Max does not support Manual CPC" });
|
|
4102
|
-
}
|
|
4103
|
-
if (p.startDate && p.endDate && p.endDate <= p.startDate) {
|
|
4104
|
-
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4105
|
-
}
|
|
4106
|
-
});
|
|
4107
|
-
var campaignUpdateSchema2 = z8.object({
|
|
4108
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4109
|
-
budget: refSchema.optional(),
|
|
4110
|
-
bidding: biddingConfigSchema.optional(),
|
|
4111
|
-
networkSettings: networkSettingsSchema.optional(),
|
|
4112
|
-
startDate: dateSchema.optional(),
|
|
4113
|
-
endDate: dateSchema.optional(),
|
|
4114
|
-
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4115
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4116
|
-
var adGroupCreateSchema = z8.object({
|
|
4117
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4118
|
-
campaign: refSchema,
|
|
4119
|
-
type: z8.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4120
|
-
cpcBidMicros: microsSchema.optional(),
|
|
4121
|
-
status: stageableStatusSchema2.default("PAUSED")
|
|
4122
|
-
});
|
|
4123
|
-
var adGroupUpdateSchema = z8.object({
|
|
4124
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4125
|
-
cpcBidMicros: microsSchema.optional(),
|
|
4126
|
-
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4127
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4128
|
-
var keywordAddSchema = z8.object({
|
|
4129
|
-
adGroup: refSchema,
|
|
4130
|
-
text: keywordTextSchema,
|
|
4131
|
-
matchType: matchTypeSchema,
|
|
4132
|
-
cpcBidMicros: microsSchema.optional(),
|
|
4133
|
-
finalUrls: z8.array(httpsUrlSchema2).optional(),
|
|
4134
|
-
status: stageableStatusSchema2.default("ENABLED")
|
|
4135
|
-
});
|
|
4136
|
-
var keywordUpdateSchema = z8.object({
|
|
4137
|
-
cpcBidMicros: microsSchema.optional(),
|
|
4138
|
-
finalUrls: z8.array(httpsUrlSchema2).optional(),
|
|
4139
|
-
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4140
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4141
|
-
var negativeKeywordAddSchema = z8.object({
|
|
4142
|
-
level: z8.enum(["adGroup", "campaign"]),
|
|
4143
|
-
parent: refSchema,
|
|
4144
|
-
text: keywordTextSchema,
|
|
4145
|
-
matchType: matchTypeSchema
|
|
4146
|
-
});
|
|
4147
|
-
var sharedSetCreateSchema = z8.object({
|
|
4148
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4149
|
-
type: z8.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4150
|
-
});
|
|
4151
|
-
var sharedSetMemberAddSchema = z8.object({
|
|
4152
|
-
sharedSet: refSchema,
|
|
4153
|
-
text: keywordTextSchema,
|
|
4154
|
-
matchType: matchTypeSchema
|
|
4155
|
-
});
|
|
4156
|
-
var campaignSharedSetAttachSchema = z8.object({
|
|
4157
|
-
campaign: refSchema,
|
|
4158
|
-
sharedSet: refSchema
|
|
4159
|
-
});
|
|
4160
|
-
var adTextAssetSchema = z8.object({
|
|
4161
|
-
text: z8.string().min(1),
|
|
4162
|
-
pinnedField: z8.enum(PINNED_FIELDS).optional()
|
|
4163
|
-
});
|
|
4164
|
-
var responsiveSearchAdSchema = z8.object({
|
|
4165
|
-
format: z8.literal("responsiveSearch"),
|
|
4166
|
-
headlines: z8.array(
|
|
4167
|
-
adTextAssetSchema.refine(
|
|
4168
|
-
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4169
|
-
"headline exceeds 30 chars"
|
|
4170
|
-
)
|
|
4171
|
-
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4172
|
-
descriptions: z8.array(
|
|
4173
|
-
adTextAssetSchema.refine(
|
|
4174
|
-
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4175
|
-
"description exceeds 90 chars"
|
|
4176
|
-
)
|
|
4177
|
-
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4178
|
-
path1: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4179
|
-
path2: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4180
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4181
|
-
});
|
|
4182
|
-
var responsiveDisplayAdSchema = z8.object({
|
|
4183
|
-
format: z8.literal("responsiveDisplay"),
|
|
4184
|
-
headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4185
|
-
longHeadline: z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4186
|
-
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4187
|
-
businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4188
|
-
marketingImageAssets: z8.array(refSchema).optional(),
|
|
4189
|
-
logoImageAssets: z8.array(refSchema).optional(),
|
|
4190
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4191
|
-
});
|
|
4192
|
-
var performanceMaxAssetGroupSchema = z8.object({
|
|
4193
|
-
format: z8.literal("performanceMaxAssetGroup"),
|
|
4194
|
-
name: z8.string().min(1).max(255),
|
|
4195
|
-
headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(3).max(15),
|
|
4196
|
-
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(2).max(5),
|
|
4197
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1),
|
|
4198
|
-
imageAssets: z8.array(refSchema).optional(),
|
|
4199
|
-
logoAssets: z8.array(refSchema).optional()
|
|
4200
|
-
});
|
|
4201
|
-
var callAdSchema = z8.object({
|
|
4202
|
-
format: z8.literal("call"),
|
|
4203
|
-
countryCode: z8.string().length(2),
|
|
4204
|
-
phoneNumber: z8.string().min(3),
|
|
4205
|
-
headline1: z8.string().min(1).max(30),
|
|
4206
|
-
headline2: z8.string().min(1).max(30),
|
|
4207
|
-
description1: z8.string().min(1).max(90),
|
|
4208
|
-
description2: z8.string().min(1).max(90),
|
|
4209
|
-
businessName: z8.string().min(1).max(25),
|
|
4210
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4211
|
-
});
|
|
4212
|
-
var appAdSchema = z8.object({
|
|
4213
|
-
format: z8.literal("app"),
|
|
4214
|
-
headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(1),
|
|
4215
|
-
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1)
|
|
4216
|
-
});
|
|
4217
|
-
var videoAdSchema = z8.object({
|
|
4218
|
-
format: z8.literal("video"),
|
|
4219
|
-
youtubeVideoId: z8.string().min(1),
|
|
4220
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4221
|
-
});
|
|
4222
|
-
var demandGenAdSchema = z8.object({
|
|
4223
|
-
format: z8.literal("demandGen"),
|
|
4224
|
-
headlines: z8.array(z8.object({ text: z8.string().min(1).max(40) })).min(1).max(5),
|
|
4225
|
-
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1).max(5),
|
|
4226
|
-
businessName: z8.string().min(1).max(25),
|
|
4227
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1),
|
|
4228
|
-
imageAssets: z8.array(refSchema).optional()
|
|
4229
|
-
});
|
|
4230
|
-
var adContentSchema = z8.discriminatedUnion("format", [
|
|
4231
|
-
responsiveSearchAdSchema,
|
|
4232
|
-
responsiveDisplayAdSchema,
|
|
4233
|
-
performanceMaxAssetGroupSchema,
|
|
4234
|
-
callAdSchema,
|
|
4235
|
-
appAdSchema,
|
|
4236
|
-
videoAdSchema,
|
|
4237
|
-
demandGenAdSchema
|
|
4238
|
-
]);
|
|
4239
|
-
var adCreateSchema = z8.object({
|
|
4240
|
-
adGroup: refSchema,
|
|
4241
|
-
status: stageableStatusSchema2.default("PAUSED"),
|
|
4242
|
-
content: adContentSchema
|
|
4243
|
-
});
|
|
4244
|
-
var adUpdateSchema = z8.object({
|
|
4245
|
-
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4246
|
-
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4247
|
-
content: z8.record(z8.string(), z8.unknown()).optional()
|
|
4248
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4249
|
-
var textAssetSchema = z8.object({ type: z8.literal("text"), text: z8.string().min(1) });
|
|
4250
|
-
var imageAssetSchema = z8.object({
|
|
4251
|
-
type: z8.literal("image"),
|
|
4252
|
-
imageId: z8.string().min(1),
|
|
4253
|
-
name: z8.string().optional()
|
|
4254
|
-
});
|
|
4255
|
-
var youtubeVideoAssetSchema = z8.object({
|
|
4256
|
-
type: z8.literal("youtubeVideo"),
|
|
4257
|
-
youtubeVideoId: z8.string().min(1),
|
|
4258
|
-
name: z8.string().optional()
|
|
4259
|
-
});
|
|
4260
|
-
var sitelinkAssetSchema = z8.object({
|
|
4261
|
-
type: z8.literal("sitelink"),
|
|
4262
|
-
linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4263
|
-
description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4264
|
-
description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4265
|
-
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4266
|
-
});
|
|
4267
|
-
var calloutAssetSchema = z8.object({
|
|
4268
|
-
type: z8.literal("callout"),
|
|
4269
|
-
calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4270
|
-
});
|
|
4271
|
-
var structuredSnippetAssetSchema = z8.object({
|
|
4272
|
-
type: z8.literal("structuredSnippet"),
|
|
4273
|
-
header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4274
|
-
values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4275
|
-
});
|
|
4276
|
-
var callToActionAssetSchema = z8.object({ type: z8.literal("callToAction"), callToAction: z8.string().min(1) });
|
|
4277
|
-
var assetCreateSchema = z8.discriminatedUnion("type", [
|
|
4278
|
-
textAssetSchema,
|
|
4279
|
-
imageAssetSchema,
|
|
4280
|
-
youtubeVideoAssetSchema,
|
|
4281
|
-
sitelinkAssetSchema,
|
|
4282
|
-
calloutAssetSchema,
|
|
4283
|
-
structuredSnippetAssetSchema,
|
|
4284
|
-
callToActionAssetSchema
|
|
4285
|
-
]);
|
|
4286
|
-
var assetLinkAttachSchema = z8.object({
|
|
4287
|
-
level: z8.enum(["campaign", "adGroup", "customer"]),
|
|
4288
|
-
parent: refSchema.optional(),
|
|
4289
|
-
asset: refSchema,
|
|
4290
|
-
fieldType: z8.enum(ASSET_FIELD_TYPES)
|
|
4291
|
-
});
|
|
4292
|
-
var audienceCreateSchema2 = z8.object({
|
|
4293
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4294
|
-
type: z8.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4295
|
-
description: z8.string().optional(),
|
|
4296
|
-
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4297
|
-
members: z8.array(z8.record(z8.string(), z8.string())).optional(),
|
|
4298
|
-
sourceFileRef: z8.string().optional()
|
|
4299
|
-
});
|
|
4300
|
-
var audienceCriterionAttachSchema = z8.object({
|
|
4301
|
-
level: z8.enum(["campaign", "adGroup"]),
|
|
4302
|
-
parent: refSchema,
|
|
4303
|
-
userList: refSchema,
|
|
4304
|
-
negative: z8.boolean().default(false)
|
|
4305
|
-
});
|
|
4306
|
-
var conversionActionCreateSchema = z8.object({
|
|
4307
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
4308
|
-
type: z8.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
4309
|
-
category: z8.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
4310
|
-
countingType: z8.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4311
|
-
defaultValueMicros: microsSchema.optional(),
|
|
4312
|
-
defaultCurrencyCode: z8.string().length(3).optional(),
|
|
4313
|
-
clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4314
|
-
viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4315
|
-
status: z8.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
4316
|
-
});
|
|
4317
|
-
var conversionActionUpdateSchema = z8.object({
|
|
4318
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
4319
|
-
category: z8.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
4320
|
-
countingType: z8.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
4321
|
-
defaultValueMicros: microsSchema.optional(),
|
|
4322
|
-
status: z8.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
4323
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4324
|
-
var biddingStrategyCreateSchema = z8.object({
|
|
4325
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
4326
|
-
config: biddingConfigSchema
|
|
4327
|
-
}).superRefine((p, ctx) => {
|
|
4328
|
-
if (p.config.type === "MANUAL_CPC") {
|
|
4329
|
-
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
4330
|
-
}
|
|
4331
|
-
});
|
|
4332
|
-
var biddingStrategyUpdateSchema = z8.object({
|
|
4333
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
4334
|
-
config: biddingConfigSchema.optional()
|
|
4335
|
-
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4336
|
-
var labelCreateSchema = z8.object({
|
|
4337
|
-
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
4338
|
-
backgroundColor: z8.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
4339
|
-
description: z8.string().optional()
|
|
4340
|
-
});
|
|
4341
|
-
var labelAttachSchema = z8.object({
|
|
4342
|
-
level: z8.enum(["campaign", "adGroup", "ad"]),
|
|
4343
|
-
parent: refSchema,
|
|
4344
|
-
label: refSchema
|
|
4345
|
-
});
|
|
4346
|
-
var locationCriterionSchema = z8.object({
|
|
4347
|
-
criterionType: z8.literal("location"),
|
|
4348
|
-
geoTargetConstant: z8.union([z8.string().regex(GEO_TARGET_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
|
|
4349
|
-
});
|
|
4350
|
-
var languageCriterionSchema = z8.object({
|
|
4351
|
-
criterionType: z8.literal("language"),
|
|
4352
|
-
languageConstant: z8.union([z8.string().regex(LANGUAGE_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
|
|
4353
|
-
});
|
|
4354
|
-
var adScheduleCriterionSchema = z8.object({
|
|
4355
|
-
criterionType: z8.literal("adSchedule"),
|
|
4356
|
-
dayOfWeek: z8.enum(DAYS_OF_WEEK),
|
|
4357
|
-
startHour: z8.number().int().min(0).max(23),
|
|
4358
|
-
startMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
4359
|
-
endHour: z8.number().int().min(0).max(24),
|
|
4360
|
-
endMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
4361
|
-
});
|
|
4362
|
-
var deviceCriterionSchema = z8.object({
|
|
4363
|
-
criterionType: z8.literal("device"),
|
|
4364
|
-
device: z8.enum(DEVICE_TYPES),
|
|
4365
|
-
bidModifier: z8.number().min(0.1).max(10).optional()
|
|
4366
|
-
});
|
|
4367
|
-
var campaignCriterionAddSchema = z8.object({
|
|
4368
|
-
campaign: refSchema,
|
|
4369
|
-
negative: z8.boolean().default(false),
|
|
4370
|
-
criterion: z8.discriminatedUnion("criterionType", [
|
|
4371
|
-
locationCriterionSchema,
|
|
4372
|
-
languageCriterionSchema,
|
|
4373
|
-
adScheduleCriterionSchema,
|
|
4374
|
-
deviceCriterionSchema
|
|
4375
|
-
])
|
|
4376
|
-
});
|
|
4377
|
-
var GOOGLE_DRAFT_OP_KINDS = [
|
|
4378
|
-
"google.budget.create",
|
|
4379
|
-
"google.budget.update",
|
|
4380
|
-
"google.campaign.create",
|
|
4381
|
-
"google.campaign.update",
|
|
4382
|
-
"google.campaign.pause",
|
|
4383
|
-
"google.campaign.resume",
|
|
4384
|
-
"google.campaign.remove",
|
|
4385
|
-
"google.adGroup.create",
|
|
4386
|
-
"google.adGroup.update",
|
|
4387
|
-
"google.adGroup.pause",
|
|
4388
|
-
"google.adGroup.resume",
|
|
4389
|
-
"google.adGroup.remove",
|
|
4390
|
-
"google.keyword.add",
|
|
4391
|
-
"google.keyword.update",
|
|
4392
|
-
"google.keyword.remove",
|
|
4393
|
-
"google.negativeKeyword.add",
|
|
4394
|
-
"google.negativeKeyword.remove",
|
|
4395
|
-
"google.sharedSet.create",
|
|
4396
|
-
"google.sharedSetMember.add",
|
|
4397
|
-
"google.sharedSetMember.remove",
|
|
4398
|
-
"google.campaignSharedSet.attach",
|
|
4399
|
-
"google.campaignSharedSet.detach",
|
|
4400
|
-
"google.ad.create",
|
|
4401
|
-
"google.ad.update",
|
|
4402
|
-
"google.ad.pause",
|
|
4403
|
-
"google.ad.resume",
|
|
4404
|
-
"google.ad.remove",
|
|
4405
|
-
"google.asset.create",
|
|
4406
|
-
"google.assetLink.attach",
|
|
4407
|
-
"google.assetLink.detach",
|
|
4408
|
-
"google.audience.create",
|
|
4409
|
-
"google.audienceCriterion.attach",
|
|
4410
|
-
"google.audienceCriterion.detach",
|
|
4411
|
-
"google.conversionAction.create",
|
|
4412
|
-
"google.conversionAction.update",
|
|
4413
|
-
"google.biddingStrategy.create",
|
|
4414
|
-
"google.biddingStrategy.update",
|
|
4415
|
-
"google.label.create",
|
|
4416
|
-
"google.label.attach",
|
|
4417
|
-
"google.campaignCriterion.add",
|
|
4418
|
-
"google.campaignCriterion.remove"
|
|
4419
|
-
];
|
|
4420
|
-
var googleDraftOpKindSchema = z8.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
4421
|
-
function createOp2(kind, payload) {
|
|
4422
|
-
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, payload });
|
|
4423
|
-
}
|
|
4424
|
-
function updateOp2(kind, payload) {
|
|
4425
|
-
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
4426
|
-
}
|
|
4427
|
-
function targetOp(kind) {
|
|
4428
|
-
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
4429
|
-
}
|
|
4430
|
-
var googleDraftOpInputSchema = z8.discriminatedUnion("kind", [
|
|
4431
|
-
createOp2("google.budget.create", budgetCreateSchema),
|
|
4432
|
-
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
4433
|
-
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
4434
|
-
updateOp2("google.campaign.update", campaignUpdateSchema2),
|
|
4435
|
-
targetOp("google.campaign.pause"),
|
|
4436
|
-
targetOp("google.campaign.resume"),
|
|
4437
|
-
targetOp("google.campaign.remove"),
|
|
4438
|
-
createOp2("google.adGroup.create", adGroupCreateSchema),
|
|
4439
|
-
updateOp2("google.adGroup.update", adGroupUpdateSchema),
|
|
4440
|
-
targetOp("google.adGroup.pause"),
|
|
4441
|
-
targetOp("google.adGroup.resume"),
|
|
4442
|
-
targetOp("google.adGroup.remove"),
|
|
4443
|
-
createOp2("google.keyword.add", keywordAddSchema),
|
|
4444
|
-
updateOp2("google.keyword.update", keywordUpdateSchema),
|
|
4445
|
-
targetOp("google.keyword.remove"),
|
|
4446
|
-
createOp2("google.negativeKeyword.add", negativeKeywordAddSchema),
|
|
4447
|
-
targetOp("google.negativeKeyword.remove"),
|
|
4448
|
-
createOp2("google.sharedSet.create", sharedSetCreateSchema),
|
|
4449
|
-
createOp2("google.sharedSetMember.add", sharedSetMemberAddSchema),
|
|
4450
|
-
targetOp("google.sharedSetMember.remove"),
|
|
4451
|
-
createOp2("google.campaignSharedSet.attach", campaignSharedSetAttachSchema),
|
|
4452
|
-
targetOp("google.campaignSharedSet.detach"),
|
|
4453
|
-
createOp2("google.ad.create", adCreateSchema),
|
|
4454
|
-
updateOp2("google.ad.update", adUpdateSchema),
|
|
4455
|
-
targetOp("google.ad.pause"),
|
|
4456
|
-
targetOp("google.ad.resume"),
|
|
4457
|
-
targetOp("google.ad.remove"),
|
|
4458
|
-
createOp2("google.asset.create", assetCreateSchema),
|
|
4459
|
-
createOp2("google.assetLink.attach", assetLinkAttachSchema),
|
|
4460
|
-
targetOp("google.assetLink.detach"),
|
|
4461
|
-
createOp2("google.audience.create", audienceCreateSchema2),
|
|
4462
|
-
createOp2("google.audienceCriterion.attach", audienceCriterionAttachSchema),
|
|
4463
|
-
targetOp("google.audienceCriterion.detach"),
|
|
4464
|
-
createOp2("google.conversionAction.create", conversionActionCreateSchema),
|
|
4465
|
-
updateOp2("google.conversionAction.update", conversionActionUpdateSchema),
|
|
4466
|
-
createOp2("google.biddingStrategy.create", biddingStrategyCreateSchema),
|
|
4467
|
-
updateOp2("google.biddingStrategy.update", biddingStrategyUpdateSchema),
|
|
4468
|
-
createOp2("google.label.create", labelCreateSchema),
|
|
4469
|
-
createOp2("google.label.attach", labelAttachSchema),
|
|
4470
|
-
createOp2("google.campaignCriterion.add", campaignCriterionAddSchema),
|
|
4471
|
-
targetOp("google.campaignCriterion.remove")
|
|
4472
|
-
]);
|
|
4473
|
-
|
|
4474
|
-
// ../api/src/ads-google/wire.ts
|
|
4475
|
-
import { z as z9 } from "zod";
|
|
4476
|
-
var googleWriteModeSchema = z9.enum(["live", "simulated"]);
|
|
4477
|
-
var googleDraftOpResultSchema = z9.object({
|
|
4478
|
-
status: z9.enum(["applied", "simulated", "failed", "skipped"]),
|
|
4479
|
-
resourceName: z9.string().optional(),
|
|
4480
|
-
error: z9.string().optional(),
|
|
4481
|
-
skippedBecause: z9.string().optional(),
|
|
4482
|
-
executedAt: z9.number().optional()
|
|
4483
|
-
});
|
|
4484
|
-
var googleDraftStageRequestSchema = z9.object({
|
|
4485
|
-
chatId: z9.string(),
|
|
4486
|
-
op: googleDraftOpInputSchema
|
|
4487
|
-
});
|
|
4488
|
-
var googleDraftStageResponseSchema = z9.object({
|
|
4489
|
-
staged: z9.literal(true),
|
|
4490
|
-
ref: z9.string(),
|
|
4491
|
-
kind: googleDraftOpKindSchema,
|
|
4492
|
-
mode: googleWriteModeSchema,
|
|
4493
|
-
dependsOn: z9.array(z9.string()),
|
|
4494
|
-
summary: z9.string(),
|
|
4495
|
-
warnings: z9.array(z9.string()),
|
|
4496
|
-
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
4497
|
-
amended: z9.boolean().optional()
|
|
4498
|
-
});
|
|
4499
|
-
var googleDraftOpViewSchema = z9.object({
|
|
4500
|
-
ref: z9.string(),
|
|
4501
|
-
kind: googleDraftOpKindSchema,
|
|
4502
|
-
customerId: z9.string(),
|
|
4503
|
-
target: z9.string().optional(),
|
|
4504
|
-
dependsOn: z9.array(z9.string()),
|
|
4505
|
-
summary: z9.string(),
|
|
4506
|
-
stagedAt: z9.number(),
|
|
4507
|
-
result: googleDraftOpResultSchema.optional()
|
|
4508
|
-
});
|
|
4509
|
-
var googleDraftListRequestSchema = z9.object({
|
|
4510
|
-
chatId: z9.string()
|
|
4511
|
-
});
|
|
4512
|
-
var googleDraftListResponseSchema = z9.object({
|
|
4513
|
-
status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
4514
|
-
mode: googleWriteModeSchema,
|
|
4515
|
-
count: z9.number(),
|
|
4516
|
-
ops: z9.array(googleDraftOpViewSchema)
|
|
4517
|
-
});
|
|
4518
|
-
var googleDraftRemoveRequestSchema = z9.object({
|
|
4519
|
-
chatId: z9.string(),
|
|
4520
|
-
ref: z9.string()
|
|
4521
|
-
});
|
|
4522
|
-
var googleDraftRemoveResponseSchema = z9.object({
|
|
4523
|
-
/** The requested ref plus any dependents removed by cascade. */
|
|
4524
|
-
removed: z9.array(z9.string())
|
|
4525
|
-
});
|
|
4526
|
-
var googleDraftClearRequestSchema = z9.object({
|
|
4527
|
-
chatId: z9.string()
|
|
4528
|
-
});
|
|
4529
|
-
var googleDraftClearResponseSchema = z9.object({
|
|
4530
|
-
cleared: z9.number()
|
|
4531
|
-
});
|
|
4532
|
-
var googleFieldErrorSchema = z9.object({
|
|
4533
|
-
path: z9.string(),
|
|
4534
|
-
message: z9.string()
|
|
4535
|
-
});
|
|
4536
|
-
var googleDraftErrorResponseSchema = z9.object({
|
|
4537
|
-
code: z9.string(),
|
|
4538
|
-
error: z9.string(),
|
|
4539
|
-
fields: z9.array(googleFieldErrorSchema).optional()
|
|
4540
|
-
});
|
|
4541
|
-
|
|
4542
|
-
// src/commands/ads/google/write-shared.ts
|
|
4543
|
-
function failWriteValidation(message) {
|
|
4544
|
-
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
4545
|
-
process.exit(1);
|
|
4546
|
-
}
|
|
4547
|
-
function requireCustomerId(args) {
|
|
4548
|
-
const raw = args["customer-id"] ?? args.customerId;
|
|
4549
|
-
if (!raw || !/^\d{10}$/.test(raw)) {
|
|
4550
|
-
failWriteValidation("pass --customer-id as the 10-digit Google Ads customer id (no dashes)");
|
|
4551
|
-
}
|
|
4552
|
-
return raw;
|
|
4553
|
-
}
|
|
4554
|
-
function requireTarget(args, entity) {
|
|
4555
|
-
const target = args.id ?? args.target ?? args._?.[0];
|
|
4556
|
-
if (typeof target !== "string" || target.length === 0) {
|
|
4557
|
-
failWriteValidation(`pass the ${entity} resource name or id as the positional argument`);
|
|
4558
|
-
}
|
|
4559
|
-
return target;
|
|
4560
|
-
}
|
|
4561
|
-
function requireStringFlag(value, flag) {
|
|
4562
|
-
if (typeof value !== "string" || value.length === 0) {
|
|
4563
|
-
failWriteValidation(`${flag} is required`);
|
|
4564
|
-
}
|
|
4565
|
-
return value;
|
|
4566
|
-
}
|
|
4567
|
-
function microsFlag(value, flag) {
|
|
4568
|
-
if (value === void 0 || value === null || value === "") {
|
|
4569
|
-
return void 0;
|
|
4570
|
-
}
|
|
4571
|
-
const num = Number(value);
|
|
4572
|
-
if (Number.isNaN(num) || num <= 0) {
|
|
4573
|
-
failWriteValidation(`${flag} must be a positive amount (major currency units, e.g. 50 or 50.00)`);
|
|
4574
|
-
}
|
|
4575
|
-
return toMicros(num);
|
|
4576
|
-
}
|
|
4577
|
-
function listFlag(value) {
|
|
4578
|
-
if (typeof value !== "string" || value.length === 0) {
|
|
4579
|
-
return void 0;
|
|
4580
|
-
}
|
|
4581
|
-
const items = value.split(",").map((v) => v.trim()).filter(Boolean);
|
|
4582
|
-
return items.length > 0 ? items : void 0;
|
|
4583
|
-
}
|
|
4584
|
-
function loadJsonFileArg(path11) {
|
|
4585
|
-
if (typeof path11 !== "string" || path11.length === 0) {
|
|
4586
|
-
return {};
|
|
4587
|
-
}
|
|
4588
|
-
try {
|
|
4589
|
-
const parsed = JSON.parse(readFileSync3(path11, "utf8"));
|
|
4590
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
4591
|
-
failWriteValidation(`${path11} must contain a JSON object`);
|
|
4592
|
-
}
|
|
4593
|
-
return parsed;
|
|
4594
|
-
} catch (err) {
|
|
4595
|
-
if (err instanceof SyntaxError) {
|
|
4596
|
-
failWriteValidation(`${path11} is not valid JSON: ${err.message}`);
|
|
4597
|
-
}
|
|
4598
|
-
throw err;
|
|
4599
|
-
}
|
|
4600
|
-
}
|
|
4601
|
-
function mergePayload(file, flags) {
|
|
4602
|
-
const merged = { ...file };
|
|
4603
|
-
for (const [key, value] of Object.entries(flags)) {
|
|
4604
|
-
if (value !== void 0) {
|
|
4605
|
-
merged[key] = value;
|
|
4606
|
-
}
|
|
4607
|
-
}
|
|
4608
|
-
return merged;
|
|
4609
|
-
}
|
|
4610
|
-
function handleGoogleError(err) {
|
|
4611
|
-
if (err instanceof ApiError) {
|
|
4612
|
-
writeJsonEnvelope({ ok: false, error: { code: err.code ?? "API_ERROR", message: err.message } });
|
|
4613
|
-
process.exit(1);
|
|
4614
|
-
}
|
|
4615
|
-
writeJsonEnvelope({
|
|
4616
|
-
ok: false,
|
|
4617
|
-
error: { code: "UNKNOWN", message: err instanceof Error ? err.message : String(err) }
|
|
4618
|
-
});
|
|
4619
|
-
process.exit(1);
|
|
4620
|
-
}
|
|
4621
|
-
async function stageGoogleOp(raw) {
|
|
4622
|
-
const preflight = googleDraftOpInputSchema.safeParse(raw);
|
|
4623
|
-
if (!preflight.success) {
|
|
4624
|
-
const fields = preflight.error.issues.map((issue) => ({ path: issue.path.join("."), message: issue.message }));
|
|
4625
|
-
writeJsonEnvelope({
|
|
4626
|
-
ok: false,
|
|
4627
|
-
error: {
|
|
4628
|
-
code: "VALIDATION_ERROR",
|
|
4629
|
-
message: fields.map((f) => f.path ? `${f.path}: ${f.message}` : f.message).join("; "),
|
|
4630
|
-
fields
|
|
4631
|
-
}
|
|
4632
|
-
});
|
|
4633
|
-
process.exit(1);
|
|
4634
|
-
}
|
|
4635
|
-
try {
|
|
4636
|
-
const chatId = requireChatId();
|
|
4637
|
-
const response = await apiPost("/api/ads/google/draft/stage", { chatId, op: preflight.data });
|
|
4638
|
-
writeJsonEnvelope(response);
|
|
4639
|
-
} catch (err) {
|
|
4640
|
-
handleGoogleError(err);
|
|
4641
|
-
}
|
|
4642
|
-
}
|
|
4643
|
-
async function stageCreate(kind, customerId, payload) {
|
|
4644
|
-
await stageGoogleOp({ kind, customerId, payload });
|
|
4645
|
-
}
|
|
4646
|
-
async function stageUpdate(kind, customerId, target, payload) {
|
|
4647
|
-
await stageGoogleOp({ kind, customerId, target, payload });
|
|
4648
|
-
}
|
|
4649
|
-
async function stageTarget(kind, customerId, target) {
|
|
4650
|
-
await stageGoogleOp({ kind, customerId, target });
|
|
4651
|
-
}
|
|
4652
|
-
async function draftAction(path11, body) {
|
|
4653
|
-
try {
|
|
4654
|
-
const chatId = requireChatId();
|
|
4655
|
-
const response = await apiPost(path11, { chatId, ...body });
|
|
4656
|
-
writeJsonEnvelope(response);
|
|
4657
|
-
} catch (err) {
|
|
4658
|
-
handleGoogleError(err);
|
|
4659
|
-
}
|
|
4660
|
-
}
|
|
4661
|
-
|
|
4662
|
-
// src/commands/ads/google/draft.ts
|
|
4663
|
-
var draftCommand2 = defineCommand22({
|
|
4664
|
-
meta: { name: "draft", description: "List, remove, or clear staged Google Ads write ops for this chat" },
|
|
4665
|
-
subCommands: {
|
|
4666
|
-
list: defineCommand22({
|
|
4667
|
-
meta: { name: "list", description: "List staged ops (with lineage, mode, and results)" },
|
|
4668
|
-
run: async () => {
|
|
4669
|
-
await draftAction("/api/ads/google/draft", {});
|
|
4670
|
-
}
|
|
4671
|
-
}),
|
|
4672
|
-
remove: defineCommand22({
|
|
4673
|
-
meta: { name: "remove", description: "Remove one staged op (cascades to dependents)" },
|
|
4674
|
-
args: { ref: { type: "positional", description: "Staged op ref (g_temp_* or target)", required: false } },
|
|
4675
|
-
run: async ({ args }) => {
|
|
4676
|
-
await draftAction("/api/ads/google/draft/remove", { ref: requireTarget(args, "op") });
|
|
4677
|
-
}
|
|
4678
|
-
}),
|
|
4679
|
-
clear: defineCommand22({
|
|
4680
|
-
meta: { name: "clear", description: "Discard all staged ops on this chat" },
|
|
4681
|
-
run: async () => {
|
|
4682
|
-
await draftAction("/api/ads/google/draft/clear", {});
|
|
4683
|
-
}
|
|
4684
|
-
})
|
|
4685
|
-
}
|
|
4686
|
-
});
|
|
4687
|
-
|
|
4688
3834
|
// src/commands/ads/google/keywords/index.ts
|
|
4689
|
-
import { defineCommand as
|
|
3835
|
+
import { defineCommand as defineCommand26 } from "citty";
|
|
4690
3836
|
|
|
4691
3837
|
// src/commands/ads/google/keywords/discover.ts
|
|
4692
|
-
import { defineCommand as
|
|
3838
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
4693
3839
|
|
|
4694
3840
|
// src/geo-context.ts
|
|
4695
3841
|
var GOOGLE_ADS_LOCATIONS = [
|
|
@@ -4964,7 +4110,7 @@ function handleKeywordError(err) {
|
|
|
4964
4110
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
4965
4111
|
process.exit(1);
|
|
4966
4112
|
}
|
|
4967
|
-
var discoverCommand =
|
|
4113
|
+
var discoverCommand = defineCommand22({
|
|
4968
4114
|
meta: {
|
|
4969
4115
|
name: "discover",
|
|
4970
4116
|
description: `Discover new keyword ideas from seed keywords or competitor URLs.
|
|
@@ -5026,7 +4172,7 @@ Examples:
|
|
|
5026
4172
|
});
|
|
5027
4173
|
|
|
5028
4174
|
// src/commands/ads/google/keywords/languages.ts
|
|
5029
|
-
import { defineCommand as
|
|
4175
|
+
import { defineCommand as defineCommand23 } from "citty";
|
|
5030
4176
|
registerSchema({
|
|
5031
4177
|
command: "ads.google.keywords.languages",
|
|
5032
4178
|
description: "List all supported language IDs for --language flag in Google Ads keyword commands.",
|
|
@@ -5036,7 +4182,7 @@ var FIELDS = {
|
|
|
5036
4182
|
id: "Language ID to pass as --language",
|
|
5037
4183
|
name: "Language name"
|
|
5038
4184
|
};
|
|
5039
|
-
var languagesCommand =
|
|
4185
|
+
var languagesCommand = defineCommand23({
|
|
5040
4186
|
meta: {
|
|
5041
4187
|
name: "languages",
|
|
5042
4188
|
description: "List all supported language IDs for --language flag."
|
|
@@ -5047,7 +4193,7 @@ var languagesCommand = defineCommand24({
|
|
|
5047
4193
|
});
|
|
5048
4194
|
|
|
5049
4195
|
// src/commands/ads/google/keywords/locations.ts
|
|
5050
|
-
import { defineCommand as
|
|
4196
|
+
import { defineCommand as defineCommand24 } from "citty";
|
|
5051
4197
|
registerSchema({
|
|
5052
4198
|
command: "ads.google.keywords.locations",
|
|
5053
4199
|
description: "List all supported geo target IDs for --location flag in Google Ads keyword commands.",
|
|
@@ -5057,7 +4203,7 @@ var FIELDS2 = {
|
|
|
5057
4203
|
id: "Geo target ID to pass as --location",
|
|
5058
4204
|
name: "Country/region name"
|
|
5059
4205
|
};
|
|
5060
|
-
var locationsCommand =
|
|
4206
|
+
var locationsCommand = defineCommand24({
|
|
5061
4207
|
meta: {
|
|
5062
4208
|
name: "locations",
|
|
5063
4209
|
description: "List all supported geo target IDs for --location flag."
|
|
@@ -5068,7 +4214,7 @@ var locationsCommand = defineCommand25({
|
|
|
5068
4214
|
});
|
|
5069
4215
|
|
|
5070
4216
|
// src/commands/ads/google/keywords/metrics.ts
|
|
5071
|
-
import { defineCommand as
|
|
4217
|
+
import { defineCommand as defineCommand25 } from "citty";
|
|
5072
4218
|
registerSchema({
|
|
5073
4219
|
command: "ads.google.keywords.metrics",
|
|
5074
4220
|
description: "Get historical metrics for specific keywords. Returns { historical_metrics: [...] } with snake_case fields matching the Google Ads API. IMPORTANT: If --location and --language are omitted, defaults to United States (2840) and English (1000). The response includes a query_context object showing which location/language were used.",
|
|
@@ -5092,7 +4238,7 @@ registerSchema({
|
|
|
5092
4238
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
5093
4239
|
}
|
|
5094
4240
|
});
|
|
5095
|
-
var metricsCommand =
|
|
4241
|
+
var metricsCommand = defineCommand25({
|
|
5096
4242
|
meta: {
|
|
5097
4243
|
name: "metrics",
|
|
5098
4244
|
description: `Get historical search metrics for specific keywords.
|
|
@@ -5179,7 +4325,7 @@ Examples:
|
|
|
5179
4325
|
});
|
|
5180
4326
|
|
|
5181
4327
|
// src/commands/ads/google/keywords/index.ts
|
|
5182
|
-
var keywordsCommand =
|
|
4328
|
+
var keywordsCommand = defineCommand26({
|
|
5183
4329
|
meta: {
|
|
5184
4330
|
name: "keywords",
|
|
5185
4331
|
description: `Keyword research tools. Subcommands: discover, metrics, locations, languages.
|
|
@@ -5199,8 +4345,8 @@ Examples:
|
|
|
5199
4345
|
});
|
|
5200
4346
|
|
|
5201
4347
|
// src/commands/ads/google/library/index.ts
|
|
5202
|
-
import { defineCommand as
|
|
5203
|
-
var listAdvertisers =
|
|
4348
|
+
import { defineCommand as defineCommand27 } from "citty";
|
|
4349
|
+
var listAdvertisers = defineCommand27({
|
|
5204
4350
|
meta: {
|
|
5205
4351
|
name: "list-advertisers",
|
|
5206
4352
|
description: "List tracked Google advertisers and their accounts"
|
|
@@ -5217,7 +4363,7 @@ var listAdvertisers = defineCommand28({
|
|
|
5217
4363
|
}
|
|
5218
4364
|
}
|
|
5219
4365
|
});
|
|
5220
|
-
var syncStatus =
|
|
4366
|
+
var syncStatus = defineCommand27({
|
|
5221
4367
|
meta: {
|
|
5222
4368
|
name: "sync-status",
|
|
5223
4369
|
description: "Check the sync status and ad counts of a Google account"
|
|
@@ -5237,7 +4383,7 @@ var syncStatus = defineCommand28({
|
|
|
5237
4383
|
writeAdsJson({ ok: true, data });
|
|
5238
4384
|
}
|
|
5239
4385
|
});
|
|
5240
|
-
var searchAds =
|
|
4386
|
+
var searchAds = defineCommand27({
|
|
5241
4387
|
meta: {
|
|
5242
4388
|
name: "search-ads",
|
|
5243
4389
|
description: "Search and filter Google ads for an account"
|
|
@@ -5294,7 +4440,7 @@ var searchAds = defineCommand28({
|
|
|
5294
4440
|
}
|
|
5295
4441
|
}
|
|
5296
4442
|
});
|
|
5297
|
-
var searchAdvertiser =
|
|
4443
|
+
var searchAdvertiser = defineCommand27({
|
|
5298
4444
|
meta: {
|
|
5299
4445
|
name: "search-advertiser",
|
|
5300
4446
|
description: "Search for an advertiser on the Google Ads Transparency Center"
|
|
@@ -5329,7 +4475,7 @@ var searchAdvertiser = defineCommand28({
|
|
|
5329
4475
|
function sleep(ms) {
|
|
5330
4476
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
5331
4477
|
}
|
|
5332
|
-
var track =
|
|
4478
|
+
var track = defineCommand27({
|
|
5333
4479
|
meta: {
|
|
5334
4480
|
name: "track",
|
|
5335
4481
|
description: "Track a new Google advertiser (from search results). Waits for initial sync to complete before returning."
|
|
@@ -5387,7 +4533,7 @@ var track = defineCommand28({
|
|
|
5387
4533
|
process.exit(1);
|
|
5388
4534
|
}
|
|
5389
4535
|
});
|
|
5390
|
-
var sync =
|
|
4536
|
+
var sync = defineCommand27({
|
|
5391
4537
|
meta: {
|
|
5392
4538
|
name: "sync",
|
|
5393
4539
|
description: "Trigger an immediate sync for a Google account. Waits for completion before returning."
|
|
@@ -5431,7 +4577,7 @@ var sync = defineCommand28({
|
|
|
5431
4577
|
process.exit(1);
|
|
5432
4578
|
}
|
|
5433
4579
|
});
|
|
5434
|
-
var searchCompetitors =
|
|
4580
|
+
var searchCompetitors = defineCommand27({
|
|
5435
4581
|
meta: {
|
|
5436
4582
|
name: "search-competitors",
|
|
5437
4583
|
description: "Search for competitors running Google ads for a keyword (DataForSEO)"
|
|
@@ -5463,7 +4609,7 @@ var searchCompetitors = defineCommand28({
|
|
|
5463
4609
|
}
|
|
5464
4610
|
}
|
|
5465
4611
|
});
|
|
5466
|
-
var library =
|
|
4612
|
+
var library = defineCommand27({
|
|
5467
4613
|
meta: {
|
|
5468
4614
|
name: "library",
|
|
5469
4615
|
description: "Manage and search the Google Ads Library"
|
|
@@ -5480,9 +4626,9 @@ var library = defineCommand28({
|
|
|
5480
4626
|
});
|
|
5481
4627
|
|
|
5482
4628
|
// src/commands/ads/google/query.ts
|
|
5483
|
-
import { appendFileSync, existsSync as existsSync3, readFileSync as
|
|
4629
|
+
import { appendFileSync, existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
5484
4630
|
import { resolve } from "path";
|
|
5485
|
-
import { defineCommand as
|
|
4631
|
+
import { defineCommand as defineCommand28 } from "citty";
|
|
5486
4632
|
|
|
5487
4633
|
// src/commands/ads/google/preflight.ts
|
|
5488
4634
|
function buildCommand2(query, customerId) {
|
|
@@ -5774,7 +4920,7 @@ function writeRowsToFile(filePath, rows, fields, append) {
|
|
|
5774
4920
|
`, "utf-8");
|
|
5775
4921
|
}
|
|
5776
4922
|
} else if (append && existsSync3(filePath)) {
|
|
5777
|
-
const existing = JSON.parse(
|
|
4923
|
+
const existing = JSON.parse(readFileSync3(filePath, "utf-8"));
|
|
5778
4924
|
writeFileSync2(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
|
|
5779
4925
|
} else {
|
|
5780
4926
|
writeFileSync2(filePath, JSON.stringify(rows, null, 2), "utf-8");
|
|
@@ -5938,7 +5084,7 @@ function handleQueryError(err, finalQuery, customerId) {
|
|
|
5938
5084
|
});
|
|
5939
5085
|
process.exit(1);
|
|
5940
5086
|
}
|
|
5941
|
-
var queryCommand =
|
|
5087
|
+
var queryCommand = defineCommand28({
|
|
5942
5088
|
meta: {
|
|
5943
5089
|
name: "query",
|
|
5944
5090
|
description: `Run GAQL queries against Google Ads. Supports raw GAQL, presets, pagination, file export, and caching.
|
|
@@ -5995,516 +5141,8 @@ Examples:
|
|
|
5995
5141
|
}
|
|
5996
5142
|
});
|
|
5997
5143
|
|
|
5998
|
-
// src/commands/ads/google/write-commands.ts
|
|
5999
|
-
import { defineCommand as defineCommand30 } from "citty";
|
|
6000
|
-
var customerIdArg = { "customer-id": { type: "string", description: "10-digit Google Ads customer id" } };
|
|
6001
|
-
var fileArg = {
|
|
6002
|
-
file: { type: "string", description: "JSON file with the full op payload (flags override)" }
|
|
6003
|
-
};
|
|
6004
|
-
var budgetsCommand = defineCommand30({
|
|
6005
|
-
meta: { name: "budgets", description: "Stage campaign budget create/update" },
|
|
6006
|
-
subCommands: {
|
|
6007
|
-
create: defineCommand30({
|
|
6008
|
-
meta: { name: "create", description: "Stage a campaign budget" },
|
|
6009
|
-
args: {
|
|
6010
|
-
...customerIdArg,
|
|
6011
|
-
...fileArg,
|
|
6012
|
-
name: { type: "string", description: "Budget name" },
|
|
6013
|
-
amount: { type: "string", description: "Daily amount in major currency units (e.g. 50)" },
|
|
6014
|
-
delivery: { type: "string", description: "STANDARD | ACCELERATED" },
|
|
6015
|
-
shared: { type: "boolean", description: "Explicitly shared budget" }
|
|
6016
|
-
},
|
|
6017
|
-
run: async ({ args }) => {
|
|
6018
|
-
const customerId = requireCustomerId(args);
|
|
6019
|
-
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6020
|
-
name: args.name,
|
|
6021
|
-
amountMicros: microsFlag(args.amount, "--amount"),
|
|
6022
|
-
deliveryMethod: args.delivery,
|
|
6023
|
-
explicitlyShared: args.shared || void 0
|
|
6024
|
-
});
|
|
6025
|
-
await stageCreate("google.budget.create", customerId, payload);
|
|
6026
|
-
}
|
|
6027
|
-
}),
|
|
6028
|
-
update: defineCommand30({
|
|
6029
|
-
meta: { name: "update", description: "Stage a budget update" },
|
|
6030
|
-
args: {
|
|
6031
|
-
...customerIdArg,
|
|
6032
|
-
...fileArg,
|
|
6033
|
-
name: { type: "string" },
|
|
6034
|
-
amount: { type: "string", description: "New daily amount in major currency units" },
|
|
6035
|
-
delivery: { type: "string" }
|
|
6036
|
-
},
|
|
6037
|
-
run: async ({ args }) => {
|
|
6038
|
-
const customerId = requireCustomerId(args);
|
|
6039
|
-
const target = requireTarget(args, "budget");
|
|
6040
|
-
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6041
|
-
name: args.name,
|
|
6042
|
-
amountMicros: microsFlag(args.amount, "--amount"),
|
|
6043
|
-
deliveryMethod: args.delivery
|
|
6044
|
-
});
|
|
6045
|
-
await stageUpdate("google.budget.update", customerId, target, payload);
|
|
6046
|
-
}
|
|
6047
|
-
})
|
|
6048
|
-
}
|
|
6049
|
-
});
|
|
6050
|
-
function biddingFromFlags(args) {
|
|
6051
|
-
const type = args["bidding-strategy"];
|
|
6052
|
-
if (!type) {
|
|
6053
|
-
return void 0;
|
|
6054
|
-
}
|
|
6055
|
-
return {
|
|
6056
|
-
type,
|
|
6057
|
-
targetCpaMicros: microsFlag(args["target-cpa"], "--target-cpa"),
|
|
6058
|
-
targetRoas: args["target-roas"] !== void 0 ? Number(args["target-roas"]) : void 0
|
|
6059
|
-
};
|
|
6060
|
-
}
|
|
6061
|
-
var campaignsCommand = defineCommand30({
|
|
6062
|
-
meta: { name: "campaigns", description: "Stage campaign create/update/pause/resume/remove" },
|
|
6063
|
-
subCommands: {
|
|
6064
|
-
create: defineCommand30({
|
|
6065
|
-
meta: { name: "create", description: "Stage a campaign" },
|
|
6066
|
-
args: {
|
|
6067
|
-
...customerIdArg,
|
|
6068
|
-
...fileArg,
|
|
6069
|
-
name: { type: "string" },
|
|
6070
|
-
"channel-type": {
|
|
6071
|
-
type: "string",
|
|
6072
|
-
description: "SEARCH | DISPLAY | SHOPPING | VIDEO | PERFORMANCE_MAX | DEMAND_GEN | \u2026"
|
|
6073
|
-
},
|
|
6074
|
-
"sub-type": { type: "string", description: "Advertising channel sub-type" },
|
|
6075
|
-
"budget-ref": { type: "string", description: "Budget ref (g_temp_*, id, or resource name)" },
|
|
6076
|
-
"bidding-strategy": {
|
|
6077
|
-
type: "string",
|
|
6078
|
-
description: "MANUAL_CPC | MAXIMIZE_CONVERSIONS | TARGET_CPA | TARGET_ROAS | \u2026"
|
|
6079
|
-
},
|
|
6080
|
-
"target-cpa": { type: "string", description: "Target CPA (major units) for TARGET_CPA" },
|
|
6081
|
-
"target-roas": { type: "string", description: "Target ROAS (e.g. 4.0) for TARGET_ROAS" },
|
|
6082
|
-
objective: { type: "string", description: "Advisory UI objective (SALES, LEADS, \u2026)" },
|
|
6083
|
-
"start-date": { type: "string", description: "YYYY-MM-DD" },
|
|
6084
|
-
"end-date": { type: "string", description: "YYYY-MM-DD" },
|
|
6085
|
-
status: { type: "string", description: "ENABLED | PAUSED (default PAUSED)" }
|
|
6086
|
-
},
|
|
6087
|
-
run: async ({ args }) => {
|
|
6088
|
-
const customerId = requireCustomerId(args);
|
|
6089
|
-
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6090
|
-
name: args.name,
|
|
6091
|
-
channelType: args["channel-type"],
|
|
6092
|
-
channelSubType: args["sub-type"],
|
|
6093
|
-
budget: args["budget-ref"],
|
|
6094
|
-
bidding: biddingFromFlags(args),
|
|
6095
|
-
objective: args.objective,
|
|
6096
|
-
startDate: args["start-date"],
|
|
6097
|
-
endDate: args["end-date"],
|
|
6098
|
-
status: args.status
|
|
6099
|
-
});
|
|
6100
|
-
await stageCreate("google.campaign.create", customerId, payload);
|
|
6101
|
-
}
|
|
6102
|
-
}),
|
|
6103
|
-
update: defineCommand30({
|
|
6104
|
-
meta: { name: "update", description: "Stage a campaign update" },
|
|
6105
|
-
args: {
|
|
6106
|
-
...customerIdArg,
|
|
6107
|
-
...fileArg,
|
|
6108
|
-
name: { type: "string" },
|
|
6109
|
-
"budget-ref": { type: "string" },
|
|
6110
|
-
"bidding-strategy": { type: "string" },
|
|
6111
|
-
"target-cpa": { type: "string" },
|
|
6112
|
-
"target-roas": { type: "string" },
|
|
6113
|
-
status: { type: "string" }
|
|
6114
|
-
},
|
|
6115
|
-
run: async ({ args }) => {
|
|
6116
|
-
const customerId = requireCustomerId(args);
|
|
6117
|
-
const target = requireTarget(args, "campaign");
|
|
6118
|
-
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6119
|
-
name: args.name,
|
|
6120
|
-
budget: args["budget-ref"],
|
|
6121
|
-
bidding: biddingFromFlags(args),
|
|
6122
|
-
status: args.status
|
|
6123
|
-
});
|
|
6124
|
-
await stageUpdate("google.campaign.update", customerId, target, payload);
|
|
6125
|
-
}
|
|
6126
|
-
}),
|
|
6127
|
-
pause: statusCommand2("google.campaign.pause", "campaign"),
|
|
6128
|
-
resume: statusCommand2("google.campaign.resume", "campaign"),
|
|
6129
|
-
remove: statusCommand2("google.campaign.remove", "campaign")
|
|
6130
|
-
}
|
|
6131
|
-
});
|
|
6132
|
-
function statusCommand2(kind, entity) {
|
|
6133
|
-
return defineCommand30({
|
|
6134
|
-
meta: { name: kind.split(".")[2], description: `Stage a ${entity} ${kind.split(".")[2]}` },
|
|
6135
|
-
args: {
|
|
6136
|
-
...customerIdArg,
|
|
6137
|
-
id: { type: "positional", description: `${entity} resource name or id`, required: false }
|
|
6138
|
-
},
|
|
6139
|
-
run: async ({ args }) => {
|
|
6140
|
-
const customerId = requireCustomerId(args);
|
|
6141
|
-
await stageTarget(kind, customerId, requireTarget(args, entity));
|
|
6142
|
-
}
|
|
6143
|
-
});
|
|
6144
|
-
}
|
|
6145
|
-
var adGroupsCommand = defineCommand30({
|
|
6146
|
-
meta: { name: "ad-groups", description: "Stage ad group create/update/pause/resume/remove" },
|
|
6147
|
-
subCommands: {
|
|
6148
|
-
create: defineCommand30({
|
|
6149
|
-
meta: { name: "create", description: "Stage an ad group" },
|
|
6150
|
-
args: {
|
|
6151
|
-
...customerIdArg,
|
|
6152
|
-
...fileArg,
|
|
6153
|
-
name: { type: "string" },
|
|
6154
|
-
"campaign-ref": { type: "string", description: "Campaign ref (g_temp_*, id, or resource name)" },
|
|
6155
|
-
type: { type: "string", description: "Ad group type (default SEARCH_STANDARD)" },
|
|
6156
|
-
"cpc-bid": { type: "string", description: "Default CPC bid in major units" },
|
|
6157
|
-
status: { type: "string" }
|
|
6158
|
-
},
|
|
6159
|
-
run: async ({ args }) => {
|
|
6160
|
-
const customerId = requireCustomerId(args);
|
|
6161
|
-
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6162
|
-
name: args.name,
|
|
6163
|
-
campaign: args["campaign-ref"],
|
|
6164
|
-
type: args.type,
|
|
6165
|
-
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6166
|
-
status: args.status
|
|
6167
|
-
});
|
|
6168
|
-
await stageCreate("google.adGroup.create", customerId, payload);
|
|
6169
|
-
}
|
|
6170
|
-
}),
|
|
6171
|
-
update: defineCommand30({
|
|
6172
|
-
meta: { name: "update", description: "Stage an ad group update" },
|
|
6173
|
-
args: {
|
|
6174
|
-
...customerIdArg,
|
|
6175
|
-
...fileArg,
|
|
6176
|
-
name: { type: "string" },
|
|
6177
|
-
"cpc-bid": { type: "string" },
|
|
6178
|
-
status: { type: "string" }
|
|
6179
|
-
},
|
|
6180
|
-
run: async ({ args }) => {
|
|
6181
|
-
const customerId = requireCustomerId(args);
|
|
6182
|
-
const target = requireTarget(args, "ad group");
|
|
6183
|
-
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6184
|
-
name: args.name,
|
|
6185
|
-
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6186
|
-
status: args.status
|
|
6187
|
-
});
|
|
6188
|
-
await stageUpdate("google.adGroup.update", customerId, target, payload);
|
|
6189
|
-
}
|
|
6190
|
-
}),
|
|
6191
|
-
pause: statusCommand2("google.adGroup.pause", "ad group"),
|
|
6192
|
-
resume: statusCommand2("google.adGroup.resume", "ad group"),
|
|
6193
|
-
remove: statusCommand2("google.adGroup.remove", "ad group")
|
|
6194
|
-
}
|
|
6195
|
-
});
|
|
6196
|
-
var keywordWriteSubcommands = {
|
|
6197
|
-
add: defineCommand30({
|
|
6198
|
-
meta: { name: "add", description: "Add a keyword to an ad group" },
|
|
6199
|
-
args: {
|
|
6200
|
-
...customerIdArg,
|
|
6201
|
-
"ad-group-ref": { type: "string", description: "Ad group ref (g_temp_*, id, or resource name)" },
|
|
6202
|
-
text: { type: "string", description: "Keyword text" },
|
|
6203
|
-
"match-type": { type: "string", description: "EXACT | PHRASE | BROAD" },
|
|
6204
|
-
"cpc-bid": { type: "string", description: "Keyword CPC bid in major units" },
|
|
6205
|
-
"final-url": { type: "string", description: "Keyword-level final URL" }
|
|
6206
|
-
},
|
|
6207
|
-
run: async ({ args }) => {
|
|
6208
|
-
const customerId = requireCustomerId(args);
|
|
6209
|
-
await stageCreate("google.keyword.add", customerId, {
|
|
6210
|
-
adGroup: requireStringFlag(args["ad-group-ref"], "--ad-group-ref"),
|
|
6211
|
-
text: requireStringFlag(args.text, "--text"),
|
|
6212
|
-
matchType: requireStringFlag(args["match-type"], "--match-type"),
|
|
6213
|
-
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6214
|
-
finalUrls: args["final-url"] ? [args["final-url"]] : void 0
|
|
6215
|
-
});
|
|
6216
|
-
}
|
|
6217
|
-
}),
|
|
6218
|
-
update: defineCommand30({
|
|
6219
|
-
meta: { name: "update", description: "Update a keyword" },
|
|
6220
|
-
args: { ...customerIdArg, "cpc-bid": { type: "string" }, status: { type: "string" } },
|
|
6221
|
-
run: async ({ args }) => {
|
|
6222
|
-
const customerId = requireCustomerId(args);
|
|
6223
|
-
await stageUpdate("google.keyword.update", customerId, requireTarget(args, "keyword"), {
|
|
6224
|
-
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6225
|
-
status: args.status
|
|
6226
|
-
});
|
|
6227
|
-
}
|
|
6228
|
-
}),
|
|
6229
|
-
remove: statusCommand2("google.keyword.remove", "keyword")
|
|
6230
|
-
};
|
|
6231
|
-
var negativeKeywordsCommand = defineCommand30({
|
|
6232
|
-
meta: { name: "negative-keywords", description: "Stage negative keyword add/remove (ad-group or campaign level)" },
|
|
6233
|
-
subCommands: {
|
|
6234
|
-
add: defineCommand30({
|
|
6235
|
-
meta: { name: "add", description: "Add a negative keyword" },
|
|
6236
|
-
args: {
|
|
6237
|
-
...customerIdArg,
|
|
6238
|
-
level: { type: "string", description: "adGroup | campaign" },
|
|
6239
|
-
"parent-ref": { type: "string", description: "Ad group or campaign ref" },
|
|
6240
|
-
text: { type: "string" },
|
|
6241
|
-
"match-type": { type: "string", description: "EXACT | PHRASE | BROAD" }
|
|
6242
|
-
},
|
|
6243
|
-
run: async ({ args }) => {
|
|
6244
|
-
const customerId = requireCustomerId(args);
|
|
6245
|
-
await stageCreate("google.negativeKeyword.add", customerId, {
|
|
6246
|
-
level: requireStringFlag(args.level, "--level"),
|
|
6247
|
-
parent: requireStringFlag(args["parent-ref"], "--parent-ref"),
|
|
6248
|
-
text: requireStringFlag(args.text, "--text"),
|
|
6249
|
-
matchType: requireStringFlag(args["match-type"], "--match-type")
|
|
6250
|
-
});
|
|
6251
|
-
}
|
|
6252
|
-
}),
|
|
6253
|
-
remove: statusCommand2("google.negativeKeyword.remove", "negative keyword")
|
|
6254
|
-
}
|
|
6255
|
-
});
|
|
6256
|
-
var keywordListsCommand = defineCommand30({
|
|
6257
|
-
meta: { name: "keyword-lists", description: "Stage shared negative keyword lists (create/add/attach/detach)" },
|
|
6258
|
-
subCommands: {
|
|
6259
|
-
create: defineCommand30({
|
|
6260
|
-
meta: { name: "create", description: "Create a shared negative keyword list" },
|
|
6261
|
-
args: {
|
|
6262
|
-
...customerIdArg,
|
|
6263
|
-
name: { type: "string" },
|
|
6264
|
-
type: {
|
|
6265
|
-
type: "string",
|
|
6266
|
-
description: "NEGATIVE_KEYWORDS (default) | NEGATIVE_PLACEMENTS | ACCOUNT_LEVEL_NEGATIVE_KEYWORDS"
|
|
6267
|
-
}
|
|
6268
|
-
},
|
|
6269
|
-
run: async ({ args }) => {
|
|
6270
|
-
const customerId = requireCustomerId(args);
|
|
6271
|
-
await stageCreate("google.sharedSet.create", customerId, {
|
|
6272
|
-
name: requireStringFlag(args.name, "--name"),
|
|
6273
|
-
type: args.type
|
|
6274
|
-
});
|
|
6275
|
-
}
|
|
6276
|
-
}),
|
|
6277
|
-
add: defineCommand30({
|
|
6278
|
-
meta: { name: "add", description: "Add a keyword to a shared list" },
|
|
6279
|
-
args: {
|
|
6280
|
-
...customerIdArg,
|
|
6281
|
-
"list-ref": { type: "string", description: "Shared set ref" },
|
|
6282
|
-
text: { type: "string" },
|
|
6283
|
-
"match-type": { type: "string" }
|
|
6284
|
-
},
|
|
6285
|
-
run: async ({ args }) => {
|
|
6286
|
-
const customerId = requireCustomerId(args);
|
|
6287
|
-
await stageCreate("google.sharedSetMember.add", customerId, {
|
|
6288
|
-
sharedSet: requireStringFlag(args["list-ref"], "--list-ref"),
|
|
6289
|
-
text: requireStringFlag(args.text, "--text"),
|
|
6290
|
-
matchType: requireStringFlag(args["match-type"], "--match-type")
|
|
6291
|
-
});
|
|
6292
|
-
}
|
|
6293
|
-
}),
|
|
6294
|
-
attach: defineCommand30({
|
|
6295
|
-
meta: { name: "attach", description: "Attach a keyword list to a campaign" },
|
|
6296
|
-
args: { ...customerIdArg, "campaign-ref": { type: "string" }, "list-ref": { type: "string" } },
|
|
6297
|
-
run: async ({ args }) => {
|
|
6298
|
-
const customerId = requireCustomerId(args);
|
|
6299
|
-
await stageCreate("google.campaignSharedSet.attach", customerId, {
|
|
6300
|
-
campaign: requireStringFlag(args["campaign-ref"], "--campaign-ref"),
|
|
6301
|
-
sharedSet: requireStringFlag(args["list-ref"], "--list-ref")
|
|
6302
|
-
});
|
|
6303
|
-
}
|
|
6304
|
-
}),
|
|
6305
|
-
detach: statusCommand2("google.campaignSharedSet.detach", "campaign shared set")
|
|
6306
|
-
}
|
|
6307
|
-
});
|
|
6308
|
-
function rsaContentFromFlags(args) {
|
|
6309
|
-
const headlines = listFlag(args.headlines);
|
|
6310
|
-
const descriptions = listFlag(args.descriptions);
|
|
6311
|
-
if (!headlines || !descriptions) {
|
|
6312
|
-
failWriteValidation("responsive search ads need --headlines and --descriptions (comma-separated), or use --file");
|
|
6313
|
-
}
|
|
6314
|
-
const finalUrls = listFlag(args["final-url"]);
|
|
6315
|
-
if (!finalUrls) {
|
|
6316
|
-
failWriteValidation("--final-url is required for a responsive search ad");
|
|
6317
|
-
}
|
|
6318
|
-
return {
|
|
6319
|
-
format: "responsiveSearch",
|
|
6320
|
-
headlines: headlines.map((text) => ({ text })),
|
|
6321
|
-
descriptions: descriptions.map((text) => ({ text })),
|
|
6322
|
-
path1: args.path1,
|
|
6323
|
-
path2: args.path2,
|
|
6324
|
-
finalUrls
|
|
6325
|
-
};
|
|
6326
|
-
}
|
|
6327
|
-
var adsCommand = defineCommand30({
|
|
6328
|
-
meta: { name: "ads", description: "Stage ad create/update/pause/resume/remove" },
|
|
6329
|
-
subCommands: {
|
|
6330
|
-
create: defineCommand30({
|
|
6331
|
-
meta: { name: "create", description: "Stage an ad (responsive search via flags; other formats via --file)" },
|
|
6332
|
-
args: {
|
|
6333
|
-
...customerIdArg,
|
|
6334
|
-
...fileArg,
|
|
6335
|
-
"ad-group-ref": { type: "string", description: "Ad group ref" },
|
|
6336
|
-
format: {
|
|
6337
|
-
type: "string",
|
|
6338
|
-
description: "responsiveSearch (default) | responsiveDisplay | performanceMaxAssetGroup | call | app | video | demandGen"
|
|
6339
|
-
},
|
|
6340
|
-
headlines: { type: "string", description: "Comma-separated headlines (RSA)" },
|
|
6341
|
-
descriptions: { type: "string", description: "Comma-separated descriptions (RSA)" },
|
|
6342
|
-
path1: { type: "string" },
|
|
6343
|
-
path2: { type: "string" },
|
|
6344
|
-
"final-url": { type: "string", description: "Comma-separated final URLs" },
|
|
6345
|
-
status: { type: "string" }
|
|
6346
|
-
},
|
|
6347
|
-
run: async ({ args }) => {
|
|
6348
|
-
const customerId = requireCustomerId(args);
|
|
6349
|
-
const file = loadJsonFileArg(args.file);
|
|
6350
|
-
const format = args.format ?? "responsiveSearch";
|
|
6351
|
-
const content = file.content ?? (format === "responsiveSearch" ? rsaContentFromFlags(args) : failWriteValidation(`--format ${format} needs --file with the ad content`));
|
|
6352
|
-
await stageCreate("google.ad.create", customerId, {
|
|
6353
|
-
adGroup: requireStringFlag(args["ad-group-ref"] ?? file.adGroup, "--ad-group-ref"),
|
|
6354
|
-
status: args.status ?? file.status,
|
|
6355
|
-
content
|
|
6356
|
-
});
|
|
6357
|
-
}
|
|
6358
|
-
}),
|
|
6359
|
-
update: defineCommand30({
|
|
6360
|
-
meta: { name: "update", description: "Stage an ad update" },
|
|
6361
|
-
args: { ...customerIdArg, ...fileArg, status: { type: "string" } },
|
|
6362
|
-
run: async ({ args }) => {
|
|
6363
|
-
const customerId = requireCustomerId(args);
|
|
6364
|
-
const file = loadJsonFileArg(args.file);
|
|
6365
|
-
await stageUpdate(
|
|
6366
|
-
"google.ad.update",
|
|
6367
|
-
customerId,
|
|
6368
|
-
requireTarget(args, "ad"),
|
|
6369
|
-
mergePayload(file, { status: args.status })
|
|
6370
|
-
);
|
|
6371
|
-
}
|
|
6372
|
-
}),
|
|
6373
|
-
pause: statusCommand2("google.ad.pause", "ad"),
|
|
6374
|
-
resume: statusCommand2("google.ad.resume", "ad"),
|
|
6375
|
-
remove: statusCommand2("google.ad.remove", "ad")
|
|
6376
|
-
}
|
|
6377
|
-
});
|
|
6378
|
-
function fileCreateCommand(name, kind, description) {
|
|
6379
|
-
return defineCommand30({
|
|
6380
|
-
meta: { name, description },
|
|
6381
|
-
args: { ...customerIdArg, ...fileArg },
|
|
6382
|
-
run: async ({ args }) => {
|
|
6383
|
-
const customerId = requireCustomerId(args);
|
|
6384
|
-
const payload = loadJsonFileArg(args.file);
|
|
6385
|
-
if (Object.keys(payload).length === 0) {
|
|
6386
|
-
failWriteValidation(`${kind} needs --file with the op payload`);
|
|
6387
|
-
}
|
|
6388
|
-
await stageGoogleOp({ kind, customerId, payload });
|
|
6389
|
-
}
|
|
6390
|
-
});
|
|
6391
|
-
}
|
|
6392
|
-
var assetsCommand = defineCommand30({
|
|
6393
|
-
meta: { name: "assets", description: "Stage asset create + asset-link attach/detach (via --file)" },
|
|
6394
|
-
subCommands: {
|
|
6395
|
-
create: fileCreateCommand(
|
|
6396
|
-
"create",
|
|
6397
|
-
"google.asset.create",
|
|
6398
|
-
"Stage an asset (text/image/sitelink/callout/structuredSnippet/\u2026)"
|
|
6399
|
-
),
|
|
6400
|
-
attach: fileCreateCommand("attach", "google.assetLink.attach", "Attach an asset to a campaign/adGroup/customer"),
|
|
6401
|
-
detach: statusCommand2("google.assetLink.detach", "asset link")
|
|
6402
|
-
}
|
|
6403
|
-
});
|
|
6404
|
-
var audiencesCommand = defineCommand30({
|
|
6405
|
-
meta: { name: "audiences", description: "Stage audience (user list) create + criterion attach/detach (via --file)" },
|
|
6406
|
-
subCommands: {
|
|
6407
|
-
create: fileCreateCommand("create", "google.audience.create", "Stage a user-list audience"),
|
|
6408
|
-
attach: fileCreateCommand(
|
|
6409
|
-
"attach",
|
|
6410
|
-
"google.audienceCriterion.attach",
|
|
6411
|
-
"Target/exclude an audience on a campaign/adGroup"
|
|
6412
|
-
),
|
|
6413
|
-
detach: statusCommand2("google.audienceCriterion.detach", "audience criterion")
|
|
6414
|
-
}
|
|
6415
|
-
});
|
|
6416
|
-
var conversionsCommand = defineCommand30({
|
|
6417
|
-
meta: { name: "conversions", description: "Stage conversion action create/update (via --file)" },
|
|
6418
|
-
subCommands: {
|
|
6419
|
-
create: fileCreateCommand("create", "google.conversionAction.create", "Stage a conversion action"),
|
|
6420
|
-
update: defineCommand30({
|
|
6421
|
-
meta: { name: "update", description: "Stage a conversion action update" },
|
|
6422
|
-
args: { ...customerIdArg, ...fileArg },
|
|
6423
|
-
run: async ({ args }) => {
|
|
6424
|
-
const customerId = requireCustomerId(args);
|
|
6425
|
-
await stageUpdate(
|
|
6426
|
-
"google.conversionAction.update",
|
|
6427
|
-
customerId,
|
|
6428
|
-
requireTarget(args, "conversion action"),
|
|
6429
|
-
loadJsonFileArg(args.file)
|
|
6430
|
-
);
|
|
6431
|
-
}
|
|
6432
|
-
})
|
|
6433
|
-
}
|
|
6434
|
-
});
|
|
6435
|
-
var biddingStrategiesCommand = defineCommand30({
|
|
6436
|
-
meta: { name: "bidding-strategies", description: "Stage portfolio bidding strategy create/update (via --file)" },
|
|
6437
|
-
subCommands: {
|
|
6438
|
-
create: fileCreateCommand("create", "google.biddingStrategy.create", "Stage a portfolio bidding strategy"),
|
|
6439
|
-
update: defineCommand30({
|
|
6440
|
-
meta: { name: "update", description: "Stage a portfolio bidding strategy update" },
|
|
6441
|
-
args: { ...customerIdArg, ...fileArg },
|
|
6442
|
-
run: async ({ args }) => {
|
|
6443
|
-
const customerId = requireCustomerId(args);
|
|
6444
|
-
await stageUpdate(
|
|
6445
|
-
"google.biddingStrategy.update",
|
|
6446
|
-
customerId,
|
|
6447
|
-
requireTarget(args, "bidding strategy"),
|
|
6448
|
-
loadJsonFileArg(args.file)
|
|
6449
|
-
);
|
|
6450
|
-
}
|
|
6451
|
-
})
|
|
6452
|
-
}
|
|
6453
|
-
});
|
|
6454
|
-
var labelsCommand = defineCommand30({
|
|
6455
|
-
meta: { name: "labels", description: "Stage label create + attach (via --file)" },
|
|
6456
|
-
subCommands: {
|
|
6457
|
-
create: defineCommand30({
|
|
6458
|
-
meta: { name: "create", description: "Create a label" },
|
|
6459
|
-
args: {
|
|
6460
|
-
...customerIdArg,
|
|
6461
|
-
name: { type: "string" },
|
|
6462
|
-
"background-color": { type: "string" },
|
|
6463
|
-
description: { type: "string" }
|
|
6464
|
-
},
|
|
6465
|
-
run: async ({ args }) => {
|
|
6466
|
-
const customerId = requireCustomerId(args);
|
|
6467
|
-
await stageCreate("google.label.create", customerId, {
|
|
6468
|
-
name: requireStringFlag(args.name, "--name"),
|
|
6469
|
-
backgroundColor: args["background-color"],
|
|
6470
|
-
description: args.description
|
|
6471
|
-
});
|
|
6472
|
-
}
|
|
6473
|
-
}),
|
|
6474
|
-
attach: fileCreateCommand("attach", "google.label.attach", "Attach a label to a campaign/adGroup/ad")
|
|
6475
|
-
}
|
|
6476
|
-
});
|
|
6477
|
-
var campaignCriteriaCommand = defineCommand30({
|
|
6478
|
-
meta: {
|
|
6479
|
-
name: "campaign-criteria",
|
|
6480
|
-
description: "Stage campaign criteria (location/language/adSchedule/device) add/remove (via --file)"
|
|
6481
|
-
},
|
|
6482
|
-
subCommands: {
|
|
6483
|
-
add: fileCreateCommand("add", "google.campaignCriterion.add", "Add a campaign criterion"),
|
|
6484
|
-
remove: statusCommand2("google.campaignCriterion.remove", "campaign criterion")
|
|
6485
|
-
}
|
|
6486
|
-
});
|
|
6487
|
-
var googleWriteCommands = {
|
|
6488
|
-
budgets: budgetsCommand,
|
|
6489
|
-
campaigns: campaignsCommand,
|
|
6490
|
-
"ad-groups": adGroupsCommand,
|
|
6491
|
-
"negative-keywords": negativeKeywordsCommand,
|
|
6492
|
-
"keyword-lists": keywordListsCommand,
|
|
6493
|
-
ads: adsCommand,
|
|
6494
|
-
assets: assetsCommand,
|
|
6495
|
-
audiences: audiencesCommand,
|
|
6496
|
-
conversions: conversionsCommand,
|
|
6497
|
-
"bidding-strategies": biddingStrategiesCommand,
|
|
6498
|
-
labels: labelsCommand,
|
|
6499
|
-
"campaign-criteria": campaignCriteriaCommand
|
|
6500
|
-
};
|
|
6501
|
-
|
|
6502
5144
|
// src/commands/ads/google/index.ts
|
|
6503
|
-
var
|
|
6504
|
-
meta: keywordsCommand.meta,
|
|
6505
|
-
subCommands: { ...keywordsCommand.subCommands, ...keywordWriteSubcommands }
|
|
6506
|
-
});
|
|
6507
|
-
var googleCommand = defineCommand31({
|
|
5145
|
+
var googleCommand = defineCommand29({
|
|
6508
5146
|
meta: {
|
|
6509
5147
|
name: "google",
|
|
6510
5148
|
description: `Google Ads commands. Query campaigns, keywords, search terms, and more via GAQL.
|
|
@@ -6519,28 +5157,20 @@ Examples:
|
|
|
6519
5157
|
baker ads google query --preset campaign-performance --customer-id 1234567890
|
|
6520
5158
|
baker ads google currency --customer-id 1234567890
|
|
6521
5159
|
baker ads google keywords discover --customer-id 1234567890 --seeds "running shoes"
|
|
6522
|
-
baker ads google library list-advertisers \u2014 list tracked Google advertisers
|
|
6523
|
-
|
|
6524
|
-
Staged writes (never touch Google until the chat is published):
|
|
6525
|
-
baker ads google budgets create --customer-id 1234567890 --name "Search" --amount 50
|
|
6526
|
-
baker ads google campaigns create --customer-id 1234567890 --name "Brand" --channel-type SEARCH --budget-ref g_temp_\u2026 --bidding-strategy MANUAL_CPC
|
|
6527
|
-
baker ads google keyword-lists create --customer-id 1234567890 --name "Brand exclusions"
|
|
6528
|
-
baker ads google draft list \u2014 review staged Google Ads changes`
|
|
5160
|
+
baker ads google library list-advertisers \u2014 list tracked Google advertisers`
|
|
6529
5161
|
},
|
|
6530
5162
|
subCommands: {
|
|
6531
5163
|
accounts: accountsCommand,
|
|
6532
5164
|
currency: currencyCommand,
|
|
6533
5165
|
changes: changesCommand,
|
|
6534
5166
|
query: queryCommand,
|
|
6535
|
-
keywords:
|
|
6536
|
-
library
|
|
6537
|
-
...googleWriteCommands,
|
|
6538
|
-
draft: draftCommand2
|
|
5167
|
+
keywords: keywordsCommand,
|
|
5168
|
+
library
|
|
6539
5169
|
}
|
|
6540
5170
|
});
|
|
6541
5171
|
|
|
6542
5172
|
// src/commands/ads/linkedin/index.ts
|
|
6543
|
-
import { defineCommand as
|
|
5173
|
+
import { defineCommand as defineCommand49 } from "citty";
|
|
6544
5174
|
|
|
6545
5175
|
// src/commands/ads/linkedin/schemas.ts
|
|
6546
5176
|
registerSchema({
|
|
@@ -7201,7 +5831,7 @@ registerSchema({
|
|
|
7201
5831
|
});
|
|
7202
5832
|
|
|
7203
5833
|
// src/commands/ads/linkedin/account.ts
|
|
7204
|
-
import { defineCommand as
|
|
5834
|
+
import { defineCommand as defineCommand30 } from "citty";
|
|
7205
5835
|
|
|
7206
5836
|
// src/commands/ads/linkedin/shared.ts
|
|
7207
5837
|
var DAY_MS2 = 864e5;
|
|
@@ -7304,7 +5934,7 @@ function resolveStatusFilter(args) {
|
|
|
7304
5934
|
}
|
|
7305
5935
|
|
|
7306
5936
|
// src/commands/ads/linkedin/account.ts
|
|
7307
|
-
var accountCommand =
|
|
5937
|
+
var accountCommand = defineCommand30({
|
|
7308
5938
|
meta: {
|
|
7309
5939
|
name: "account",
|
|
7310
5940
|
description: `Single LinkedIn ad account detail (currency, status, type).
|
|
@@ -7338,9 +5968,9 @@ Examples:
|
|
|
7338
5968
|
});
|
|
7339
5969
|
|
|
7340
5970
|
// src/commands/ads/linkedin/accounts.ts
|
|
7341
|
-
import { defineCommand as
|
|
5971
|
+
import { defineCommand as defineCommand31 } from "citty";
|
|
7342
5972
|
var ACCOUNTS_TTL_MS = 60 * 60 * 1e3;
|
|
7343
|
-
var accountsCommand2 =
|
|
5973
|
+
var accountsCommand2 = defineCommand31({
|
|
7344
5974
|
meta: {
|
|
7345
5975
|
name: "accounts",
|
|
7346
5976
|
description: `List LinkedIn ad accounts in this company's connected scope.
|
|
@@ -7388,7 +6018,7 @@ Examples:
|
|
|
7388
6018
|
});
|
|
7389
6019
|
|
|
7390
6020
|
// src/commands/ads/linkedin/analytics.ts
|
|
7391
|
-
import { defineCommand as
|
|
6021
|
+
import { defineCommand as defineCommand32 } from "citty";
|
|
7392
6022
|
|
|
7393
6023
|
// src/commands/ads/linkedin/presets.ts
|
|
7394
6024
|
var INTENTS = {
|
|
@@ -7660,7 +6290,7 @@ function numberOf(v) {
|
|
|
7660
6290
|
}
|
|
7661
6291
|
return 0;
|
|
7662
6292
|
}
|
|
7663
|
-
var analyticsCommand =
|
|
6293
|
+
var analyticsCommand = defineCommand32({
|
|
7664
6294
|
meta: {
|
|
7665
6295
|
name: "analytics",
|
|
7666
6296
|
description: `Performance reporting \u2014 the workhorse for AI agents.
|
|
@@ -7787,8 +6417,8 @@ Examples \u2014 common AI questions:
|
|
|
7787
6417
|
});
|
|
7788
6418
|
|
|
7789
6419
|
// src/commands/ads/linkedin/audience-size.ts
|
|
7790
|
-
import { readFileSync as
|
|
7791
|
-
import { defineCommand as
|
|
6420
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
6421
|
+
import { defineCommand as defineCommand33 } from "citty";
|
|
7792
6422
|
function loadTargeting(args) {
|
|
7793
6423
|
const inline = args.targeting;
|
|
7794
6424
|
if (inline) {
|
|
@@ -7801,7 +6431,7 @@ function loadTargeting(args) {
|
|
|
7801
6431
|
const file = args["targeting-file"];
|
|
7802
6432
|
if (file) {
|
|
7803
6433
|
try {
|
|
7804
|
-
return JSON.parse(
|
|
6434
|
+
return JSON.parse(readFileSync4(file, "utf-8"));
|
|
7805
6435
|
} catch (e) {
|
|
7806
6436
|
handleLinkedinError(
|
|
7807
6437
|
new Error(`Failed to read --targeting-file: ${e instanceof Error ? e.message : "I/O error"}`)
|
|
@@ -7810,7 +6440,7 @@ function loadTargeting(args) {
|
|
|
7810
6440
|
}
|
|
7811
6441
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
7812
6442
|
}
|
|
7813
|
-
var audienceSizeCommand =
|
|
6443
|
+
var audienceSizeCommand = defineCommand33({
|
|
7814
6444
|
meta: {
|
|
7815
6445
|
name: "audience-size",
|
|
7816
6446
|
description: `Estimate audience size for a targeting payload \u2014 pre-launch sanity check.
|
|
@@ -7855,7 +6485,7 @@ Examples:
|
|
|
7855
6485
|
});
|
|
7856
6486
|
|
|
7857
6487
|
// src/commands/ads/linkedin/audit.ts
|
|
7858
|
-
import { defineCommand as
|
|
6488
|
+
import { defineCommand as defineCommand34 } from "citty";
|
|
7859
6489
|
var SEVERITY_RANK = {
|
|
7860
6490
|
critical: 0,
|
|
7861
6491
|
high: 1,
|
|
@@ -7914,7 +6544,7 @@ function noteOf(f) {
|
|
|
7914
6544
|
const fix = f.fix?.explanation ?? "";
|
|
7915
6545
|
return [fix, ev].filter(Boolean).join(" \u2014 ");
|
|
7916
6546
|
}
|
|
7917
|
-
var auditCommand =
|
|
6547
|
+
var auditCommand = defineCommand34({
|
|
7918
6548
|
meta: {
|
|
7919
6549
|
name: "audit",
|
|
7920
6550
|
description: `Run a LinkedIn Ads playbook audit \u2014 30+ checks across Settings, Tracking,
|
|
@@ -7980,8 +6610,8 @@ Examples:
|
|
|
7980
6610
|
});
|
|
7981
6611
|
|
|
7982
6612
|
// src/commands/ads/linkedin/bid-pricing.ts
|
|
7983
|
-
import { readFileSync as
|
|
7984
|
-
import { defineCommand as
|
|
6613
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
6614
|
+
import { defineCommand as defineCommand35 } from "citty";
|
|
7985
6615
|
function loadTargeting2(args) {
|
|
7986
6616
|
const inline = args.targeting;
|
|
7987
6617
|
if (inline) {
|
|
@@ -7994,7 +6624,7 @@ function loadTargeting2(args) {
|
|
|
7994
6624
|
const file = args["targeting-file"];
|
|
7995
6625
|
if (file) {
|
|
7996
6626
|
try {
|
|
7997
|
-
return JSON.parse(
|
|
6627
|
+
return JSON.parse(readFileSync5(file, "utf-8"));
|
|
7998
6628
|
} catch (e) {
|
|
7999
6629
|
handleLinkedinError(
|
|
8000
6630
|
new Error(`Failed to read --targeting-file: ${e instanceof Error ? e.message : "I/O error"}`)
|
|
@@ -8003,7 +6633,7 @@ function loadTargeting2(args) {
|
|
|
8003
6633
|
}
|
|
8004
6634
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
8005
6635
|
}
|
|
8006
|
-
var bidPricingCommand =
|
|
6636
|
+
var bidPricingCommand = defineCommand35({
|
|
8007
6637
|
meta: {
|
|
8008
6638
|
name: "bid-pricing",
|
|
8009
6639
|
description: `Get LinkedIn's suggested bid range for a targeting + objective + cost type.
|
|
@@ -8053,40 +6683,40 @@ Examples:
|
|
|
8053
6683
|
});
|
|
8054
6684
|
|
|
8055
6685
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
8056
|
-
import { defineCommand as
|
|
6686
|
+
import { defineCommand as defineCommand37 } from "citty";
|
|
8057
6687
|
|
|
8058
6688
|
// src/commands/ads/linkedin/write-commands.ts
|
|
8059
|
-
import { defineCommand as
|
|
6689
|
+
import { defineCommand as defineCommand36 } from "citty";
|
|
8060
6690
|
|
|
8061
6691
|
// src/commands/ads/linkedin/write-shared.ts
|
|
8062
6692
|
import { createHash as createHash2 } from "crypto";
|
|
8063
|
-
import { readFileSync as
|
|
6693
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
8064
6694
|
function bareAccountId(args) {
|
|
8065
6695
|
const raw = resolveAccountIdArg(args);
|
|
8066
6696
|
return raw.replace(/^urn:li:sponsoredAccount:/, "").replace(/^sponsoredAccount:/, "");
|
|
8067
6697
|
}
|
|
8068
|
-
function
|
|
6698
|
+
function failWriteValidation(message) {
|
|
8069
6699
|
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
8070
6700
|
process.exit(1);
|
|
8071
6701
|
}
|
|
8072
|
-
function
|
|
6702
|
+
function loadJsonFileArg(path11) {
|
|
8073
6703
|
if (typeof path11 !== "string" || path11.length === 0) {
|
|
8074
6704
|
return {};
|
|
8075
6705
|
}
|
|
8076
6706
|
try {
|
|
8077
|
-
const parsed = JSON.parse(
|
|
6707
|
+
const parsed = JSON.parse(readFileSync6(path11, "utf8"));
|
|
8078
6708
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
8079
|
-
|
|
6709
|
+
failWriteValidation(`${path11} must contain a JSON object`);
|
|
8080
6710
|
}
|
|
8081
6711
|
return parsed;
|
|
8082
6712
|
} catch (err) {
|
|
8083
6713
|
if (err instanceof SyntaxError) {
|
|
8084
|
-
|
|
6714
|
+
failWriteValidation(`${path11} is not valid JSON: ${err.message}`);
|
|
8085
6715
|
}
|
|
8086
6716
|
throw err;
|
|
8087
6717
|
}
|
|
8088
6718
|
}
|
|
8089
|
-
function
|
|
6719
|
+
function mergePayload(file, flags) {
|
|
8090
6720
|
const merged = { ...file };
|
|
8091
6721
|
for (const [key, value] of Object.entries(flags)) {
|
|
8092
6722
|
if (value !== void 0) {
|
|
@@ -8103,7 +6733,7 @@ function parseMoneyFlag(amount, currency, flag) {
|
|
|
8103
6733
|
return { amount: String(amount) };
|
|
8104
6734
|
}
|
|
8105
6735
|
if (typeof currency !== "string" || currency.length !== 3) {
|
|
8106
|
-
|
|
6736
|
+
failWriteValidation(`${flag} got an invalid --currency (expected a 3-letter code like EUR)`);
|
|
8107
6737
|
}
|
|
8108
6738
|
return { amount: String(amount), currencyCode: currency.toUpperCase() };
|
|
8109
6739
|
}
|
|
@@ -8117,7 +6747,7 @@ function parseDateFlag(value, flag) {
|
|
|
8117
6747
|
}
|
|
8118
6748
|
const parsed = Date.parse(raw);
|
|
8119
6749
|
if (Number.isNaN(parsed)) {
|
|
8120
|
-
|
|
6750
|
+
failWriteValidation(`${flag} must be an ISO date (2026-07-10) or epoch milliseconds`);
|
|
8121
6751
|
}
|
|
8122
6752
|
return parsed;
|
|
8123
6753
|
}
|
|
@@ -8132,7 +6762,7 @@ function parseOnOffFlag(value, flag) {
|
|
|
8132
6762
|
if (raw === "off" || raw === "false") {
|
|
8133
6763
|
return false;
|
|
8134
6764
|
}
|
|
8135
|
-
|
|
6765
|
+
failWriteValidation(`${flag} must be on|off`);
|
|
8136
6766
|
}
|
|
8137
6767
|
function parseLocaleFlag(value) {
|
|
8138
6768
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -8140,7 +6770,7 @@ function parseLocaleFlag(value) {
|
|
|
8140
6770
|
}
|
|
8141
6771
|
const match = /^([a-z]{2})[_-]([A-Za-z]{2})$/.exec(String(value));
|
|
8142
6772
|
if (!match) {
|
|
8143
|
-
|
|
6773
|
+
failWriteValidation("--locale must look like en_US (language_COUNTRY)");
|
|
8144
6774
|
}
|
|
8145
6775
|
return { language: match[1], country: match[2].toUpperCase() };
|
|
8146
6776
|
}
|
|
@@ -8148,10 +6778,10 @@ function loadTargetingFileArg(path11) {
|
|
|
8148
6778
|
if (typeof path11 !== "string" || path11.length === 0) {
|
|
8149
6779
|
return void 0;
|
|
8150
6780
|
}
|
|
8151
|
-
const parsed =
|
|
6781
|
+
const parsed = loadJsonFileArg(path11);
|
|
8152
6782
|
const criteria = parsed.targetingCriteria ?? parsed;
|
|
8153
6783
|
if (!criteria.include) {
|
|
8154
|
-
|
|
6784
|
+
failWriteValidation(
|
|
8155
6785
|
`${path11} must contain targeting criteria with an "include" block (see baker schema ads.linkedin.campaigns.create)`
|
|
8156
6786
|
);
|
|
8157
6787
|
}
|
|
@@ -8191,10 +6821,10 @@ function parseListFileArg(path11, maxRows) {
|
|
|
8191
6821
|
if (typeof path11 !== "string" || path11.length === 0) {
|
|
8192
6822
|
return void 0;
|
|
8193
6823
|
}
|
|
8194
|
-
const raw =
|
|
6824
|
+
const raw = readFileSync6(path11, "utf8");
|
|
8195
6825
|
const lines = raw.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
8196
6826
|
if (lines.length < 2) {
|
|
8197
|
-
|
|
6827
|
+
failWriteValidation(`${path11} needs a header row and at least one data row`);
|
|
8198
6828
|
}
|
|
8199
6829
|
const columns = parseCsvLine(lines[0]).map((column) => column.trim());
|
|
8200
6830
|
const rows = [];
|
|
@@ -8213,7 +6843,7 @@ function parseListFileArg(path11, maxRows) {
|
|
|
8213
6843
|
}
|
|
8214
6844
|
}
|
|
8215
6845
|
if (rows.length > maxRows) {
|
|
8216
|
-
|
|
6846
|
+
failWriteValidation(`${path11} has ${rows.length} rows \u2014 the inline limit is ${maxRows}. Split the list.`);
|
|
8217
6847
|
}
|
|
8218
6848
|
return { columns, rows };
|
|
8219
6849
|
}
|
|
@@ -8249,10 +6879,10 @@ async function stageStatusChange(input) {
|
|
|
8249
6879
|
const payload = input.kind === "creative.update" ? { intendedStatus: input.status } : { status: input.status };
|
|
8250
6880
|
await stageOp({ kind: input.kind, accountId: input.accountId, target: input.target, payload });
|
|
8251
6881
|
}
|
|
8252
|
-
function
|
|
6882
|
+
function requireTarget(args, entity) {
|
|
8253
6883
|
const target = args.id ?? args.target;
|
|
8254
6884
|
if (typeof target !== "string" || target.length === 0) {
|
|
8255
|
-
|
|
6885
|
+
failWriteValidation(`pass the ${entity} id or URN as the positional argument`);
|
|
8256
6886
|
}
|
|
8257
6887
|
return target;
|
|
8258
6888
|
}
|
|
@@ -8271,7 +6901,7 @@ function runScheduleFromFlags(args) {
|
|
|
8271
6901
|
}
|
|
8272
6902
|
return { ...start !== void 0 ? { start } : {}, ...end !== void 0 ? { end } : {} };
|
|
8273
6903
|
}
|
|
8274
|
-
var campaignGroupsCreateCommand =
|
|
6904
|
+
var campaignGroupsCreateCommand = defineCommand36({
|
|
8275
6905
|
meta: {
|
|
8276
6906
|
name: "create",
|
|
8277
6907
|
description: `Stage a new campaign group. ${STAGED_NOTE}
|
|
@@ -8289,7 +6919,7 @@ Example: baker ads linkedin campaign-groups create --name "Q3 ABM" --start 2026-
|
|
|
8289
6919
|
},
|
|
8290
6920
|
run: async ({ args }) => {
|
|
8291
6921
|
const accountId = bareAccountId(args);
|
|
8292
|
-
const payload =
|
|
6922
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
8293
6923
|
name: args.name,
|
|
8294
6924
|
runSchedule: runScheduleFromFlags(args),
|
|
8295
6925
|
totalBudget: parseMoneyFlag(args["total-budget"], args.currency, "--total-budget"),
|
|
@@ -8298,7 +6928,7 @@ Example: baker ads linkedin campaign-groups create --name "Q3 ABM" --start 2026-
|
|
|
8298
6928
|
await stageOp({ kind: "campaignGroup.create", accountId, payload });
|
|
8299
6929
|
}
|
|
8300
6930
|
});
|
|
8301
|
-
var campaignGroupsUpdateCommand =
|
|
6931
|
+
var campaignGroupsUpdateCommand = defineCommand36({
|
|
8302
6932
|
meta: {
|
|
8303
6933
|
name: "update",
|
|
8304
6934
|
description: `Stage changes to an existing campaign group. ${STAGED_NOTE}
|
|
@@ -8318,7 +6948,7 @@ Example: baker ads linkedin campaign-groups update 635137195 --total-budget 8000
|
|
|
8318
6948
|
},
|
|
8319
6949
|
run: async ({ args }) => {
|
|
8320
6950
|
const accountId = bareAccountId(args);
|
|
8321
|
-
const payload =
|
|
6951
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
8322
6952
|
name: args.name,
|
|
8323
6953
|
runSchedule: runScheduleFromFlags(args),
|
|
8324
6954
|
totalBudget: parseMoneyFlag(args["total-budget"], args.currency, "--total-budget"),
|
|
@@ -8327,7 +6957,7 @@ Example: baker ads linkedin campaign-groups update 635137195 --total-budget 8000
|
|
|
8327
6957
|
await stageOp({
|
|
8328
6958
|
kind: "campaignGroup.update",
|
|
8329
6959
|
accountId,
|
|
8330
|
-
target:
|
|
6960
|
+
target: requireTarget(args, "campaign group"),
|
|
8331
6961
|
payload
|
|
8332
6962
|
});
|
|
8333
6963
|
}
|
|
@@ -8376,7 +7006,7 @@ var campaignFlagArgs = {
|
|
|
8376
7006
|
status: { type: "string", description: "DRAFT|ACTIVE|PAUSED" },
|
|
8377
7007
|
file: { type: "string", description: "JSON file with the full payload; flags override file keys" }
|
|
8378
7008
|
};
|
|
8379
|
-
var campaignsCreateCommand =
|
|
7009
|
+
var campaignsCreateCommand = defineCommand36({
|
|
8380
7010
|
meta: {
|
|
8381
7011
|
name: "create",
|
|
8382
7012
|
description: `Stage a new campaign. ${STAGED_NOTE}
|
|
@@ -8386,14 +7016,14 @@ Example: baker ads linkedin campaigns create --name "ABM Tier-1" --group li_temp
|
|
|
8386
7016
|
args: campaignFlagArgs,
|
|
8387
7017
|
run: async ({ args }) => {
|
|
8388
7018
|
const accountId = bareAccountId(args);
|
|
8389
|
-
const payload =
|
|
7019
|
+
const payload = mergePayload(loadJsonFileArg(args.file), campaignPayloadFromFlags(args));
|
|
8390
7020
|
if (payload.locale === void 0) {
|
|
8391
7021
|
payload.locale = { country: "US", language: "en" };
|
|
8392
7022
|
}
|
|
8393
7023
|
await stageOp({ kind: "campaign.create", accountId, payload });
|
|
8394
7024
|
}
|
|
8395
7025
|
});
|
|
8396
|
-
var campaignsUpdateCommand =
|
|
7026
|
+
var campaignsUpdateCommand = defineCommand36({
|
|
8397
7027
|
meta: {
|
|
8398
7028
|
name: "update",
|
|
8399
7029
|
description: `Stage changes to an existing campaign (budget, bid, targeting, flags, schedule, status). ${STAGED_NOTE}
|
|
@@ -8411,18 +7041,18 @@ Example: baker ads linkedin campaigns update 123456 --daily-budget 100 --currenc
|
|
|
8411
7041
|
flags.type = void 0;
|
|
8412
7042
|
flags.locale = void 0;
|
|
8413
7043
|
flags.associatedEntity = void 0;
|
|
8414
|
-
const payload =
|
|
7044
|
+
const payload = mergePayload(loadJsonFileArg(args.file), flags);
|
|
8415
7045
|
await stageOp({
|
|
8416
7046
|
kind: "campaign.update",
|
|
8417
7047
|
accountId,
|
|
8418
|
-
target:
|
|
7048
|
+
target: requireTarget(args, "campaign"),
|
|
8419
7049
|
payload
|
|
8420
7050
|
});
|
|
8421
7051
|
}
|
|
8422
7052
|
});
|
|
8423
7053
|
function statusSugarCommand(entity, kind, name) {
|
|
8424
7054
|
const status = name === "pause" ? "PAUSED" : name === "resume" ? "ACTIVE" : "ARCHIVED";
|
|
8425
|
-
return
|
|
7055
|
+
return defineCommand36({
|
|
8426
7056
|
meta: {
|
|
8427
7057
|
name,
|
|
8428
7058
|
description: `Stage a status change to ${status}. ${STAGED_NOTE}
|
|
@@ -8436,7 +7066,7 @@ Example: baker ads linkedin ${entity} ${name} 123456`
|
|
|
8436
7066
|
await stageStatusChange({
|
|
8437
7067
|
kind,
|
|
8438
7068
|
accountId: bareAccountId(args),
|
|
8439
|
-
target:
|
|
7069
|
+
target: requireTarget(args, entity.replace(/-/g, " ").replace(/s$/, "")),
|
|
8440
7070
|
status
|
|
8441
7071
|
});
|
|
8442
7072
|
}
|
|
@@ -8450,7 +7080,7 @@ var campaignGroupsResumeCommand = statusSugarCommand("campaign-groups", "campaig
|
|
|
8450
7080
|
var creativesPauseCommand = statusSugarCommand("creatives", "creative.update", "pause");
|
|
8451
7081
|
var creativesResumeCommand = statusSugarCommand("creatives", "creative.update", "resume");
|
|
8452
7082
|
function duplicateCommand(entity, cliGroup) {
|
|
8453
|
-
return
|
|
7083
|
+
return defineCommand36({
|
|
8454
7084
|
meta: {
|
|
8455
7085
|
name: "duplicate",
|
|
8456
7086
|
description: `Stage a copy of an existing ${entity} as a new DRAFT create (playbook: duplicate, never link-to-original). ${STAGED_NOTE}
|
|
@@ -8465,14 +7095,14 @@ Example: baker ads linkedin ${cliGroup} duplicate 123456 --name "New variant"`
|
|
|
8465
7095
|
run: async ({ args }) => {
|
|
8466
7096
|
try {
|
|
8467
7097
|
const chatId = requireChatId();
|
|
8468
|
-
const overrides =
|
|
7098
|
+
const overrides = mergePayload(loadJsonFileArg(args.file), { name: args.name });
|
|
8469
7099
|
const response = await apiPost(
|
|
8470
7100
|
"/api/ads/linkedin/draft/duplicate",
|
|
8471
7101
|
{
|
|
8472
7102
|
chatId,
|
|
8473
7103
|
accountId: bareAccountId(args),
|
|
8474
7104
|
entity,
|
|
8475
|
-
sourceId:
|
|
7105
|
+
sourceId: requireTarget(args, entity),
|
|
8476
7106
|
...Object.keys(overrides).length > 0 ? { overrides } : {}
|
|
8477
7107
|
}
|
|
8478
7108
|
);
|
|
@@ -8485,7 +7115,7 @@ Example: baker ads linkedin ${cliGroup} duplicate 123456 --name "New variant"`
|
|
|
8485
7115
|
}
|
|
8486
7116
|
var campaignsDuplicateCommand = duplicateCommand("campaign", "campaigns");
|
|
8487
7117
|
var campaignGroupsDuplicateCommand = duplicateCommand("campaignGroup", "campaign-groups");
|
|
8488
|
-
var creativesDuplicateCommand =
|
|
7118
|
+
var creativesDuplicateCommand = defineCommand36({
|
|
8489
7119
|
meta: {
|
|
8490
7120
|
name: "duplicate",
|
|
8491
7121
|
description: `Stage a copy of an existing ad, optionally with new content \u2014 the ONLY way to change copy/media/URL on a live ad (LinkedIn makes ad content immutable). ${STAGED_NOTE}
|
|
@@ -8523,10 +7153,10 @@ Examples:
|
|
|
8523
7153
|
run: async ({ args }) => {
|
|
8524
7154
|
try {
|
|
8525
7155
|
const chatId = requireChatId();
|
|
8526
|
-
const file =
|
|
7156
|
+
const file = loadJsonFileArg(args.file);
|
|
8527
7157
|
const fileContent = file.content !== null && typeof file.content === "object" && !Array.isArray(file.content) ? file.content : {};
|
|
8528
7158
|
const content = { ...fileContent, ...creativeContentPatch(args) };
|
|
8529
|
-
const overrides =
|
|
7159
|
+
const overrides = mergePayload(file, {
|
|
8530
7160
|
campaign: args.campaign,
|
|
8531
7161
|
intendedStatus: args["intended-status"] ? String(args["intended-status"]).toUpperCase() : void 0,
|
|
8532
7162
|
content: Object.keys(content).length > 0 ? content : void 0
|
|
@@ -8537,7 +7167,7 @@ Examples:
|
|
|
8537
7167
|
chatId,
|
|
8538
7168
|
accountId: bareAccountId(args),
|
|
8539
7169
|
entity: "creative",
|
|
8540
|
-
sourceId:
|
|
7170
|
+
sourceId: requireTarget(args, "creative"),
|
|
8541
7171
|
...Object.keys(overrides).length > 0 ? { overrides } : {},
|
|
8542
7172
|
...args.replace ? { replace: true } : {}
|
|
8543
7173
|
}
|
|
@@ -8562,7 +7192,7 @@ var CREATIVE_FORMATS = [
|
|
|
8562
7192
|
"event",
|
|
8563
7193
|
"article"
|
|
8564
7194
|
];
|
|
8565
|
-
var creativesCreateCommand =
|
|
7195
|
+
var creativesCreateCommand = defineCommand36({
|
|
8566
7196
|
meta: {
|
|
8567
7197
|
name: "create",
|
|
8568
7198
|
description: `Stage a new creative (ad). ${STAGED_NOTE}
|
|
@@ -8598,13 +7228,13 @@ Examples:
|
|
|
8598
7228
|
run: async ({ args }) => {
|
|
8599
7229
|
const accountId = bareAccountId(args);
|
|
8600
7230
|
if (!args.campaign) {
|
|
8601
|
-
|
|
7231
|
+
failWriteValidation("--campaign is required (id, URN, or li_temp_* ref)");
|
|
8602
7232
|
}
|
|
8603
7233
|
const format = args.format ? String(args.format) : void 0;
|
|
8604
7234
|
if (!format || !CREATIVE_FORMATS.includes(format)) {
|
|
8605
|
-
|
|
7235
|
+
failWriteValidation(`--format must be one of ${CREATIVE_FORMATS.join("|")}`);
|
|
8606
7236
|
}
|
|
8607
|
-
const content =
|
|
7237
|
+
const content = mergePayload(loadJsonFileArg(args.file), {
|
|
8608
7238
|
format,
|
|
8609
7239
|
commentary: args.intro,
|
|
8610
7240
|
imageId: args["image-id"],
|
|
@@ -8663,7 +7293,7 @@ function creativeContentPatch(args) {
|
|
|
8663
7293
|
}
|
|
8664
7294
|
return patch;
|
|
8665
7295
|
}
|
|
8666
|
-
var creativesUpdateCommand =
|
|
7296
|
+
var creativesUpdateCommand = defineCommand36({
|
|
8667
7297
|
meta: {
|
|
8668
7298
|
name: "update",
|
|
8669
7299
|
description: `Stage changes to an existing creative, or amend a creative staged in this chat by passing its li_temp_* ref. ${STAGED_NOTE}
|
|
@@ -8695,13 +7325,13 @@ Examples:
|
|
|
8695
7325
|
},
|
|
8696
7326
|
run: async ({ args }) => {
|
|
8697
7327
|
const accountId = bareAccountId(args);
|
|
8698
|
-
const target =
|
|
8699
|
-
const file =
|
|
7328
|
+
const target = requireTarget(args, "creative");
|
|
7329
|
+
const file = loadJsonFileArg(args.file);
|
|
8700
7330
|
const contentPatch = creativeContentPatch(args);
|
|
8701
7331
|
const intendedStatus = args["intended-status"] ? String(args["intended-status"]).toUpperCase() : void 0;
|
|
8702
7332
|
const fileContent = file.content !== null && typeof file.content === "object" && !Array.isArray(file.content) ? file.content : {};
|
|
8703
7333
|
const content = { ...fileContent, ...contentPatch };
|
|
8704
|
-
const payload =
|
|
7334
|
+
const payload = mergePayload(file, {
|
|
8705
7335
|
intendedStatus,
|
|
8706
7336
|
name: args.name,
|
|
8707
7337
|
content: Object.keys(content).length > 0 ? content : void 0
|
|
@@ -8711,7 +7341,7 @@ Examples:
|
|
|
8711
7341
|
});
|
|
8712
7342
|
var AUDIENCE_TYPES2 = ["company-list", "user-list", "retargeting", "engagement"];
|
|
8713
7343
|
var INLINE_ROWS_MAX = 1e4;
|
|
8714
|
-
var audiencesCreateCommand =
|
|
7344
|
+
var audiencesCreateCommand = defineCommand36({
|
|
8715
7345
|
meta: {
|
|
8716
7346
|
name: "create",
|
|
8717
7347
|
description: `Stage a new matched audience. ${STAGED_NOTE}
|
|
@@ -8728,7 +7358,7 @@ Example: baker ads linkedin audiences create --name "ABM Tier-1" --type company-
|
|
|
8728
7358
|
run: async ({ args }) => {
|
|
8729
7359
|
const accountId = bareAccountId(args);
|
|
8730
7360
|
const list = parseListFileArg(args["list-file"], INLINE_ROWS_MAX);
|
|
8731
|
-
const raw = args.file ?
|
|
7361
|
+
const raw = args.file ? loadJsonFileArg(args.file) : void 0;
|
|
8732
7362
|
await stageOp({
|
|
8733
7363
|
kind: "audience.create",
|
|
8734
7364
|
accountId,
|
|
@@ -8741,7 +7371,7 @@ Example: baker ads linkedin audiences create --name "ABM Tier-1" --type company-
|
|
|
8741
7371
|
});
|
|
8742
7372
|
}
|
|
8743
7373
|
});
|
|
8744
|
-
var audiencesUploadCommand =
|
|
7374
|
+
var audiencesUploadCommand = defineCommand36({
|
|
8745
7375
|
meta: {
|
|
8746
7376
|
name: "upload",
|
|
8747
7377
|
description: `Stage a list upload into an existing audience segment. ${STAGED_NOTE}
|
|
@@ -8756,20 +7386,20 @@ Example: baker ads linkedin audiences upload urn:li:dmpSegment:42 --list-file mo
|
|
|
8756
7386
|
const accountId = bareAccountId(args);
|
|
8757
7387
|
const list = parseListFileArg(args["list-file"], INLINE_ROWS_MAX);
|
|
8758
7388
|
if (!list) {
|
|
8759
|
-
|
|
7389
|
+
failWriteValidation("--list-file is required");
|
|
8760
7390
|
}
|
|
8761
7391
|
await stageOp({
|
|
8762
7392
|
kind: "audience.uploadList",
|
|
8763
7393
|
accountId,
|
|
8764
7394
|
payload: {
|
|
8765
|
-
segment:
|
|
7395
|
+
segment: requireTarget(args, "audience segment"),
|
|
8766
7396
|
listColumns: list.columns,
|
|
8767
7397
|
listRows: list.rows
|
|
8768
7398
|
}
|
|
8769
7399
|
});
|
|
8770
7400
|
}
|
|
8771
7401
|
});
|
|
8772
|
-
var
|
|
7402
|
+
var audiencesCommand = defineCommand36({
|
|
8773
7403
|
meta: {
|
|
8774
7404
|
name: "audiences",
|
|
8775
7405
|
description: "Stage LinkedIn matched-audience changes (create lists, upload rows). Staged until publish \u2014 never hits the API directly."
|
|
@@ -8779,7 +7409,7 @@ var audiencesCommand2 = defineCommand38({
|
|
|
8779
7409
|
upload: audiencesUploadCommand
|
|
8780
7410
|
}
|
|
8781
7411
|
});
|
|
8782
|
-
var conversionsCreateCommand =
|
|
7412
|
+
var conversionsCreateCommand = defineCommand36({
|
|
8783
7413
|
meta: {
|
|
8784
7414
|
name: "create",
|
|
8785
7415
|
description: `Stage a new conversion rule. ${STAGED_NOTE}
|
|
@@ -8798,7 +7428,7 @@ Example: baker ads linkedin conversions create --name "Demo booked" --type LEAD
|
|
|
8798
7428
|
},
|
|
8799
7429
|
run: async ({ args }) => {
|
|
8800
7430
|
const accountId = bareAccountId(args);
|
|
8801
|
-
const payload =
|
|
7431
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
8802
7432
|
name: args.name,
|
|
8803
7433
|
type: args.type ? String(args.type).toUpperCase() : void 0,
|
|
8804
7434
|
conversionMethod: args.method ? String(args.method).toUpperCase() : void 0,
|
|
@@ -8810,7 +7440,7 @@ Example: baker ads linkedin conversions create --name "Demo booked" --type LEAD
|
|
|
8810
7440
|
await stageOp({ kind: "conversion.create", accountId, payload });
|
|
8811
7441
|
}
|
|
8812
7442
|
});
|
|
8813
|
-
var conversionsUpdateCommand =
|
|
7443
|
+
var conversionsUpdateCommand = defineCommand36({
|
|
8814
7444
|
meta: {
|
|
8815
7445
|
name: "update",
|
|
8816
7446
|
description: `Stage changes to a conversion rule (windows, name, enabled). ${STAGED_NOTE}
|
|
@@ -8828,7 +7458,7 @@ Example: baker ads linkedin conversions update 104988516 --post-click-window 30
|
|
|
8828
7458
|
},
|
|
8829
7459
|
run: async ({ args }) => {
|
|
8830
7460
|
const accountId = bareAccountId(args);
|
|
8831
|
-
const payload =
|
|
7461
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
8832
7462
|
name: args.name,
|
|
8833
7463
|
postClickAttributionWindowSize: args["post-click-window"] ? Number(args["post-click-window"]) : void 0,
|
|
8834
7464
|
viewThroughAttributionWindowSize: args["view-window"] ? Number(args["view-window"]) : void 0,
|
|
@@ -8838,12 +7468,12 @@ Example: baker ads linkedin conversions update 104988516 --post-click-window 30
|
|
|
8838
7468
|
await stageOp({
|
|
8839
7469
|
kind: "conversion.update",
|
|
8840
7470
|
accountId,
|
|
8841
|
-
target:
|
|
7471
|
+
target: requireTarget(args, "conversion rule"),
|
|
8842
7472
|
payload
|
|
8843
7473
|
});
|
|
8844
7474
|
}
|
|
8845
7475
|
});
|
|
8846
|
-
var leadFormsCreateCommand =
|
|
7476
|
+
var leadFormsCreateCommand = defineCommand36({
|
|
8847
7477
|
meta: {
|
|
8848
7478
|
name: "create",
|
|
8849
7479
|
description: `Stage a new Lead Gen Form from a JSON file. ${STAGED_NOTE}
|
|
@@ -8856,11 +7486,11 @@ The file needs: name, headline (\u226460), privacyPolicyUrl, questions[] (\u2264
|
|
|
8856
7486
|
},
|
|
8857
7487
|
run: async ({ args }) => {
|
|
8858
7488
|
const accountId = bareAccountId(args);
|
|
8859
|
-
const payload =
|
|
7489
|
+
const payload = mergePayload(loadJsonFileArg(args.file), { name: args.name });
|
|
8860
7490
|
await stageOp({ kind: "leadForm.create", accountId, payload });
|
|
8861
7491
|
}
|
|
8862
7492
|
});
|
|
8863
|
-
var leadFormsUpdateCommand =
|
|
7493
|
+
var leadFormsUpdateCommand = defineCommand36({
|
|
8864
7494
|
meta: {
|
|
8865
7495
|
name: "update",
|
|
8866
7496
|
description: `Stage changes to a Lead Gen Form from a JSON file. ${STAGED_NOTE}`
|
|
@@ -8873,16 +7503,16 @@ var leadFormsUpdateCommand = defineCommand38({
|
|
|
8873
7503
|
},
|
|
8874
7504
|
run: async ({ args }) => {
|
|
8875
7505
|
const accountId = bareAccountId(args);
|
|
8876
|
-
const payload =
|
|
7506
|
+
const payload = mergePayload({ raw: loadJsonFileArg(args.file) }, { name: args.name });
|
|
8877
7507
|
await stageOp({
|
|
8878
7508
|
kind: "leadForm.update",
|
|
8879
7509
|
accountId,
|
|
8880
|
-
target:
|
|
7510
|
+
target: requireTarget(args, "lead form"),
|
|
8881
7511
|
payload
|
|
8882
7512
|
});
|
|
8883
7513
|
}
|
|
8884
7514
|
});
|
|
8885
|
-
var leadFormsCommand =
|
|
7515
|
+
var leadFormsCommand = defineCommand36({
|
|
8886
7516
|
meta: {
|
|
8887
7517
|
name: "lead-forms",
|
|
8888
7518
|
description: "Stage LinkedIn Lead Gen Form changes (file-first). Staged until publish \u2014 never hits the API directly."
|
|
@@ -8894,7 +7524,7 @@ var leadFormsCommand = defineCommand38({
|
|
|
8894
7524
|
});
|
|
8895
7525
|
|
|
8896
7526
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
8897
|
-
var campaignGroupsCommand =
|
|
7527
|
+
var campaignGroupsCommand = defineCommand37({
|
|
8898
7528
|
meta: {
|
|
8899
7529
|
name: "campaign-groups",
|
|
8900
7530
|
description: `List LinkedIn campaign groups, or stage writes (create/update/pause/resume/duplicate).
|
|
@@ -8945,8 +7575,8 @@ Examples:
|
|
|
8945
7575
|
});
|
|
8946
7576
|
|
|
8947
7577
|
// src/commands/ads/linkedin/campaigns.ts
|
|
8948
|
-
import { defineCommand as
|
|
8949
|
-
var
|
|
7578
|
+
import { defineCommand as defineCommand38 } from "citty";
|
|
7579
|
+
var campaignsCommand = defineCommand38({
|
|
8950
7580
|
meta: {
|
|
8951
7581
|
name: "campaigns",
|
|
8952
7582
|
description: `List LinkedIn campaigns, or stage writes (create/update/pause/resume/archive/duplicate).
|
|
@@ -9007,8 +7637,8 @@ Examples:
|
|
|
9007
7637
|
});
|
|
9008
7638
|
|
|
9009
7639
|
// src/commands/ads/linkedin/conversation.ts
|
|
9010
|
-
import { defineCommand as
|
|
9011
|
-
var conversationCommand =
|
|
7640
|
+
import { defineCommand as defineCommand39 } from "citty";
|
|
7641
|
+
var conversationCommand = defineCommand39({
|
|
9012
7642
|
meta: {
|
|
9013
7643
|
name: "conversation",
|
|
9014
7644
|
description: `Per-button click rates inside Sponsored Messaging / Conversation Ads.
|
|
@@ -9071,7 +7701,7 @@ Examples:
|
|
|
9071
7701
|
});
|
|
9072
7702
|
|
|
9073
7703
|
// src/commands/ads/linkedin/conversions.ts
|
|
9074
|
-
import { defineCommand as
|
|
7704
|
+
import { defineCommand as defineCommand40 } from "citty";
|
|
9075
7705
|
var DAY_MS3 = 864e5;
|
|
9076
7706
|
function healthOf(rules) {
|
|
9077
7707
|
const enabled = rules.filter((r) => r.enabled !== false);
|
|
@@ -9097,7 +7727,7 @@ function healthOf(rules) {
|
|
|
9097
7727
|
wrongLeadDedup: wrongDedup
|
|
9098
7728
|
};
|
|
9099
7729
|
}
|
|
9100
|
-
var listCmd =
|
|
7730
|
+
var listCmd = defineCommand40({
|
|
9101
7731
|
meta: {
|
|
9102
7732
|
name: "list",
|
|
9103
7733
|
description: `List conversion rules on the account.`
|
|
@@ -9125,7 +7755,7 @@ var listCmd = defineCommand42({
|
|
|
9125
7755
|
}
|
|
9126
7756
|
}
|
|
9127
7757
|
});
|
|
9128
|
-
var healthCmd =
|
|
7758
|
+
var healthCmd = defineCommand40({
|
|
9129
7759
|
meta: {
|
|
9130
7760
|
name: "health",
|
|
9131
7761
|
description: `5-point Insight Tag / CAPI health check (playbook \xA707).
|
|
@@ -9155,7 +7785,7 @@ Surfaces:
|
|
|
9155
7785
|
}
|
|
9156
7786
|
}
|
|
9157
7787
|
});
|
|
9158
|
-
var
|
|
7788
|
+
var conversionsCommand = defineCommand40({
|
|
9159
7789
|
meta: {
|
|
9160
7790
|
name: "conversions",
|
|
9161
7791
|
description: `Conversion rules \u2014 Insight Tag and Conversions API.
|
|
@@ -9174,8 +7804,8 @@ Subcommands:
|
|
|
9174
7804
|
});
|
|
9175
7805
|
|
|
9176
7806
|
// src/commands/ads/linkedin/creatives.ts
|
|
9177
|
-
import { defineCommand as
|
|
9178
|
-
var creativesCommand =
|
|
7807
|
+
import { defineCommand as defineCommand41 } from "citty";
|
|
7808
|
+
var creativesCommand = defineCommand41({
|
|
9179
7809
|
meta: {
|
|
9180
7810
|
name: "creatives",
|
|
9181
7811
|
description: `List LinkedIn creatives (ads), or stage writes (create/update/pause/resume/duplicate).
|
|
@@ -9234,7 +7864,7 @@ Examples:
|
|
|
9234
7864
|
});
|
|
9235
7865
|
|
|
9236
7866
|
// src/commands/ads/linkedin/demographics.ts
|
|
9237
|
-
import { defineCommand as
|
|
7867
|
+
import { defineCommand as defineCommand42 } from "citty";
|
|
9238
7868
|
var DEFAULT_PIVOTS = ["job-title", "company", "industry", "seniority", "job-function", "company-size"];
|
|
9239
7869
|
function numberOf2(v) {
|
|
9240
7870
|
if (typeof v === "number") return Number.isFinite(v) ? v : 0;
|
|
@@ -9247,7 +7877,7 @@ function numberOf2(v) {
|
|
|
9247
7877
|
function topByImpressions(rows, limit) {
|
|
9248
7878
|
return [...rows].sort((a, b) => numberOf2(b.impressions) - numberOf2(a.impressions)).slice(0, limit);
|
|
9249
7879
|
}
|
|
9250
|
-
var demographicsCommand =
|
|
7880
|
+
var demographicsCommand = defineCommand42({
|
|
9251
7881
|
meta: {
|
|
9252
7882
|
name: "demographics",
|
|
9253
7883
|
description: `Sweep all firmographic pivots in one command \u2014 LinkedIn's superpower.
|
|
@@ -9344,7 +7974,7 @@ function resolveRange(args) {
|
|
|
9344
7974
|
}
|
|
9345
7975
|
|
|
9346
7976
|
// src/commands/ads/linkedin/draft.ts
|
|
9347
|
-
import { defineCommand as
|
|
7977
|
+
import { defineCommand as defineCommand43 } from "citty";
|
|
9348
7978
|
async function listDraft() {
|
|
9349
7979
|
try {
|
|
9350
7980
|
const chatId = requireChatId();
|
|
@@ -9356,14 +7986,14 @@ async function listDraft() {
|
|
|
9356
7986
|
handleLinkedinError(err);
|
|
9357
7987
|
}
|
|
9358
7988
|
}
|
|
9359
|
-
var listCommand3 =
|
|
7989
|
+
var listCommand3 = defineCommand43({
|
|
9360
7990
|
meta: {
|
|
9361
7991
|
name: "list",
|
|
9362
7992
|
description: "Show every LinkedIn write op staged in this chat, its mode (simulated = publish will NOT hit LinkedIn), dependencies, and post-publish results. Example: baker ads linkedin draft"
|
|
9363
7993
|
},
|
|
9364
7994
|
run: listDraft
|
|
9365
7995
|
});
|
|
9366
|
-
var removeCommand2 =
|
|
7996
|
+
var removeCommand2 = defineCommand43({
|
|
9367
7997
|
meta: {
|
|
9368
7998
|
name: "remove",
|
|
9369
7999
|
description: "Drop one staged LinkedIn op. Removing a create cascades to everything that depends on it. Example: baker ads linkedin draft remove li_temp_abc123"
|
|
@@ -9388,7 +8018,7 @@ var removeCommand2 = defineCommand45({
|
|
|
9388
8018
|
}
|
|
9389
8019
|
}
|
|
9390
8020
|
});
|
|
9391
|
-
var clearCommand2 =
|
|
8021
|
+
var clearCommand2 = defineCommand43({
|
|
9392
8022
|
meta: {
|
|
9393
8023
|
name: "clear",
|
|
9394
8024
|
description: "Discard ALL staged LinkedIn ops in this chat's draft \u2014 nothing will apply on publish. Example: baker ads linkedin draft clear"
|
|
@@ -9405,7 +8035,7 @@ var clearCommand2 = defineCommand45({
|
|
|
9405
8035
|
}
|
|
9406
8036
|
}
|
|
9407
8037
|
});
|
|
9408
|
-
var linkedinDraftCommand =
|
|
8038
|
+
var linkedinDraftCommand = defineCommand43({
|
|
9409
8039
|
meta: {
|
|
9410
8040
|
name: "draft",
|
|
9411
8041
|
description: "Review and edit the LinkedIn write ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear. Ops never hit LinkedIn until the chat is published."
|
|
@@ -9419,8 +8049,8 @@ var linkedinDraftCommand = defineCommand45({
|
|
|
9419
8049
|
});
|
|
9420
8050
|
|
|
9421
8051
|
// src/commands/ads/linkedin/facets.ts
|
|
9422
|
-
import { defineCommand as
|
|
9423
|
-
var listCmd2 =
|
|
8052
|
+
import { defineCommand as defineCommand44 } from "citty";
|
|
8053
|
+
var listCmd2 = defineCommand44({
|
|
9424
8054
|
meta: {
|
|
9425
8055
|
name: "list",
|
|
9426
8056
|
description: `List every targeting facet LinkedIn supports.
|
|
@@ -9448,7 +8078,7 @@ seniorities, titles, employers, growthRate, companyCategory, skills, etc.).`
|
|
|
9448
8078
|
}
|
|
9449
8079
|
}
|
|
9450
8080
|
});
|
|
9451
|
-
var valuesCmd =
|
|
8081
|
+
var valuesCmd = defineCommand44({
|
|
9452
8082
|
meta: {
|
|
9453
8083
|
name: "values",
|
|
9454
8084
|
description: `Look up entity values for a single facet \u2014 full list or typeahead search.
|
|
@@ -9489,7 +8119,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
|
|
|
9489
8119
|
}
|
|
9490
8120
|
}
|
|
9491
8121
|
});
|
|
9492
|
-
var facetsCommand =
|
|
8122
|
+
var facetsCommand = defineCommand44({
|
|
9493
8123
|
meta: {
|
|
9494
8124
|
name: "facets",
|
|
9495
8125
|
description: `LinkedIn targeting facets and entity lookup.
|
|
@@ -9506,8 +8136,8 @@ Subcommands:
|
|
|
9506
8136
|
});
|
|
9507
8137
|
|
|
9508
8138
|
// src/commands/ads/linkedin/forecast.ts
|
|
9509
|
-
import { readFileSync as
|
|
9510
|
-
import { defineCommand as
|
|
8139
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
8140
|
+
import { defineCommand as defineCommand45 } from "citty";
|
|
9511
8141
|
function loadTargeting3(args) {
|
|
9512
8142
|
const inline = args.targeting;
|
|
9513
8143
|
if (inline) {
|
|
@@ -9520,7 +8150,7 @@ function loadTargeting3(args) {
|
|
|
9520
8150
|
const file = args["targeting-file"];
|
|
9521
8151
|
if (file) {
|
|
9522
8152
|
try {
|
|
9523
|
-
return JSON.parse(
|
|
8153
|
+
return JSON.parse(readFileSync7(file, "utf-8"));
|
|
9524
8154
|
} catch (e) {
|
|
9525
8155
|
handleLinkedinError(
|
|
9526
8156
|
new Error(`Failed to read --targeting-file: ${e instanceof Error ? e.message : "I/O error"}`)
|
|
@@ -9537,7 +8167,7 @@ function parseMoney(raw) {
|
|
|
9537
8167
|
}
|
|
9538
8168
|
return { amount: m[1] ?? "0", currencyCode: m[2] ?? "USD" };
|
|
9539
8169
|
}
|
|
9540
|
-
var forecastCommand =
|
|
8170
|
+
var forecastCommand = defineCommand45({
|
|
9541
8171
|
meta: {
|
|
9542
8172
|
name: "forecast",
|
|
9543
8173
|
description: `Forecast reach + impressions + clicks + spend for a hypothetical campaign.
|
|
@@ -9584,9 +8214,9 @@ Examples:
|
|
|
9584
8214
|
});
|
|
9585
8215
|
|
|
9586
8216
|
// src/commands/ads/linkedin/leads.ts
|
|
9587
|
-
import { defineCommand as
|
|
8217
|
+
import { defineCommand as defineCommand46 } from "citty";
|
|
9588
8218
|
var DAY_MS4 = 864e5;
|
|
9589
|
-
var leadsCommand =
|
|
8219
|
+
var leadsCommand = defineCommand46({
|
|
9590
8220
|
meta: {
|
|
9591
8221
|
name: "leads",
|
|
9592
8222
|
description: `List Lead Gen Form responses (playbook \xA707).
|
|
@@ -9646,7 +8276,7 @@ Examples:
|
|
|
9646
8276
|
});
|
|
9647
8277
|
|
|
9648
8278
|
// src/commands/ads/linkedin/resolve.ts
|
|
9649
|
-
import { defineCommand as
|
|
8279
|
+
import { defineCommand as defineCommand47 } from "citty";
|
|
9650
8280
|
function toOrgUrn(raw) {
|
|
9651
8281
|
const trimmed = raw.trim();
|
|
9652
8282
|
if (trimmed.length === 0) {
|
|
@@ -9657,7 +8287,7 @@ function toOrgUrn(raw) {
|
|
|
9657
8287
|
}
|
|
9658
8288
|
return /^\d+$/.test(trimmed) ? `urn:li:organization:${trimmed}` : null;
|
|
9659
8289
|
}
|
|
9660
|
-
var resolveCommand =
|
|
8290
|
+
var resolveCommand = defineCommand47({
|
|
9661
8291
|
meta: {
|
|
9662
8292
|
name: "resolve",
|
|
9663
8293
|
description: `Resolve organization URNs to company names.
|
|
@@ -9699,8 +8329,8 @@ couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
|
|
|
9699
8329
|
});
|
|
9700
8330
|
|
|
9701
8331
|
// src/commands/ads/linkedin/top-companies.ts
|
|
9702
|
-
import { defineCommand as
|
|
9703
|
-
var topCompaniesCommand =
|
|
8332
|
+
import { defineCommand as defineCommand48 } from "citty";
|
|
8333
|
+
var topCompaniesCommand = defineCommand48({
|
|
9704
8334
|
meta: {
|
|
9705
8335
|
name: "top-companies",
|
|
9706
8336
|
description: `Top companies whose employees saw / clicked / converted on a campaign.
|
|
@@ -9771,7 +8401,7 @@ Examples:
|
|
|
9771
8401
|
});
|
|
9772
8402
|
|
|
9773
8403
|
// src/commands/ads/linkedin/index.ts
|
|
9774
|
-
var linkedinCommand =
|
|
8404
|
+
var linkedinCommand = defineCommand49({
|
|
9775
8405
|
meta: {
|
|
9776
8406
|
name: "linkedin",
|
|
9777
8407
|
description: `LinkedIn Marketing API \u2014 AI-first command surface for B2B ad insights.
|
|
@@ -9816,9 +8446,9 @@ Account ID format:
|
|
|
9816
8446
|
accounts: accountsCommand2,
|
|
9817
8447
|
account: accountCommand,
|
|
9818
8448
|
"campaign-groups": campaignGroupsCommand,
|
|
9819
|
-
campaigns:
|
|
8449
|
+
campaigns: campaignsCommand,
|
|
9820
8450
|
creatives: creativesCommand,
|
|
9821
|
-
audiences:
|
|
8451
|
+
audiences: audiencesCommand,
|
|
9822
8452
|
"lead-forms": leadFormsCommand,
|
|
9823
8453
|
draft: linkedinDraftCommand,
|
|
9824
8454
|
analytics: analyticsCommand,
|
|
@@ -9830,17 +8460,17 @@ Account ID format:
|
|
|
9830
8460
|
"bid-pricing": bidPricingCommand,
|
|
9831
8461
|
forecast: forecastCommand,
|
|
9832
8462
|
leads: leadsCommand,
|
|
9833
|
-
conversions:
|
|
8463
|
+
conversions: conversionsCommand,
|
|
9834
8464
|
conversation: conversationCommand,
|
|
9835
8465
|
audit: auditCommand
|
|
9836
8466
|
}
|
|
9837
8467
|
});
|
|
9838
8468
|
|
|
9839
8469
|
// src/commands/ads/meta/index.ts
|
|
9840
|
-
import { defineCommand as
|
|
8470
|
+
import { defineCommand as defineCommand62 } from "citty";
|
|
9841
8471
|
|
|
9842
8472
|
// src/commands/ads/meta/account.ts
|
|
9843
|
-
import { defineCommand as
|
|
8473
|
+
import { defineCommand as defineCommand50 } from "citty";
|
|
9844
8474
|
|
|
9845
8475
|
// src/commands/ads/meta/shared.ts
|
|
9846
8476
|
var DAY_MS5 = 864e5;
|
|
@@ -9919,7 +8549,7 @@ function resolveEffectiveStatus(args) {
|
|
|
9919
8549
|
}
|
|
9920
8550
|
|
|
9921
8551
|
// src/commands/ads/meta/account.ts
|
|
9922
|
-
var accountCommand2 =
|
|
8552
|
+
var accountCommand2 = defineCommand50({
|
|
9923
8553
|
meta: {
|
|
9924
8554
|
name: "account",
|
|
9925
8555
|
description: `Show single Meta ad account detail (currency, timezone, balance, business).
|
|
@@ -9946,8 +8576,8 @@ Examples:
|
|
|
9946
8576
|
});
|
|
9947
8577
|
|
|
9948
8578
|
// src/commands/ads/meta/accounts.ts
|
|
9949
|
-
import { defineCommand as
|
|
9950
|
-
var accountsCommand3 =
|
|
8579
|
+
import { defineCommand as defineCommand51 } from "citty";
|
|
8580
|
+
var accountsCommand3 = defineCommand51({
|
|
9951
8581
|
meta: {
|
|
9952
8582
|
name: "accounts",
|
|
9953
8583
|
description: `List Meta ad accounts in this company's connected scope.
|
|
@@ -9995,8 +8625,8 @@ Examples:
|
|
|
9995
8625
|
});
|
|
9996
8626
|
|
|
9997
8627
|
// src/commands/ads/meta/activities.ts
|
|
9998
|
-
import { defineCommand as
|
|
9999
|
-
var activitiesCommand =
|
|
8628
|
+
import { defineCommand as defineCommand52 } from "citty";
|
|
8629
|
+
var activitiesCommand = defineCommand52({
|
|
10000
8630
|
meta: {
|
|
10001
8631
|
name: "activities",
|
|
10002
8632
|
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
@@ -10033,8 +8663,8 @@ Examples:
|
|
|
10033
8663
|
});
|
|
10034
8664
|
|
|
10035
8665
|
// src/commands/ads/meta/ads.ts
|
|
10036
|
-
import { defineCommand as
|
|
10037
|
-
var adsListCommand =
|
|
8666
|
+
import { defineCommand as defineCommand53 } from "citty";
|
|
8667
|
+
var adsListCommand = defineCommand53({
|
|
10038
8668
|
meta: {
|
|
10039
8669
|
name: "ads",
|
|
10040
8670
|
description: `List ads in a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -10082,8 +8712,8 @@ Examples:
|
|
|
10082
8712
|
});
|
|
10083
8713
|
|
|
10084
8714
|
// src/commands/ads/meta/adsets.ts
|
|
10085
|
-
import { defineCommand as
|
|
10086
|
-
var adsetsCommand =
|
|
8715
|
+
import { defineCommand as defineCommand54 } from "citty";
|
|
8716
|
+
var adsetsCommand = defineCommand54({
|
|
10087
8717
|
meta: {
|
|
10088
8718
|
name: "adsets",
|
|
10089
8719
|
description: `List ad sets in a Meta ad account, optionally scoped to one campaign. Defaults to ACTIVE only.
|
|
@@ -10125,8 +8755,8 @@ Examples:
|
|
|
10125
8755
|
});
|
|
10126
8756
|
|
|
10127
8757
|
// src/commands/ads/meta/audiences.ts
|
|
10128
|
-
import { defineCommand as
|
|
10129
|
-
var
|
|
8758
|
+
import { defineCommand as defineCommand55 } from "citty";
|
|
8759
|
+
var audiencesCommand2 = defineCommand55({
|
|
10130
8760
|
meta: {
|
|
10131
8761
|
name: "audiences",
|
|
10132
8762
|
description: `List custom audiences for a Meta ad account. Includes lookalikes, website-pixel audiences,
|
|
@@ -10161,8 +8791,8 @@ Examples:
|
|
|
10161
8791
|
});
|
|
10162
8792
|
|
|
10163
8793
|
// src/commands/ads/meta/businesses.ts
|
|
10164
|
-
import { defineCommand as
|
|
10165
|
-
var businessesCommand =
|
|
8794
|
+
import { defineCommand as defineCommand56 } from "citty";
|
|
8795
|
+
var businessesCommand = defineCommand56({
|
|
10166
8796
|
meta: {
|
|
10167
8797
|
name: "businesses",
|
|
10168
8798
|
description: `List Meta Business Manager accounts the connected user has access to. Required for ad-studies and product-catalogs commands.
|
|
@@ -10192,8 +8822,8 @@ Examples:
|
|
|
10192
8822
|
});
|
|
10193
8823
|
|
|
10194
8824
|
// src/commands/ads/meta/campaigns.ts
|
|
10195
|
-
import { defineCommand as
|
|
10196
|
-
var
|
|
8825
|
+
import { defineCommand as defineCommand57 } from "citty";
|
|
8826
|
+
var campaignsCommand2 = defineCommand57({
|
|
10197
8827
|
meta: {
|
|
10198
8828
|
name: "campaigns",
|
|
10199
8829
|
description: `List campaigns for a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -10237,8 +8867,8 @@ Examples:
|
|
|
10237
8867
|
});
|
|
10238
8868
|
|
|
10239
8869
|
// src/commands/ads/meta/creatives.ts
|
|
10240
|
-
import { defineCommand as
|
|
10241
|
-
var creativesCommand2 =
|
|
8870
|
+
import { defineCommand as defineCommand58 } from "citty";
|
|
8871
|
+
var creativesCommand2 = defineCommand58({
|
|
10242
8872
|
meta: {
|
|
10243
8873
|
name: "creatives",
|
|
10244
8874
|
description: `List ad creatives in an account, or fetch a single creative by ID.
|
|
@@ -10282,7 +8912,7 @@ Examples:
|
|
|
10282
8912
|
});
|
|
10283
8913
|
|
|
10284
8914
|
// src/commands/ads/meta/insights.ts
|
|
10285
|
-
import { defineCommand as
|
|
8915
|
+
import { defineCommand as defineCommand59 } from "citty";
|
|
10286
8916
|
|
|
10287
8917
|
// src/commands/ads/meta/presets.ts
|
|
10288
8918
|
var INSIGHTS_INTENTS = {
|
|
@@ -10487,7 +9117,7 @@ function sortRowsBySpendDesc(rows) {
|
|
|
10487
9117
|
return sb - sa;
|
|
10488
9118
|
});
|
|
10489
9119
|
}
|
|
10490
|
-
var insightsCommand =
|
|
9120
|
+
var insightsCommand = defineCommand59({
|
|
10491
9121
|
meta: {
|
|
10492
9122
|
name: "insights",
|
|
10493
9123
|
description: `Performance reporting \u2014 the main Meta tool for AI agents.
|
|
@@ -10588,8 +9218,8 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
|
|
|
10588
9218
|
});
|
|
10589
9219
|
|
|
10590
9220
|
// src/commands/ads/meta/pixels.ts
|
|
10591
|
-
import { defineCommand as
|
|
10592
|
-
var pixelsCommand =
|
|
9221
|
+
import { defineCommand as defineCommand60 } from "citty";
|
|
9222
|
+
var pixelsCommand = defineCommand60({
|
|
10593
9223
|
meta: {
|
|
10594
9224
|
name: "pixels",
|
|
10595
9225
|
description: `List Meta Pixels for an ad account, or fetch firing stats for one pixel.
|
|
@@ -10660,7 +9290,7 @@ function emit(data, args) {
|
|
|
10660
9290
|
|
|
10661
9291
|
// src/commands/ads/meta/preview.ts
|
|
10662
9292
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
10663
|
-
import { defineCommand as
|
|
9293
|
+
import { defineCommand as defineCommand61 } from "citty";
|
|
10664
9294
|
var VALID_AD_FORMATS = [
|
|
10665
9295
|
"DESKTOP_FEED_STANDARD",
|
|
10666
9296
|
"MOBILE_FEED_STANDARD",
|
|
@@ -10694,7 +9324,7 @@ var VALID_AD_FORMATS = [
|
|
|
10694
9324
|
"MARKETPLACE_MOBILE",
|
|
10695
9325
|
"BIZ_DISCO_FEED_MOBILE"
|
|
10696
9326
|
];
|
|
10697
|
-
var previewCommand =
|
|
9327
|
+
var previewCommand = defineCommand61({
|
|
10698
9328
|
meta: {
|
|
10699
9329
|
name: "preview",
|
|
10700
9330
|
description: `Generate a Meta-hosted preview iframe for a creative or ad. Returns iframe HTML which you
|
|
@@ -10741,7 +9371,7 @@ Examples:
|
|
|
10741
9371
|
});
|
|
10742
9372
|
|
|
10743
9373
|
// src/commands/ads/meta/index.ts
|
|
10744
|
-
var metaCommand =
|
|
9374
|
+
var metaCommand = defineCommand62({
|
|
10745
9375
|
meta: {
|
|
10746
9376
|
name: "meta",
|
|
10747
9377
|
description: `Meta Marketing API \u2014 AI-first command surface (Facebook + Instagram ads).
|
|
@@ -10780,11 +9410,11 @@ Audit & review:
|
|
|
10780
9410
|
accounts: accountsCommand3,
|
|
10781
9411
|
account: accountCommand2,
|
|
10782
9412
|
businesses: businessesCommand,
|
|
10783
|
-
campaigns:
|
|
9413
|
+
campaigns: campaignsCommand2,
|
|
10784
9414
|
adsets: adsetsCommand,
|
|
10785
9415
|
ads: adsListCommand,
|
|
10786
9416
|
creatives: creativesCommand2,
|
|
10787
|
-
audiences:
|
|
9417
|
+
audiences: audiencesCommand2,
|
|
10788
9418
|
pixels: pixelsCommand,
|
|
10789
9419
|
activities: activitiesCommand,
|
|
10790
9420
|
insights: insightsCommand,
|
|
@@ -10793,10 +9423,10 @@ Audit & review:
|
|
|
10793
9423
|
});
|
|
10794
9424
|
|
|
10795
9425
|
// src/commands/ads/x/index.ts
|
|
10796
|
-
import { defineCommand as
|
|
9426
|
+
import { defineCommand as defineCommand79 } from "citty";
|
|
10797
9427
|
|
|
10798
9428
|
// src/commands/ads/x/accounts.ts
|
|
10799
|
-
import { defineCommand as
|
|
9429
|
+
import { defineCommand as defineCommand63 } from "citty";
|
|
10800
9430
|
registerSchema({
|
|
10801
9431
|
command: "ads.x.accounts",
|
|
10802
9432
|
description: "List all accessible X Ads accounts. Returns accounts with id (base36), name, approval_status, timezone, currency. Run this first to find account IDs for other commands.",
|
|
@@ -10824,7 +9454,7 @@ function handleAccountsError2(err) {
|
|
|
10824
9454
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
10825
9455
|
process.exit(1);
|
|
10826
9456
|
}
|
|
10827
|
-
var accountsCommand4 =
|
|
9457
|
+
var accountsCommand4 = defineCommand63({
|
|
10828
9458
|
meta: {
|
|
10829
9459
|
name: "accounts",
|
|
10830
9460
|
description: `List accessible X Ads accounts. Returns account IDs needed for all other commands.
|
|
@@ -10864,7 +9494,7 @@ Examples:
|
|
|
10864
9494
|
});
|
|
10865
9495
|
|
|
10866
9496
|
// src/commands/ads/x/active-entities.ts
|
|
10867
|
-
import { defineCommand as
|
|
9497
|
+
import { defineCommand as defineCommand64 } from "citty";
|
|
10868
9498
|
|
|
10869
9499
|
// src/commands/ads/x/error-parser.ts
|
|
10870
9500
|
function mapXErrorCode(message) {
|
|
@@ -11015,7 +9645,7 @@ function parseCsv(v) {
|
|
|
11015
9645
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
11016
9646
|
return parts.length > 0 ? parts : void 0;
|
|
11017
9647
|
}
|
|
11018
|
-
var activeEntitiesCommand =
|
|
9648
|
+
var activeEntitiesCommand = defineCommand64({
|
|
11019
9649
|
meta: {
|
|
11020
9650
|
name: "active-entities",
|
|
11021
9651
|
description: `List entities with metric activity in a time range.
|
|
@@ -11073,7 +9703,7 @@ Examples:
|
|
|
11073
9703
|
});
|
|
11074
9704
|
|
|
11075
9705
|
// src/commands/ads/x/audiences.ts
|
|
11076
|
-
import { defineCommand as
|
|
9706
|
+
import { defineCommand as defineCommand65 } from "citty";
|
|
11077
9707
|
registerSchema({
|
|
11078
9708
|
command: "ads.x.audiences",
|
|
11079
9709
|
description: "List custom audiences for an X Ads account. Returns id, name, audience_size, audience_type, targetable status. Audiences need 100+ active users in the past 90 days to be targetable.",
|
|
@@ -11082,7 +9712,7 @@ registerSchema({
|
|
|
11082
9712
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11083
9713
|
}
|
|
11084
9714
|
});
|
|
11085
|
-
var
|
|
9715
|
+
var audiencesCommand3 = defineCommand65({
|
|
11086
9716
|
meta: {
|
|
11087
9717
|
name: "audiences",
|
|
11088
9718
|
description: `List X Ads custom audiences.
|
|
@@ -11131,7 +9761,7 @@ Examples:
|
|
|
11131
9761
|
});
|
|
11132
9762
|
|
|
11133
9763
|
// src/commands/ads/x/campaigns.ts
|
|
11134
|
-
import { defineCommand as
|
|
9764
|
+
import { defineCommand as defineCommand66 } from "citty";
|
|
11135
9765
|
|
|
11136
9766
|
// src/commands/ads/x/run-list.ts
|
|
11137
9767
|
function buildCleanParams(opts) {
|
|
@@ -11194,7 +9824,7 @@ registerSchema({
|
|
|
11194
9824
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11195
9825
|
}
|
|
11196
9826
|
});
|
|
11197
|
-
var
|
|
9827
|
+
var campaignsCommand3 = defineCommand66({
|
|
11198
9828
|
meta: {
|
|
11199
9829
|
name: "campaigns",
|
|
11200
9830
|
description: `List X Ads campaigns. Returns budget, schedule, funding instrument, status.
|
|
@@ -11236,7 +9866,7 @@ Examples:
|
|
|
11236
9866
|
});
|
|
11237
9867
|
|
|
11238
9868
|
// src/commands/ads/x/cards.ts
|
|
11239
|
-
import { defineCommand as
|
|
9869
|
+
import { defineCommand as defineCommand67 } from "citty";
|
|
11240
9870
|
registerSchema({
|
|
11241
9871
|
command: "ads.x.cards",
|
|
11242
9872
|
description: "List website cards, video cards, and carousels for an X Ads account.",
|
|
@@ -11245,7 +9875,7 @@ registerSchema({
|
|
|
11245
9875
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11246
9876
|
}
|
|
11247
9877
|
});
|
|
11248
|
-
var cardsCommand =
|
|
9878
|
+
var cardsCommand = defineCommand67({
|
|
11249
9879
|
meta: {
|
|
11250
9880
|
name: "cards",
|
|
11251
9881
|
description: `List X Ads cards (rich creatives).
|
|
@@ -11294,7 +9924,7 @@ Examples:
|
|
|
11294
9924
|
});
|
|
11295
9925
|
|
|
11296
9926
|
// src/commands/ads/x/funding.ts
|
|
11297
|
-
import { defineCommand as
|
|
9927
|
+
import { defineCommand as defineCommand68 } from "citty";
|
|
11298
9928
|
registerSchema({
|
|
11299
9929
|
command: "ads.x.funding",
|
|
11300
9930
|
description: "List funding instruments for an X Ads account. Returns id, type, currency, credit_limit_local_micro, funded_amount_local_micro, status. Falls back to BAKER_X_ADS_ACCOUNT_ID env var.",
|
|
@@ -11303,7 +9933,7 @@ registerSchema({
|
|
|
11303
9933
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11304
9934
|
}
|
|
11305
9935
|
});
|
|
11306
|
-
var fundingCommand =
|
|
9936
|
+
var fundingCommand = defineCommand68({
|
|
11307
9937
|
meta: {
|
|
11308
9938
|
name: "funding",
|
|
11309
9939
|
description: `List funding instruments for an X Ads account.
|
|
@@ -11352,7 +9982,7 @@ Examples:
|
|
|
11352
9982
|
});
|
|
11353
9983
|
|
|
11354
9984
|
// src/commands/ads/x/line-items.ts
|
|
11355
|
-
import { defineCommand as
|
|
9985
|
+
import { defineCommand as defineCommand69 } from "citty";
|
|
11356
9986
|
registerSchema({
|
|
11357
9987
|
command: "ads.x.lineItems",
|
|
11358
9988
|
description: "List line items (ad groups) for an X Ads account. Returns bid, product_type, objective, placements, schedule. Filter by campaign-ids or line-item-ids (CSV).",
|
|
@@ -11364,7 +9994,7 @@ registerSchema({
|
|
|
11364
9994
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11365
9995
|
}
|
|
11366
9996
|
});
|
|
11367
|
-
var lineItemsCommand =
|
|
9997
|
+
var lineItemsCommand = defineCommand69({
|
|
11368
9998
|
meta: {
|
|
11369
9999
|
name: "line-items",
|
|
11370
10000
|
description: `List X Ads line items (ad groups).
|
|
@@ -11405,7 +10035,7 @@ Examples:
|
|
|
11405
10035
|
});
|
|
11406
10036
|
|
|
11407
10037
|
// src/commands/ads/x/media.ts
|
|
11408
|
-
import { defineCommand as
|
|
10038
|
+
import { defineCommand as defineCommand70 } from "citty";
|
|
11409
10039
|
registerSchema({
|
|
11410
10040
|
command: "ads.x.media",
|
|
11411
10041
|
description: "List media assets in the X Ads media library (images, GIFs, videos). Filter by media-type (IMAGE, GIF, VIDEO).",
|
|
@@ -11415,7 +10045,7 @@ registerSchema({
|
|
|
11415
10045
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11416
10046
|
}
|
|
11417
10047
|
});
|
|
11418
|
-
var mediaCommand =
|
|
10048
|
+
var mediaCommand = defineCommand70({
|
|
11419
10049
|
meta: {
|
|
11420
10050
|
name: "media",
|
|
11421
10051
|
description: `List media assets in the X Ads media library.
|
|
@@ -11467,7 +10097,7 @@ Examples:
|
|
|
11467
10097
|
});
|
|
11468
10098
|
|
|
11469
10099
|
// src/commands/ads/x/promoted-tweets.ts
|
|
11470
|
-
import { defineCommand as
|
|
10100
|
+
import { defineCommand as defineCommand71 } from "citty";
|
|
11471
10101
|
registerSchema({
|
|
11472
10102
|
command: "ads.x.promotedTweets",
|
|
11473
10103
|
description: "List promoted tweets for an X Ads account. Returns id, line_item_id, tweet_id, approval_status. Filter by line-item-ids (CSV).",
|
|
@@ -11478,7 +10108,7 @@ registerSchema({
|
|
|
11478
10108
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
11479
10109
|
}
|
|
11480
10110
|
});
|
|
11481
|
-
var promotedTweetsCommand =
|
|
10111
|
+
var promotedTweetsCommand = defineCommand71({
|
|
11482
10112
|
meta: {
|
|
11483
10113
|
name: "promoted-tweets",
|
|
11484
10114
|
description: `List X Ads promoted tweets.
|
|
@@ -11532,11 +10162,11 @@ Examples:
|
|
|
11532
10162
|
});
|
|
11533
10163
|
|
|
11534
10164
|
// src/commands/ads/x/stats/index.ts
|
|
11535
|
-
import { defineCommand as
|
|
10165
|
+
import { defineCommand as defineCommand76 } from "citty";
|
|
11536
10166
|
|
|
11537
10167
|
// src/commands/ads/x/stats/job.ts
|
|
11538
10168
|
import { gunzipSync } from "zlib";
|
|
11539
|
-
import { defineCommand as
|
|
10169
|
+
import { defineCommand as defineCommand72 } from "citty";
|
|
11540
10170
|
var POLL_INTERVAL_MS2 = 1e4;
|
|
11541
10171
|
var DEADLINE_MS = 12 * 60 * 1e3;
|
|
11542
10172
|
var RESULT_CACHE_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
@@ -11606,7 +10236,7 @@ async function pollUntilDone(accountId, jobId) {
|
|
|
11606
10236
|
function buildCacheKey(body) {
|
|
11607
10237
|
return `stats-job:${JSON.stringify(body)}`;
|
|
11608
10238
|
}
|
|
11609
|
-
var statsJobCommand =
|
|
10239
|
+
var statsJobCommand = defineCommand72({
|
|
11610
10240
|
meta: {
|
|
11611
10241
|
name: "job",
|
|
11612
10242
|
description: `Async X Ads stats job, sync from the CLI's perspective. Creates \u2192 polls \u2192 downloads \u2192 returns.
|
|
@@ -11711,7 +10341,7 @@ For fine-grained control (don't wait, poll yourself), use:
|
|
|
11711
10341
|
});
|
|
11712
10342
|
|
|
11713
10343
|
// src/commands/ads/x/stats/job-create.ts
|
|
11714
|
-
import { defineCommand as
|
|
10344
|
+
import { defineCommand as defineCommand73 } from "citty";
|
|
11715
10345
|
registerSchema({
|
|
11716
10346
|
command: "ads.x.statsJobCreate",
|
|
11717
10347
|
description: "Create an asynchronous X Ads stats job (range up to 90 days non-segmented, 45 days segmented). Returns a job id; poll with `stats job-status`. Times must be ISO 8601 hour-aligned.",
|
|
@@ -11734,7 +10364,7 @@ function parseCsv3(v) {
|
|
|
11734
10364
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
11735
10365
|
return parts.length > 0 ? parts : void 0;
|
|
11736
10366
|
}
|
|
11737
|
-
var statsJobCreateCommand =
|
|
10367
|
+
var statsJobCreateCommand = defineCommand73({
|
|
11738
10368
|
meta: {
|
|
11739
10369
|
name: "job-create",
|
|
11740
10370
|
description: `Create an async X Ads stats job (up to 90 days, supports segmentation).
|
|
@@ -11797,7 +10427,7 @@ Examples:
|
|
|
11797
10427
|
});
|
|
11798
10428
|
|
|
11799
10429
|
// src/commands/ads/x/stats/job-status.ts
|
|
11800
|
-
import { defineCommand as
|
|
10430
|
+
import { defineCommand as defineCommand74 } from "citty";
|
|
11801
10431
|
registerSchema({
|
|
11802
10432
|
command: "ads.x.statsJobStatus",
|
|
11803
10433
|
description: "Check the status of one or more X Ads stats jobs. Returns status (PROCESSING|SUCCESS|FAILED) and a downloadable url when SUCCESS. Pass --job-id or --job-ids (CSV).",
|
|
@@ -11807,7 +10437,7 @@ registerSchema({
|
|
|
11807
10437
|
"job-ids": { type: "string", description: "CSV of job IDs", required: false }
|
|
11808
10438
|
}
|
|
11809
10439
|
});
|
|
11810
|
-
var statsJobStatusCommand =
|
|
10440
|
+
var statsJobStatusCommand = defineCommand74({
|
|
11811
10441
|
meta: {
|
|
11812
10442
|
name: "job-status",
|
|
11813
10443
|
description: `Poll the status of an async X Ads stats job.
|
|
@@ -11848,7 +10478,7 @@ Examples:
|
|
|
11848
10478
|
});
|
|
11849
10479
|
|
|
11850
10480
|
// src/commands/ads/x/stats/sync.ts
|
|
11851
|
-
import { defineCommand as
|
|
10481
|
+
import { defineCommand as defineCommand75 } from "citty";
|
|
11852
10482
|
|
|
11853
10483
|
// src/commands/ads/x/presets.ts
|
|
11854
10484
|
var X_STATS_PRESETS = [
|
|
@@ -12007,7 +10637,7 @@ async function runSync(args, q) {
|
|
|
12007
10637
|
process.exit(1);
|
|
12008
10638
|
}
|
|
12009
10639
|
}
|
|
12010
|
-
var statsSyncCommand =
|
|
10640
|
+
var statsSyncCommand = defineCommand75({
|
|
12011
10641
|
meta: {
|
|
12012
10642
|
name: "sync",
|
|
12013
10643
|
description: `Synchronous X Ads analytics (max 7-day window).
|
|
@@ -12050,7 +10680,7 @@ Examples:
|
|
|
12050
10680
|
});
|
|
12051
10681
|
|
|
12052
10682
|
// src/commands/ads/x/stats/index.ts
|
|
12053
|
-
var statsCommand =
|
|
10683
|
+
var statsCommand = defineCommand76({
|
|
12054
10684
|
meta: {
|
|
12055
10685
|
name: "stats",
|
|
12056
10686
|
description: `X Ads analytics. Sync (\u22647 days, no segmentation) or async jobs (\u226490 days, segmentable).
|
|
@@ -12078,7 +10708,7 @@ Examples:
|
|
|
12078
10708
|
});
|
|
12079
10709
|
|
|
12080
10710
|
// src/commands/ads/x/targeting-constants.ts
|
|
12081
|
-
import { defineCommand as
|
|
10711
|
+
import { defineCommand as defineCommand77 } from "citty";
|
|
12082
10712
|
var ALLOWED_CONSTANTS = [
|
|
12083
10713
|
"locations",
|
|
12084
10714
|
"interests",
|
|
@@ -12106,7 +10736,7 @@ registerSchema({
|
|
|
12106
10736
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
12107
10737
|
}
|
|
12108
10738
|
});
|
|
12109
|
-
var targetingConstantsCommand =
|
|
10739
|
+
var targetingConstantsCommand = defineCommand77({
|
|
12110
10740
|
meta: {
|
|
12111
10741
|
name: "targeting-constants",
|
|
12112
10742
|
description: `Lookup X Ads targeting constants.
|
|
@@ -12156,7 +10786,7 @@ Examples:
|
|
|
12156
10786
|
});
|
|
12157
10787
|
|
|
12158
10788
|
// src/commands/ads/x/targeting-criteria.ts
|
|
12159
|
-
import { defineCommand as
|
|
10789
|
+
import { defineCommand as defineCommand78 } from "citty";
|
|
12160
10790
|
registerSchema({
|
|
12161
10791
|
command: "ads.x.targetingCriteria",
|
|
12162
10792
|
description: "List targeting criteria attached to line items in an X Ads account. Returns targeting_type, targeting_value, name, operator_type per criterion. Filter by line-item-ids.",
|
|
@@ -12166,7 +10796,7 @@ registerSchema({
|
|
|
12166
10796
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
12167
10797
|
}
|
|
12168
10798
|
});
|
|
12169
|
-
var targetingCriteriaCommand =
|
|
10799
|
+
var targetingCriteriaCommand = defineCommand78({
|
|
12170
10800
|
meta: {
|
|
12171
10801
|
name: "targeting-criteria",
|
|
12172
10802
|
description: `List targeting criteria attached to line items.
|
|
@@ -12217,7 +10847,7 @@ Examples:
|
|
|
12217
10847
|
});
|
|
12218
10848
|
|
|
12219
10849
|
// src/commands/ads/x/index.ts
|
|
12220
|
-
var xCommand =
|
|
10850
|
+
var xCommand = defineCommand79({
|
|
12221
10851
|
meta: {
|
|
12222
10852
|
name: "x",
|
|
12223
10853
|
description: `X (Twitter) Ads commands. Read campaigns, line items, promoted tweets, creatives, audiences, and analytics.
|
|
@@ -12241,12 +10871,12 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
12241
10871
|
subCommands: {
|
|
12242
10872
|
accounts: accountsCommand4,
|
|
12243
10873
|
funding: fundingCommand,
|
|
12244
|
-
campaigns:
|
|
10874
|
+
campaigns: campaignsCommand3,
|
|
12245
10875
|
"line-items": lineItemsCommand,
|
|
12246
10876
|
"promoted-tweets": promotedTweetsCommand,
|
|
12247
10877
|
cards: cardsCommand,
|
|
12248
10878
|
media: mediaCommand,
|
|
12249
|
-
audiences:
|
|
10879
|
+
audiences: audiencesCommand3,
|
|
12250
10880
|
"targeting-criteria": targetingCriteriaCommand,
|
|
12251
10881
|
"targeting-constants": targetingConstantsCommand,
|
|
12252
10882
|
"active-entities": activeEntitiesCommand,
|
|
@@ -12255,7 +10885,7 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
12255
10885
|
});
|
|
12256
10886
|
|
|
12257
10887
|
// src/commands/ads/index.ts
|
|
12258
|
-
var
|
|
10888
|
+
var adsCommand = defineCommand80({
|
|
12259
10889
|
meta: {
|
|
12260
10890
|
name: "ads",
|
|
12261
10891
|
description: `Ad platform commands. Each platform exposes its own native command surface \u2014 no forced parity.
|
|
@@ -12285,11 +10915,11 @@ Examples:
|
|
|
12285
10915
|
});
|
|
12286
10916
|
|
|
12287
10917
|
// src/commands/canvas/index.ts
|
|
12288
|
-
import { defineCommand as
|
|
10918
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
12289
10919
|
|
|
12290
10920
|
// src/commands/canvas/catalog.ts
|
|
12291
|
-
import { defineCommand as
|
|
12292
|
-
var catalogCommand =
|
|
10921
|
+
import { defineCommand as defineCommand81 } from "citty";
|
|
10922
|
+
var catalogCommand = defineCommand81({
|
|
12293
10923
|
meta: {
|
|
12294
10924
|
name: "catalog",
|
|
12295
10925
|
description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
|
|
@@ -12306,9 +10936,9 @@ import { execFile } from "child_process";
|
|
|
12306
10936
|
import { readdir, readFile, stat } from "fs/promises";
|
|
12307
10937
|
import path from "path";
|
|
12308
10938
|
import { promisify } from "util";
|
|
12309
|
-
import { defineCommand as
|
|
10939
|
+
import { defineCommand as defineCommand82 } from "citty";
|
|
12310
10940
|
var execFileAsync = promisify(execFile);
|
|
12311
|
-
var inspectCommand =
|
|
10941
|
+
var inspectCommand = defineCommand82({
|
|
12312
10942
|
meta: {
|
|
12313
10943
|
name: "inspect",
|
|
12314
10944
|
description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
|
|
@@ -12417,7 +11047,7 @@ async function probeDuration(filePath) {
|
|
|
12417
11047
|
// src/commands/canvas/run.ts
|
|
12418
11048
|
import { readFile as readFile2 } from "fs/promises";
|
|
12419
11049
|
import path4 from "path";
|
|
12420
|
-
import { defineCommand as
|
|
11050
|
+
import { defineCommand as defineCommand83 } from "citty";
|
|
12421
11051
|
|
|
12422
11052
|
// src/commands/canvas/placeholders.ts
|
|
12423
11053
|
function unsuppliedPlaceholderAssets(canvas) {
|
|
@@ -12487,7 +11117,7 @@ async function pruneOldRuns(outputsDir, keep, currentRunId, log) {
|
|
|
12487
11117
|
}
|
|
12488
11118
|
|
|
12489
11119
|
// src/commands/canvas/run.ts
|
|
12490
|
-
var runCommand =
|
|
11120
|
+
var runCommand = defineCommand83({
|
|
12491
11121
|
meta: { name: "run", description: "Validate and execute a canvas JSON file." },
|
|
12492
11122
|
args: {
|
|
12493
11123
|
file: { type: "positional", required: true, description: "Path to canvas JSON" },
|
|
@@ -12583,30 +11213,30 @@ var runCommand = defineCommand85({
|
|
|
12583
11213
|
// src/commands/canvas/scaffold-static-ad.ts
|
|
12584
11214
|
import { readFile as readFile3, writeFile } from "fs/promises";
|
|
12585
11215
|
import path5 from "path";
|
|
12586
|
-
import { defineCommand as
|
|
11216
|
+
import { defineCommand as defineCommand84 } from "citty";
|
|
12587
11217
|
|
|
12588
11218
|
// src/engine/scaffold/staticAd.ts
|
|
12589
|
-
import { z as
|
|
11219
|
+
import { z as z8 } from "zod";
|
|
12590
11220
|
var GEN_ASPECT_RATIOS = /* @__PURE__ */ new Set(["1:1", "4:5", "9:16", "16:9", "4:3", "3:4", "2:3", "3:2", "21:9"]);
|
|
12591
11221
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
12592
|
-
var Blueprint =
|
|
12593
|
-
meta:
|
|
12594
|
-
text_content:
|
|
11222
|
+
var Blueprint = z8.object({
|
|
11223
|
+
meta: z8.object({ estimated_aspect_ratio: z8.string().optional() }).loose().optional(),
|
|
11224
|
+
text_content: z8.array(z8.object({ text: z8.string().optional() }).loose()).optional()
|
|
12595
11225
|
}).loose();
|
|
12596
|
-
var ElementLocator =
|
|
12597
|
-
collection:
|
|
12598
|
-
index:
|
|
11226
|
+
var ElementLocator = z8.object({
|
|
11227
|
+
collection: z8.enum(["subjects", "people", "brands_logos"]),
|
|
11228
|
+
index: z8.number().int().nonnegative()
|
|
12599
11229
|
}).loose();
|
|
12600
|
-
var MainElement =
|
|
11230
|
+
var MainElement = z8.object({
|
|
12601
11231
|
// logo | product | person | animal | badge | other
|
|
12602
|
-
type:
|
|
12603
|
-
label:
|
|
12604
|
-
description:
|
|
12605
|
-
expression:
|
|
12606
|
-
reason:
|
|
11232
|
+
type: z8.string(),
|
|
11233
|
+
label: z8.string().optional(),
|
|
11234
|
+
description: z8.string().optional(),
|
|
11235
|
+
expression: z8.string().nullable().optional(),
|
|
11236
|
+
reason: z8.string().optional(),
|
|
12607
11237
|
locator: ElementLocator.optional()
|
|
12608
11238
|
}).loose();
|
|
12609
|
-
var MainElements =
|
|
11239
|
+
var MainElements = z8.array(MainElement);
|
|
12610
11240
|
function sanitizeId(raw, fallback) {
|
|
12611
11241
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
12612
11242
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -12648,7 +11278,7 @@ function roleForType(type) {
|
|
|
12648
11278
|
return "the showcased product; keep this exact product identity. Ignore any caption text printed on this reference.";
|
|
12649
11279
|
case "person":
|
|
12650
11280
|
case "animal":
|
|
12651
|
-
return "the hero
|
|
11281
|
+
return "the emotional hero \u2014 the face/muzzle/eyes the viewer locks onto and exactly where AI artifacts (malformed mouths, teeth, foam, extra fingers) betray a fake. It MUST be grounded in this real reference, never invented from prose. Keep this identity AND the expression the blueprint specifies. Ignore any caption text printed on this reference.";
|
|
12652
11282
|
default:
|
|
12653
11283
|
return "an identity-bearing element; reproduce it faithfully from this reference. Ignore any caption text printed on it.";
|
|
12654
11284
|
}
|
|
@@ -12656,7 +11286,9 @@ function roleForType(type) {
|
|
|
12656
11286
|
function todoPath(el, label) {
|
|
12657
11287
|
const desc = el.description ? ` \u2014 ${el.description}` : "";
|
|
12658
11288
|
const expr = el.expression ? `, with a ${el.expression} expression` : "";
|
|
12659
|
-
|
|
11289
|
+
const t = el.type.toLowerCase();
|
|
11290
|
+
const lock = t === "person" || t === "animal" ? " \u2014 REQUIRED: this is the emotional hero; ground it in a real reference (image-library / video-library / Pinterest), do not delete this slot and free-generate" : "";
|
|
11291
|
+
return `[TODO: drop a real image for ${label} (${el.type})${desc}${expr}${lock}]`;
|
|
12660
11292
|
}
|
|
12661
11293
|
function aspectRatio(blueprint, opts) {
|
|
12662
11294
|
const requested = opts.aspectRatio ?? blueprint.meta?.estimated_aspect_ratio;
|
|
@@ -12771,7 +11403,7 @@ function resolveModel(kind, preferred) {
|
|
|
12771
11403
|
const ids = Object.keys(MODEL_REGISTRY[kind]);
|
|
12772
11404
|
return ids.includes(preferred) ? preferred : ids[0] ?? preferred;
|
|
12773
11405
|
}
|
|
12774
|
-
var DESCRIBE_FOCUS =
|
|
11406
|
+
var DESCRIBE_FOCUS = `the GLOBAL LAYOUT GEOMETRY above all \u2014 the column/row grid, each region's approximate bounds as a percentage of frame width and height, any panel SPLITS and their proportions (e.g. a left column split into a ~60% top photo and a ~20% bottom price box), what occupies every region, and for EVERY text block its string verbatim, relative size (x_large | large | medium | small), weight, case, color, and alignment \u2014 including small bottom-corner fine print. Also: the EXPRESSION and emotion of every person/animal (capture exaggerated or AI-edited faces), the ad_intent (what feeling it engineers and how), per-color brand_ownership (which colors are the advertiser's brand vs borrowed-functional like a red comparison column), logos by brand, and all visible text verbatim. CRITICAL \u2014 name the WINNING MECHANISM(S): the special sauce, the specific thing that makes THIS ad a candidate winner rather than a generic ad. A great ad is rarely great by accident, and the mechanism is invisible unless named, so a faithful rewrite quietly discards it. It may be VERBAL (a rhyme, pun, alliteration, rhythm/meter, repetition, antithesis, double meaning), VISUAL (an unexpected crop or scale, a visual gag or pun, a striking juxtaposition, a pattern interrupt, an exaggerated/AI-edited expression, a before/after or comparison, bold negative space, a surprising focal point), or STRUCTURAL (an unusual hook, order, or reveal). Record each as a \`winning_mechanisms\` array of { kind: verbal|visual|structural, device, why_it_works } (e.g. { kind: verbal, device: "rhyme \u2014 'today' / 'go away'", why_it_works: "memorable, playful, reframes cost as relief" }) so a rewrite can rebuild the SAUCE for our brand instead of adapting only the surface and losing what made it convert`;
|
|
12775
11407
|
var LAYOUT_SYSTEM = "You convert an advertisement's JSON blueprint into a precise, structured LAYOUT MAP of the frame \u2014 the spatial grid a designer would rebuild it from. Be exhaustive and quantitative: every region, its bounds as a percentage of the frame, and every text block with its relative size. Output ONLY a JSON object, no prose.";
|
|
12776
11408
|
var LAYOUT_PROMPT = `AD BLUEPRINT (from image_describe):
|
|
12777
11409
|
{{blueprint}}
|
|
@@ -12793,7 +11425,20 @@ Return a JSON object describing the GLOBAL LAYOUT of the frame precisely enough
|
|
|
12793
11425
|
|
|
12794
11426
|
Use the blueprint's positions, sizes, text_content, and colors. Estimate the percentages and split proportions as accurately as you can (e.g. a column split 60/20 with a 20% gap). Cover EVERY visible element \u2014 photos, text boxes, badges, background shapes, and small corner text \u2014 top-to-bottom, left-to-right. Output ONLY the JSON object.`;
|
|
12795
11427
|
var SELECT_SYSTEM = 'You identify the MAIN, identity-critical visual elements of an advertisement from its JSON blueprint \u2014 the things a faithful reproduction must supply as REAL reference images instead of letting a model invent them. Output ONLY a JSON object of the form { "elements": [ ... ] }, no prose.';
|
|
12796
|
-
var SELECT_PROMPT =
|
|
11428
|
+
var SELECT_PROMPT = `AD BLUEPRINT (from image_describe):
|
|
11429
|
+
{{blueprint}}
|
|
11430
|
+
|
|
11431
|
+
From this blueprint, list ONLY the elements that are prominent, important, and identity-bearing \u2014 the ones a reproduction must ground in a real asset:
|
|
11432
|
+
- the brand logo/wordmark (from brands_logos with function_in_image = advertiser_brand) -> type "logo"
|
|
11433
|
+
- trust/rating/certification/app-store/review badges (brands_logos with function_in_image = trust_badge | review_platform | certification_or_seal | app_store_badge | payment_method) -> type "badge"
|
|
11434
|
+
- a showcased/hero product or package (a foreground entry in subjects that the ad is selling) -> type "product"
|
|
11435
|
+
- a foreground person (from people) \u2014 keep it when its identity matters OR it is the emotional/hero focal point of the ad, even a generic one with no brand identity -> type "person"
|
|
11436
|
+
- a foreground animal/character (from subjects) \u2014 keep it when it carries a specific expression OR it is the emotional/hero focal point, even a generic one -> type "animal"
|
|
11437
|
+
(For both: a free-generated face, muzzle, hands, or teeth reads as AI and grows artifacts \u2014 malformed mouths, extra fingers, foam \u2014 so the emotional hero needs the STRONGEST real grounding, not the weakest; "it's just a generic dog/person" is never a reason to drop it.)
|
|
11438
|
+
|
|
11439
|
+
DROP background extras, decorative props, generic scenery, and anything small or incidental. Keep at most ~6. If there are none, return an empty list.
|
|
11440
|
+
|
|
11441
|
+
For each kept element return: { "type": one of logo|product|person|animal|badge, "label": a short UPPER_SNAKE_CASE name (e.g. LOGO, PRODUCT, HERO_DOG, TRUSTPILOT), "description": a concrete reusable description to source/shoot the real asset (include the exact expression for a living subject, and its castable attributes \u2014 breed/species for an animal, apparent age band, apparent origin/ethnicity, and wardrobe/setting for a person \u2014 so it can be recast to fit OUR audience/market), "expression": the facial expression for a living subject or null, "reason": why it is identity-critical, "locator": the blueprint entry this element came from as { "collection": one of "subjects" | "people" | "brands_logos", "index": its 0-based position in that array } (people -> people; logos/badges -> brands_logos; products/animals/objects -> subjects). Output ONLY the JSON object.`;
|
|
12797
11442
|
async function loadAssetText(ref, label) {
|
|
12798
11443
|
const r = ref;
|
|
12799
11444
|
if (typeof r?.path === "string") return readFile3(r.path, "utf8");
|
|
@@ -12902,7 +11547,7 @@ async function runVisionPasses(canvas) {
|
|
|
12902
11547
|
return fail("read_outputs", e instanceof Error ? e.message : String(e));
|
|
12903
11548
|
}
|
|
12904
11549
|
}
|
|
12905
|
-
var scaffoldStaticAdCommand =
|
|
11550
|
+
var scaffoldStaticAdCommand = defineCommand84({
|
|
12906
11551
|
meta: {
|
|
12907
11552
|
name: "scaffold-static-ad",
|
|
12908
11553
|
description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. Edit prompt.json and drop the real assets, then `baker canvas run` it."
|
|
@@ -12996,7 +11641,7 @@ var scaffoldStaticAdCommand = defineCommand86({
|
|
|
12996
11641
|
// src/commands/canvas/scaffold-video.ts
|
|
12997
11642
|
import { cp, mkdir, readFile as readFile6, writeFile as writeFile2 } from "fs/promises";
|
|
12998
11643
|
import path8 from "path";
|
|
12999
|
-
import { defineCommand as
|
|
11644
|
+
import { defineCommand as defineCommand85 } from "citty";
|
|
13000
11645
|
|
|
13001
11646
|
// src/engine/nodes/local/lib/sceneDetect.ts
|
|
13002
11647
|
import { execFile as execFile2 } from "child_process";
|
|
@@ -13101,7 +11746,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
13101
11746
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
13102
11747
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
13103
11748
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
13104
|
-
import { z as
|
|
11749
|
+
import { z as z9 } from "zod";
|
|
13105
11750
|
|
|
13106
11751
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
13107
11752
|
var SHOOT_MODES = [
|
|
@@ -13358,49 +12003,49 @@ function trimArgs(durationS, offsetS = 0) {
|
|
|
13358
12003
|
"{{out.video}}"
|
|
13359
12004
|
];
|
|
13360
12005
|
}
|
|
13361
|
-
var FrameAsset =
|
|
13362
|
-
var DialogueLine =
|
|
13363
|
-
speaker:
|
|
13364
|
-
line:
|
|
12006
|
+
var FrameAsset = z9.object({ url: z9.string().optional() }).loose().optional();
|
|
12007
|
+
var DialogueLine = z9.object({
|
|
12008
|
+
speaker: z9.string().optional(),
|
|
12009
|
+
line: z9.string().optional(),
|
|
13365
12010
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
13366
|
-
start_s:
|
|
13367
|
-
end_s:
|
|
13368
|
-
delivery:
|
|
13369
|
-
voice_description:
|
|
12011
|
+
start_s: z9.number().optional(),
|
|
12012
|
+
end_s: z9.number().optional(),
|
|
12013
|
+
delivery: z9.string().optional(),
|
|
12014
|
+
voice_description: z9.string().optional()
|
|
13370
12015
|
}).loose();
|
|
13371
|
-
var Sfx =
|
|
13372
|
-
at_s:
|
|
13373
|
-
duration_s:
|
|
13374
|
-
sound_effect_prompt:
|
|
13375
|
-
description:
|
|
12016
|
+
var Sfx = z9.object({
|
|
12017
|
+
at_s: z9.number().optional(),
|
|
12018
|
+
duration_s: z9.number().optional(),
|
|
12019
|
+
sound_effect_prompt: z9.string().optional(),
|
|
12020
|
+
description: z9.string().optional()
|
|
13376
12021
|
}).loose();
|
|
13377
|
-
var CompositionRegion =
|
|
12022
|
+
var CompositionRegion = z9.object({
|
|
13378
12023
|
// full | top | bottom | left | right | inset
|
|
13379
|
-
panel:
|
|
12024
|
+
panel: z9.string().optional(),
|
|
13380
12025
|
// 9-grid anchor for an `inset` presenter box.
|
|
13381
|
-
position:
|
|
13382
|
-
is_presenter:
|
|
12026
|
+
position: z9.string().optional(),
|
|
12027
|
+
is_presenter: z9.boolean().optional(),
|
|
13383
12028
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
13384
|
-
cast_ref:
|
|
13385
|
-
summary:
|
|
13386
|
-
frame_prompt:
|
|
13387
|
-
motion_prompt:
|
|
12029
|
+
cast_ref: z9.string().optional(),
|
|
12030
|
+
summary: z9.string().optional(),
|
|
12031
|
+
frame_prompt: z9.string().optional(),
|
|
12032
|
+
motion_prompt: z9.string().optional()
|
|
13388
12033
|
}).loose();
|
|
13389
|
-
var SceneComposition =
|
|
12034
|
+
var SceneComposition = z9.object({
|
|
13390
12035
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
13391
|
-
layout:
|
|
12036
|
+
layout: z9.string().optional(),
|
|
13392
12037
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
13393
|
-
split_axis:
|
|
13394
|
-
regions:
|
|
12038
|
+
split_axis: z9.string().optional(),
|
|
12039
|
+
regions: z9.array(CompositionRegion).optional()
|
|
13395
12040
|
}).loose();
|
|
13396
|
-
var CameraMotion =
|
|
13397
|
-
var TranscriptWord =
|
|
13398
|
-
var Scene =
|
|
13399
|
-
start_s:
|
|
13400
|
-
end_s:
|
|
13401
|
-
duration_s:
|
|
13402
|
-
summary:
|
|
13403
|
-
action_detail:
|
|
12041
|
+
var CameraMotion = z9.object({ movement: z9.string().optional(), detail: z9.string().optional() }).loose();
|
|
12042
|
+
var TranscriptWord = z9.object({ text: z9.string().optional() }).loose();
|
|
12043
|
+
var Scene = z9.object({
|
|
12044
|
+
start_s: z9.number().optional(),
|
|
12045
|
+
end_s: z9.number().optional(),
|
|
12046
|
+
duration_s: z9.number().optional(),
|
|
12047
|
+
summary: z9.string().optional(),
|
|
12048
|
+
action_detail: z9.string().optional(),
|
|
13404
12049
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
13405
12050
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
13406
12051
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -13408,77 +12053,77 @@ var Scene = z11.object({
|
|
|
13408
12053
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
13409
12054
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
13410
12055
|
// UGC/product mode; a human can override per scene by setting this.
|
|
13411
|
-
shoot_mode:
|
|
12056
|
+
shoot_mode: z9.string().optional(),
|
|
13412
12057
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
13413
12058
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
13414
|
-
ambient:
|
|
12059
|
+
ambient: z9.string().optional(),
|
|
13415
12060
|
camera_motion: CameraMotion.optional(),
|
|
13416
|
-
start_frame_prompt:
|
|
13417
|
-
end_frame_prompt:
|
|
13418
|
-
motion_prompt:
|
|
12061
|
+
start_frame_prompt: z9.string().optional(),
|
|
12062
|
+
end_frame_prompt: z9.string().optional(),
|
|
12063
|
+
motion_prompt: z9.string().optional(),
|
|
13419
12064
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
13420
12065
|
// script re-craft checklist. Inferred from position when absent.
|
|
13421
|
-
narrative_role:
|
|
12066
|
+
narrative_role: z9.string().optional(),
|
|
13422
12067
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
13423
12068
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
13424
12069
|
// into the hook's start-frame description so the generator renders that state,
|
|
13425
12070
|
// not a calm influencer (CCA-11).
|
|
13426
|
-
hook_mechanic:
|
|
12071
|
+
hook_mechanic: z9.object({ mechanic: z9.string().optional(), why_it_stops_scroll: z9.string().optional() }).loose().optional(),
|
|
13427
12072
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
13428
|
-
scene_setting:
|
|
12073
|
+
scene_setting: z9.string().optional(),
|
|
13429
12074
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
13430
12075
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
13431
12076
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
13432
12077
|
// ignored (nothing follows it).
|
|
13433
|
-
transition_out:
|
|
13434
|
-
dialogue:
|
|
13435
|
-
sfx:
|
|
13436
|
-
overlays:
|
|
13437
|
-
floating_elements:
|
|
13438
|
-
transcript_slice:
|
|
12078
|
+
transition_out: z9.object({ type: z9.string().optional(), description: z9.string().optional() }).loose().optional(),
|
|
12079
|
+
dialogue: z9.array(DialogueLine).optional(),
|
|
12080
|
+
sfx: z9.array(Sfx).optional(),
|
|
12081
|
+
overlays: z9.array(z9.unknown()).optional(),
|
|
12082
|
+
floating_elements: z9.array(z9.unknown()).optional(),
|
|
12083
|
+
transcript_slice: z9.array(TranscriptWord).optional(),
|
|
13439
12084
|
start_frame_asset: FrameAsset,
|
|
13440
12085
|
end_frame_asset: FrameAsset,
|
|
13441
12086
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
13442
12087
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
13443
12088
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
13444
12089
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
13445
|
-
continues_previous:
|
|
12090
|
+
continues_previous: z9.boolean().optional()
|
|
13446
12091
|
}).loose();
|
|
13447
|
-
var VideoBlueprint =
|
|
13448
|
-
source:
|
|
13449
|
-
global:
|
|
13450
|
-
music:
|
|
13451
|
-
present:
|
|
13452
|
-
music_prompt:
|
|
12092
|
+
var VideoBlueprint = z9.object({
|
|
12093
|
+
source: z9.object({ aspect_ratio: z9.string().optional(), duration_s: z9.number().optional() }).loose().optional(),
|
|
12094
|
+
global: z9.object({
|
|
12095
|
+
music: z9.object({
|
|
12096
|
+
present: z9.boolean().optional(),
|
|
12097
|
+
music_prompt: z9.string().optional(),
|
|
13453
12098
|
// Absolute second the music enters in the reference (the bed often
|
|
13454
12099
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
13455
12100
|
// instead of at 0 so the timing matches.
|
|
13456
|
-
starts_at_s:
|
|
12101
|
+
starts_at_s: z9.number().optional(),
|
|
13457
12102
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
13458
12103
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
13459
|
-
identified_track:
|
|
12104
|
+
identified_track: z9.object({ title: z9.string().optional(), artist: z9.string().optional() }).loose().nullish()
|
|
13460
12105
|
}).loose().optional(),
|
|
13461
|
-
cast:
|
|
13462
|
-
|
|
13463
|
-
id:
|
|
13464
|
-
description:
|
|
12106
|
+
cast: z9.array(
|
|
12107
|
+
z9.object({
|
|
12108
|
+
id: z9.string().optional(),
|
|
12109
|
+
description: z9.string().optional(),
|
|
13465
12110
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
13466
12111
|
// French speaker") — read to derive the spoken-track language code.
|
|
13467
|
-
market_localization_note:
|
|
12112
|
+
market_localization_note: z9.string().optional()
|
|
13468
12113
|
}).loose()
|
|
13469
12114
|
).optional(),
|
|
13470
|
-
voiceover:
|
|
12115
|
+
voiceover: z9.object({
|
|
13471
12116
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
13472
12117
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
13473
|
-
mode:
|
|
13474
|
-
voice_description:
|
|
13475
|
-
persona:
|
|
12118
|
+
mode: z9.string().optional(),
|
|
12119
|
+
voice_description: z9.string().optional(),
|
|
12120
|
+
persona: z9.string().optional()
|
|
13476
12121
|
}).loose().optional(),
|
|
13477
12122
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
13478
12123
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
13479
|
-
style:
|
|
12124
|
+
style: z9.object({ palette: z9.array(z9.object({ hex: z9.string().optional() }).loose()).optional() }).loose().optional()
|
|
13480
12125
|
}).loose().optional(),
|
|
13481
|
-
scenes:
|
|
12126
|
+
scenes: z9.array(Scene).min(1)
|
|
13482
12127
|
}).loose();
|
|
13483
12128
|
function injectHookPhysicality(blueprint) {
|
|
13484
12129
|
for (const scene of blueprint.scenes) {
|
|
@@ -13488,26 +12133,26 @@ function injectHookPhysicality(blueprint) {
|
|
|
13488
12133
|
scene.start_frame_prompt = `${prompt} The subject's physical state IS the scroll-stopper \u2014 render it explicitly, not a calm pose: ${why}.`;
|
|
13489
12134
|
}
|
|
13490
12135
|
}
|
|
13491
|
-
var AppearsItem =
|
|
13492
|
-
var RecurringElement =
|
|
12136
|
+
var AppearsItem = z9.union([z9.number(), z9.object({ scene: z9.number(), edge: z9.string().optional() }).loose()]);
|
|
12137
|
+
var RecurringElement = z9.object({
|
|
13493
12138
|
// person | animal | product | logo | badge | other
|
|
13494
|
-
type:
|
|
13495
|
-
label:
|
|
13496
|
-
description:
|
|
13497
|
-
expression:
|
|
12139
|
+
type: z9.string(),
|
|
12140
|
+
label: z9.string().optional(),
|
|
12141
|
+
description: z9.string().optional(),
|
|
12142
|
+
expression: z9.string().nullable().optional(),
|
|
13498
12143
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
13499
|
-
cast_id:
|
|
12144
|
+
cast_id: z9.string().nullable().optional(),
|
|
13500
12145
|
// The label of another element that is the SAME individual as this one, shown
|
|
13501
12146
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
13502
12147
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
13503
12148
|
// slot, but the face/identity must stay identical across them.
|
|
13504
|
-
same_as:
|
|
12149
|
+
same_as: z9.string().nullable().optional(),
|
|
13505
12150
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
13506
12151
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
13507
|
-
scenes:
|
|
13508
|
-
appears_in:
|
|
12152
|
+
scenes: z9.array(z9.number()).optional(),
|
|
12153
|
+
appears_in: z9.array(AppearsItem).optional()
|
|
13509
12154
|
}).loose();
|
|
13510
|
-
var RecurringElements =
|
|
12155
|
+
var RecurringElements = z9.array(RecurringElement);
|
|
13511
12156
|
function sanitizeId2(raw, fallback) {
|
|
13512
12157
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
13513
12158
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -14970,25 +13615,25 @@ function buildSfxMusic(blueprint, nodes) {
|
|
|
14970
13615
|
}
|
|
14971
13616
|
return tracks;
|
|
14972
13617
|
}
|
|
14973
|
-
var OverlayStyle =
|
|
14974
|
-
var Overlay =
|
|
14975
|
-
text:
|
|
14976
|
-
appears_at_s:
|
|
14977
|
-
duration_s:
|
|
14978
|
-
position:
|
|
14979
|
-
role:
|
|
14980
|
-
animation:
|
|
14981
|
-
animation_detail:
|
|
13618
|
+
var OverlayStyle = z9.object({ color_hex: z9.string().optional(), background: z9.string().optional(), size: z9.string().optional() }).loose();
|
|
13619
|
+
var Overlay = z9.object({
|
|
13620
|
+
text: z9.string().optional(),
|
|
13621
|
+
appears_at_s: z9.number().optional(),
|
|
13622
|
+
duration_s: z9.number().optional(),
|
|
13623
|
+
position: z9.string().optional(),
|
|
13624
|
+
role: z9.string().optional(),
|
|
13625
|
+
animation: z9.string().optional(),
|
|
13626
|
+
animation_detail: z9.string().optional(),
|
|
14982
13627
|
style: OverlayStyle.optional()
|
|
14983
13628
|
}).loose();
|
|
14984
|
-
var FloatingElement =
|
|
14985
|
-
kind:
|
|
14986
|
-
description:
|
|
14987
|
-
brand_name:
|
|
14988
|
-
what_it_represents:
|
|
14989
|
-
appears_at_s:
|
|
14990
|
-
duration_s:
|
|
14991
|
-
position:
|
|
13629
|
+
var FloatingElement = z9.object({
|
|
13630
|
+
kind: z9.string().optional(),
|
|
13631
|
+
description: z9.string().optional(),
|
|
13632
|
+
brand_name: z9.string().nullish(),
|
|
13633
|
+
what_it_represents: z9.string().optional(),
|
|
13634
|
+
appears_at_s: z9.number().optional(),
|
|
13635
|
+
duration_s: z9.number().optional(),
|
|
13636
|
+
position: z9.string().optional()
|
|
14992
13637
|
}).loose();
|
|
14993
13638
|
function escapeHtml(s) {
|
|
14994
13639
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -15020,7 +13665,7 @@ function positionClass(position) {
|
|
|
15020
13665
|
function collectCaptions(blueprint) {
|
|
15021
13666
|
return blueprint.scenes.flatMap((scene) => {
|
|
15022
13667
|
const sceneStart = scene.start_s ?? 0;
|
|
15023
|
-
const overlays =
|
|
13668
|
+
const overlays = z9.array(Overlay).safeParse(scene.overlays ?? []);
|
|
15024
13669
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
15025
13670
|
const at = ov.appears_at_s ?? sceneStart;
|
|
15026
13671
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -15129,7 +13774,7 @@ function buildOverlayHtml(input) {
|
|
|
15129
13774
|
if (ovParts.length > 0) blocks.push(ovParts.join("\n"));
|
|
15130
13775
|
for (const scene of blueprint.scenes) {
|
|
15131
13776
|
const sceneStart = scene.start_s ?? 0;
|
|
15132
|
-
const floats =
|
|
13777
|
+
const floats = z9.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
15133
13778
|
const parts = (floats.success ? floats.data.map((fe) => floatingStub(fe, sceneStart)) : []).filter(Boolean);
|
|
15134
13779
|
const pip = uiPipStub(scene);
|
|
15135
13780
|
if (pip) parts.push(pip);
|
|
@@ -15386,8 +14031,8 @@ function buildMotionBoard(blueprint) {
|
|
|
15386
14031
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
15387
14032
|
cursor = end_s;
|
|
15388
14033
|
const spoken = sceneSpokenText(scene);
|
|
15389
|
-
const overlays =
|
|
15390
|
-
const floats =
|
|
14034
|
+
const overlays = z9.array(Overlay).safeParse(scene.overlays ?? []);
|
|
14035
|
+
const floats = z9.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
15391
14036
|
const graphics = [
|
|
15392
14037
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
15393
14038
|
kind: "text",
|
|
@@ -15828,7 +14473,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
|
|
|
15828
14473
|
return fail2("deconstruct", e instanceof Error ? e.message : String(e));
|
|
15829
14474
|
}
|
|
15830
14475
|
}
|
|
15831
|
-
var scaffoldVideoCommand =
|
|
14476
|
+
var scaffoldVideoCommand = defineCommand85({
|
|
15832
14477
|
meta: {
|
|
15833
14478
|
name: "scaffold-video",
|
|
15834
14479
|
description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to prompt.json as the editable 'prompt') and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit prompt.json, drop the real source images, then `baker canvas run`."
|
|
@@ -15973,7 +14618,7 @@ var scaffoldVideoCommand = defineCommand87({
|
|
|
15973
14618
|
// src/commands/canvas/set-prompt.ts
|
|
15974
14619
|
import { readFile as readFile7, writeFile as writeFile3 } from "fs/promises";
|
|
15975
14620
|
import path9 from "path";
|
|
15976
|
-
import { defineCommand as
|
|
14621
|
+
import { defineCommand as defineCommand86 } from "citty";
|
|
15977
14622
|
function setNodePrompt(canvas, nodeId, text) {
|
|
15978
14623
|
const nodes = canvas?.nodes;
|
|
15979
14624
|
if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
|
|
@@ -15988,7 +14633,7 @@ function setNodePrompt(canvas, nodeId, text) {
|
|
|
15988
14633
|
newNodes[idx] = newNode;
|
|
15989
14634
|
return { ...canvas, nodes: newNodes };
|
|
15990
14635
|
}
|
|
15991
|
-
var setPromptCommand =
|
|
14636
|
+
var setPromptCommand = defineCommand86({
|
|
15992
14637
|
meta: {
|
|
15993
14638
|
name: "set-prompt",
|
|
15994
14639
|
description: "Safely set a node's params.prompt (a frame description, motion prompt, etc.) without hand-editing the JSON. Prefer --text-file for multi-line/accented copy \u2014 it preserves UTF-8 exactly, unlike shell-quoted jq."
|
|
@@ -16048,8 +14693,8 @@ var setPromptCommand = defineCommand88({
|
|
|
16048
14693
|
// src/commands/canvas/validate.ts
|
|
16049
14694
|
import { readFile as readFile8 } from "fs/promises";
|
|
16050
14695
|
import path10 from "path";
|
|
16051
|
-
import { defineCommand as
|
|
16052
|
-
var validateCommand =
|
|
14696
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
14697
|
+
var validateCommand = defineCommand87({
|
|
16053
14698
|
meta: {
|
|
16054
14699
|
name: "validate",
|
|
16055
14700
|
description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
|
|
@@ -16092,7 +14737,7 @@ var validateCommand = defineCommand89({
|
|
|
16092
14737
|
});
|
|
16093
14738
|
|
|
16094
14739
|
// src/commands/canvas/index.ts
|
|
16095
|
-
var canvasCommand =
|
|
14740
|
+
var canvasCommand = defineCommand88({
|
|
16096
14741
|
meta: {
|
|
16097
14742
|
name: "canvas",
|
|
16098
14743
|
description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
|
|
@@ -16119,10 +14764,10 @@ Subcommands:
|
|
|
16119
14764
|
});
|
|
16120
14765
|
|
|
16121
14766
|
// src/commands/creatives/index.ts
|
|
16122
|
-
import { defineCommand as
|
|
14767
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
16123
14768
|
|
|
16124
14769
|
// src/commands/creatives/publish.ts
|
|
16125
|
-
import { defineCommand as
|
|
14770
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
16126
14771
|
|
|
16127
14772
|
// src/commands/images/api.ts
|
|
16128
14773
|
import { readFile as readFile9 } from "fs/promises";
|
|
@@ -16245,7 +14890,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
|
|
|
16245
14890
|
sourceReferenceUrl
|
|
16246
14891
|
});
|
|
16247
14892
|
}
|
|
16248
|
-
var publishCommand =
|
|
14893
|
+
var publishCommand = defineCommand89({
|
|
16249
14894
|
meta: {
|
|
16250
14895
|
name: "publish",
|
|
16251
14896
|
description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
|
|
@@ -16291,7 +14936,7 @@ var publishCommand = defineCommand91({
|
|
|
16291
14936
|
});
|
|
16292
14937
|
|
|
16293
14938
|
// src/commands/creatives/index.ts
|
|
16294
|
-
var creativesCommand3 =
|
|
14939
|
+
var creativesCommand3 = defineCommand90({
|
|
16295
14940
|
meta: {
|
|
16296
14941
|
name: "creatives",
|
|
16297
14942
|
description: `Publish static ad creatives as first-class Baker outputs.
|
|
@@ -16307,10 +14952,10 @@ Publishing uploads the image to the Company image library, applies the official
|
|
|
16307
14952
|
});
|
|
16308
14953
|
|
|
16309
14954
|
// src/commands/ga4/index.ts
|
|
16310
|
-
import { defineCommand as
|
|
14955
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
16311
14956
|
|
|
16312
14957
|
// src/commands/ga4/audit.ts
|
|
16313
|
-
import { defineCommand as
|
|
14958
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
16314
14959
|
|
|
16315
14960
|
// src/commands/ga4/resolve.ts
|
|
16316
14961
|
async function fetchProperties(useCache = true) {
|
|
@@ -16373,7 +15018,7 @@ registerSchema({
|
|
|
16373
15018
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
16374
15019
|
}
|
|
16375
15020
|
});
|
|
16376
|
-
var auditCommand2 =
|
|
15021
|
+
var auditCommand2 = defineCommand91({
|
|
16377
15022
|
meta: {
|
|
16378
15023
|
name: "audit",
|
|
16379
15024
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -16425,7 +15070,7 @@ Examples:
|
|
|
16425
15070
|
});
|
|
16426
15071
|
|
|
16427
15072
|
// src/commands/ga4/properties.ts
|
|
16428
|
-
import { defineCommand as
|
|
15073
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
16429
15074
|
registerSchema({
|
|
16430
15075
|
command: "ga4.properties",
|
|
16431
15076
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -16433,7 +15078,7 @@ registerSchema({
|
|
|
16433
15078
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
16434
15079
|
}
|
|
16435
15080
|
});
|
|
16436
|
-
var propertiesCommand =
|
|
15081
|
+
var propertiesCommand = defineCommand92({
|
|
16437
15082
|
meta: {
|
|
16438
15083
|
name: "properties",
|
|
16439
15084
|
description: `List accessible GA4 properties.
|
|
@@ -16481,9 +15126,9 @@ Examples:
|
|
|
16481
15126
|
});
|
|
16482
15127
|
|
|
16483
15128
|
// src/commands/ga4/query.ts
|
|
16484
|
-
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as
|
|
15129
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
|
|
16485
15130
|
import { resolve as resolve2 } from "path";
|
|
16486
|
-
import { defineCommand as
|
|
15131
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
16487
15132
|
|
|
16488
15133
|
// src/commands/ga4/presets.ts
|
|
16489
15134
|
var GA4_PRESETS = [
|
|
@@ -16572,7 +15217,7 @@ function writeRowsToFile2(filePath, rows, append) {
|
|
|
16572
15217
|
writeFileSync4(filePath, content, "utf-8");
|
|
16573
15218
|
}
|
|
16574
15219
|
} else if (append && existsSync5(filePath)) {
|
|
16575
|
-
const existing = JSON.parse(
|
|
15220
|
+
const existing = JSON.parse(readFileSync8(filePath, "utf-8"));
|
|
16576
15221
|
writeFileSync4(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
|
|
16577
15222
|
} else {
|
|
16578
15223
|
writeFileSync4(filePath, JSON.stringify(rows, null, 2), "utf-8");
|
|
@@ -16615,7 +15260,7 @@ function handleError(err) {
|
|
|
16615
15260
|
});
|
|
16616
15261
|
process.exit(1);
|
|
16617
15262
|
}
|
|
16618
|
-
var queryCommand2 =
|
|
15263
|
+
var queryCommand2 = defineCommand93({
|
|
16619
15264
|
meta: {
|
|
16620
15265
|
name: "query",
|
|
16621
15266
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -16686,7 +15331,7 @@ Free-form (escape hatch):
|
|
|
16686
15331
|
});
|
|
16687
15332
|
|
|
16688
15333
|
// src/commands/ga4/index.ts
|
|
16689
|
-
var ga4Command =
|
|
15334
|
+
var ga4Command = defineCommand94({
|
|
16690
15335
|
meta: {
|
|
16691
15336
|
name: "ga4",
|
|
16692
15337
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -16709,12 +15354,12 @@ Examples:
|
|
|
16709
15354
|
});
|
|
16710
15355
|
|
|
16711
15356
|
// src/commands/gsc/index.ts
|
|
16712
|
-
import { defineCommand as
|
|
15357
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
16713
15358
|
|
|
16714
15359
|
// src/commands/gsc/query.ts
|
|
16715
|
-
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as
|
|
15360
|
+
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
|
|
16716
15361
|
import { resolve as resolve3 } from "path";
|
|
16717
|
-
import { defineCommand as
|
|
15362
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
16718
15363
|
|
|
16719
15364
|
// src/commands/gsc/presets.ts
|
|
16720
15365
|
var GSC_PRESETS = [
|
|
@@ -16857,7 +15502,7 @@ function writeRowsToFile3(filePath, rows, append) {
|
|
|
16857
15502
|
writeFileSync5(filePath, content, "utf-8");
|
|
16858
15503
|
}
|
|
16859
15504
|
} else if (append && existsSync6(filePath)) {
|
|
16860
|
-
const existing = JSON.parse(
|
|
15505
|
+
const existing = JSON.parse(readFileSync9(filePath, "utf-8"));
|
|
16861
15506
|
writeFileSync5(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
|
|
16862
15507
|
} else {
|
|
16863
15508
|
writeFileSync5(filePath, JSON.stringify(rows, null, 2), "utf-8");
|
|
@@ -16902,7 +15547,7 @@ function handleError2(err) {
|
|
|
16902
15547
|
});
|
|
16903
15548
|
process.exit(1);
|
|
16904
15549
|
}
|
|
16905
|
-
var queryCommand3 =
|
|
15550
|
+
var queryCommand3 = defineCommand95({
|
|
16906
15551
|
meta: {
|
|
16907
15552
|
name: "query",
|
|
16908
15553
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -16980,7 +15625,7 @@ Free-form (escape hatch):
|
|
|
16980
15625
|
});
|
|
16981
15626
|
|
|
16982
15627
|
// src/commands/gsc/sitemaps.ts
|
|
16983
|
-
import { defineCommand as
|
|
15628
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
16984
15629
|
registerSchema({
|
|
16985
15630
|
command: "gsc.sitemaps",
|
|
16986
15631
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -16989,7 +15634,7 @@ registerSchema({
|
|
|
16989
15634
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
16990
15635
|
}
|
|
16991
15636
|
});
|
|
16992
|
-
var sitemapsCommand =
|
|
15637
|
+
var sitemapsCommand = defineCommand96({
|
|
16993
15638
|
meta: {
|
|
16994
15639
|
name: "sitemaps",
|
|
16995
15640
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -17039,7 +15684,7 @@ Examples:
|
|
|
17039
15684
|
});
|
|
17040
15685
|
|
|
17041
15686
|
// src/commands/gsc/sites.ts
|
|
17042
|
-
import { defineCommand as
|
|
15687
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
17043
15688
|
registerSchema({
|
|
17044
15689
|
command: "gsc.sites",
|
|
17045
15690
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -17047,7 +15692,7 @@ registerSchema({
|
|
|
17047
15692
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
17048
15693
|
}
|
|
17049
15694
|
});
|
|
17050
|
-
var sitesCommand =
|
|
15695
|
+
var sitesCommand = defineCommand97({
|
|
17051
15696
|
meta: {
|
|
17052
15697
|
name: "sites",
|
|
17053
15698
|
description: `List verified Search Console sites.
|
|
@@ -17095,7 +15740,7 @@ Examples:
|
|
|
17095
15740
|
});
|
|
17096
15741
|
|
|
17097
15742
|
// src/commands/gsc/index.ts
|
|
17098
|
-
var gscCommand =
|
|
15743
|
+
var gscCommand = defineCommand98({
|
|
17099
15744
|
meta: {
|
|
17100
15745
|
name: "gsc",
|
|
17101
15746
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -17118,10 +15763,10 @@ Examples:
|
|
|
17118
15763
|
});
|
|
17119
15764
|
|
|
17120
15765
|
// src/commands/images/index.ts
|
|
17121
|
-
import { defineCommand as
|
|
15766
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
17122
15767
|
|
|
17123
15768
|
// src/commands/images/crop.ts
|
|
17124
|
-
import { defineCommand as
|
|
15769
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
17125
15770
|
|
|
17126
15771
|
// src/lib/image/crop-sprite.ts
|
|
17127
15772
|
import sharp from "sharp";
|
|
@@ -17246,7 +15891,7 @@ function emitError2(err) {
|
|
|
17246
15891
|
}
|
|
17247
15892
|
process.exit(1);
|
|
17248
15893
|
}
|
|
17249
|
-
var cropCommand =
|
|
15894
|
+
var cropCommand = defineCommand99({
|
|
17250
15895
|
meta: {
|
|
17251
15896
|
name: "crop",
|
|
17252
15897
|
description: "Crop a rectangular region from an image.\n\nExample: baker images crop sprite.png --x 0 --y 0 --width 64 --height 64 --output icon.png"
|
|
@@ -17282,7 +15927,7 @@ var cropCommand = defineCommand101({
|
|
|
17282
15927
|
});
|
|
17283
15928
|
|
|
17284
15929
|
// src/commands/images/delete.ts
|
|
17285
|
-
import { defineCommand as
|
|
15930
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
17286
15931
|
registerSchema({
|
|
17287
15932
|
command: "images.delete",
|
|
17288
15933
|
description: "Delete an image by ID",
|
|
@@ -17296,7 +15941,7 @@ registerSchema({
|
|
|
17296
15941
|
}
|
|
17297
15942
|
}
|
|
17298
15943
|
});
|
|
17299
|
-
var deleteCommand =
|
|
15944
|
+
var deleteCommand = defineCommand100({
|
|
17300
15945
|
meta: {
|
|
17301
15946
|
name: "delete",
|
|
17302
15947
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -17337,7 +15982,7 @@ var deleteCommand = defineCommand102({
|
|
|
17337
15982
|
});
|
|
17338
15983
|
|
|
17339
15984
|
// src/commands/images/dimensions.ts
|
|
17340
|
-
import { defineCommand as
|
|
15985
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
17341
15986
|
|
|
17342
15987
|
// src/lib/image/dimensions.ts
|
|
17343
15988
|
import { imageSize } from "image-size";
|
|
@@ -17360,7 +16005,7 @@ registerSchema({
|
|
|
17360
16005
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
17361
16006
|
}
|
|
17362
16007
|
});
|
|
17363
|
-
var dimensionsCommand =
|
|
16008
|
+
var dimensionsCommand = defineCommand101({
|
|
17364
16009
|
meta: {
|
|
17365
16010
|
name: "dimensions",
|
|
17366
16011
|
description: "Read image dimensions without decoding the full file.\n\nExample: baker images dimensions ./logo.png\nExample: baker images dimensions https://acme.com/hero.png"
|
|
@@ -17404,7 +16049,7 @@ var dimensionsCommand = defineCommand103({
|
|
|
17404
16049
|
});
|
|
17405
16050
|
|
|
17406
16051
|
// src/commands/images/extract.ts
|
|
17407
|
-
import { defineCommand as
|
|
16052
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
17408
16053
|
registerSchema({
|
|
17409
16054
|
command: "images.extract",
|
|
17410
16055
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -17420,7 +16065,7 @@ registerSchema({
|
|
|
17420
16065
|
}
|
|
17421
16066
|
}
|
|
17422
16067
|
});
|
|
17423
|
-
var extractCommand =
|
|
16068
|
+
var extractCommand = defineCommand102({
|
|
17424
16069
|
meta: {
|
|
17425
16070
|
name: "extract",
|
|
17426
16071
|
description: "Pull every image from a single URL via Firecrawl. ~$0.001/scrape. Cap auto-ingest at 20.\n\nExample: baker images extract https://stripe.com --auto-ingest 5"
|
|
@@ -17458,7 +16103,7 @@ var extractCommand = defineCommand104({
|
|
|
17458
16103
|
});
|
|
17459
16104
|
|
|
17460
16105
|
// src/commands/images/find.ts
|
|
17461
|
-
import { defineCommand as
|
|
16106
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
17462
16107
|
registerSchema({
|
|
17463
16108
|
command: "images.find",
|
|
17464
16109
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -17490,7 +16135,7 @@ registerSchema({
|
|
|
17490
16135
|
}
|
|
17491
16136
|
}
|
|
17492
16137
|
});
|
|
17493
|
-
var findCommand =
|
|
16138
|
+
var findCommand = defineCommand103({
|
|
17494
16139
|
meta: {
|
|
17495
16140
|
name: "find",
|
|
17496
16141
|
description: "Library-first fanout image search. Opt in to providers with --sources. `--fallback` short-circuits to externals only when library is thin. With --auto-ingest, ingested external hits return Baker-owned URLs.\n\nExample: baker images find 'office' --sources library,magnific --limit 20"
|
|
@@ -17539,7 +16184,7 @@ var findCommand = defineCommand105({
|
|
|
17539
16184
|
|
|
17540
16185
|
// src/commands/images/generate.ts
|
|
17541
16186
|
import { readFile as readFile11 } from "fs/promises";
|
|
17542
|
-
import { defineCommand as
|
|
16187
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
17543
16188
|
import sharp2 from "sharp";
|
|
17544
16189
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
17545
16190
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -17642,7 +16287,7 @@ async function resolveReferences(spec) {
|
|
|
17642
16287
|
}
|
|
17643
16288
|
return out;
|
|
17644
16289
|
}
|
|
17645
|
-
var generateCommand =
|
|
16290
|
+
var generateCommand = defineCommand104({
|
|
17646
16291
|
meta: {
|
|
17647
16292
|
name: "generate",
|
|
17648
16293
|
description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: openai/gpt-5.4-image-2 (default \u2014 photoreal, cleanest text, best for ad/landing reproduction), google/gemini-3-pro-image-preview (Nano Banana Pro), google/gemini-3.5-flash & google/gemini-3.1-flash-image-preview (fast, extreme aspect ratios), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model google/gemini-3-pro-image-preview --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
|
|
@@ -17694,7 +16339,7 @@ var generateCommand = defineCommand106({
|
|
|
17694
16339
|
});
|
|
17695
16340
|
|
|
17696
16341
|
// src/commands/images/get.ts
|
|
17697
|
-
import { defineCommand as
|
|
16342
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
17698
16343
|
registerSchema({
|
|
17699
16344
|
command: "images.get",
|
|
17700
16345
|
description: "Get a single image by ID",
|
|
@@ -17702,7 +16347,7 @@ registerSchema({
|
|
|
17702
16347
|
id: { type: "string", description: "Image ID", required: true }
|
|
17703
16348
|
}
|
|
17704
16349
|
});
|
|
17705
|
-
var getCommand2 =
|
|
16350
|
+
var getCommand2 = defineCommand105({
|
|
17706
16351
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
17707
16352
|
args: {
|
|
17708
16353
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -17738,7 +16383,7 @@ var getCommand2 = defineCommand107({
|
|
|
17738
16383
|
});
|
|
17739
16384
|
|
|
17740
16385
|
// src/commands/images/gif.ts
|
|
17741
|
-
import { defineCommand as
|
|
16386
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
17742
16387
|
registerSchema({
|
|
17743
16388
|
command: "images.gif",
|
|
17744
16389
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -17770,7 +16415,7 @@ registerSchema({
|
|
|
17770
16415
|
}
|
|
17771
16416
|
}
|
|
17772
16417
|
});
|
|
17773
|
-
var gifCommand =
|
|
16418
|
+
var gifCommand = defineCommand106({
|
|
17774
16419
|
meta: {
|
|
17775
16420
|
name: "gif",
|
|
17776
16421
|
description: "Search Giphy for GIFs / reaction memes \u2014 built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25"
|
|
@@ -17817,7 +16462,7 @@ var gifCommand = defineCommand108({
|
|
|
17817
16462
|
});
|
|
17818
16463
|
|
|
17819
16464
|
// src/commands/images/google.ts
|
|
17820
|
-
import { defineCommand as
|
|
16465
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
17821
16466
|
registerSchema({
|
|
17822
16467
|
command: "images.google",
|
|
17823
16468
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -17853,7 +16498,7 @@ registerSchema({
|
|
|
17853
16498
|
}
|
|
17854
16499
|
}
|
|
17855
16500
|
});
|
|
17856
|
-
var googleCommand2 =
|
|
16501
|
+
var googleCommand2 = defineCommand107({
|
|
17857
16502
|
meta: {
|
|
17858
16503
|
name: "google",
|
|
17859
16504
|
description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). \u26A0 Source unverified \u2014 watermarks, low-res, mislabeled results are common. Use as last resort. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20"
|
|
@@ -17901,7 +16546,7 @@ var googleCommand2 = defineCommand109({
|
|
|
17901
16546
|
});
|
|
17902
16547
|
|
|
17903
16548
|
// src/commands/images/icon.ts
|
|
17904
|
-
import { defineCommand as
|
|
16549
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
17905
16550
|
registerSchema({
|
|
17906
16551
|
command: "images.icon",
|
|
17907
16552
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -17927,7 +16572,7 @@ registerSchema({
|
|
|
17927
16572
|
}
|
|
17928
16573
|
}
|
|
17929
16574
|
});
|
|
17930
|
-
var iconCommand =
|
|
16575
|
+
var iconCommand = defineCommand108({
|
|
17931
16576
|
meta: {
|
|
17932
16577
|
name: "icon",
|
|
17933
16578
|
description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, \u2026). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'"
|
|
@@ -17967,7 +16612,7 @@ var iconCommand = defineCommand110({
|
|
|
17967
16612
|
});
|
|
17968
16613
|
|
|
17969
16614
|
// src/commands/images/ingest.ts
|
|
17970
|
-
import { defineCommand as
|
|
16615
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
17971
16616
|
registerSchema({
|
|
17972
16617
|
command: "images.ingest",
|
|
17973
16618
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -17979,7 +16624,7 @@ registerSchema({
|
|
|
17979
16624
|
context: { type: "string", description: "Description context hint", required: false }
|
|
17980
16625
|
}
|
|
17981
16626
|
});
|
|
17982
|
-
var ingestCommand =
|
|
16627
|
+
var ingestCommand = defineCommand109({
|
|
17983
16628
|
meta: {
|
|
17984
16629
|
name: "ingest",
|
|
17985
16630
|
description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345"
|
|
@@ -18021,7 +16666,7 @@ var ingestCommand = defineCommand111({
|
|
|
18021
16666
|
});
|
|
18022
16667
|
|
|
18023
16668
|
// src/commands/images/library.ts
|
|
18024
|
-
import { defineCommand as
|
|
16669
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
18025
16670
|
registerSchema({
|
|
18026
16671
|
command: "images.library",
|
|
18027
16672
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -18047,7 +16692,7 @@ registerSchema({
|
|
|
18047
16692
|
}
|
|
18048
16693
|
}
|
|
18049
16694
|
});
|
|
18050
|
-
var libraryCommand =
|
|
16695
|
+
var libraryCommand = defineCommand110({
|
|
18051
16696
|
meta: {
|
|
18052
16697
|
name: "library",
|
|
18053
16698
|
description: "Search the company image library (hybrid BM25 + vector + Cohere rerank). Use this BEFORE any external provider.\n\nExample: baker images library 'hero banner' --aspect-ratio 16:9 --source magnific"
|
|
@@ -18104,7 +16749,7 @@ var libraryCommand = defineCommand112({
|
|
|
18104
16749
|
});
|
|
18105
16750
|
|
|
18106
16751
|
// src/commands/images/logo.ts
|
|
18107
|
-
import { defineCommand as
|
|
16752
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
18108
16753
|
registerSchema({
|
|
18109
16754
|
command: "images.logo",
|
|
18110
16755
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -18129,7 +16774,7 @@ registerSchema({
|
|
|
18129
16774
|
}
|
|
18130
16775
|
}
|
|
18131
16776
|
});
|
|
18132
|
-
var logoCommand =
|
|
16777
|
+
var logoCommand = defineCommand111({
|
|
18133
16778
|
meta: {
|
|
18134
16779
|
name: "logo",
|
|
18135
16780
|
description: "Brand logo via Brandfetch CDN. Returns up to 5 variants (icon, light/dark logo, light/dark symbol). Auto-ingests the first variant.\n\nExample: baker images logo stripe.com --variant logo"
|
|
@@ -18167,7 +16812,7 @@ var logoCommand = defineCommand113({
|
|
|
18167
16812
|
});
|
|
18168
16813
|
|
|
18169
16814
|
// src/commands/images/normalize.ts
|
|
18170
|
-
import { defineCommand as
|
|
16815
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
18171
16816
|
|
|
18172
16817
|
// src/lib/image/color-changer.ts
|
|
18173
16818
|
import quantize from "quantize";
|
|
@@ -18899,7 +17544,7 @@ function coerceRawArgs(args) {
|
|
|
18899
17544
|
"dry-run": bool(args["dry-run"])
|
|
18900
17545
|
};
|
|
18901
17546
|
}
|
|
18902
|
-
var normalizeCommand =
|
|
17547
|
+
var normalizeCommand = defineCommand112({
|
|
18903
17548
|
meta: {
|
|
18904
17549
|
name: "normalize",
|
|
18905
17550
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -18954,7 +17599,7 @@ Examples:
|
|
|
18954
17599
|
});
|
|
18955
17600
|
|
|
18956
17601
|
// src/commands/images/pinterest.ts
|
|
18957
|
-
import { defineCommand as
|
|
17602
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
18958
17603
|
registerSchema({
|
|
18959
17604
|
command: "images.pinterest",
|
|
18960
17605
|
description: "Pinterest image search via ScrapeCreators. Reference-grade real-world photography, product styling, interiors, fashion, food, and aesthetic mood boards. Inspect before placing \u2014 Pinterest is unverified, trademark-bearing web content.",
|
|
@@ -18974,7 +17619,7 @@ registerSchema({
|
|
|
18974
17619
|
}
|
|
18975
17620
|
}
|
|
18976
17621
|
});
|
|
18977
|
-
var pinterestCommand =
|
|
17622
|
+
var pinterestCommand = defineCommand113({
|
|
18978
17623
|
meta: {
|
|
18979
17624
|
name: "pinterest",
|
|
18980
17625
|
description: "Pinterest image search via ScrapeCreators ($0.00188/request). Best for photo-realistic reference imagery \u2014 lifestyle, interiors, fashion, food, product styling, and mood boards to brief AI generation against. \u26A0 Unverified, trademark-bearing web content \u2014 inspect and respect rights before placing on a customer page. Browse first; auto-ingest only the pins you commit to.\n\nExamples:\n baker images pinterest 'scandinavian living room'\n baker images pinterest 'minimalist skincare product photography' --limit 20\n baker images pinterest 'cozy coffee shop interior' --auto-ingest 2 --context 'Mood reference for hero photography'"
|
|
@@ -19014,7 +17659,7 @@ var pinterestCommand = defineCommand115({
|
|
|
19014
17659
|
});
|
|
19015
17660
|
|
|
19016
17661
|
// src/commands/images/screenshot.ts
|
|
19017
|
-
import { defineCommand as
|
|
17662
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
19018
17663
|
registerSchema({
|
|
19019
17664
|
command: "images.screenshot",
|
|
19020
17665
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -19030,7 +17675,7 @@ registerSchema({
|
|
|
19030
17675
|
}
|
|
19031
17676
|
}
|
|
19032
17677
|
});
|
|
19033
|
-
var screenshotCommand =
|
|
17678
|
+
var screenshotCommand = defineCommand114({
|
|
19034
17679
|
meta: {
|
|
19035
17680
|
name: "screenshot",
|
|
19036
17681
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -19080,7 +17725,7 @@ var screenshotCommand = defineCommand116({
|
|
|
19080
17725
|
});
|
|
19081
17726
|
|
|
19082
17727
|
// src/commands/images/search.ts
|
|
19083
|
-
import { defineCommand as
|
|
17728
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
19084
17729
|
registerSchema({
|
|
19085
17730
|
command: "images.search",
|
|
19086
17731
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -19096,7 +17741,7 @@ registerSchema({
|
|
|
19096
17741
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
19097
17742
|
}
|
|
19098
17743
|
});
|
|
19099
|
-
var searchCommand =
|
|
17744
|
+
var searchCommand = defineCommand115({
|
|
19100
17745
|
meta: {
|
|
19101
17746
|
name: "search",
|
|
19102
17747
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -19156,7 +17801,7 @@ var searchCommand = defineCommand117({
|
|
|
19156
17801
|
});
|
|
19157
17802
|
|
|
19158
17803
|
// src/commands/images/sticker.ts
|
|
19159
|
-
import { defineCommand as
|
|
17804
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
19160
17805
|
registerSchema({
|
|
19161
17806
|
command: "images.sticker",
|
|
19162
17807
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -19188,7 +17833,7 @@ registerSchema({
|
|
|
19188
17833
|
}
|
|
19189
17834
|
}
|
|
19190
17835
|
});
|
|
19191
|
-
var stickerCommand =
|
|
17836
|
+
var stickerCommand = defineCommand116({
|
|
19192
17837
|
meta: {
|
|
19193
17838
|
name: "sticker",
|
|
19194
17839
|
description: "Search Giphy's sticker corpus \u2014 transparent-background WebPs / GIFs ideal for overlaying on ad creative (Meta, TikTok, Stories). Same Giphy free API as `baker images gif`; results carry WebP + GIF + MP4 URLs in providerMeta.\n\nExample: baker images sticker 'thumbs up' --limit 10\nExample: baker images sticker celebration --rating g --auto-ingest 3\nExample: baker images sticker --trending --limit 25"
|
|
@@ -19235,7 +17880,7 @@ var stickerCommand = defineCommand118({
|
|
|
19235
17880
|
});
|
|
19236
17881
|
|
|
19237
17882
|
// src/commands/images/stock.ts
|
|
19238
|
-
import { defineCommand as
|
|
17883
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
19239
17884
|
registerSchema({
|
|
19240
17885
|
command: "images.stock",
|
|
19241
17886
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -19293,7 +17938,7 @@ registerSchema({
|
|
|
19293
17938
|
}
|
|
19294
17939
|
}
|
|
19295
17940
|
});
|
|
19296
|
-
var stockCommand =
|
|
17941
|
+
var stockCommand = defineCommand117({
|
|
19297
17942
|
meta: {
|
|
19298
17943
|
name: "stock",
|
|
19299
17944
|
description: "Stock search via Magnific \u2014 Freepik's developer API (~250M assets: photos, vectors, illustrations, icons, PSDs). $0.002/req. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExamples:\n baker images stock 'minimalist office'\n baker images stock 'flat office workers' --type vector\n baker images stock 'hero photo of a kitchen' --type photo --orientation landscape --ai exclude\n baker images stock 'brand pattern' --color '#0a0a0a' --license freemium --auto-ingest 2"
|
|
@@ -19349,7 +17994,7 @@ var stockCommand = defineCommand119({
|
|
|
19349
17994
|
});
|
|
19350
17995
|
|
|
19351
17996
|
// src/lib/tags-command.ts
|
|
19352
|
-
import { defineCommand as
|
|
17997
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
19353
17998
|
function makeTagsCommand(command, label, endpoint) {
|
|
19354
17999
|
registerSchema({
|
|
19355
18000
|
command: `${command}.tags`,
|
|
@@ -19358,7 +18003,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
19358
18003
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
19359
18004
|
}
|
|
19360
18005
|
});
|
|
19361
|
-
return
|
|
18006
|
+
return defineCommand118({
|
|
19362
18007
|
meta: {
|
|
19363
18008
|
name: "tags",
|
|
19364
18009
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -19394,7 +18039,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
19394
18039
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
19395
18040
|
|
|
19396
18041
|
// src/commands/images/upload.ts
|
|
19397
|
-
import { defineCommand as
|
|
18042
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
19398
18043
|
registerSchema({
|
|
19399
18044
|
command: "images.upload",
|
|
19400
18045
|
description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
|
|
@@ -19432,7 +18077,7 @@ registerSchema({
|
|
|
19432
18077
|
function isRemoteUrl2(value) {
|
|
19433
18078
|
return /^https?:\/\//i.test(value);
|
|
19434
18079
|
}
|
|
19435
|
-
var uploadCommand =
|
|
18080
|
+
var uploadCommand = defineCommand119({
|
|
19436
18081
|
meta: {
|
|
19437
18082
|
name: "upload",
|
|
19438
18083
|
description: "Upload an image to the library \u2014 accepts a local file path OR a remote http(s) URL.\n\nLocal: reads bytes, sends to /api/images/upload, content-type auto-detected from extension.\nRemote: dispatches to /api/images/ingest with hash-dedup on bytes + externalId.\n\nExamples:\n baker images upload ./logo.png --source uploaded\n baker images upload ./cert.png --context 'ISO 27001 badge \u2014 enterprise tier'\n baker images upload https://acme.com/hero.png --source firecrawl --context 'Acme competitor pricing hero'"
|
|
@@ -19525,7 +18170,7 @@ async function uploadLocal(target, args) {
|
|
|
19525
18170
|
}
|
|
19526
18171
|
|
|
19527
18172
|
// src/commands/images/upscale.ts
|
|
19528
|
-
import { defineCommand as
|
|
18173
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
19529
18174
|
registerSchema({
|
|
19530
18175
|
command: "images.upscale",
|
|
19531
18176
|
description: "Upscale a library image via the backend (Replicate, cost-tracked). Waits for completion by default. The image must be status 'ready' and raster (not SVG/AVIF).",
|
|
@@ -19540,7 +18185,7 @@ registerSchema({
|
|
|
19540
18185
|
}
|
|
19541
18186
|
});
|
|
19542
18187
|
var POLL_INTERVAL_MS3 = 1500;
|
|
19543
|
-
var upscaleCommand =
|
|
18188
|
+
var upscaleCommand = defineCommand120({
|
|
19544
18189
|
meta: {
|
|
19545
18190
|
name: "upscale",
|
|
19546
18191
|
description: "Upscale a library image via the Convex backend (Replicate, cost-tracked at $0.05/image). Waits for completion by default.\n\nExample: baker images upscale j571abc123def\nExample: baker images upscale j571abc123def --max-wait 0 # fire-and-forget"
|
|
@@ -19595,7 +18240,7 @@ var upscaleCommand = defineCommand122({
|
|
|
19595
18240
|
});
|
|
19596
18241
|
|
|
19597
18242
|
// src/commands/images/use.ts
|
|
19598
|
-
import { defineCommand as
|
|
18243
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
19599
18244
|
registerSchema({
|
|
19600
18245
|
command: "images.use",
|
|
19601
18246
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -19611,7 +18256,7 @@ registerSchema({
|
|
|
19611
18256
|
}
|
|
19612
18257
|
});
|
|
19613
18258
|
var POLL_INTERVAL_MS4 = 1500;
|
|
19614
|
-
var useCommand =
|
|
18259
|
+
var useCommand = defineCommand121({
|
|
19615
18260
|
meta: {
|
|
19616
18261
|
name: "use",
|
|
19617
18262
|
description: "Sugar over `ingest`: download \u2192 store \u2192 wait until describe + embed complete \u2192 return ready library record.\n\nExample: baker images use https://cdn.example.com/hero.png --source uploaded"
|
|
@@ -19657,7 +18302,7 @@ var useCommand = defineCommand123({
|
|
|
19657
18302
|
});
|
|
19658
18303
|
|
|
19659
18304
|
// src/commands/images/index.ts
|
|
19660
|
-
var imagesCommand =
|
|
18305
|
+
var imagesCommand = defineCommand122({
|
|
19661
18306
|
meta: {
|
|
19662
18307
|
name: "images",
|
|
19663
18308
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -19727,10 +18372,10 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
19727
18372
|
});
|
|
19728
18373
|
|
|
19729
18374
|
// src/commands/research/index.ts
|
|
19730
|
-
import { defineCommand as
|
|
18375
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
19731
18376
|
|
|
19732
18377
|
// src/commands/research/advertisers.ts
|
|
19733
|
-
import { defineCommand as
|
|
18378
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
19734
18379
|
|
|
19735
18380
|
// src/commands/research/output.ts
|
|
19736
18381
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -19843,7 +18488,7 @@ var FIELDS3 = {
|
|
|
19843
18488
|
etv: "Estimated traffic value (USD)",
|
|
19844
18489
|
visibility: "SERP visibility score (0-1)"
|
|
19845
18490
|
};
|
|
19846
|
-
var advertisersCommand =
|
|
18491
|
+
var advertisersCommand = defineCommand123({
|
|
19847
18492
|
meta: {
|
|
19848
18493
|
name: "advertisers",
|
|
19849
18494
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -19890,7 +18535,7 @@ Examples:
|
|
|
19890
18535
|
});
|
|
19891
18536
|
|
|
19892
18537
|
// src/commands/research/autocomplete.ts
|
|
19893
|
-
import { defineCommand as
|
|
18538
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
19894
18539
|
registerSchema({
|
|
19895
18540
|
command: "research.autocomplete",
|
|
19896
18541
|
description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -19913,7 +18558,7 @@ registerSchema({
|
|
|
19913
18558
|
var FIELDS4 = {
|
|
19914
18559
|
suggestion: "Autocomplete suggestion from Google"
|
|
19915
18560
|
};
|
|
19916
|
-
var autocompleteCommand =
|
|
18561
|
+
var autocompleteCommand = defineCommand124({
|
|
19917
18562
|
meta: {
|
|
19918
18563
|
name: "autocomplete",
|
|
19919
18564
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -19959,7 +18604,7 @@ Examples:
|
|
|
19959
18604
|
});
|
|
19960
18605
|
|
|
19961
18606
|
// src/commands/research/countries.ts
|
|
19962
|
-
import { defineCommand as
|
|
18607
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
19963
18608
|
registerSchema({
|
|
19964
18609
|
command: "research.countries",
|
|
19965
18610
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -20016,7 +18661,7 @@ var FIELDS5 = {
|
|
|
20016
18661
|
code: "Country code to pass as --location",
|
|
20017
18662
|
name: "Country name"
|
|
20018
18663
|
};
|
|
20019
|
-
var countriesCommand =
|
|
18664
|
+
var countriesCommand = defineCommand125({
|
|
20020
18665
|
meta: {
|
|
20021
18666
|
name: "countries",
|
|
20022
18667
|
description: "List all supported country codes for --location flag."
|
|
@@ -20027,7 +18672,7 @@ var countriesCommand = defineCommand127({
|
|
|
20027
18672
|
});
|
|
20028
18673
|
|
|
20029
18674
|
// src/commands/research/intent.ts
|
|
20030
|
-
import { defineCommand as
|
|
18675
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
20031
18676
|
registerSchema({
|
|
20032
18677
|
command: "research.intent",
|
|
20033
18678
|
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
|
|
@@ -20050,7 +18695,7 @@ var FIELDS6 = {
|
|
|
20050
18695
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
20051
18696
|
probability: "Confidence score 0.0-1.0"
|
|
20052
18697
|
};
|
|
20053
|
-
var intentCommand =
|
|
18698
|
+
var intentCommand = defineCommand126({
|
|
20054
18699
|
meta: {
|
|
20055
18700
|
name: "intent",
|
|
20056
18701
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -20098,7 +18743,7 @@ Examples:
|
|
|
20098
18743
|
});
|
|
20099
18744
|
|
|
20100
18745
|
// src/commands/research/keyword-gap.ts
|
|
20101
|
-
import { defineCommand as
|
|
18746
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
20102
18747
|
registerSchema({
|
|
20103
18748
|
command: "research.keyword-gap",
|
|
20104
18749
|
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -20127,7 +18772,7 @@ var FIELDS7 = {
|
|
|
20127
18772
|
cpc: "Cost per click USD",
|
|
20128
18773
|
their_position: "Competitor's ranking position"
|
|
20129
18774
|
};
|
|
20130
|
-
var keywordGapCommand =
|
|
18775
|
+
var keywordGapCommand = defineCommand127({
|
|
20131
18776
|
meta: {
|
|
20132
18777
|
name: "keyword-gap",
|
|
20133
18778
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -20201,7 +18846,7 @@ Examples:
|
|
|
20201
18846
|
});
|
|
20202
18847
|
|
|
20203
18848
|
// src/commands/research/keywords-for-site.ts
|
|
20204
|
-
import { defineCommand as
|
|
18849
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
20205
18850
|
registerSchema({
|
|
20206
18851
|
command: "research.keywords-for-site",
|
|
20207
18852
|
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -20234,7 +18879,7 @@ var FIELDS8 = {
|
|
|
20234
18879
|
competition: "LOW, MEDIUM, or HIGH",
|
|
20235
18880
|
competition_index: "Competition score 0-100"
|
|
20236
18881
|
};
|
|
20237
|
-
var keywordsForSiteCommand =
|
|
18882
|
+
var keywordsForSiteCommand = defineCommand128({
|
|
20238
18883
|
meta: {
|
|
20239
18884
|
name: "keywords-for-site",
|
|
20240
18885
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -20287,7 +18932,7 @@ Examples:
|
|
|
20287
18932
|
});
|
|
20288
18933
|
|
|
20289
18934
|
// src/commands/research/languages.ts
|
|
20290
|
-
import { defineCommand as
|
|
18935
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
20291
18936
|
registerSchema({
|
|
20292
18937
|
command: "research.languages",
|
|
20293
18938
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -20317,7 +18962,7 @@ var FIELDS9 = {
|
|
|
20317
18962
|
code: "Language code to pass as --language",
|
|
20318
18963
|
name: "Language name (also accepted by --language)"
|
|
20319
18964
|
};
|
|
20320
|
-
var languagesCommand2 =
|
|
18965
|
+
var languagesCommand2 = defineCommand129({
|
|
20321
18966
|
meta: {
|
|
20322
18967
|
name: "languages",
|
|
20323
18968
|
description: "List all supported language codes for --language flag."
|
|
@@ -20328,7 +18973,7 @@ var languagesCommand2 = defineCommand131({
|
|
|
20328
18973
|
});
|
|
20329
18974
|
|
|
20330
18975
|
// src/commands/research/lighthouse.ts
|
|
20331
|
-
import { defineCommand as
|
|
18976
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
20332
18977
|
registerSchema({
|
|
20333
18978
|
command: "research.lighthouse",
|
|
20334
18979
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -20347,7 +18992,7 @@ var FIELDS10 = {
|
|
|
20347
18992
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
20348
18993
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
20349
18994
|
};
|
|
20350
|
-
var lighthouseCommand =
|
|
18995
|
+
var lighthouseCommand = defineCommand130({
|
|
20351
18996
|
meta: {
|
|
20352
18997
|
name: "lighthouse",
|
|
20353
18998
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -20385,7 +19030,7 @@ Examples:
|
|
|
20385
19030
|
});
|
|
20386
19031
|
|
|
20387
19032
|
// src/commands/research/relevant-pages.ts
|
|
20388
|
-
import { defineCommand as
|
|
19033
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
20389
19034
|
registerSchema({
|
|
20390
19035
|
command: "research.relevant-pages",
|
|
20391
19036
|
description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -20411,7 +19056,7 @@ var FIELDS11 = {
|
|
|
20411
19056
|
keywords: "Total organic keywords the page ranks for",
|
|
20412
19057
|
top_10: "Keywords in positions 1-10"
|
|
20413
19058
|
};
|
|
20414
|
-
var relevantPagesCommand =
|
|
19059
|
+
var relevantPagesCommand = defineCommand131({
|
|
20415
19060
|
meta: {
|
|
20416
19061
|
name: "relevant-pages",
|
|
20417
19062
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -20457,7 +19102,7 @@ Examples:
|
|
|
20457
19102
|
});
|
|
20458
19103
|
|
|
20459
19104
|
// src/commands/research/web.ts
|
|
20460
|
-
import { defineCommand as
|
|
19105
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
20461
19106
|
registerSchema({
|
|
20462
19107
|
command: "research.web",
|
|
20463
19108
|
description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
|
|
@@ -20508,7 +19153,7 @@ async function runDeepResearch(question) {
|
|
|
20508
19153
|
}
|
|
20509
19154
|
throw new Error("Deep research timed out");
|
|
20510
19155
|
}
|
|
20511
|
-
var webCommand =
|
|
19156
|
+
var webCommand = defineCommand132({
|
|
20512
19157
|
meta: {
|
|
20513
19158
|
name: "web",
|
|
20514
19159
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -20568,7 +19213,7 @@ Examples:
|
|
|
20568
19213
|
});
|
|
20569
19214
|
|
|
20570
19215
|
// src/commands/research/index.ts
|
|
20571
|
-
var researchCommand =
|
|
19216
|
+
var researchCommand = defineCommand133({
|
|
20572
19217
|
meta: {
|
|
20573
19218
|
name: "research",
|
|
20574
19219
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -20608,10 +19253,10 @@ Examples:
|
|
|
20608
19253
|
});
|
|
20609
19254
|
|
|
20610
19255
|
// src/commands/scheduled-actions/index.ts
|
|
20611
|
-
import { defineCommand as
|
|
19256
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
20612
19257
|
|
|
20613
19258
|
// src/commands/scheduled-actions/create.ts
|
|
20614
|
-
import { defineCommand as
|
|
19259
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
20615
19260
|
|
|
20616
19261
|
// src/commands/scheduled-actions/shared.ts
|
|
20617
19262
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -20726,7 +19371,7 @@ registerSchema({
|
|
|
20726
19371
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
20727
19372
|
}
|
|
20728
19373
|
});
|
|
20729
|
-
var createCommand2 =
|
|
19374
|
+
var createCommand2 = defineCommand134({
|
|
20730
19375
|
meta: {
|
|
20731
19376
|
name: "create",
|
|
20732
19377
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -20775,7 +19420,7 @@ var createCommand2 = defineCommand136({
|
|
|
20775
19420
|
});
|
|
20776
19421
|
|
|
20777
19422
|
// src/commands/scheduled-actions/delete.ts
|
|
20778
|
-
import { defineCommand as
|
|
19423
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
20779
19424
|
registerSchema({
|
|
20780
19425
|
command: "scheduled-actions.delete",
|
|
20781
19426
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -20783,7 +19428,7 @@ registerSchema({
|
|
|
20783
19428
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
20784
19429
|
}
|
|
20785
19430
|
});
|
|
20786
|
-
var deleteCommand2 =
|
|
19431
|
+
var deleteCommand2 = defineCommand135({
|
|
20787
19432
|
meta: {
|
|
20788
19433
|
name: "delete",
|
|
20789
19434
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -20812,7 +19457,7 @@ var deleteCommand2 = defineCommand137({
|
|
|
20812
19457
|
});
|
|
20813
19458
|
|
|
20814
19459
|
// src/commands/scheduled-actions/get.ts
|
|
20815
|
-
import { defineCommand as
|
|
19460
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
20816
19461
|
registerSchema({
|
|
20817
19462
|
command: "scheduled-actions.get",
|
|
20818
19463
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -20820,7 +19465,7 @@ registerSchema({
|
|
|
20820
19465
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
20821
19466
|
}
|
|
20822
19467
|
});
|
|
20823
|
-
var getCommand3 =
|
|
19468
|
+
var getCommand3 = defineCommand136({
|
|
20824
19469
|
meta: {
|
|
20825
19470
|
name: "get",
|
|
20826
19471
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -20857,13 +19502,13 @@ var getCommand3 = defineCommand138({
|
|
|
20857
19502
|
});
|
|
20858
19503
|
|
|
20859
19504
|
// src/commands/scheduled-actions/list.ts
|
|
20860
|
-
import { defineCommand as
|
|
19505
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
20861
19506
|
registerSchema({
|
|
20862
19507
|
command: "scheduled-actions.list",
|
|
20863
19508
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
20864
19509
|
args: {}
|
|
20865
19510
|
});
|
|
20866
|
-
var listCommand4 =
|
|
19511
|
+
var listCommand4 = defineCommand137({
|
|
20867
19512
|
meta: {
|
|
20868
19513
|
name: "list",
|
|
20869
19514
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -20884,7 +19529,7 @@ var listCommand4 = defineCommand139({
|
|
|
20884
19529
|
});
|
|
20885
19530
|
|
|
20886
19531
|
// src/commands/scheduled-actions/trigger.ts
|
|
20887
|
-
import { defineCommand as
|
|
19532
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
20888
19533
|
registerSchema({
|
|
20889
19534
|
command: "scheduled-actions.trigger",
|
|
20890
19535
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -20892,7 +19537,7 @@ registerSchema({
|
|
|
20892
19537
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
20893
19538
|
}
|
|
20894
19539
|
});
|
|
20895
|
-
var triggerCommand =
|
|
19540
|
+
var triggerCommand = defineCommand138({
|
|
20896
19541
|
meta: {
|
|
20897
19542
|
name: "trigger",
|
|
20898
19543
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -20929,7 +19574,7 @@ var triggerCommand = defineCommand140({
|
|
|
20929
19574
|
});
|
|
20930
19575
|
|
|
20931
19576
|
// src/commands/scheduled-actions/update.ts
|
|
20932
|
-
import { defineCommand as
|
|
19577
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
20933
19578
|
registerSchema({
|
|
20934
19579
|
command: "scheduled-actions.update",
|
|
20935
19580
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -20954,7 +19599,7 @@ registerSchema({
|
|
|
20954
19599
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
20955
19600
|
}
|
|
20956
19601
|
});
|
|
20957
|
-
var updateCommand2 =
|
|
19602
|
+
var updateCommand2 = defineCommand139({
|
|
20958
19603
|
meta: {
|
|
20959
19604
|
name: "update",
|
|
20960
19605
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -21025,7 +19670,7 @@ var updateCommand2 = defineCommand141({
|
|
|
21025
19670
|
});
|
|
21026
19671
|
|
|
21027
19672
|
// src/commands/scheduled-actions/index.ts
|
|
21028
|
-
var scheduledActionsCommand =
|
|
19673
|
+
var scheduledActionsCommand = defineCommand140({
|
|
21029
19674
|
meta: {
|
|
21030
19675
|
name: "scheduled-actions",
|
|
21031
19676
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -21051,8 +19696,8 @@ Examples:
|
|
|
21051
19696
|
});
|
|
21052
19697
|
|
|
21053
19698
|
// src/commands/schema.ts
|
|
21054
|
-
import { defineCommand as
|
|
21055
|
-
var schemaCommand =
|
|
19699
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
19700
|
+
var schemaCommand = defineCommand141({
|
|
21056
19701
|
meta: {
|
|
21057
19702
|
name: "schema",
|
|
21058
19703
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -21088,10 +19733,10 @@ var schemaCommand = defineCommand143({
|
|
|
21088
19733
|
});
|
|
21089
19734
|
|
|
21090
19735
|
// src/commands/testimonials/index.ts
|
|
21091
|
-
import { defineCommand as
|
|
19736
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
21092
19737
|
|
|
21093
19738
|
// src/commands/testimonials/get.ts
|
|
21094
|
-
import { defineCommand as
|
|
19739
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
21095
19740
|
registerSchema({
|
|
21096
19741
|
command: "testimonials.get",
|
|
21097
19742
|
description: "Get a single testimonial by ID",
|
|
@@ -21099,7 +19744,7 @@ registerSchema({
|
|
|
21099
19744
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
21100
19745
|
}
|
|
21101
19746
|
});
|
|
21102
|
-
var getCommand4 =
|
|
19747
|
+
var getCommand4 = defineCommand142({
|
|
21103
19748
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
21104
19749
|
args: {
|
|
21105
19750
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -21136,7 +19781,7 @@ var getCommand4 = defineCommand144({
|
|
|
21136
19781
|
});
|
|
21137
19782
|
|
|
21138
19783
|
// src/commands/testimonials/list.ts
|
|
21139
|
-
import { defineCommand as
|
|
19784
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
21140
19785
|
registerSchema({
|
|
21141
19786
|
command: "testimonials.list",
|
|
21142
19787
|
description: "List testimonials with optional filters.",
|
|
@@ -21166,7 +19811,7 @@ registerSchema({
|
|
|
21166
19811
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
21167
19812
|
}
|
|
21168
19813
|
});
|
|
21169
|
-
var listCommand5 =
|
|
19814
|
+
var listCommand5 = defineCommand143({
|
|
21170
19815
|
meta: {
|
|
21171
19816
|
name: "list",
|
|
21172
19817
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -21215,7 +19860,7 @@ var listCommand5 = defineCommand145({
|
|
|
21215
19860
|
});
|
|
21216
19861
|
|
|
21217
19862
|
// src/commands/testimonials/search.ts
|
|
21218
|
-
import { defineCommand as
|
|
19863
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
21219
19864
|
registerSchema({
|
|
21220
19865
|
command: "testimonials.search",
|
|
21221
19866
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -21246,7 +19891,7 @@ registerSchema({
|
|
|
21246
19891
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
21247
19892
|
}
|
|
21248
19893
|
});
|
|
21249
|
-
var searchCommand2 =
|
|
19894
|
+
var searchCommand2 = defineCommand144({
|
|
21250
19895
|
meta: {
|
|
21251
19896
|
name: "search",
|
|
21252
19897
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -21320,7 +19965,7 @@ var searchCommand2 = defineCommand146({
|
|
|
21320
19965
|
var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
21321
19966
|
|
|
21322
19967
|
// src/commands/testimonials/index.ts
|
|
21323
|
-
var testimonialsCommand =
|
|
19968
|
+
var testimonialsCommand = defineCommand145({
|
|
21324
19969
|
meta: {
|
|
21325
19970
|
name: "testimonials",
|
|
21326
19971
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -21341,10 +19986,10 @@ Examples:
|
|
|
21341
19986
|
});
|
|
21342
19987
|
|
|
21343
19988
|
// src/commands/videos/index.ts
|
|
21344
|
-
import { defineCommand as
|
|
19989
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
21345
19990
|
|
|
21346
19991
|
// src/commands/videos/delete.ts
|
|
21347
|
-
import { defineCommand as
|
|
19992
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
21348
19993
|
registerSchema({
|
|
21349
19994
|
command: "videos.delete",
|
|
21350
19995
|
description: "Delete a video by ID",
|
|
@@ -21358,7 +20003,7 @@ registerSchema({
|
|
|
21358
20003
|
}
|
|
21359
20004
|
}
|
|
21360
20005
|
});
|
|
21361
|
-
var deleteCommand3 =
|
|
20006
|
+
var deleteCommand3 = defineCommand146({
|
|
21362
20007
|
meta: {
|
|
21363
20008
|
name: "delete",
|
|
21364
20009
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -21399,7 +20044,7 @@ var deleteCommand3 = defineCommand148({
|
|
|
21399
20044
|
});
|
|
21400
20045
|
|
|
21401
20046
|
// src/commands/videos/get.ts
|
|
21402
|
-
import { defineCommand as
|
|
20047
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
21403
20048
|
registerSchema({
|
|
21404
20049
|
command: "videos.get",
|
|
21405
20050
|
description: "Get a single video by ID",
|
|
@@ -21407,7 +20052,7 @@ registerSchema({
|
|
|
21407
20052
|
id: { type: "string", description: "Video ID", required: true }
|
|
21408
20053
|
}
|
|
21409
20054
|
});
|
|
21410
|
-
var getCommand5 =
|
|
20055
|
+
var getCommand5 = defineCommand147({
|
|
21411
20056
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
21412
20057
|
args: {
|
|
21413
20058
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -21444,7 +20089,7 @@ var getCommand5 = defineCommand149({
|
|
|
21444
20089
|
});
|
|
21445
20090
|
|
|
21446
20091
|
// src/commands/videos/search.ts
|
|
21447
|
-
import { defineCommand as
|
|
20092
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
21448
20093
|
registerSchema({
|
|
21449
20094
|
command: "videos.search",
|
|
21450
20095
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -21454,7 +20099,7 @@ registerSchema({
|
|
|
21454
20099
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
21455
20100
|
}
|
|
21456
20101
|
});
|
|
21457
|
-
var searchCommand3 =
|
|
20102
|
+
var searchCommand3 = defineCommand148({
|
|
21458
20103
|
meta: {
|
|
21459
20104
|
name: "search",
|
|
21460
20105
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -21506,7 +20151,7 @@ var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
21506
20151
|
// src/commands/videos/upload.ts
|
|
21507
20152
|
import { readFile as readFile12, stat as stat3 } from "fs/promises";
|
|
21508
20153
|
import { extname as extname3 } from "path";
|
|
21509
|
-
import { defineCommand as
|
|
20154
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
21510
20155
|
var MIME_MAP = {
|
|
21511
20156
|
".mp4": "video/mp4",
|
|
21512
20157
|
".mov": "video/quicktime",
|
|
@@ -21540,7 +20185,7 @@ function detectContentType(filePath) {
|
|
|
21540
20185
|
}
|
|
21541
20186
|
return mime;
|
|
21542
20187
|
}
|
|
21543
|
-
var uploadCommand2 =
|
|
20188
|
+
var uploadCommand2 = defineCommand149({
|
|
21544
20189
|
meta: {
|
|
21545
20190
|
name: "upload",
|
|
21546
20191
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -21594,7 +20239,7 @@ var uploadCommand2 = defineCommand151({
|
|
|
21594
20239
|
});
|
|
21595
20240
|
|
|
21596
20241
|
// src/commands/videos/index.ts
|
|
21597
|
-
var videosCommand =
|
|
20242
|
+
var videosCommand = defineCommand150({
|
|
21598
20243
|
meta: {
|
|
21599
20244
|
name: "videos",
|
|
21600
20245
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -21617,10 +20262,10 @@ Examples:
|
|
|
21617
20262
|
});
|
|
21618
20263
|
|
|
21619
20264
|
// src/commands/winning-ads/index.ts
|
|
21620
|
-
import { defineCommand as
|
|
20265
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
21621
20266
|
|
|
21622
20267
|
// src/commands/winning-ads/advertisers.ts
|
|
21623
|
-
import { defineCommand as
|
|
20268
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
21624
20269
|
registerSchema({
|
|
21625
20270
|
command: "winning-ads.advertisers",
|
|
21626
20271
|
description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
|
|
@@ -21633,7 +20278,7 @@ registerSchema({
|
|
|
21633
20278
|
function identity(record) {
|
|
21634
20279
|
return record;
|
|
21635
20280
|
}
|
|
21636
|
-
var advertisersCommand2 =
|
|
20281
|
+
var advertisersCommand2 = defineCommand151({
|
|
21637
20282
|
meta: {
|
|
21638
20283
|
name: "advertisers",
|
|
21639
20284
|
description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -21684,7 +20329,7 @@ var advertisersCommand2 = defineCommand153({
|
|
|
21684
20329
|
});
|
|
21685
20330
|
|
|
21686
20331
|
// src/commands/winning-ads/search.ts
|
|
21687
|
-
import { defineCommand as
|
|
20332
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
21688
20333
|
registerSchema({
|
|
21689
20334
|
command: "winning-ads.search",
|
|
21690
20335
|
description: "Search the ad-dna corpus of scored winning ads. Returns a lean shortlist (advertiser, summary, scores, media_url) to pick a reference to reproduce.",
|
|
@@ -21792,7 +20437,7 @@ function buildSearchBody(args) {
|
|
|
21792
20437
|
}
|
|
21793
20438
|
return body;
|
|
21794
20439
|
}
|
|
21795
|
-
var searchCommand4 =
|
|
20440
|
+
var searchCommand4 = defineCommand152({
|
|
21796
20441
|
meta: {
|
|
21797
20442
|
name: "search",
|
|
21798
20443
|
description: "Search winning reference ads. Example: baker winning-ads search 'B2B SaaS before/after AI automation' --platform meta --format static --winner-category winner --exclude-advertiser adv_123 --output md"
|
|
@@ -21904,7 +20549,7 @@ var searchCommand4 = defineCommand154({
|
|
|
21904
20549
|
});
|
|
21905
20550
|
|
|
21906
20551
|
// src/commands/winning-ads/index.ts
|
|
21907
|
-
var winningAdsCommand =
|
|
20552
|
+
var winningAdsCommand = defineCommand153({
|
|
21908
20553
|
meta: {
|
|
21909
20554
|
name: "winning-ads",
|
|
21910
20555
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -21928,7 +20573,7 @@ Examples:
|
|
|
21928
20573
|
});
|
|
21929
20574
|
|
|
21930
20575
|
// src/version.ts
|
|
21931
|
-
import { readFileSync as
|
|
20576
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
21932
20577
|
function packageJsonUrl() {
|
|
21933
20578
|
return new URL("../package.json", import.meta.url);
|
|
21934
20579
|
}
|
|
@@ -21940,11 +20585,11 @@ function parsePackageVersion(raw) {
|
|
|
21940
20585
|
throw new Error("Invalid CLI package.json: missing version");
|
|
21941
20586
|
}
|
|
21942
20587
|
function getCliVersion() {
|
|
21943
|
-
return parsePackageVersion(
|
|
20588
|
+
return parsePackageVersion(readFileSync10(packageJsonUrl(), "utf8"));
|
|
21944
20589
|
}
|
|
21945
20590
|
|
|
21946
20591
|
// src/cli.ts
|
|
21947
|
-
var main =
|
|
20592
|
+
var main = defineCommand154({
|
|
21948
20593
|
meta: {
|
|
21949
20594
|
name: "baker",
|
|
21950
20595
|
version: getCliVersion(),
|
|
@@ -21959,7 +20604,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
21959
20604
|
subCommands: {
|
|
21960
20605
|
actions: actionsCommand,
|
|
21961
20606
|
"scheduled-actions": scheduledActionsCommand,
|
|
21962
|
-
ads:
|
|
20607
|
+
ads: adsCommand,
|
|
21963
20608
|
ga4: ga4Command,
|
|
21964
20609
|
gsc: gscCommand,
|
|
21965
20610
|
research: researchCommand,
|