@koda-sl/baker-cli 0.111.0-dev.4a58faec8 → 0.111.0-dev.802867580
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 +33 -0
- package/dist/cli.js +1856 -485
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-26K7V346.js";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
|
-
import { defineCommand as
|
|
15
|
+
import { defineCommand as defineCommand157, runMain } from "citty";
|
|
16
16
|
|
|
17
17
|
// src/commands/actions/index.ts
|
|
18
18
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -2844,10 +2844,10 @@ Examples:
|
|
|
2844
2844
|
});
|
|
2845
2845
|
|
|
2846
2846
|
// src/commands/ads/index.ts
|
|
2847
|
-
import { defineCommand as
|
|
2847
|
+
import { defineCommand as defineCommand82 } from "citty";
|
|
2848
2848
|
|
|
2849
2849
|
// src/commands/ads/google/index.ts
|
|
2850
|
-
import { defineCommand as
|
|
2850
|
+
import { defineCommand as defineCommand31 } from "citty";
|
|
2851
2851
|
|
|
2852
2852
|
// src/commands/ads/google/accounts.ts
|
|
2853
2853
|
import { defineCommand as defineCommand19 } from "citty";
|
|
@@ -3832,11 +3832,866 @@ Examples:
|
|
|
3832
3832
|
}
|
|
3833
3833
|
});
|
|
3834
3834
|
|
|
3835
|
+
// src/commands/ads/google/draft.ts
|
|
3836
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
3837
|
+
|
|
3838
|
+
// src/commands/ads/google/write-shared.ts
|
|
3839
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
3840
|
+
|
|
3841
|
+
// ../api/src/ads-google/limits.ts
|
|
3842
|
+
var GOOGLE_ADS_LIMITS = {
|
|
3843
|
+
budget: {
|
|
3844
|
+
nameMax: 255,
|
|
3845
|
+
amountMicrosMin: 1
|
|
3846
|
+
},
|
|
3847
|
+
campaign: {
|
|
3848
|
+
nameMax: 255
|
|
3849
|
+
},
|
|
3850
|
+
adGroup: {
|
|
3851
|
+
nameMax: 255
|
|
3852
|
+
},
|
|
3853
|
+
keyword: {
|
|
3854
|
+
textMax: 80,
|
|
3855
|
+
wordsMax: 10
|
|
3856
|
+
},
|
|
3857
|
+
responsiveSearchAd: {
|
|
3858
|
+
headlinesMin: 3,
|
|
3859
|
+
headlinesMax: 15,
|
|
3860
|
+
headlineTextMax: 30,
|
|
3861
|
+
descriptionsMin: 2,
|
|
3862
|
+
descriptionsMax: 4,
|
|
3863
|
+
descriptionTextMax: 90,
|
|
3864
|
+
pathMax: 15
|
|
3865
|
+
},
|
|
3866
|
+
responsiveDisplayAd: {
|
|
3867
|
+
headlinesMin: 1,
|
|
3868
|
+
headlinesMax: 5,
|
|
3869
|
+
headlineTextMax: 30,
|
|
3870
|
+
longHeadlineTextMax: 90,
|
|
3871
|
+
descriptionsMin: 1,
|
|
3872
|
+
descriptionsMax: 5,
|
|
3873
|
+
descriptionTextMax: 90,
|
|
3874
|
+
businessNameMax: 25
|
|
3875
|
+
},
|
|
3876
|
+
sharedSet: {
|
|
3877
|
+
nameMax: 255
|
|
3878
|
+
},
|
|
3879
|
+
asset: {
|
|
3880
|
+
sitelinkLinkTextMax: 25,
|
|
3881
|
+
sitelinkDescriptionMax: 35,
|
|
3882
|
+
calloutTextMax: 25,
|
|
3883
|
+
structuredSnippetHeaderMax: 25,
|
|
3884
|
+
structuredSnippetValuesMin: 3,
|
|
3885
|
+
structuredSnippetValuesMax: 10
|
|
3886
|
+
},
|
|
3887
|
+
conversionAction: {
|
|
3888
|
+
nameMax: 255
|
|
3889
|
+
},
|
|
3890
|
+
audience: {
|
|
3891
|
+
nameMax: 255
|
|
3892
|
+
},
|
|
3893
|
+
biddingStrategy: {
|
|
3894
|
+
nameMax: 255
|
|
3895
|
+
},
|
|
3896
|
+
label: {
|
|
3897
|
+
nameMax: 255
|
|
3898
|
+
}
|
|
3899
|
+
};
|
|
3900
|
+
var KEYWORD_MATCH_TYPES = ["EXACT", "PHRASE", "BROAD"];
|
|
3901
|
+
var ADVERTISING_CHANNEL_TYPES = [
|
|
3902
|
+
"SEARCH",
|
|
3903
|
+
"DISPLAY",
|
|
3904
|
+
"SHOPPING",
|
|
3905
|
+
"VIDEO",
|
|
3906
|
+
"PERFORMANCE_MAX",
|
|
3907
|
+
"DEMAND_GEN",
|
|
3908
|
+
"MULTI_CHANNEL",
|
|
3909
|
+
"LOCAL",
|
|
3910
|
+
"SMART",
|
|
3911
|
+
"TRAVEL",
|
|
3912
|
+
"HOTEL",
|
|
3913
|
+
"DISCOVERY"
|
|
3914
|
+
];
|
|
3915
|
+
var ADVERTISING_CHANNEL_SUB_TYPES = [
|
|
3916
|
+
"SEARCH_MOBILE_APP",
|
|
3917
|
+
"DISPLAY_MOBILE_APP",
|
|
3918
|
+
"SEARCH_EXPRESS",
|
|
3919
|
+
"DISPLAY_EXPRESS",
|
|
3920
|
+
"SHOPPING_SMART_ADS",
|
|
3921
|
+
"DISPLAY_GMAIL_AD",
|
|
3922
|
+
"DISPLAY_SMART_CAMPAIGN",
|
|
3923
|
+
"VIDEO_OUTSTREAM",
|
|
3924
|
+
"VIDEO_ACTION",
|
|
3925
|
+
"VIDEO_NON_SKIPPABLE",
|
|
3926
|
+
"APP_CAMPAIGN",
|
|
3927
|
+
"APP_CAMPAIGN_FOR_ENGAGEMENT",
|
|
3928
|
+
"LOCAL_CAMPAIGN",
|
|
3929
|
+
"SHOPPING_COMPARISON_LISTING_ADS",
|
|
3930
|
+
"SEARCH_MOBILE_APP_ENGAGEMENT",
|
|
3931
|
+
"TRAVEL_ACTIVITIES"
|
|
3932
|
+
];
|
|
3933
|
+
var BIDDING_STRATEGY_TYPES = [
|
|
3934
|
+
"MANUAL_CPC",
|
|
3935
|
+
"MAXIMIZE_CONVERSIONS",
|
|
3936
|
+
"MAXIMIZE_CONVERSION_VALUE",
|
|
3937
|
+
"TARGET_SPEND",
|
|
3938
|
+
"TARGET_CPA",
|
|
3939
|
+
"TARGET_ROAS",
|
|
3940
|
+
"TARGET_IMPRESSION_SHARE",
|
|
3941
|
+
"MANUAL_CPM",
|
|
3942
|
+
"MANUAL_CPV",
|
|
3943
|
+
"PERCENT_CPC"
|
|
3944
|
+
];
|
|
3945
|
+
var BUDGET_DELIVERY_METHODS = ["STANDARD", "ACCELERATED"];
|
|
3946
|
+
var AD_GROUP_TYPES = [
|
|
3947
|
+
"SEARCH_STANDARD",
|
|
3948
|
+
"DISPLAY_STANDARD",
|
|
3949
|
+
"SHOPPING_PRODUCT_ADS",
|
|
3950
|
+
"VIDEO_BUMPER",
|
|
3951
|
+
"VIDEO_TRUE_VIEW_IN_STREAM",
|
|
3952
|
+
"VIDEO_TRUE_VIEW_IN_DISPLAY",
|
|
3953
|
+
"VIDEO_NON_SKIPPABLE_IN_STREAM",
|
|
3954
|
+
"VIDEO_OUTSTREAM",
|
|
3955
|
+
"DEMAND_GEN_AD"
|
|
3956
|
+
];
|
|
3957
|
+
var SHARED_SET_TYPES = [
|
|
3958
|
+
"NEGATIVE_KEYWORDS",
|
|
3959
|
+
"NEGATIVE_PLACEMENTS",
|
|
3960
|
+
"ACCOUNT_LEVEL_NEGATIVE_KEYWORDS"
|
|
3961
|
+
];
|
|
3962
|
+
var STAGEABLE_CREATE_STATUSES2 = ["ENABLED", "PAUSED"];
|
|
3963
|
+
var PINNED_FIELDS = ["HEADLINE_1", "HEADLINE_2", "HEADLINE_3", "DESCRIPTION_1", "DESCRIPTION_2"];
|
|
3964
|
+
var CONVERSION_ACTION_CATEGORIES = [
|
|
3965
|
+
"DEFAULT",
|
|
3966
|
+
"PAGE_VIEW",
|
|
3967
|
+
"PURCHASE",
|
|
3968
|
+
"SIGNUP",
|
|
3969
|
+
"LEAD",
|
|
3970
|
+
"DOWNLOAD",
|
|
3971
|
+
"ADD_TO_CART",
|
|
3972
|
+
"BEGIN_CHECKOUT",
|
|
3973
|
+
"SUBSCRIBE_PAID",
|
|
3974
|
+
"PHONE_CALL_LEAD",
|
|
3975
|
+
"SUBMIT_LEAD_FORM",
|
|
3976
|
+
"BOOK_APPOINTMENT",
|
|
3977
|
+
"REQUEST_QUOTE",
|
|
3978
|
+
"CONTACT"
|
|
3979
|
+
];
|
|
3980
|
+
var CONVERSION_ACTION_TYPES = [
|
|
3981
|
+
"WEBPAGE",
|
|
3982
|
+
"UPLOAD_CLICKS",
|
|
3983
|
+
"UPLOAD_CALLS",
|
|
3984
|
+
"WEBSITE_CALL",
|
|
3985
|
+
"GOOGLE_ANALYTICS_4_CUSTOM"
|
|
3986
|
+
];
|
|
3987
|
+
var CONVERSION_COUNTING_TYPES = ["ONE_PER_CLICK", "MANY_PER_CLICK"];
|
|
3988
|
+
var USER_LIST_TYPES = ["CRM_BASED", "RULE_BASED", "LOGICAL", "BASIC", "LOOKALIKE"];
|
|
3989
|
+
var ASSET_FIELD_TYPES = [
|
|
3990
|
+
"SITELINK",
|
|
3991
|
+
"CALLOUT",
|
|
3992
|
+
"STRUCTURED_SNIPPET",
|
|
3993
|
+
"CALL",
|
|
3994
|
+
"PRICE",
|
|
3995
|
+
"PROMOTION",
|
|
3996
|
+
"MOBILE_APP",
|
|
3997
|
+
"HEADLINE",
|
|
3998
|
+
"DESCRIPTION",
|
|
3999
|
+
"LOGO",
|
|
4000
|
+
"MARKETING_IMAGE",
|
|
4001
|
+
"BUSINESS_NAME"
|
|
4002
|
+
];
|
|
4003
|
+
var DEVICE_TYPES = ["MOBILE", "TABLET", "DESKTOP", "CONNECTED_TV", "OTHER"];
|
|
4004
|
+
var DAYS_OF_WEEK = ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"];
|
|
4005
|
+
var CAMPAIGN_OBJECTIVES = [
|
|
4006
|
+
"SALES",
|
|
4007
|
+
"LEADS",
|
|
4008
|
+
"WEBSITE_TRAFFIC",
|
|
4009
|
+
"PRODUCT_BRAND_CONSIDERATION",
|
|
4010
|
+
"BRAND_AWARENESS_REACH",
|
|
4011
|
+
"APP_PROMOTION",
|
|
4012
|
+
"LOCAL_STORE_VISITS"
|
|
4013
|
+
];
|
|
4014
|
+
var MICROS_PER_UNIT = 1e6;
|
|
4015
|
+
function toMicros(amount) {
|
|
4016
|
+
return Math.round(amount * MICROS_PER_UNIT);
|
|
4017
|
+
}
|
|
4018
|
+
var PLAYBOOK_DAILY_BUDGET_FLOOR_MICROS = 10 * MICROS_PER_UNIT;
|
|
4019
|
+
var TEMP_REF_REGEX2 = /^g_temp_[A-Za-z0-9_-]{2,}$/;
|
|
4020
|
+
var NUMERIC_ID_REGEX2 = /^\d+$/;
|
|
4021
|
+
var RESOURCE_NAME_REGEX = /^customers\/\d+\/[A-Za-z]+\/[-\w~]+$/;
|
|
4022
|
+
var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
4023
|
+
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4024
|
+
|
|
4025
|
+
// ../api/src/ads-google/ops.ts
|
|
4026
|
+
import { z as z8 } from "zod";
|
|
4027
|
+
var tempRefSchema2 = z8.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
4028
|
+
var refSchema = z8.union([
|
|
4029
|
+
z8.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
4030
|
+
z8.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4031
|
+
tempRefSchema2
|
|
4032
|
+
]);
|
|
4033
|
+
var targetRefSchema = refSchema;
|
|
4034
|
+
var microsSchema = z8.number().int().positive("expected a positive micros amount");
|
|
4035
|
+
var httpsUrlSchema2 = z8.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
4036
|
+
var customerIdSchema = z8.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
4037
|
+
var stageableStatusSchema2 = z8.enum(STAGEABLE_CREATE_STATUSES2);
|
|
4038
|
+
var matchTypeSchema = z8.enum(KEYWORD_MATCH_TYPES);
|
|
4039
|
+
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");
|
|
4040
|
+
var budgetCreateSchema = z8.object({
|
|
4041
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4042
|
+
amountMicros: microsSchema,
|
|
4043
|
+
deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
4044
|
+
explicitlyShared: z8.boolean().default(false)
|
|
4045
|
+
});
|
|
4046
|
+
var budgetUpdateSchema = z8.object({
|
|
4047
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4048
|
+
amountMicros: microsSchema.optional(),
|
|
4049
|
+
deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4050
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4051
|
+
var biddingConfigSchema = z8.object({
|
|
4052
|
+
type: z8.enum(BIDDING_STRATEGY_TYPES),
|
|
4053
|
+
targetCpaMicros: microsSchema.optional(),
|
|
4054
|
+
targetRoas: z8.number().positive().optional(),
|
|
4055
|
+
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4056
|
+
enhancedCpcEnabled: z8.boolean().optional()
|
|
4057
|
+
}).superRefine((p, ctx) => {
|
|
4058
|
+
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4059
|
+
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
4060
|
+
}
|
|
4061
|
+
if (p.type === "TARGET_ROAS" && p.targetRoas === void 0) {
|
|
4062
|
+
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4063
|
+
}
|
|
4064
|
+
});
|
|
4065
|
+
var networkSettingsSchema = z8.object({
|
|
4066
|
+
targetGoogleSearch: z8.boolean().optional(),
|
|
4067
|
+
targetSearchNetwork: z8.boolean().optional(),
|
|
4068
|
+
targetContentNetwork: z8.boolean().optional(),
|
|
4069
|
+
targetPartnerSearchNetwork: z8.boolean().optional()
|
|
4070
|
+
});
|
|
4071
|
+
var dateSchema = z8.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4072
|
+
var campaignCreateSchema2 = z8.object({
|
|
4073
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4074
|
+
channelType: z8.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4075
|
+
channelSubType: z8.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4076
|
+
budget: refSchema,
|
|
4077
|
+
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4078
|
+
bidding: biddingConfigSchema.optional(),
|
|
4079
|
+
biddingStrategy: refSchema.optional(),
|
|
4080
|
+
networkSettings: networkSettingsSchema.optional(),
|
|
4081
|
+
startDate: dateSchema.optional(),
|
|
4082
|
+
endDate: dateSchema.optional(),
|
|
4083
|
+
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4084
|
+
objective: z8.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4085
|
+
status: stageableStatusSchema2.default("PAUSED")
|
|
4086
|
+
}).superRefine((p, ctx) => {
|
|
4087
|
+
if (!p.bidding && !p.biddingStrategy) {
|
|
4088
|
+
ctx.addIssue({
|
|
4089
|
+
code: "custom",
|
|
4090
|
+
path: ["bidding"],
|
|
4091
|
+
message: "set an inline bidding strategy or reference a portfolio biddingStrategy"
|
|
4092
|
+
});
|
|
4093
|
+
}
|
|
4094
|
+
if (p.bidding && p.biddingStrategy) {
|
|
4095
|
+
ctx.addIssue({
|
|
4096
|
+
code: "custom",
|
|
4097
|
+
path: ["bidding"],
|
|
4098
|
+
message: "use inline bidding OR a portfolio biddingStrategy, not both"
|
|
4099
|
+
});
|
|
4100
|
+
}
|
|
4101
|
+
if (p.channelType === "PERFORMANCE_MAX" && p.bidding && p.bidding.type === "MANUAL_CPC") {
|
|
4102
|
+
ctx.addIssue({ code: "custom", path: ["bidding"], message: "Performance Max does not support Manual CPC" });
|
|
4103
|
+
}
|
|
4104
|
+
if (p.startDate && p.endDate && p.endDate <= p.startDate) {
|
|
4105
|
+
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4106
|
+
}
|
|
4107
|
+
});
|
|
4108
|
+
var campaignUpdateSchema2 = z8.object({
|
|
4109
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4110
|
+
budget: refSchema.optional(),
|
|
4111
|
+
bidding: biddingConfigSchema.optional(),
|
|
4112
|
+
networkSettings: networkSettingsSchema.optional(),
|
|
4113
|
+
startDate: dateSchema.optional(),
|
|
4114
|
+
endDate: dateSchema.optional(),
|
|
4115
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4116
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4117
|
+
var adGroupCreateSchema = z8.object({
|
|
4118
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4119
|
+
campaign: refSchema,
|
|
4120
|
+
type: z8.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4121
|
+
cpcBidMicros: microsSchema.optional(),
|
|
4122
|
+
status: stageableStatusSchema2.default("PAUSED")
|
|
4123
|
+
});
|
|
4124
|
+
var adGroupUpdateSchema = z8.object({
|
|
4125
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4126
|
+
cpcBidMicros: microsSchema.optional(),
|
|
4127
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4128
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4129
|
+
var keywordAddSchema = z8.object({
|
|
4130
|
+
adGroup: refSchema,
|
|
4131
|
+
text: keywordTextSchema,
|
|
4132
|
+
matchType: matchTypeSchema,
|
|
4133
|
+
cpcBidMicros: microsSchema.optional(),
|
|
4134
|
+
finalUrls: z8.array(httpsUrlSchema2).optional(),
|
|
4135
|
+
status: stageableStatusSchema2.default("ENABLED")
|
|
4136
|
+
});
|
|
4137
|
+
var keywordUpdateSchema = z8.object({
|
|
4138
|
+
cpcBidMicros: microsSchema.optional(),
|
|
4139
|
+
finalUrls: z8.array(httpsUrlSchema2).optional(),
|
|
4140
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4141
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4142
|
+
var negativeKeywordAddSchema = z8.object({
|
|
4143
|
+
level: z8.enum(["adGroup", "campaign"]),
|
|
4144
|
+
parent: refSchema,
|
|
4145
|
+
text: keywordTextSchema,
|
|
4146
|
+
matchType: matchTypeSchema
|
|
4147
|
+
});
|
|
4148
|
+
var sharedSetCreateSchema = z8.object({
|
|
4149
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4150
|
+
type: z8.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4151
|
+
});
|
|
4152
|
+
var sharedSetMemberAddSchema = z8.object({
|
|
4153
|
+
sharedSet: refSchema,
|
|
4154
|
+
text: keywordTextSchema,
|
|
4155
|
+
matchType: matchTypeSchema
|
|
4156
|
+
});
|
|
4157
|
+
var campaignSharedSetAttachSchema = z8.object({
|
|
4158
|
+
campaign: refSchema,
|
|
4159
|
+
sharedSet: refSchema
|
|
4160
|
+
});
|
|
4161
|
+
var adTextAssetSchema = z8.object({
|
|
4162
|
+
text: z8.string().min(1),
|
|
4163
|
+
pinnedField: z8.enum(PINNED_FIELDS).optional()
|
|
4164
|
+
});
|
|
4165
|
+
var responsiveSearchAdSchema = z8.object({
|
|
4166
|
+
format: z8.literal("responsiveSearch"),
|
|
4167
|
+
headlines: z8.array(
|
|
4168
|
+
adTextAssetSchema.refine(
|
|
4169
|
+
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4170
|
+
"headline exceeds 30 chars"
|
|
4171
|
+
)
|
|
4172
|
+
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4173
|
+
descriptions: z8.array(
|
|
4174
|
+
adTextAssetSchema.refine(
|
|
4175
|
+
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4176
|
+
"description exceeds 90 chars"
|
|
4177
|
+
)
|
|
4178
|
+
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4179
|
+
path1: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4180
|
+
path2: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4181
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4182
|
+
});
|
|
4183
|
+
var responsiveDisplayAdSchema = z8.object({
|
|
4184
|
+
format: z8.literal("responsiveDisplay"),
|
|
4185
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4186
|
+
longHeadline: z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4187
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4188
|
+
businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4189
|
+
marketingImageAssets: z8.array(refSchema).optional(),
|
|
4190
|
+
logoImageAssets: z8.array(refSchema).optional(),
|
|
4191
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4192
|
+
});
|
|
4193
|
+
var performanceMaxAssetGroupSchema = z8.object({
|
|
4194
|
+
format: z8.literal("performanceMaxAssetGroup"),
|
|
4195
|
+
name: z8.string().min(1).max(255),
|
|
4196
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(3).max(15),
|
|
4197
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(2).max(5),
|
|
4198
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1),
|
|
4199
|
+
imageAssets: z8.array(refSchema).optional(),
|
|
4200
|
+
logoAssets: z8.array(refSchema).optional()
|
|
4201
|
+
});
|
|
4202
|
+
var callAdSchema = z8.object({
|
|
4203
|
+
format: z8.literal("call"),
|
|
4204
|
+
countryCode: z8.string().length(2),
|
|
4205
|
+
phoneNumber: z8.string().min(3),
|
|
4206
|
+
headline1: z8.string().min(1).max(30),
|
|
4207
|
+
headline2: z8.string().min(1).max(30),
|
|
4208
|
+
description1: z8.string().min(1).max(90),
|
|
4209
|
+
description2: z8.string().min(1).max(90),
|
|
4210
|
+
businessName: z8.string().min(1).max(25),
|
|
4211
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4212
|
+
});
|
|
4213
|
+
var appAdSchema = z8.object({
|
|
4214
|
+
format: z8.literal("app"),
|
|
4215
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(1),
|
|
4216
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1)
|
|
4217
|
+
});
|
|
4218
|
+
var videoAdSchema = z8.object({
|
|
4219
|
+
format: z8.literal("video"),
|
|
4220
|
+
youtubeVideoId: z8.string().min(1),
|
|
4221
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4222
|
+
});
|
|
4223
|
+
var demandGenAdSchema = z8.object({
|
|
4224
|
+
format: z8.literal("demandGen"),
|
|
4225
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(40) })).min(1).max(5),
|
|
4226
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1).max(5),
|
|
4227
|
+
businessName: z8.string().min(1).max(25),
|
|
4228
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1),
|
|
4229
|
+
imageAssets: z8.array(refSchema).optional()
|
|
4230
|
+
});
|
|
4231
|
+
var adContentSchema = z8.discriminatedUnion("format", [
|
|
4232
|
+
responsiveSearchAdSchema,
|
|
4233
|
+
responsiveDisplayAdSchema,
|
|
4234
|
+
performanceMaxAssetGroupSchema,
|
|
4235
|
+
callAdSchema,
|
|
4236
|
+
appAdSchema,
|
|
4237
|
+
videoAdSchema,
|
|
4238
|
+
demandGenAdSchema
|
|
4239
|
+
]);
|
|
4240
|
+
var adCreateSchema = z8.object({
|
|
4241
|
+
adGroup: refSchema,
|
|
4242
|
+
status: stageableStatusSchema2.default("PAUSED"),
|
|
4243
|
+
content: adContentSchema
|
|
4244
|
+
});
|
|
4245
|
+
var adUpdateSchema = z8.object({
|
|
4246
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4247
|
+
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4248
|
+
content: z8.record(z8.string(), z8.unknown()).optional()
|
|
4249
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4250
|
+
var textAssetSchema = z8.object({ type: z8.literal("text"), text: z8.string().min(1) });
|
|
4251
|
+
var imageAssetSchema = z8.object({
|
|
4252
|
+
type: z8.literal("image"),
|
|
4253
|
+
imageId: z8.string().min(1),
|
|
4254
|
+
name: z8.string().optional()
|
|
4255
|
+
});
|
|
4256
|
+
var youtubeVideoAssetSchema = z8.object({
|
|
4257
|
+
type: z8.literal("youtubeVideo"),
|
|
4258
|
+
youtubeVideoId: z8.string().min(1),
|
|
4259
|
+
name: z8.string().optional()
|
|
4260
|
+
});
|
|
4261
|
+
var sitelinkAssetSchema = z8.object({
|
|
4262
|
+
type: z8.literal("sitelink"),
|
|
4263
|
+
linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4264
|
+
description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4265
|
+
description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4266
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4267
|
+
});
|
|
4268
|
+
var calloutAssetSchema = z8.object({
|
|
4269
|
+
type: z8.literal("callout"),
|
|
4270
|
+
calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4271
|
+
});
|
|
4272
|
+
var structuredSnippetAssetSchema = z8.object({
|
|
4273
|
+
type: z8.literal("structuredSnippet"),
|
|
4274
|
+
header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4275
|
+
values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4276
|
+
});
|
|
4277
|
+
var callToActionAssetSchema = z8.object({ type: z8.literal("callToAction"), callToAction: z8.string().min(1) });
|
|
4278
|
+
var assetCreateSchema = z8.discriminatedUnion("type", [
|
|
4279
|
+
textAssetSchema,
|
|
4280
|
+
imageAssetSchema,
|
|
4281
|
+
youtubeVideoAssetSchema,
|
|
4282
|
+
sitelinkAssetSchema,
|
|
4283
|
+
calloutAssetSchema,
|
|
4284
|
+
structuredSnippetAssetSchema,
|
|
4285
|
+
callToActionAssetSchema
|
|
4286
|
+
]);
|
|
4287
|
+
var assetLinkAttachSchema = z8.object({
|
|
4288
|
+
level: z8.enum(["campaign", "adGroup", "customer"]),
|
|
4289
|
+
parent: refSchema.optional(),
|
|
4290
|
+
asset: refSchema,
|
|
4291
|
+
fieldType: z8.enum(ASSET_FIELD_TYPES)
|
|
4292
|
+
});
|
|
4293
|
+
var audienceCreateSchema2 = z8.object({
|
|
4294
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4295
|
+
type: z8.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4296
|
+
description: z8.string().optional(),
|
|
4297
|
+
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4298
|
+
members: z8.array(z8.record(z8.string(), z8.string())).optional(),
|
|
4299
|
+
sourceFileRef: z8.string().optional()
|
|
4300
|
+
});
|
|
4301
|
+
var audienceCriterionAttachSchema = z8.object({
|
|
4302
|
+
level: z8.enum(["campaign", "adGroup"]),
|
|
4303
|
+
parent: refSchema,
|
|
4304
|
+
userList: refSchema,
|
|
4305
|
+
negative: z8.boolean().default(false)
|
|
4306
|
+
});
|
|
4307
|
+
var conversionActionCreateSchema = z8.object({
|
|
4308
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
4309
|
+
type: z8.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
4310
|
+
category: z8.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
4311
|
+
countingType: z8.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4312
|
+
defaultValueMicros: microsSchema.optional(),
|
|
4313
|
+
defaultCurrencyCode: z8.string().length(3).optional(),
|
|
4314
|
+
clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4315
|
+
viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4316
|
+
status: z8.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
4317
|
+
});
|
|
4318
|
+
var conversionActionUpdateSchema = z8.object({
|
|
4319
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
4320
|
+
category: z8.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
4321
|
+
countingType: z8.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
4322
|
+
defaultValueMicros: microsSchema.optional(),
|
|
4323
|
+
status: z8.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
4324
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4325
|
+
var biddingStrategyCreateSchema = z8.object({
|
|
4326
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
4327
|
+
config: biddingConfigSchema
|
|
4328
|
+
}).superRefine((p, ctx) => {
|
|
4329
|
+
if (p.config.type === "MANUAL_CPC") {
|
|
4330
|
+
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
4331
|
+
}
|
|
4332
|
+
});
|
|
4333
|
+
var biddingStrategyUpdateSchema = z8.object({
|
|
4334
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
4335
|
+
config: biddingConfigSchema.optional()
|
|
4336
|
+
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4337
|
+
var labelCreateSchema = z8.object({
|
|
4338
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
4339
|
+
backgroundColor: z8.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
4340
|
+
description: z8.string().optional()
|
|
4341
|
+
});
|
|
4342
|
+
var labelAttachSchema = z8.object({
|
|
4343
|
+
level: z8.enum(["campaign", "adGroup", "ad"]),
|
|
4344
|
+
parent: refSchema,
|
|
4345
|
+
label: refSchema
|
|
4346
|
+
});
|
|
4347
|
+
var locationCriterionSchema = z8.object({
|
|
4348
|
+
criterionType: z8.literal("location"),
|
|
4349
|
+
geoTargetConstant: z8.union([z8.string().regex(GEO_TARGET_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
|
|
4350
|
+
});
|
|
4351
|
+
var languageCriterionSchema = z8.object({
|
|
4352
|
+
criterionType: z8.literal("language"),
|
|
4353
|
+
languageConstant: z8.union([z8.string().regex(LANGUAGE_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
|
|
4354
|
+
});
|
|
4355
|
+
var adScheduleCriterionSchema = z8.object({
|
|
4356
|
+
criterionType: z8.literal("adSchedule"),
|
|
4357
|
+
dayOfWeek: z8.enum(DAYS_OF_WEEK),
|
|
4358
|
+
startHour: z8.number().int().min(0).max(23),
|
|
4359
|
+
startMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
4360
|
+
endHour: z8.number().int().min(0).max(24),
|
|
4361
|
+
endMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
4362
|
+
});
|
|
4363
|
+
var deviceCriterionSchema = z8.object({
|
|
4364
|
+
criterionType: z8.literal("device"),
|
|
4365
|
+
device: z8.enum(DEVICE_TYPES),
|
|
4366
|
+
bidModifier: z8.number().min(0.1).max(10).optional()
|
|
4367
|
+
});
|
|
4368
|
+
var campaignCriterionAddSchema = z8.object({
|
|
4369
|
+
campaign: refSchema,
|
|
4370
|
+
negative: z8.boolean().default(false),
|
|
4371
|
+
criterion: z8.discriminatedUnion("criterionType", [
|
|
4372
|
+
locationCriterionSchema,
|
|
4373
|
+
languageCriterionSchema,
|
|
4374
|
+
adScheduleCriterionSchema,
|
|
4375
|
+
deviceCriterionSchema
|
|
4376
|
+
])
|
|
4377
|
+
});
|
|
4378
|
+
var GOOGLE_DRAFT_OP_KINDS = [
|
|
4379
|
+
"google.budget.create",
|
|
4380
|
+
"google.budget.update",
|
|
4381
|
+
"google.campaign.create",
|
|
4382
|
+
"google.campaign.update",
|
|
4383
|
+
"google.campaign.pause",
|
|
4384
|
+
"google.campaign.resume",
|
|
4385
|
+
"google.campaign.remove",
|
|
4386
|
+
"google.adGroup.create",
|
|
4387
|
+
"google.adGroup.update",
|
|
4388
|
+
"google.adGroup.pause",
|
|
4389
|
+
"google.adGroup.resume",
|
|
4390
|
+
"google.adGroup.remove",
|
|
4391
|
+
"google.keyword.add",
|
|
4392
|
+
"google.keyword.update",
|
|
4393
|
+
"google.keyword.remove",
|
|
4394
|
+
"google.negativeKeyword.add",
|
|
4395
|
+
"google.negativeKeyword.remove",
|
|
4396
|
+
"google.sharedSet.create",
|
|
4397
|
+
"google.sharedSetMember.add",
|
|
4398
|
+
"google.sharedSetMember.remove",
|
|
4399
|
+
"google.campaignSharedSet.attach",
|
|
4400
|
+
"google.campaignSharedSet.detach",
|
|
4401
|
+
"google.ad.create",
|
|
4402
|
+
"google.ad.update",
|
|
4403
|
+
"google.ad.pause",
|
|
4404
|
+
"google.ad.resume",
|
|
4405
|
+
"google.ad.remove",
|
|
4406
|
+
"google.asset.create",
|
|
4407
|
+
"google.assetLink.attach",
|
|
4408
|
+
"google.assetLink.detach",
|
|
4409
|
+
"google.audience.create",
|
|
4410
|
+
"google.audienceCriterion.attach",
|
|
4411
|
+
"google.audienceCriterion.detach",
|
|
4412
|
+
"google.conversionAction.create",
|
|
4413
|
+
"google.conversionAction.update",
|
|
4414
|
+
"google.biddingStrategy.create",
|
|
4415
|
+
"google.biddingStrategy.update",
|
|
4416
|
+
"google.label.create",
|
|
4417
|
+
"google.label.attach",
|
|
4418
|
+
"google.campaignCriterion.add",
|
|
4419
|
+
"google.campaignCriterion.remove"
|
|
4420
|
+
];
|
|
4421
|
+
var googleDraftOpKindSchema = z8.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
4422
|
+
function createOp2(kind, payload) {
|
|
4423
|
+
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, payload });
|
|
4424
|
+
}
|
|
4425
|
+
function updateOp2(kind, payload) {
|
|
4426
|
+
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
4427
|
+
}
|
|
4428
|
+
function targetOp(kind) {
|
|
4429
|
+
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
4430
|
+
}
|
|
4431
|
+
var googleDraftOpInputSchema = z8.discriminatedUnion("kind", [
|
|
4432
|
+
createOp2("google.budget.create", budgetCreateSchema),
|
|
4433
|
+
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
4434
|
+
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
4435
|
+
updateOp2("google.campaign.update", campaignUpdateSchema2),
|
|
4436
|
+
targetOp("google.campaign.pause"),
|
|
4437
|
+
targetOp("google.campaign.resume"),
|
|
4438
|
+
targetOp("google.campaign.remove"),
|
|
4439
|
+
createOp2("google.adGroup.create", adGroupCreateSchema),
|
|
4440
|
+
updateOp2("google.adGroup.update", adGroupUpdateSchema),
|
|
4441
|
+
targetOp("google.adGroup.pause"),
|
|
4442
|
+
targetOp("google.adGroup.resume"),
|
|
4443
|
+
targetOp("google.adGroup.remove"),
|
|
4444
|
+
createOp2("google.keyword.add", keywordAddSchema),
|
|
4445
|
+
updateOp2("google.keyword.update", keywordUpdateSchema),
|
|
4446
|
+
targetOp("google.keyword.remove"),
|
|
4447
|
+
createOp2("google.negativeKeyword.add", negativeKeywordAddSchema),
|
|
4448
|
+
targetOp("google.negativeKeyword.remove"),
|
|
4449
|
+
createOp2("google.sharedSet.create", sharedSetCreateSchema),
|
|
4450
|
+
createOp2("google.sharedSetMember.add", sharedSetMemberAddSchema),
|
|
4451
|
+
targetOp("google.sharedSetMember.remove"),
|
|
4452
|
+
createOp2("google.campaignSharedSet.attach", campaignSharedSetAttachSchema),
|
|
4453
|
+
targetOp("google.campaignSharedSet.detach"),
|
|
4454
|
+
createOp2("google.ad.create", adCreateSchema),
|
|
4455
|
+
updateOp2("google.ad.update", adUpdateSchema),
|
|
4456
|
+
targetOp("google.ad.pause"),
|
|
4457
|
+
targetOp("google.ad.resume"),
|
|
4458
|
+
targetOp("google.ad.remove"),
|
|
4459
|
+
createOp2("google.asset.create", assetCreateSchema),
|
|
4460
|
+
createOp2("google.assetLink.attach", assetLinkAttachSchema),
|
|
4461
|
+
targetOp("google.assetLink.detach"),
|
|
4462
|
+
createOp2("google.audience.create", audienceCreateSchema2),
|
|
4463
|
+
createOp2("google.audienceCriterion.attach", audienceCriterionAttachSchema),
|
|
4464
|
+
targetOp("google.audienceCriterion.detach"),
|
|
4465
|
+
createOp2("google.conversionAction.create", conversionActionCreateSchema),
|
|
4466
|
+
updateOp2("google.conversionAction.update", conversionActionUpdateSchema),
|
|
4467
|
+
createOp2("google.biddingStrategy.create", biddingStrategyCreateSchema),
|
|
4468
|
+
updateOp2("google.biddingStrategy.update", biddingStrategyUpdateSchema),
|
|
4469
|
+
createOp2("google.label.create", labelCreateSchema),
|
|
4470
|
+
createOp2("google.label.attach", labelAttachSchema),
|
|
4471
|
+
createOp2("google.campaignCriterion.add", campaignCriterionAddSchema),
|
|
4472
|
+
targetOp("google.campaignCriterion.remove")
|
|
4473
|
+
]);
|
|
4474
|
+
|
|
4475
|
+
// ../api/src/ads-google/wire.ts
|
|
4476
|
+
import { z as z9 } from "zod";
|
|
4477
|
+
var googleWriteModeSchema = z9.enum(["live", "simulated"]);
|
|
4478
|
+
var googleDraftOpResultSchema = z9.object({
|
|
4479
|
+
status: z9.enum(["applied", "simulated", "failed", "skipped"]),
|
|
4480
|
+
resourceName: z9.string().optional(),
|
|
4481
|
+
error: z9.string().optional(),
|
|
4482
|
+
skippedBecause: z9.string().optional(),
|
|
4483
|
+
executedAt: z9.number().optional()
|
|
4484
|
+
});
|
|
4485
|
+
var googleDraftStageRequestSchema = z9.object({
|
|
4486
|
+
chatId: z9.string(),
|
|
4487
|
+
op: googleDraftOpInputSchema
|
|
4488
|
+
});
|
|
4489
|
+
var googleDraftStageResponseSchema = z9.object({
|
|
4490
|
+
staged: z9.literal(true),
|
|
4491
|
+
ref: z9.string(),
|
|
4492
|
+
kind: googleDraftOpKindSchema,
|
|
4493
|
+
mode: googleWriteModeSchema,
|
|
4494
|
+
dependsOn: z9.array(z9.string()),
|
|
4495
|
+
summary: z9.string(),
|
|
4496
|
+
warnings: z9.array(z9.string()),
|
|
4497
|
+
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
4498
|
+
amended: z9.boolean().optional()
|
|
4499
|
+
});
|
|
4500
|
+
var googleDraftOpViewSchema = z9.object({
|
|
4501
|
+
ref: z9.string(),
|
|
4502
|
+
kind: googleDraftOpKindSchema,
|
|
4503
|
+
customerId: z9.string(),
|
|
4504
|
+
target: z9.string().optional(),
|
|
4505
|
+
dependsOn: z9.array(z9.string()),
|
|
4506
|
+
summary: z9.string(),
|
|
4507
|
+
stagedAt: z9.number(),
|
|
4508
|
+
result: googleDraftOpResultSchema.optional()
|
|
4509
|
+
});
|
|
4510
|
+
var googleDraftListRequestSchema = z9.object({
|
|
4511
|
+
chatId: z9.string()
|
|
4512
|
+
});
|
|
4513
|
+
var googleDraftListResponseSchema = z9.object({
|
|
4514
|
+
status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
4515
|
+
mode: googleWriteModeSchema,
|
|
4516
|
+
count: z9.number(),
|
|
4517
|
+
ops: z9.array(googleDraftOpViewSchema)
|
|
4518
|
+
});
|
|
4519
|
+
var googleDraftRemoveRequestSchema = z9.object({
|
|
4520
|
+
chatId: z9.string(),
|
|
4521
|
+
ref: z9.string()
|
|
4522
|
+
});
|
|
4523
|
+
var googleDraftRemoveResponseSchema = z9.object({
|
|
4524
|
+
/** The requested ref plus any dependents removed by cascade. */
|
|
4525
|
+
removed: z9.array(z9.string())
|
|
4526
|
+
});
|
|
4527
|
+
var googleDraftClearRequestSchema = z9.object({
|
|
4528
|
+
chatId: z9.string()
|
|
4529
|
+
});
|
|
4530
|
+
var googleDraftClearResponseSchema = z9.object({
|
|
4531
|
+
cleared: z9.number()
|
|
4532
|
+
});
|
|
4533
|
+
var googleFieldErrorSchema = z9.object({
|
|
4534
|
+
path: z9.string(),
|
|
4535
|
+
message: z9.string()
|
|
4536
|
+
});
|
|
4537
|
+
var googleDraftErrorResponseSchema = z9.object({
|
|
4538
|
+
code: z9.string(),
|
|
4539
|
+
error: z9.string(),
|
|
4540
|
+
fields: z9.array(googleFieldErrorSchema).optional()
|
|
4541
|
+
});
|
|
4542
|
+
|
|
4543
|
+
// src/commands/ads/google/write-shared.ts
|
|
4544
|
+
function failWriteValidation(message) {
|
|
4545
|
+
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
4546
|
+
process.exit(1);
|
|
4547
|
+
}
|
|
4548
|
+
function requireCustomerId(args) {
|
|
4549
|
+
const raw = args["customer-id"] ?? args.customerId;
|
|
4550
|
+
if (!raw || !/^\d{10}$/.test(raw)) {
|
|
4551
|
+
failWriteValidation("pass --customer-id as the 10-digit Google Ads customer id (no dashes)");
|
|
4552
|
+
}
|
|
4553
|
+
return raw;
|
|
4554
|
+
}
|
|
4555
|
+
function requireTarget(args, entity) {
|
|
4556
|
+
const positional = Array.isArray(args._) ? args._[0] : void 0;
|
|
4557
|
+
const target = args.id ?? args.target ?? positional;
|
|
4558
|
+
if (typeof target !== "string" || target.length === 0) {
|
|
4559
|
+
failWriteValidation(`pass the ${entity} resource name or id as the positional argument`);
|
|
4560
|
+
}
|
|
4561
|
+
return target;
|
|
4562
|
+
}
|
|
4563
|
+
function requireStringFlag(value, flag) {
|
|
4564
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
4565
|
+
failWriteValidation(`${flag} is required`);
|
|
4566
|
+
}
|
|
4567
|
+
return value;
|
|
4568
|
+
}
|
|
4569
|
+
function microsFlag(value, flag) {
|
|
4570
|
+
if (value === void 0 || value === null || value === "") {
|
|
4571
|
+
return void 0;
|
|
4572
|
+
}
|
|
4573
|
+
const num = Number(value);
|
|
4574
|
+
if (Number.isNaN(num) || num <= 0) {
|
|
4575
|
+
failWriteValidation(`${flag} must be a positive amount (major currency units, e.g. 50 or 50.00)`);
|
|
4576
|
+
}
|
|
4577
|
+
return toMicros(num);
|
|
4578
|
+
}
|
|
4579
|
+
function listFlag(value) {
|
|
4580
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
4581
|
+
return void 0;
|
|
4582
|
+
}
|
|
4583
|
+
const items = value.split(",").map((v) => v.trim()).filter(Boolean);
|
|
4584
|
+
return items.length > 0 ? items : void 0;
|
|
4585
|
+
}
|
|
4586
|
+
function loadJsonFileArg(path11) {
|
|
4587
|
+
if (typeof path11 !== "string" || path11.length === 0) {
|
|
4588
|
+
return {};
|
|
4589
|
+
}
|
|
4590
|
+
try {
|
|
4591
|
+
const parsed = JSON.parse(readFileSync3(path11, "utf8"));
|
|
4592
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
4593
|
+
failWriteValidation(`${path11} must contain a JSON object`);
|
|
4594
|
+
}
|
|
4595
|
+
return parsed;
|
|
4596
|
+
} catch (err) {
|
|
4597
|
+
if (err instanceof SyntaxError) {
|
|
4598
|
+
failWriteValidation(`${path11} is not valid JSON: ${err.message}`);
|
|
4599
|
+
}
|
|
4600
|
+
throw err;
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
function mergePayload(file, flags) {
|
|
4604
|
+
const merged = { ...file };
|
|
4605
|
+
for (const [key, value] of Object.entries(flags)) {
|
|
4606
|
+
if (value !== void 0) {
|
|
4607
|
+
merged[key] = value;
|
|
4608
|
+
}
|
|
4609
|
+
}
|
|
4610
|
+
return merged;
|
|
4611
|
+
}
|
|
4612
|
+
function handleGoogleError(err) {
|
|
4613
|
+
if (err instanceof ApiError) {
|
|
4614
|
+
writeJsonEnvelope({ ok: false, error: { code: err.code ?? "API_ERROR", message: err.message } });
|
|
4615
|
+
process.exit(1);
|
|
4616
|
+
}
|
|
4617
|
+
writeJsonEnvelope({
|
|
4618
|
+
ok: false,
|
|
4619
|
+
error: { code: "UNKNOWN", message: err instanceof Error ? err.message : String(err) }
|
|
4620
|
+
});
|
|
4621
|
+
process.exit(1);
|
|
4622
|
+
}
|
|
4623
|
+
async function stageGoogleOp(raw) {
|
|
4624
|
+
const preflight = googleDraftOpInputSchema.safeParse(raw);
|
|
4625
|
+
if (!preflight.success) {
|
|
4626
|
+
const fields = preflight.error.issues.map((issue) => ({ path: issue.path.join("."), message: issue.message }));
|
|
4627
|
+
writeJsonEnvelope({
|
|
4628
|
+
ok: false,
|
|
4629
|
+
error: {
|
|
4630
|
+
code: "VALIDATION_ERROR",
|
|
4631
|
+
message: fields.map((f) => f.path ? `${f.path}: ${f.message}` : f.message).join("; "),
|
|
4632
|
+
fields
|
|
4633
|
+
}
|
|
4634
|
+
});
|
|
4635
|
+
process.exit(1);
|
|
4636
|
+
}
|
|
4637
|
+
try {
|
|
4638
|
+
const chatId = requireChatId();
|
|
4639
|
+
const response = await apiPost("/api/ads/google/draft/stage", { chatId, op: preflight.data });
|
|
4640
|
+
writeJsonEnvelope(response);
|
|
4641
|
+
} catch (err) {
|
|
4642
|
+
handleGoogleError(err);
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
async function stageCreate(kind, customerId, payload) {
|
|
4646
|
+
await stageGoogleOp({ kind, customerId, payload });
|
|
4647
|
+
}
|
|
4648
|
+
async function stageUpdate(kind, customerId, target, payload) {
|
|
4649
|
+
await stageGoogleOp({ kind, customerId, target, payload });
|
|
4650
|
+
}
|
|
4651
|
+
async function stageTarget(kind, customerId, target) {
|
|
4652
|
+
await stageGoogleOp({ kind, customerId, target });
|
|
4653
|
+
}
|
|
4654
|
+
async function draftAction(path11, body) {
|
|
4655
|
+
try {
|
|
4656
|
+
const chatId = requireChatId();
|
|
4657
|
+
const response = await apiPost(path11, { chatId, ...body });
|
|
4658
|
+
writeJsonEnvelope(response);
|
|
4659
|
+
} catch (err) {
|
|
4660
|
+
handleGoogleError(err);
|
|
4661
|
+
}
|
|
4662
|
+
}
|
|
4663
|
+
|
|
4664
|
+
// src/commands/ads/google/draft.ts
|
|
4665
|
+
var draftCommand2 = defineCommand22({
|
|
4666
|
+
meta: { name: "draft", description: "List, remove, or clear staged Google Ads write ops for this chat" },
|
|
4667
|
+
subCommands: {
|
|
4668
|
+
list: defineCommand22({
|
|
4669
|
+
meta: { name: "list", description: "List staged ops (with lineage, mode, and results)" },
|
|
4670
|
+
run: async () => {
|
|
4671
|
+
await draftAction("/api/ads/google/draft", {});
|
|
4672
|
+
}
|
|
4673
|
+
}),
|
|
4674
|
+
remove: defineCommand22({
|
|
4675
|
+
meta: { name: "remove", description: "Remove one staged op (cascades to dependents)" },
|
|
4676
|
+
args: { ref: { type: "positional", description: "Staged op ref (g_temp_* or target)", required: false } },
|
|
4677
|
+
run: async ({ args }) => {
|
|
4678
|
+
await draftAction("/api/ads/google/draft/remove", { ref: requireTarget(args, "op") });
|
|
4679
|
+
}
|
|
4680
|
+
}),
|
|
4681
|
+
clear: defineCommand22({
|
|
4682
|
+
meta: { name: "clear", description: "Discard all staged ops on this chat" },
|
|
4683
|
+
run: async () => {
|
|
4684
|
+
await draftAction("/api/ads/google/draft/clear", {});
|
|
4685
|
+
}
|
|
4686
|
+
})
|
|
4687
|
+
}
|
|
4688
|
+
});
|
|
4689
|
+
|
|
3835
4690
|
// src/commands/ads/google/keywords/index.ts
|
|
3836
|
-
import { defineCommand as
|
|
4691
|
+
import { defineCommand as defineCommand27 } from "citty";
|
|
3837
4692
|
|
|
3838
4693
|
// src/commands/ads/google/keywords/discover.ts
|
|
3839
|
-
import { defineCommand as
|
|
4694
|
+
import { defineCommand as defineCommand23 } from "citty";
|
|
3840
4695
|
|
|
3841
4696
|
// src/geo-context.ts
|
|
3842
4697
|
var GOOGLE_ADS_LOCATIONS = [
|
|
@@ -4111,7 +4966,7 @@ function handleKeywordError(err) {
|
|
|
4111
4966
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
4112
4967
|
process.exit(1);
|
|
4113
4968
|
}
|
|
4114
|
-
var discoverCommand =
|
|
4969
|
+
var discoverCommand = defineCommand23({
|
|
4115
4970
|
meta: {
|
|
4116
4971
|
name: "discover",
|
|
4117
4972
|
description: `Discover new keyword ideas from seed keywords or competitor URLs.
|
|
@@ -4173,7 +5028,7 @@ Examples:
|
|
|
4173
5028
|
});
|
|
4174
5029
|
|
|
4175
5030
|
// src/commands/ads/google/keywords/languages.ts
|
|
4176
|
-
import { defineCommand as
|
|
5031
|
+
import { defineCommand as defineCommand24 } from "citty";
|
|
4177
5032
|
registerSchema({
|
|
4178
5033
|
command: "ads.google.keywords.languages",
|
|
4179
5034
|
description: "List all supported language IDs for --language flag in Google Ads keyword commands.",
|
|
@@ -4183,7 +5038,7 @@ var FIELDS = {
|
|
|
4183
5038
|
id: "Language ID to pass as --language",
|
|
4184
5039
|
name: "Language name"
|
|
4185
5040
|
};
|
|
4186
|
-
var languagesCommand =
|
|
5041
|
+
var languagesCommand = defineCommand24({
|
|
4187
5042
|
meta: {
|
|
4188
5043
|
name: "languages",
|
|
4189
5044
|
description: "List all supported language IDs for --language flag."
|
|
@@ -4194,7 +5049,7 @@ var languagesCommand = defineCommand23({
|
|
|
4194
5049
|
});
|
|
4195
5050
|
|
|
4196
5051
|
// src/commands/ads/google/keywords/locations.ts
|
|
4197
|
-
import { defineCommand as
|
|
5052
|
+
import { defineCommand as defineCommand25 } from "citty";
|
|
4198
5053
|
registerSchema({
|
|
4199
5054
|
command: "ads.google.keywords.locations",
|
|
4200
5055
|
description: "List all supported geo target IDs for --location flag in Google Ads keyword commands.",
|
|
@@ -4204,7 +5059,7 @@ var FIELDS2 = {
|
|
|
4204
5059
|
id: "Geo target ID to pass as --location",
|
|
4205
5060
|
name: "Country/region name"
|
|
4206
5061
|
};
|
|
4207
|
-
var locationsCommand =
|
|
5062
|
+
var locationsCommand = defineCommand25({
|
|
4208
5063
|
meta: {
|
|
4209
5064
|
name: "locations",
|
|
4210
5065
|
description: "List all supported geo target IDs for --location flag."
|
|
@@ -4215,7 +5070,7 @@ var locationsCommand = defineCommand24({
|
|
|
4215
5070
|
});
|
|
4216
5071
|
|
|
4217
5072
|
// src/commands/ads/google/keywords/metrics.ts
|
|
4218
|
-
import { defineCommand as
|
|
5073
|
+
import { defineCommand as defineCommand26 } from "citty";
|
|
4219
5074
|
registerSchema({
|
|
4220
5075
|
command: "ads.google.keywords.metrics",
|
|
4221
5076
|
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.",
|
|
@@ -4239,7 +5094,7 @@ registerSchema({
|
|
|
4239
5094
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
4240
5095
|
}
|
|
4241
5096
|
});
|
|
4242
|
-
var metricsCommand =
|
|
5097
|
+
var metricsCommand = defineCommand26({
|
|
4243
5098
|
meta: {
|
|
4244
5099
|
name: "metrics",
|
|
4245
5100
|
description: `Get historical search metrics for specific keywords.
|
|
@@ -4326,7 +5181,7 @@ Examples:
|
|
|
4326
5181
|
});
|
|
4327
5182
|
|
|
4328
5183
|
// src/commands/ads/google/keywords/index.ts
|
|
4329
|
-
var keywordsCommand =
|
|
5184
|
+
var keywordsCommand = defineCommand27({
|
|
4330
5185
|
meta: {
|
|
4331
5186
|
name: "keywords",
|
|
4332
5187
|
description: `Keyword research tools. Subcommands: discover, metrics, locations, languages.
|
|
@@ -4346,8 +5201,8 @@ Examples:
|
|
|
4346
5201
|
});
|
|
4347
5202
|
|
|
4348
5203
|
// src/commands/ads/google/library/index.ts
|
|
4349
|
-
import { defineCommand as
|
|
4350
|
-
var listAdvertisers =
|
|
5204
|
+
import { defineCommand as defineCommand28 } from "citty";
|
|
5205
|
+
var listAdvertisers = defineCommand28({
|
|
4351
5206
|
meta: {
|
|
4352
5207
|
name: "list-advertisers",
|
|
4353
5208
|
description: "List tracked Google advertisers and their accounts"
|
|
@@ -4364,7 +5219,7 @@ var listAdvertisers = defineCommand27({
|
|
|
4364
5219
|
}
|
|
4365
5220
|
}
|
|
4366
5221
|
});
|
|
4367
|
-
var syncStatus =
|
|
5222
|
+
var syncStatus = defineCommand28({
|
|
4368
5223
|
meta: {
|
|
4369
5224
|
name: "sync-status",
|
|
4370
5225
|
description: "Check the sync status and ad counts of a Google account"
|
|
@@ -4384,7 +5239,7 @@ var syncStatus = defineCommand27({
|
|
|
4384
5239
|
writeAdsJson({ ok: true, data });
|
|
4385
5240
|
}
|
|
4386
5241
|
});
|
|
4387
|
-
var searchAds =
|
|
5242
|
+
var searchAds = defineCommand28({
|
|
4388
5243
|
meta: {
|
|
4389
5244
|
name: "search-ads",
|
|
4390
5245
|
description: "Search and filter Google ads for an account"
|
|
@@ -4441,7 +5296,7 @@ var searchAds = defineCommand27({
|
|
|
4441
5296
|
}
|
|
4442
5297
|
}
|
|
4443
5298
|
});
|
|
4444
|
-
var searchAdvertiser =
|
|
5299
|
+
var searchAdvertiser = defineCommand28({
|
|
4445
5300
|
meta: {
|
|
4446
5301
|
name: "search-advertiser",
|
|
4447
5302
|
description: "Search for an advertiser on the Google Ads Transparency Center"
|
|
@@ -4476,7 +5331,7 @@ var searchAdvertiser = defineCommand27({
|
|
|
4476
5331
|
function sleep(ms) {
|
|
4477
5332
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
4478
5333
|
}
|
|
4479
|
-
var track =
|
|
5334
|
+
var track = defineCommand28({
|
|
4480
5335
|
meta: {
|
|
4481
5336
|
name: "track",
|
|
4482
5337
|
description: "Track a new Google advertiser (from search results). Waits for initial sync to complete before returning."
|
|
@@ -4534,7 +5389,7 @@ var track = defineCommand27({
|
|
|
4534
5389
|
process.exit(1);
|
|
4535
5390
|
}
|
|
4536
5391
|
});
|
|
4537
|
-
var sync =
|
|
5392
|
+
var sync = defineCommand28({
|
|
4538
5393
|
meta: {
|
|
4539
5394
|
name: "sync",
|
|
4540
5395
|
description: "Trigger an immediate sync for a Google account. Waits for completion before returning."
|
|
@@ -4578,7 +5433,7 @@ var sync = defineCommand27({
|
|
|
4578
5433
|
process.exit(1);
|
|
4579
5434
|
}
|
|
4580
5435
|
});
|
|
4581
|
-
var searchCompetitors =
|
|
5436
|
+
var searchCompetitors = defineCommand28({
|
|
4582
5437
|
meta: {
|
|
4583
5438
|
name: "search-competitors",
|
|
4584
5439
|
description: "Search for competitors running Google ads for a keyword (DataForSEO)"
|
|
@@ -4610,7 +5465,7 @@ var searchCompetitors = defineCommand27({
|
|
|
4610
5465
|
}
|
|
4611
5466
|
}
|
|
4612
5467
|
});
|
|
4613
|
-
var library =
|
|
5468
|
+
var library = defineCommand28({
|
|
4614
5469
|
meta: {
|
|
4615
5470
|
name: "library",
|
|
4616
5471
|
description: "Manage and search the Google Ads Library"
|
|
@@ -4627,9 +5482,9 @@ var library = defineCommand27({
|
|
|
4627
5482
|
});
|
|
4628
5483
|
|
|
4629
5484
|
// src/commands/ads/google/query.ts
|
|
4630
|
-
import { appendFileSync, existsSync as existsSync3, readFileSync as
|
|
5485
|
+
import { appendFileSync, existsSync as existsSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
4631
5486
|
import { resolve } from "path";
|
|
4632
|
-
import { defineCommand as
|
|
5487
|
+
import { defineCommand as defineCommand29 } from "citty";
|
|
4633
5488
|
|
|
4634
5489
|
// src/commands/ads/google/preflight.ts
|
|
4635
5490
|
function buildCommand2(query, customerId) {
|
|
@@ -4921,7 +5776,7 @@ function writeRowsToFile(filePath, rows, fields, append) {
|
|
|
4921
5776
|
`, "utf-8");
|
|
4922
5777
|
}
|
|
4923
5778
|
} else if (append && existsSync3(filePath)) {
|
|
4924
|
-
const existing = JSON.parse(
|
|
5779
|
+
const existing = JSON.parse(readFileSync4(filePath, "utf-8"));
|
|
4925
5780
|
writeFileSync2(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
|
|
4926
5781
|
} else {
|
|
4927
5782
|
writeFileSync2(filePath, JSON.stringify(rows, null, 2), "utf-8");
|
|
@@ -5085,7 +5940,7 @@ function handleQueryError(err, finalQuery, customerId) {
|
|
|
5085
5940
|
});
|
|
5086
5941
|
process.exit(1);
|
|
5087
5942
|
}
|
|
5088
|
-
var queryCommand =
|
|
5943
|
+
var queryCommand = defineCommand29({
|
|
5089
5944
|
meta: {
|
|
5090
5945
|
name: "query",
|
|
5091
5946
|
description: `Run GAQL queries against Google Ads. Supports raw GAQL, presets, pagination, file export, and caching.
|
|
@@ -5142,8 +5997,516 @@ Examples:
|
|
|
5142
5997
|
}
|
|
5143
5998
|
});
|
|
5144
5999
|
|
|
6000
|
+
// src/commands/ads/google/write-commands.ts
|
|
6001
|
+
import { defineCommand as defineCommand30 } from "citty";
|
|
6002
|
+
var customerIdArg = { "customer-id": { type: "string", description: "10-digit Google Ads customer id" } };
|
|
6003
|
+
var fileArg = {
|
|
6004
|
+
file: { type: "string", description: "JSON file with the full op payload (flags override)" }
|
|
6005
|
+
};
|
|
6006
|
+
var budgetsCommand = defineCommand30({
|
|
6007
|
+
meta: { name: "budgets", description: "Stage campaign budget create/update" },
|
|
6008
|
+
subCommands: {
|
|
6009
|
+
create: defineCommand30({
|
|
6010
|
+
meta: { name: "create", description: "Stage a campaign budget" },
|
|
6011
|
+
args: {
|
|
6012
|
+
...customerIdArg,
|
|
6013
|
+
...fileArg,
|
|
6014
|
+
name: { type: "string", description: "Budget name" },
|
|
6015
|
+
amount: { type: "string", description: "Daily amount in major currency units (e.g. 50)" },
|
|
6016
|
+
delivery: { type: "string", description: "STANDARD | ACCELERATED" },
|
|
6017
|
+
shared: { type: "boolean", description: "Explicitly shared budget" }
|
|
6018
|
+
},
|
|
6019
|
+
run: async ({ args }) => {
|
|
6020
|
+
const customerId = requireCustomerId(args);
|
|
6021
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6022
|
+
name: args.name,
|
|
6023
|
+
amountMicros: microsFlag(args.amount, "--amount"),
|
|
6024
|
+
deliveryMethod: args.delivery,
|
|
6025
|
+
explicitlyShared: args.shared || void 0
|
|
6026
|
+
});
|
|
6027
|
+
await stageCreate("google.budget.create", customerId, payload);
|
|
6028
|
+
}
|
|
6029
|
+
}),
|
|
6030
|
+
update: defineCommand30({
|
|
6031
|
+
meta: { name: "update", description: "Stage a budget update" },
|
|
6032
|
+
args: {
|
|
6033
|
+
...customerIdArg,
|
|
6034
|
+
...fileArg,
|
|
6035
|
+
name: { type: "string" },
|
|
6036
|
+
amount: { type: "string", description: "New daily amount in major currency units" },
|
|
6037
|
+
delivery: { type: "string" }
|
|
6038
|
+
},
|
|
6039
|
+
run: async ({ args }) => {
|
|
6040
|
+
const customerId = requireCustomerId(args);
|
|
6041
|
+
const target = requireTarget(args, "budget");
|
|
6042
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6043
|
+
name: args.name,
|
|
6044
|
+
amountMicros: microsFlag(args.amount, "--amount"),
|
|
6045
|
+
deliveryMethod: args.delivery
|
|
6046
|
+
});
|
|
6047
|
+
await stageUpdate("google.budget.update", customerId, target, payload);
|
|
6048
|
+
}
|
|
6049
|
+
})
|
|
6050
|
+
}
|
|
6051
|
+
});
|
|
6052
|
+
function biddingFromFlags(args) {
|
|
6053
|
+
const type = args["bidding-strategy"];
|
|
6054
|
+
if (!type) {
|
|
6055
|
+
return void 0;
|
|
6056
|
+
}
|
|
6057
|
+
return {
|
|
6058
|
+
type,
|
|
6059
|
+
targetCpaMicros: microsFlag(args["target-cpa"], "--target-cpa"),
|
|
6060
|
+
targetRoas: args["target-roas"] !== void 0 ? Number(args["target-roas"]) : void 0
|
|
6061
|
+
};
|
|
6062
|
+
}
|
|
6063
|
+
var campaignsCommand = defineCommand30({
|
|
6064
|
+
meta: { name: "campaigns", description: "Stage campaign create/update/pause/resume/remove" },
|
|
6065
|
+
subCommands: {
|
|
6066
|
+
create: defineCommand30({
|
|
6067
|
+
meta: { name: "create", description: "Stage a campaign" },
|
|
6068
|
+
args: {
|
|
6069
|
+
...customerIdArg,
|
|
6070
|
+
...fileArg,
|
|
6071
|
+
name: { type: "string" },
|
|
6072
|
+
"channel-type": {
|
|
6073
|
+
type: "string",
|
|
6074
|
+
description: "SEARCH | DISPLAY | SHOPPING | VIDEO | PERFORMANCE_MAX | DEMAND_GEN | \u2026"
|
|
6075
|
+
},
|
|
6076
|
+
"sub-type": { type: "string", description: "Advertising channel sub-type" },
|
|
6077
|
+
"budget-ref": { type: "string", description: "Budget ref (g_temp_*, id, or resource name)" },
|
|
6078
|
+
"bidding-strategy": {
|
|
6079
|
+
type: "string",
|
|
6080
|
+
description: "MANUAL_CPC | MAXIMIZE_CONVERSIONS | TARGET_CPA | TARGET_ROAS | \u2026"
|
|
6081
|
+
},
|
|
6082
|
+
"target-cpa": { type: "string", description: "Target CPA (major units) for TARGET_CPA" },
|
|
6083
|
+
"target-roas": { type: "string", description: "Target ROAS (e.g. 4.0) for TARGET_ROAS" },
|
|
6084
|
+
objective: { type: "string", description: "Advisory UI objective (SALES, LEADS, \u2026)" },
|
|
6085
|
+
"start-date": { type: "string", description: "YYYY-MM-DD" },
|
|
6086
|
+
"end-date": { type: "string", description: "YYYY-MM-DD" },
|
|
6087
|
+
status: { type: "string", description: "ENABLED | PAUSED (default PAUSED)" }
|
|
6088
|
+
},
|
|
6089
|
+
run: async ({ args }) => {
|
|
6090
|
+
const customerId = requireCustomerId(args);
|
|
6091
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6092
|
+
name: args.name,
|
|
6093
|
+
channelType: args["channel-type"],
|
|
6094
|
+
channelSubType: args["sub-type"],
|
|
6095
|
+
budget: args["budget-ref"],
|
|
6096
|
+
bidding: biddingFromFlags(args),
|
|
6097
|
+
objective: args.objective,
|
|
6098
|
+
startDate: args["start-date"],
|
|
6099
|
+
endDate: args["end-date"],
|
|
6100
|
+
status: args.status
|
|
6101
|
+
});
|
|
6102
|
+
await stageCreate("google.campaign.create", customerId, payload);
|
|
6103
|
+
}
|
|
6104
|
+
}),
|
|
6105
|
+
update: defineCommand30({
|
|
6106
|
+
meta: { name: "update", description: "Stage a campaign update" },
|
|
6107
|
+
args: {
|
|
6108
|
+
...customerIdArg,
|
|
6109
|
+
...fileArg,
|
|
6110
|
+
name: { type: "string" },
|
|
6111
|
+
"budget-ref": { type: "string" },
|
|
6112
|
+
"bidding-strategy": { type: "string" },
|
|
6113
|
+
"target-cpa": { type: "string" },
|
|
6114
|
+
"target-roas": { type: "string" },
|
|
6115
|
+
status: { type: "string" }
|
|
6116
|
+
},
|
|
6117
|
+
run: async ({ args }) => {
|
|
6118
|
+
const customerId = requireCustomerId(args);
|
|
6119
|
+
const target = requireTarget(args, "campaign");
|
|
6120
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6121
|
+
name: args.name,
|
|
6122
|
+
budget: args["budget-ref"],
|
|
6123
|
+
bidding: biddingFromFlags(args),
|
|
6124
|
+
status: args.status
|
|
6125
|
+
});
|
|
6126
|
+
await stageUpdate("google.campaign.update", customerId, target, payload);
|
|
6127
|
+
}
|
|
6128
|
+
}),
|
|
6129
|
+
pause: statusCommand2("google.campaign.pause", "campaign"),
|
|
6130
|
+
resume: statusCommand2("google.campaign.resume", "campaign"),
|
|
6131
|
+
remove: statusCommand2("google.campaign.remove", "campaign")
|
|
6132
|
+
}
|
|
6133
|
+
});
|
|
6134
|
+
function statusCommand2(kind, entity) {
|
|
6135
|
+
return defineCommand30({
|
|
6136
|
+
meta: { name: kind.split(".")[2], description: `Stage a ${entity} ${kind.split(".")[2]}` },
|
|
6137
|
+
args: {
|
|
6138
|
+
...customerIdArg,
|
|
6139
|
+
id: { type: "positional", description: `${entity} resource name or id`, required: false }
|
|
6140
|
+
},
|
|
6141
|
+
run: async ({ args }) => {
|
|
6142
|
+
const customerId = requireCustomerId(args);
|
|
6143
|
+
await stageTarget(kind, customerId, requireTarget(args, entity));
|
|
6144
|
+
}
|
|
6145
|
+
});
|
|
6146
|
+
}
|
|
6147
|
+
var adGroupsCommand = defineCommand30({
|
|
6148
|
+
meta: { name: "ad-groups", description: "Stage ad group create/update/pause/resume/remove" },
|
|
6149
|
+
subCommands: {
|
|
6150
|
+
create: defineCommand30({
|
|
6151
|
+
meta: { name: "create", description: "Stage an ad group" },
|
|
6152
|
+
args: {
|
|
6153
|
+
...customerIdArg,
|
|
6154
|
+
...fileArg,
|
|
6155
|
+
name: { type: "string" },
|
|
6156
|
+
"campaign-ref": { type: "string", description: "Campaign ref (g_temp_*, id, or resource name)" },
|
|
6157
|
+
type: { type: "string", description: "Ad group type (default SEARCH_STANDARD)" },
|
|
6158
|
+
"cpc-bid": { type: "string", description: "Default CPC bid in major units" },
|
|
6159
|
+
status: { type: "string" }
|
|
6160
|
+
},
|
|
6161
|
+
run: async ({ args }) => {
|
|
6162
|
+
const customerId = requireCustomerId(args);
|
|
6163
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6164
|
+
name: args.name,
|
|
6165
|
+
campaign: args["campaign-ref"],
|
|
6166
|
+
type: args.type,
|
|
6167
|
+
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6168
|
+
status: args.status
|
|
6169
|
+
});
|
|
6170
|
+
await stageCreate("google.adGroup.create", customerId, payload);
|
|
6171
|
+
}
|
|
6172
|
+
}),
|
|
6173
|
+
update: defineCommand30({
|
|
6174
|
+
meta: { name: "update", description: "Stage an ad group update" },
|
|
6175
|
+
args: {
|
|
6176
|
+
...customerIdArg,
|
|
6177
|
+
...fileArg,
|
|
6178
|
+
name: { type: "string" },
|
|
6179
|
+
"cpc-bid": { type: "string" },
|
|
6180
|
+
status: { type: "string" }
|
|
6181
|
+
},
|
|
6182
|
+
run: async ({ args }) => {
|
|
6183
|
+
const customerId = requireCustomerId(args);
|
|
6184
|
+
const target = requireTarget(args, "ad group");
|
|
6185
|
+
const payload = mergePayload(loadJsonFileArg(args.file), {
|
|
6186
|
+
name: args.name,
|
|
6187
|
+
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6188
|
+
status: args.status
|
|
6189
|
+
});
|
|
6190
|
+
await stageUpdate("google.adGroup.update", customerId, target, payload);
|
|
6191
|
+
}
|
|
6192
|
+
}),
|
|
6193
|
+
pause: statusCommand2("google.adGroup.pause", "ad group"),
|
|
6194
|
+
resume: statusCommand2("google.adGroup.resume", "ad group"),
|
|
6195
|
+
remove: statusCommand2("google.adGroup.remove", "ad group")
|
|
6196
|
+
}
|
|
6197
|
+
});
|
|
6198
|
+
var keywordWriteSubcommands = {
|
|
6199
|
+
add: defineCommand30({
|
|
6200
|
+
meta: { name: "add", description: "Add a keyword to an ad group" },
|
|
6201
|
+
args: {
|
|
6202
|
+
...customerIdArg,
|
|
6203
|
+
"ad-group-ref": { type: "string", description: "Ad group ref (g_temp_*, id, or resource name)" },
|
|
6204
|
+
text: { type: "string", description: "Keyword text" },
|
|
6205
|
+
"match-type": { type: "string", description: "EXACT | PHRASE | BROAD" },
|
|
6206
|
+
"cpc-bid": { type: "string", description: "Keyword CPC bid in major units" },
|
|
6207
|
+
"final-url": { type: "string", description: "Keyword-level final URL" }
|
|
6208
|
+
},
|
|
6209
|
+
run: async ({ args }) => {
|
|
6210
|
+
const customerId = requireCustomerId(args);
|
|
6211
|
+
await stageCreate("google.keyword.add", customerId, {
|
|
6212
|
+
adGroup: requireStringFlag(args["ad-group-ref"], "--ad-group-ref"),
|
|
6213
|
+
text: requireStringFlag(args.text, "--text"),
|
|
6214
|
+
matchType: requireStringFlag(args["match-type"], "--match-type"),
|
|
6215
|
+
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6216
|
+
finalUrls: args["final-url"] ? [args["final-url"]] : void 0
|
|
6217
|
+
});
|
|
6218
|
+
}
|
|
6219
|
+
}),
|
|
6220
|
+
update: defineCommand30({
|
|
6221
|
+
meta: { name: "update", description: "Update a keyword" },
|
|
6222
|
+
args: { ...customerIdArg, "cpc-bid": { type: "string" }, status: { type: "string" } },
|
|
6223
|
+
run: async ({ args }) => {
|
|
6224
|
+
const customerId = requireCustomerId(args);
|
|
6225
|
+
await stageUpdate("google.keyword.update", customerId, requireTarget(args, "keyword"), {
|
|
6226
|
+
cpcBidMicros: microsFlag(args["cpc-bid"], "--cpc-bid"),
|
|
6227
|
+
status: args.status
|
|
6228
|
+
});
|
|
6229
|
+
}
|
|
6230
|
+
}),
|
|
6231
|
+
remove: statusCommand2("google.keyword.remove", "keyword")
|
|
6232
|
+
};
|
|
6233
|
+
var negativeKeywordsCommand = defineCommand30({
|
|
6234
|
+
meta: { name: "negative-keywords", description: "Stage negative keyword add/remove (ad-group or campaign level)" },
|
|
6235
|
+
subCommands: {
|
|
6236
|
+
add: defineCommand30({
|
|
6237
|
+
meta: { name: "add", description: "Add a negative keyword" },
|
|
6238
|
+
args: {
|
|
6239
|
+
...customerIdArg,
|
|
6240
|
+
level: { type: "string", description: "adGroup | campaign" },
|
|
6241
|
+
"parent-ref": { type: "string", description: "Ad group or campaign ref" },
|
|
6242
|
+
text: { type: "string" },
|
|
6243
|
+
"match-type": { type: "string", description: "EXACT | PHRASE | BROAD" }
|
|
6244
|
+
},
|
|
6245
|
+
run: async ({ args }) => {
|
|
6246
|
+
const customerId = requireCustomerId(args);
|
|
6247
|
+
await stageCreate("google.negativeKeyword.add", customerId, {
|
|
6248
|
+
level: requireStringFlag(args.level, "--level"),
|
|
6249
|
+
parent: requireStringFlag(args["parent-ref"], "--parent-ref"),
|
|
6250
|
+
text: requireStringFlag(args.text, "--text"),
|
|
6251
|
+
matchType: requireStringFlag(args["match-type"], "--match-type")
|
|
6252
|
+
});
|
|
6253
|
+
}
|
|
6254
|
+
}),
|
|
6255
|
+
remove: statusCommand2("google.negativeKeyword.remove", "negative keyword")
|
|
6256
|
+
}
|
|
6257
|
+
});
|
|
6258
|
+
var keywordListsCommand = defineCommand30({
|
|
6259
|
+
meta: { name: "keyword-lists", description: "Stage shared negative keyword lists (create/add/attach/detach)" },
|
|
6260
|
+
subCommands: {
|
|
6261
|
+
create: defineCommand30({
|
|
6262
|
+
meta: { name: "create", description: "Create a shared negative keyword list" },
|
|
6263
|
+
args: {
|
|
6264
|
+
...customerIdArg,
|
|
6265
|
+
name: { type: "string" },
|
|
6266
|
+
type: {
|
|
6267
|
+
type: "string",
|
|
6268
|
+
description: "NEGATIVE_KEYWORDS (default) | NEGATIVE_PLACEMENTS | ACCOUNT_LEVEL_NEGATIVE_KEYWORDS"
|
|
6269
|
+
}
|
|
6270
|
+
},
|
|
6271
|
+
run: async ({ args }) => {
|
|
6272
|
+
const customerId = requireCustomerId(args);
|
|
6273
|
+
await stageCreate("google.sharedSet.create", customerId, {
|
|
6274
|
+
name: requireStringFlag(args.name, "--name"),
|
|
6275
|
+
type: args.type
|
|
6276
|
+
});
|
|
6277
|
+
}
|
|
6278
|
+
}),
|
|
6279
|
+
add: defineCommand30({
|
|
6280
|
+
meta: { name: "add", description: "Add a keyword to a shared list" },
|
|
6281
|
+
args: {
|
|
6282
|
+
...customerIdArg,
|
|
6283
|
+
"list-ref": { type: "string", description: "Shared set ref" },
|
|
6284
|
+
text: { type: "string" },
|
|
6285
|
+
"match-type": { type: "string" }
|
|
6286
|
+
},
|
|
6287
|
+
run: async ({ args }) => {
|
|
6288
|
+
const customerId = requireCustomerId(args);
|
|
6289
|
+
await stageCreate("google.sharedSetMember.add", customerId, {
|
|
6290
|
+
sharedSet: requireStringFlag(args["list-ref"], "--list-ref"),
|
|
6291
|
+
text: requireStringFlag(args.text, "--text"),
|
|
6292
|
+
matchType: requireStringFlag(args["match-type"], "--match-type")
|
|
6293
|
+
});
|
|
6294
|
+
}
|
|
6295
|
+
}),
|
|
6296
|
+
attach: defineCommand30({
|
|
6297
|
+
meta: { name: "attach", description: "Attach a keyword list to a campaign" },
|
|
6298
|
+
args: { ...customerIdArg, "campaign-ref": { type: "string" }, "list-ref": { type: "string" } },
|
|
6299
|
+
run: async ({ args }) => {
|
|
6300
|
+
const customerId = requireCustomerId(args);
|
|
6301
|
+
await stageCreate("google.campaignSharedSet.attach", customerId, {
|
|
6302
|
+
campaign: requireStringFlag(args["campaign-ref"], "--campaign-ref"),
|
|
6303
|
+
sharedSet: requireStringFlag(args["list-ref"], "--list-ref")
|
|
6304
|
+
});
|
|
6305
|
+
}
|
|
6306
|
+
}),
|
|
6307
|
+
detach: statusCommand2("google.campaignSharedSet.detach", "campaign shared set")
|
|
6308
|
+
}
|
|
6309
|
+
});
|
|
6310
|
+
function rsaContentFromFlags(args) {
|
|
6311
|
+
const headlines = listFlag(args.headlines);
|
|
6312
|
+
const descriptions = listFlag(args.descriptions);
|
|
6313
|
+
if (!headlines || !descriptions) {
|
|
6314
|
+
failWriteValidation("responsive search ads need --headlines and --descriptions (comma-separated), or use --file");
|
|
6315
|
+
}
|
|
6316
|
+
const finalUrls = listFlag(args["final-url"]);
|
|
6317
|
+
if (!finalUrls) {
|
|
6318
|
+
failWriteValidation("--final-url is required for a responsive search ad");
|
|
6319
|
+
}
|
|
6320
|
+
return {
|
|
6321
|
+
format: "responsiveSearch",
|
|
6322
|
+
headlines: headlines.map((text) => ({ text })),
|
|
6323
|
+
descriptions: descriptions.map((text) => ({ text })),
|
|
6324
|
+
path1: args.path1,
|
|
6325
|
+
path2: args.path2,
|
|
6326
|
+
finalUrls
|
|
6327
|
+
};
|
|
6328
|
+
}
|
|
6329
|
+
var adsCommand = defineCommand30({
|
|
6330
|
+
meta: { name: "ads", description: "Stage ad create/update/pause/resume/remove" },
|
|
6331
|
+
subCommands: {
|
|
6332
|
+
create: defineCommand30({
|
|
6333
|
+
meta: { name: "create", description: "Stage an ad (responsive search via flags; other formats via --file)" },
|
|
6334
|
+
args: {
|
|
6335
|
+
...customerIdArg,
|
|
6336
|
+
...fileArg,
|
|
6337
|
+
"ad-group-ref": { type: "string", description: "Ad group ref" },
|
|
6338
|
+
format: {
|
|
6339
|
+
type: "string",
|
|
6340
|
+
description: "responsiveSearch (default) | responsiveDisplay | performanceMaxAssetGroup | call | app | video | demandGen"
|
|
6341
|
+
},
|
|
6342
|
+
headlines: { type: "string", description: "Comma-separated headlines (RSA)" },
|
|
6343
|
+
descriptions: { type: "string", description: "Comma-separated descriptions (RSA)" },
|
|
6344
|
+
path1: { type: "string" },
|
|
6345
|
+
path2: { type: "string" },
|
|
6346
|
+
"final-url": { type: "string", description: "Comma-separated final URLs" },
|
|
6347
|
+
status: { type: "string" }
|
|
6348
|
+
},
|
|
6349
|
+
run: async ({ args }) => {
|
|
6350
|
+
const customerId = requireCustomerId(args);
|
|
6351
|
+
const file = loadJsonFileArg(args.file);
|
|
6352
|
+
const format = args.format ?? "responsiveSearch";
|
|
6353
|
+
const content = file.content ?? (format === "responsiveSearch" ? rsaContentFromFlags(args) : failWriteValidation(`--format ${format} needs --file with the ad content`));
|
|
6354
|
+
await stageCreate("google.ad.create", customerId, {
|
|
6355
|
+
adGroup: requireStringFlag(args["ad-group-ref"] ?? file.adGroup, "--ad-group-ref"),
|
|
6356
|
+
status: args.status ?? file.status,
|
|
6357
|
+
content
|
|
6358
|
+
});
|
|
6359
|
+
}
|
|
6360
|
+
}),
|
|
6361
|
+
update: defineCommand30({
|
|
6362
|
+
meta: { name: "update", description: "Stage an ad update" },
|
|
6363
|
+
args: { ...customerIdArg, ...fileArg, status: { type: "string" } },
|
|
6364
|
+
run: async ({ args }) => {
|
|
6365
|
+
const customerId = requireCustomerId(args);
|
|
6366
|
+
const file = loadJsonFileArg(args.file);
|
|
6367
|
+
await stageUpdate(
|
|
6368
|
+
"google.ad.update",
|
|
6369
|
+
customerId,
|
|
6370
|
+
requireTarget(args, "ad"),
|
|
6371
|
+
mergePayload(file, { status: args.status })
|
|
6372
|
+
);
|
|
6373
|
+
}
|
|
6374
|
+
}),
|
|
6375
|
+
pause: statusCommand2("google.ad.pause", "ad"),
|
|
6376
|
+
resume: statusCommand2("google.ad.resume", "ad"),
|
|
6377
|
+
remove: statusCommand2("google.ad.remove", "ad")
|
|
6378
|
+
}
|
|
6379
|
+
});
|
|
6380
|
+
function fileCreateCommand(name, kind, description) {
|
|
6381
|
+
return defineCommand30({
|
|
6382
|
+
meta: { name, description },
|
|
6383
|
+
args: { ...customerIdArg, ...fileArg },
|
|
6384
|
+
run: async ({ args }) => {
|
|
6385
|
+
const customerId = requireCustomerId(args);
|
|
6386
|
+
const payload = loadJsonFileArg(args.file);
|
|
6387
|
+
if (Object.keys(payload).length === 0) {
|
|
6388
|
+
failWriteValidation(`${kind} needs --file with the op payload`);
|
|
6389
|
+
}
|
|
6390
|
+
await stageGoogleOp({ kind, customerId, payload });
|
|
6391
|
+
}
|
|
6392
|
+
});
|
|
6393
|
+
}
|
|
6394
|
+
var assetsCommand = defineCommand30({
|
|
6395
|
+
meta: { name: "assets", description: "Stage asset create + asset-link attach/detach (via --file)" },
|
|
6396
|
+
subCommands: {
|
|
6397
|
+
create: fileCreateCommand(
|
|
6398
|
+
"create",
|
|
6399
|
+
"google.asset.create",
|
|
6400
|
+
"Stage an asset (text/image/sitelink/callout/structuredSnippet/\u2026)"
|
|
6401
|
+
),
|
|
6402
|
+
attach: fileCreateCommand("attach", "google.assetLink.attach", "Attach an asset to a campaign/adGroup/customer"),
|
|
6403
|
+
detach: statusCommand2("google.assetLink.detach", "asset link")
|
|
6404
|
+
}
|
|
6405
|
+
});
|
|
6406
|
+
var audiencesCommand = defineCommand30({
|
|
6407
|
+
meta: { name: "audiences", description: "Stage audience (user list) create + criterion attach/detach (via --file)" },
|
|
6408
|
+
subCommands: {
|
|
6409
|
+
create: fileCreateCommand("create", "google.audience.create", "Stage a user-list audience"),
|
|
6410
|
+
attach: fileCreateCommand(
|
|
6411
|
+
"attach",
|
|
6412
|
+
"google.audienceCriterion.attach",
|
|
6413
|
+
"Target/exclude an audience on a campaign/adGroup"
|
|
6414
|
+
),
|
|
6415
|
+
detach: statusCommand2("google.audienceCriterion.detach", "audience criterion")
|
|
6416
|
+
}
|
|
6417
|
+
});
|
|
6418
|
+
var conversionsCommand = defineCommand30({
|
|
6419
|
+
meta: { name: "conversions", description: "Stage conversion action create/update (via --file)" },
|
|
6420
|
+
subCommands: {
|
|
6421
|
+
create: fileCreateCommand("create", "google.conversionAction.create", "Stage a conversion action"),
|
|
6422
|
+
update: defineCommand30({
|
|
6423
|
+
meta: { name: "update", description: "Stage a conversion action update" },
|
|
6424
|
+
args: { ...customerIdArg, ...fileArg },
|
|
6425
|
+
run: async ({ args }) => {
|
|
6426
|
+
const customerId = requireCustomerId(args);
|
|
6427
|
+
await stageUpdate(
|
|
6428
|
+
"google.conversionAction.update",
|
|
6429
|
+
customerId,
|
|
6430
|
+
requireTarget(args, "conversion action"),
|
|
6431
|
+
loadJsonFileArg(args.file)
|
|
6432
|
+
);
|
|
6433
|
+
}
|
|
6434
|
+
})
|
|
6435
|
+
}
|
|
6436
|
+
});
|
|
6437
|
+
var biddingStrategiesCommand = defineCommand30({
|
|
6438
|
+
meta: { name: "bidding-strategies", description: "Stage portfolio bidding strategy create/update (via --file)" },
|
|
6439
|
+
subCommands: {
|
|
6440
|
+
create: fileCreateCommand("create", "google.biddingStrategy.create", "Stage a portfolio bidding strategy"),
|
|
6441
|
+
update: defineCommand30({
|
|
6442
|
+
meta: { name: "update", description: "Stage a portfolio bidding strategy update" },
|
|
6443
|
+
args: { ...customerIdArg, ...fileArg },
|
|
6444
|
+
run: async ({ args }) => {
|
|
6445
|
+
const customerId = requireCustomerId(args);
|
|
6446
|
+
await stageUpdate(
|
|
6447
|
+
"google.biddingStrategy.update",
|
|
6448
|
+
customerId,
|
|
6449
|
+
requireTarget(args, "bidding strategy"),
|
|
6450
|
+
loadJsonFileArg(args.file)
|
|
6451
|
+
);
|
|
6452
|
+
}
|
|
6453
|
+
})
|
|
6454
|
+
}
|
|
6455
|
+
});
|
|
6456
|
+
var labelsCommand = defineCommand30({
|
|
6457
|
+
meta: { name: "labels", description: "Stage label create + attach (via --file)" },
|
|
6458
|
+
subCommands: {
|
|
6459
|
+
create: defineCommand30({
|
|
6460
|
+
meta: { name: "create", description: "Create a label" },
|
|
6461
|
+
args: {
|
|
6462
|
+
...customerIdArg,
|
|
6463
|
+
name: { type: "string" },
|
|
6464
|
+
"background-color": { type: "string" },
|
|
6465
|
+
description: { type: "string" }
|
|
6466
|
+
},
|
|
6467
|
+
run: async ({ args }) => {
|
|
6468
|
+
const customerId = requireCustomerId(args);
|
|
6469
|
+
await stageCreate("google.label.create", customerId, {
|
|
6470
|
+
name: requireStringFlag(args.name, "--name"),
|
|
6471
|
+
backgroundColor: args["background-color"],
|
|
6472
|
+
description: args.description
|
|
6473
|
+
});
|
|
6474
|
+
}
|
|
6475
|
+
}),
|
|
6476
|
+
attach: fileCreateCommand("attach", "google.label.attach", "Attach a label to a campaign/adGroup/ad")
|
|
6477
|
+
}
|
|
6478
|
+
});
|
|
6479
|
+
var campaignCriteriaCommand = defineCommand30({
|
|
6480
|
+
meta: {
|
|
6481
|
+
name: "campaign-criteria",
|
|
6482
|
+
description: "Stage campaign criteria (location/language/adSchedule/device) add/remove (via --file)"
|
|
6483
|
+
},
|
|
6484
|
+
subCommands: {
|
|
6485
|
+
add: fileCreateCommand("add", "google.campaignCriterion.add", "Add a campaign criterion"),
|
|
6486
|
+
remove: statusCommand2("google.campaignCriterion.remove", "campaign criterion")
|
|
6487
|
+
}
|
|
6488
|
+
});
|
|
6489
|
+
var googleWriteCommands = {
|
|
6490
|
+
budgets: budgetsCommand,
|
|
6491
|
+
campaigns: campaignsCommand,
|
|
6492
|
+
"ad-groups": adGroupsCommand,
|
|
6493
|
+
"negative-keywords": negativeKeywordsCommand,
|
|
6494
|
+
"keyword-lists": keywordListsCommand,
|
|
6495
|
+
ads: adsCommand,
|
|
6496
|
+
assets: assetsCommand,
|
|
6497
|
+
audiences: audiencesCommand,
|
|
6498
|
+
conversions: conversionsCommand,
|
|
6499
|
+
"bidding-strategies": biddingStrategiesCommand,
|
|
6500
|
+
labels: labelsCommand,
|
|
6501
|
+
"campaign-criteria": campaignCriteriaCommand
|
|
6502
|
+
};
|
|
6503
|
+
|
|
5145
6504
|
// src/commands/ads/google/index.ts
|
|
5146
|
-
var
|
|
6505
|
+
var keywordsWithWrites = defineCommand31({
|
|
6506
|
+
meta: keywordsCommand.meta,
|
|
6507
|
+
subCommands: { ...keywordsCommand.subCommands, ...keywordWriteSubcommands }
|
|
6508
|
+
});
|
|
6509
|
+
var googleCommand = defineCommand31({
|
|
5147
6510
|
meta: {
|
|
5148
6511
|
name: "google",
|
|
5149
6512
|
description: `Google Ads commands. Query campaigns, keywords, search terms, and more via GAQL.
|
|
@@ -5158,20 +6521,28 @@ Examples:
|
|
|
5158
6521
|
baker ads google query --preset campaign-performance --customer-id 1234567890
|
|
5159
6522
|
baker ads google currency --customer-id 1234567890
|
|
5160
6523
|
baker ads google keywords discover --customer-id 1234567890 --seeds "running shoes"
|
|
5161
|
-
baker ads google library list-advertisers \u2014 list tracked Google advertisers
|
|
6524
|
+
baker ads google library list-advertisers \u2014 list tracked Google advertisers
|
|
6525
|
+
|
|
6526
|
+
Staged writes (never touch Google until the chat is published):
|
|
6527
|
+
baker ads google budgets create --customer-id 1234567890 --name "Search" --amount 50
|
|
6528
|
+
baker ads google campaigns create --customer-id 1234567890 --name "Brand" --channel-type SEARCH --budget-ref g_temp_\u2026 --bidding-strategy MANUAL_CPC
|
|
6529
|
+
baker ads google keyword-lists create --customer-id 1234567890 --name "Brand exclusions"
|
|
6530
|
+
baker ads google draft list \u2014 review staged Google Ads changes`
|
|
5162
6531
|
},
|
|
5163
6532
|
subCommands: {
|
|
5164
6533
|
accounts: accountsCommand,
|
|
5165
6534
|
currency: currencyCommand,
|
|
5166
6535
|
changes: changesCommand,
|
|
5167
6536
|
query: queryCommand,
|
|
5168
|
-
keywords:
|
|
5169
|
-
library
|
|
6537
|
+
keywords: keywordsWithWrites,
|
|
6538
|
+
library,
|
|
6539
|
+
...googleWriteCommands,
|
|
6540
|
+
draft: draftCommand2
|
|
5170
6541
|
}
|
|
5171
6542
|
});
|
|
5172
6543
|
|
|
5173
6544
|
// src/commands/ads/linkedin/index.ts
|
|
5174
|
-
import { defineCommand as
|
|
6545
|
+
import { defineCommand as defineCommand51 } from "citty";
|
|
5175
6546
|
|
|
5176
6547
|
// src/commands/ads/linkedin/schemas.ts
|
|
5177
6548
|
registerSchema({
|
|
@@ -5832,7 +7203,7 @@ registerSchema({
|
|
|
5832
7203
|
});
|
|
5833
7204
|
|
|
5834
7205
|
// src/commands/ads/linkedin/account.ts
|
|
5835
|
-
import { defineCommand as
|
|
7206
|
+
import { defineCommand as defineCommand32 } from "citty";
|
|
5836
7207
|
|
|
5837
7208
|
// src/commands/ads/linkedin/shared.ts
|
|
5838
7209
|
var DAY_MS2 = 864e5;
|
|
@@ -5935,7 +7306,7 @@ function resolveStatusFilter(args) {
|
|
|
5935
7306
|
}
|
|
5936
7307
|
|
|
5937
7308
|
// src/commands/ads/linkedin/account.ts
|
|
5938
|
-
var accountCommand =
|
|
7309
|
+
var accountCommand = defineCommand32({
|
|
5939
7310
|
meta: {
|
|
5940
7311
|
name: "account",
|
|
5941
7312
|
description: `Single LinkedIn ad account detail (currency, status, type).
|
|
@@ -5969,9 +7340,9 @@ Examples:
|
|
|
5969
7340
|
});
|
|
5970
7341
|
|
|
5971
7342
|
// src/commands/ads/linkedin/accounts.ts
|
|
5972
|
-
import { defineCommand as
|
|
7343
|
+
import { defineCommand as defineCommand33 } from "citty";
|
|
5973
7344
|
var ACCOUNTS_TTL_MS = 60 * 60 * 1e3;
|
|
5974
|
-
var accountsCommand2 =
|
|
7345
|
+
var accountsCommand2 = defineCommand33({
|
|
5975
7346
|
meta: {
|
|
5976
7347
|
name: "accounts",
|
|
5977
7348
|
description: `List LinkedIn ad accounts in this company's connected scope.
|
|
@@ -6019,7 +7390,7 @@ Examples:
|
|
|
6019
7390
|
});
|
|
6020
7391
|
|
|
6021
7392
|
// src/commands/ads/linkedin/analytics.ts
|
|
6022
|
-
import { defineCommand as
|
|
7393
|
+
import { defineCommand as defineCommand34 } from "citty";
|
|
6023
7394
|
|
|
6024
7395
|
// src/commands/ads/linkedin/presets.ts
|
|
6025
7396
|
var INTENTS = {
|
|
@@ -6291,7 +7662,7 @@ function numberOf(v) {
|
|
|
6291
7662
|
}
|
|
6292
7663
|
return 0;
|
|
6293
7664
|
}
|
|
6294
|
-
var analyticsCommand =
|
|
7665
|
+
var analyticsCommand = defineCommand34({
|
|
6295
7666
|
meta: {
|
|
6296
7667
|
name: "analytics",
|
|
6297
7668
|
description: `Performance reporting \u2014 the workhorse for AI agents.
|
|
@@ -6418,8 +7789,8 @@ Examples \u2014 common AI questions:
|
|
|
6418
7789
|
});
|
|
6419
7790
|
|
|
6420
7791
|
// src/commands/ads/linkedin/audience-size.ts
|
|
6421
|
-
import { readFileSync as
|
|
6422
|
-
import { defineCommand as
|
|
7792
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
7793
|
+
import { defineCommand as defineCommand35 } from "citty";
|
|
6423
7794
|
function loadTargeting(args) {
|
|
6424
7795
|
const inline = args.targeting;
|
|
6425
7796
|
if (inline) {
|
|
@@ -6432,7 +7803,7 @@ function loadTargeting(args) {
|
|
|
6432
7803
|
const file = args["targeting-file"];
|
|
6433
7804
|
if (file) {
|
|
6434
7805
|
try {
|
|
6435
|
-
return JSON.parse(
|
|
7806
|
+
return JSON.parse(readFileSync5(file, "utf-8"));
|
|
6436
7807
|
} catch (e) {
|
|
6437
7808
|
handleLinkedinError(
|
|
6438
7809
|
new Error(`Failed to read --targeting-file: ${e instanceof Error ? e.message : "I/O error"}`)
|
|
@@ -6441,7 +7812,7 @@ function loadTargeting(args) {
|
|
|
6441
7812
|
}
|
|
6442
7813
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
6443
7814
|
}
|
|
6444
|
-
var audienceSizeCommand =
|
|
7815
|
+
var audienceSizeCommand = defineCommand35({
|
|
6445
7816
|
meta: {
|
|
6446
7817
|
name: "audience-size",
|
|
6447
7818
|
description: `Estimate audience size for a targeting payload \u2014 pre-launch sanity check.
|
|
@@ -6486,7 +7857,7 @@ Examples:
|
|
|
6486
7857
|
});
|
|
6487
7858
|
|
|
6488
7859
|
// src/commands/ads/linkedin/audit.ts
|
|
6489
|
-
import { defineCommand as
|
|
7860
|
+
import { defineCommand as defineCommand36 } from "citty";
|
|
6490
7861
|
var SEVERITY_RANK = {
|
|
6491
7862
|
critical: 0,
|
|
6492
7863
|
high: 1,
|
|
@@ -6545,7 +7916,7 @@ function noteOf(f) {
|
|
|
6545
7916
|
const fix = f.fix?.explanation ?? "";
|
|
6546
7917
|
return [fix, ev].filter(Boolean).join(" \u2014 ");
|
|
6547
7918
|
}
|
|
6548
|
-
var auditCommand =
|
|
7919
|
+
var auditCommand = defineCommand36({
|
|
6549
7920
|
meta: {
|
|
6550
7921
|
name: "audit",
|
|
6551
7922
|
description: `Run a LinkedIn Ads playbook audit \u2014 30+ checks across Settings, Tracking,
|
|
@@ -6611,8 +7982,8 @@ Examples:
|
|
|
6611
7982
|
});
|
|
6612
7983
|
|
|
6613
7984
|
// src/commands/ads/linkedin/bid-pricing.ts
|
|
6614
|
-
import { readFileSync as
|
|
6615
|
-
import { defineCommand as
|
|
7985
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
7986
|
+
import { defineCommand as defineCommand37 } from "citty";
|
|
6616
7987
|
function loadTargeting2(args) {
|
|
6617
7988
|
const inline = args.targeting;
|
|
6618
7989
|
if (inline) {
|
|
@@ -6625,7 +7996,7 @@ function loadTargeting2(args) {
|
|
|
6625
7996
|
const file = args["targeting-file"];
|
|
6626
7997
|
if (file) {
|
|
6627
7998
|
try {
|
|
6628
|
-
return JSON.parse(
|
|
7999
|
+
return JSON.parse(readFileSync6(file, "utf-8"));
|
|
6629
8000
|
} catch (e) {
|
|
6630
8001
|
handleLinkedinError(
|
|
6631
8002
|
new Error(`Failed to read --targeting-file: ${e instanceof Error ? e.message : "I/O error"}`)
|
|
@@ -6634,7 +8005,7 @@ function loadTargeting2(args) {
|
|
|
6634
8005
|
}
|
|
6635
8006
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
6636
8007
|
}
|
|
6637
|
-
var bidPricingCommand =
|
|
8008
|
+
var bidPricingCommand = defineCommand37({
|
|
6638
8009
|
meta: {
|
|
6639
8010
|
name: "bid-pricing",
|
|
6640
8011
|
description: `Get LinkedIn's suggested bid range for a targeting + objective + cost type.
|
|
@@ -6684,40 +8055,40 @@ Examples:
|
|
|
6684
8055
|
});
|
|
6685
8056
|
|
|
6686
8057
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
6687
|
-
import { defineCommand as
|
|
8058
|
+
import { defineCommand as defineCommand39 } from "citty";
|
|
6688
8059
|
|
|
6689
8060
|
// src/commands/ads/linkedin/write-commands.ts
|
|
6690
|
-
import { defineCommand as
|
|
8061
|
+
import { defineCommand as defineCommand38 } from "citty";
|
|
6691
8062
|
|
|
6692
8063
|
// src/commands/ads/linkedin/write-shared.ts
|
|
6693
8064
|
import { createHash as createHash2 } from "crypto";
|
|
6694
|
-
import { readFileSync as
|
|
8065
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
6695
8066
|
function bareAccountId(args) {
|
|
6696
8067
|
const raw = resolveAccountIdArg(args);
|
|
6697
8068
|
return raw.replace(/^urn:li:sponsoredAccount:/, "").replace(/^sponsoredAccount:/, "");
|
|
6698
8069
|
}
|
|
6699
|
-
function
|
|
8070
|
+
function failWriteValidation2(message) {
|
|
6700
8071
|
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
6701
8072
|
process.exit(1);
|
|
6702
8073
|
}
|
|
6703
|
-
function
|
|
8074
|
+
function loadJsonFileArg2(path11) {
|
|
6704
8075
|
if (typeof path11 !== "string" || path11.length === 0) {
|
|
6705
8076
|
return {};
|
|
6706
8077
|
}
|
|
6707
8078
|
try {
|
|
6708
|
-
const parsed = JSON.parse(
|
|
8079
|
+
const parsed = JSON.parse(readFileSync7(path11, "utf8"));
|
|
6709
8080
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
6710
|
-
|
|
8081
|
+
failWriteValidation2(`${path11} must contain a JSON object`);
|
|
6711
8082
|
}
|
|
6712
8083
|
return parsed;
|
|
6713
8084
|
} catch (err) {
|
|
6714
8085
|
if (err instanceof SyntaxError) {
|
|
6715
|
-
|
|
8086
|
+
failWriteValidation2(`${path11} is not valid JSON: ${err.message}`);
|
|
6716
8087
|
}
|
|
6717
8088
|
throw err;
|
|
6718
8089
|
}
|
|
6719
8090
|
}
|
|
6720
|
-
function
|
|
8091
|
+
function mergePayload2(file, flags) {
|
|
6721
8092
|
const merged = { ...file };
|
|
6722
8093
|
for (const [key, value] of Object.entries(flags)) {
|
|
6723
8094
|
if (value !== void 0) {
|
|
@@ -6734,7 +8105,7 @@ function parseMoneyFlag(amount, currency, flag) {
|
|
|
6734
8105
|
return { amount: String(amount) };
|
|
6735
8106
|
}
|
|
6736
8107
|
if (typeof currency !== "string" || currency.length !== 3) {
|
|
6737
|
-
|
|
8108
|
+
failWriteValidation2(`${flag} got an invalid --currency (expected a 3-letter code like EUR)`);
|
|
6738
8109
|
}
|
|
6739
8110
|
return { amount: String(amount), currencyCode: currency.toUpperCase() };
|
|
6740
8111
|
}
|
|
@@ -6748,7 +8119,7 @@ function parseDateFlag(value, flag) {
|
|
|
6748
8119
|
}
|
|
6749
8120
|
const parsed = Date.parse(raw);
|
|
6750
8121
|
if (Number.isNaN(parsed)) {
|
|
6751
|
-
|
|
8122
|
+
failWriteValidation2(`${flag} must be an ISO date (2026-07-10) or epoch milliseconds`);
|
|
6752
8123
|
}
|
|
6753
8124
|
return parsed;
|
|
6754
8125
|
}
|
|
@@ -6763,7 +8134,7 @@ function parseOnOffFlag(value, flag) {
|
|
|
6763
8134
|
if (raw === "off" || raw === "false") {
|
|
6764
8135
|
return false;
|
|
6765
8136
|
}
|
|
6766
|
-
|
|
8137
|
+
failWriteValidation2(`${flag} must be on|off`);
|
|
6767
8138
|
}
|
|
6768
8139
|
function parseLocaleFlag(value) {
|
|
6769
8140
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -6771,7 +8142,7 @@ function parseLocaleFlag(value) {
|
|
|
6771
8142
|
}
|
|
6772
8143
|
const match = /^([a-z]{2})[_-]([A-Za-z]{2})$/.exec(String(value));
|
|
6773
8144
|
if (!match) {
|
|
6774
|
-
|
|
8145
|
+
failWriteValidation2("--locale must look like en_US (language_COUNTRY)");
|
|
6775
8146
|
}
|
|
6776
8147
|
return { language: match[1], country: match[2].toUpperCase() };
|
|
6777
8148
|
}
|
|
@@ -6779,10 +8150,10 @@ function loadTargetingFileArg(path11) {
|
|
|
6779
8150
|
if (typeof path11 !== "string" || path11.length === 0) {
|
|
6780
8151
|
return void 0;
|
|
6781
8152
|
}
|
|
6782
|
-
const parsed =
|
|
8153
|
+
const parsed = loadJsonFileArg2(path11);
|
|
6783
8154
|
const criteria = parsed.targetingCriteria ?? parsed;
|
|
6784
8155
|
if (!criteria.include) {
|
|
6785
|
-
|
|
8156
|
+
failWriteValidation2(
|
|
6786
8157
|
`${path11} must contain targeting criteria with an "include" block (see baker schema ads.linkedin.campaigns.create)`
|
|
6787
8158
|
);
|
|
6788
8159
|
}
|
|
@@ -6822,10 +8193,10 @@ function parseListFileArg(path11, maxRows) {
|
|
|
6822
8193
|
if (typeof path11 !== "string" || path11.length === 0) {
|
|
6823
8194
|
return void 0;
|
|
6824
8195
|
}
|
|
6825
|
-
const raw =
|
|
8196
|
+
const raw = readFileSync7(path11, "utf8");
|
|
6826
8197
|
const lines = raw.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
6827
8198
|
if (lines.length < 2) {
|
|
6828
|
-
|
|
8199
|
+
failWriteValidation2(`${path11} needs a header row and at least one data row`);
|
|
6829
8200
|
}
|
|
6830
8201
|
const columns = parseCsvLine(lines[0]).map((column) => column.trim());
|
|
6831
8202
|
const rows = [];
|
|
@@ -6844,7 +8215,7 @@ function parseListFileArg(path11, maxRows) {
|
|
|
6844
8215
|
}
|
|
6845
8216
|
}
|
|
6846
8217
|
if (rows.length > maxRows) {
|
|
6847
|
-
|
|
8218
|
+
failWriteValidation2(`${path11} has ${rows.length} rows \u2014 the inline limit is ${maxRows}. Split the list.`);
|
|
6848
8219
|
}
|
|
6849
8220
|
return { columns, rows };
|
|
6850
8221
|
}
|
|
@@ -6880,10 +8251,10 @@ async function stageStatusChange(input) {
|
|
|
6880
8251
|
const payload = input.kind === "creative.update" ? { intendedStatus: input.status } : { status: input.status };
|
|
6881
8252
|
await stageOp({ kind: input.kind, accountId: input.accountId, target: input.target, payload });
|
|
6882
8253
|
}
|
|
6883
|
-
function
|
|
8254
|
+
function requireTarget2(args, entity) {
|
|
6884
8255
|
const target = args.id ?? args.target;
|
|
6885
8256
|
if (typeof target !== "string" || target.length === 0) {
|
|
6886
|
-
|
|
8257
|
+
failWriteValidation2(`pass the ${entity} id or URN as the positional argument`);
|
|
6887
8258
|
}
|
|
6888
8259
|
return target;
|
|
6889
8260
|
}
|
|
@@ -6902,7 +8273,7 @@ function runScheduleFromFlags(args) {
|
|
|
6902
8273
|
}
|
|
6903
8274
|
return { ...start !== void 0 ? { start } : {}, ...end !== void 0 ? { end } : {} };
|
|
6904
8275
|
}
|
|
6905
|
-
var campaignGroupsCreateCommand =
|
|
8276
|
+
var campaignGroupsCreateCommand = defineCommand38({
|
|
6906
8277
|
meta: {
|
|
6907
8278
|
name: "create",
|
|
6908
8279
|
description: `Stage a new campaign group. ${STAGED_NOTE}
|
|
@@ -6920,7 +8291,7 @@ Example: baker ads linkedin campaign-groups create --name "Q3 ABM" --start 2026-
|
|
|
6920
8291
|
},
|
|
6921
8292
|
run: async ({ args }) => {
|
|
6922
8293
|
const accountId = bareAccountId(args);
|
|
6923
|
-
const payload =
|
|
8294
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), {
|
|
6924
8295
|
name: args.name,
|
|
6925
8296
|
runSchedule: runScheduleFromFlags(args),
|
|
6926
8297
|
totalBudget: parseMoneyFlag(args["total-budget"], args.currency, "--total-budget"),
|
|
@@ -6929,7 +8300,7 @@ Example: baker ads linkedin campaign-groups create --name "Q3 ABM" --start 2026-
|
|
|
6929
8300
|
await stageOp({ kind: "campaignGroup.create", accountId, payload });
|
|
6930
8301
|
}
|
|
6931
8302
|
});
|
|
6932
|
-
var campaignGroupsUpdateCommand =
|
|
8303
|
+
var campaignGroupsUpdateCommand = defineCommand38({
|
|
6933
8304
|
meta: {
|
|
6934
8305
|
name: "update",
|
|
6935
8306
|
description: `Stage changes to an existing campaign group. ${STAGED_NOTE}
|
|
@@ -6949,7 +8320,7 @@ Example: baker ads linkedin campaign-groups update 635137195 --total-budget 8000
|
|
|
6949
8320
|
},
|
|
6950
8321
|
run: async ({ args }) => {
|
|
6951
8322
|
const accountId = bareAccountId(args);
|
|
6952
|
-
const payload =
|
|
8323
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), {
|
|
6953
8324
|
name: args.name,
|
|
6954
8325
|
runSchedule: runScheduleFromFlags(args),
|
|
6955
8326
|
totalBudget: parseMoneyFlag(args["total-budget"], args.currency, "--total-budget"),
|
|
@@ -6958,7 +8329,7 @@ Example: baker ads linkedin campaign-groups update 635137195 --total-budget 8000
|
|
|
6958
8329
|
await stageOp({
|
|
6959
8330
|
kind: "campaignGroup.update",
|
|
6960
8331
|
accountId,
|
|
6961
|
-
target:
|
|
8332
|
+
target: requireTarget2(args, "campaign group"),
|
|
6962
8333
|
payload
|
|
6963
8334
|
});
|
|
6964
8335
|
}
|
|
@@ -7007,7 +8378,7 @@ var campaignFlagArgs = {
|
|
|
7007
8378
|
status: { type: "string", description: "DRAFT|ACTIVE|PAUSED" },
|
|
7008
8379
|
file: { type: "string", description: "JSON file with the full payload; flags override file keys" }
|
|
7009
8380
|
};
|
|
7010
|
-
var campaignsCreateCommand =
|
|
8381
|
+
var campaignsCreateCommand = defineCommand38({
|
|
7011
8382
|
meta: {
|
|
7012
8383
|
name: "create",
|
|
7013
8384
|
description: `Stage a new campaign. ${STAGED_NOTE}
|
|
@@ -7017,14 +8388,14 @@ Example: baker ads linkedin campaigns create --name "ABM Tier-1" --group li_temp
|
|
|
7017
8388
|
args: campaignFlagArgs,
|
|
7018
8389
|
run: async ({ args }) => {
|
|
7019
8390
|
const accountId = bareAccountId(args);
|
|
7020
|
-
const payload =
|
|
8391
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), campaignPayloadFromFlags(args));
|
|
7021
8392
|
if (payload.locale === void 0) {
|
|
7022
8393
|
payload.locale = { country: "US", language: "en" };
|
|
7023
8394
|
}
|
|
7024
8395
|
await stageOp({ kind: "campaign.create", accountId, payload });
|
|
7025
8396
|
}
|
|
7026
8397
|
});
|
|
7027
|
-
var campaignsUpdateCommand =
|
|
8398
|
+
var campaignsUpdateCommand = defineCommand38({
|
|
7028
8399
|
meta: {
|
|
7029
8400
|
name: "update",
|
|
7030
8401
|
description: `Stage changes to an existing campaign (budget, bid, targeting, flags, schedule, status). ${STAGED_NOTE}
|
|
@@ -7042,18 +8413,18 @@ Example: baker ads linkedin campaigns update 123456 --daily-budget 100 --currenc
|
|
|
7042
8413
|
flags.type = void 0;
|
|
7043
8414
|
flags.locale = void 0;
|
|
7044
8415
|
flags.associatedEntity = void 0;
|
|
7045
|
-
const payload =
|
|
8416
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), flags);
|
|
7046
8417
|
await stageOp({
|
|
7047
8418
|
kind: "campaign.update",
|
|
7048
8419
|
accountId,
|
|
7049
|
-
target:
|
|
8420
|
+
target: requireTarget2(args, "campaign"),
|
|
7050
8421
|
payload
|
|
7051
8422
|
});
|
|
7052
8423
|
}
|
|
7053
8424
|
});
|
|
7054
8425
|
function statusSugarCommand(entity, kind, name) {
|
|
7055
8426
|
const status = name === "pause" ? "PAUSED" : name === "resume" ? "ACTIVE" : "ARCHIVED";
|
|
7056
|
-
return
|
|
8427
|
+
return defineCommand38({
|
|
7057
8428
|
meta: {
|
|
7058
8429
|
name,
|
|
7059
8430
|
description: `Stage a status change to ${status}. ${STAGED_NOTE}
|
|
@@ -7067,7 +8438,7 @@ Example: baker ads linkedin ${entity} ${name} 123456`
|
|
|
7067
8438
|
await stageStatusChange({
|
|
7068
8439
|
kind,
|
|
7069
8440
|
accountId: bareAccountId(args),
|
|
7070
|
-
target:
|
|
8441
|
+
target: requireTarget2(args, entity.replace(/-/g, " ").replace(/s$/, "")),
|
|
7071
8442
|
status
|
|
7072
8443
|
});
|
|
7073
8444
|
}
|
|
@@ -7081,7 +8452,7 @@ var campaignGroupsResumeCommand = statusSugarCommand("campaign-groups", "campaig
|
|
|
7081
8452
|
var creativesPauseCommand = statusSugarCommand("creatives", "creative.update", "pause");
|
|
7082
8453
|
var creativesResumeCommand = statusSugarCommand("creatives", "creative.update", "resume");
|
|
7083
8454
|
function duplicateCommand(entity, cliGroup) {
|
|
7084
|
-
return
|
|
8455
|
+
return defineCommand38({
|
|
7085
8456
|
meta: {
|
|
7086
8457
|
name: "duplicate",
|
|
7087
8458
|
description: `Stage a copy of an existing ${entity} as a new DRAFT create (playbook: duplicate, never link-to-original). ${STAGED_NOTE}
|
|
@@ -7096,14 +8467,14 @@ Example: baker ads linkedin ${cliGroup} duplicate 123456 --name "New variant"`
|
|
|
7096
8467
|
run: async ({ args }) => {
|
|
7097
8468
|
try {
|
|
7098
8469
|
const chatId = requireChatId();
|
|
7099
|
-
const overrides =
|
|
8470
|
+
const overrides = mergePayload2(loadJsonFileArg2(args.file), { name: args.name });
|
|
7100
8471
|
const response = await apiPost(
|
|
7101
8472
|
"/api/ads/linkedin/draft/duplicate",
|
|
7102
8473
|
{
|
|
7103
8474
|
chatId,
|
|
7104
8475
|
accountId: bareAccountId(args),
|
|
7105
8476
|
entity,
|
|
7106
|
-
sourceId:
|
|
8477
|
+
sourceId: requireTarget2(args, entity),
|
|
7107
8478
|
...Object.keys(overrides).length > 0 ? { overrides } : {}
|
|
7108
8479
|
}
|
|
7109
8480
|
);
|
|
@@ -7116,7 +8487,7 @@ Example: baker ads linkedin ${cliGroup} duplicate 123456 --name "New variant"`
|
|
|
7116
8487
|
}
|
|
7117
8488
|
var campaignsDuplicateCommand = duplicateCommand("campaign", "campaigns");
|
|
7118
8489
|
var campaignGroupsDuplicateCommand = duplicateCommand("campaignGroup", "campaign-groups");
|
|
7119
|
-
var creativesDuplicateCommand =
|
|
8490
|
+
var creativesDuplicateCommand = defineCommand38({
|
|
7120
8491
|
meta: {
|
|
7121
8492
|
name: "duplicate",
|
|
7122
8493
|
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}
|
|
@@ -7154,10 +8525,10 @@ Examples:
|
|
|
7154
8525
|
run: async ({ args }) => {
|
|
7155
8526
|
try {
|
|
7156
8527
|
const chatId = requireChatId();
|
|
7157
|
-
const file =
|
|
8528
|
+
const file = loadJsonFileArg2(args.file);
|
|
7158
8529
|
const fileContent = file.content !== null && typeof file.content === "object" && !Array.isArray(file.content) ? file.content : {};
|
|
7159
8530
|
const content = { ...fileContent, ...creativeContentPatch(args) };
|
|
7160
|
-
const overrides =
|
|
8531
|
+
const overrides = mergePayload2(file, {
|
|
7161
8532
|
campaign: args.campaign,
|
|
7162
8533
|
intendedStatus: args["intended-status"] ? String(args["intended-status"]).toUpperCase() : void 0,
|
|
7163
8534
|
content: Object.keys(content).length > 0 ? content : void 0
|
|
@@ -7168,7 +8539,7 @@ Examples:
|
|
|
7168
8539
|
chatId,
|
|
7169
8540
|
accountId: bareAccountId(args),
|
|
7170
8541
|
entity: "creative",
|
|
7171
|
-
sourceId:
|
|
8542
|
+
sourceId: requireTarget2(args, "creative"),
|
|
7172
8543
|
...Object.keys(overrides).length > 0 ? { overrides } : {},
|
|
7173
8544
|
...args.replace ? { replace: true } : {}
|
|
7174
8545
|
}
|
|
@@ -7193,7 +8564,7 @@ var CREATIVE_FORMATS = [
|
|
|
7193
8564
|
"event",
|
|
7194
8565
|
"article"
|
|
7195
8566
|
];
|
|
7196
|
-
var creativesCreateCommand =
|
|
8567
|
+
var creativesCreateCommand = defineCommand38({
|
|
7197
8568
|
meta: {
|
|
7198
8569
|
name: "create",
|
|
7199
8570
|
description: `Stage a new creative (ad). ${STAGED_NOTE}
|
|
@@ -7229,13 +8600,13 @@ Examples:
|
|
|
7229
8600
|
run: async ({ args }) => {
|
|
7230
8601
|
const accountId = bareAccountId(args);
|
|
7231
8602
|
if (!args.campaign) {
|
|
7232
|
-
|
|
8603
|
+
failWriteValidation2("--campaign is required (id, URN, or li_temp_* ref)");
|
|
7233
8604
|
}
|
|
7234
8605
|
const format = args.format ? String(args.format) : void 0;
|
|
7235
8606
|
if (!format || !CREATIVE_FORMATS.includes(format)) {
|
|
7236
|
-
|
|
8607
|
+
failWriteValidation2(`--format must be one of ${CREATIVE_FORMATS.join("|")}`);
|
|
7237
8608
|
}
|
|
7238
|
-
const content =
|
|
8609
|
+
const content = mergePayload2(loadJsonFileArg2(args.file), {
|
|
7239
8610
|
format,
|
|
7240
8611
|
commentary: args.intro,
|
|
7241
8612
|
imageId: args["image-id"],
|
|
@@ -7294,7 +8665,7 @@ function creativeContentPatch(args) {
|
|
|
7294
8665
|
}
|
|
7295
8666
|
return patch;
|
|
7296
8667
|
}
|
|
7297
|
-
var creativesUpdateCommand =
|
|
8668
|
+
var creativesUpdateCommand = defineCommand38({
|
|
7298
8669
|
meta: {
|
|
7299
8670
|
name: "update",
|
|
7300
8671
|
description: `Stage changes to an existing creative, or amend a creative staged in this chat by passing its li_temp_* ref. ${STAGED_NOTE}
|
|
@@ -7326,13 +8697,13 @@ Examples:
|
|
|
7326
8697
|
},
|
|
7327
8698
|
run: async ({ args }) => {
|
|
7328
8699
|
const accountId = bareAccountId(args);
|
|
7329
|
-
const target =
|
|
7330
|
-
const file =
|
|
8700
|
+
const target = requireTarget2(args, "creative");
|
|
8701
|
+
const file = loadJsonFileArg2(args.file);
|
|
7331
8702
|
const contentPatch = creativeContentPatch(args);
|
|
7332
8703
|
const intendedStatus = args["intended-status"] ? String(args["intended-status"]).toUpperCase() : void 0;
|
|
7333
8704
|
const fileContent = file.content !== null && typeof file.content === "object" && !Array.isArray(file.content) ? file.content : {};
|
|
7334
8705
|
const content = { ...fileContent, ...contentPatch };
|
|
7335
|
-
const payload =
|
|
8706
|
+
const payload = mergePayload2(file, {
|
|
7336
8707
|
intendedStatus,
|
|
7337
8708
|
name: args.name,
|
|
7338
8709
|
content: Object.keys(content).length > 0 ? content : void 0
|
|
@@ -7342,7 +8713,7 @@ Examples:
|
|
|
7342
8713
|
});
|
|
7343
8714
|
var AUDIENCE_TYPES2 = ["company-list", "user-list", "retargeting", "engagement"];
|
|
7344
8715
|
var INLINE_ROWS_MAX = 1e4;
|
|
7345
|
-
var audiencesCreateCommand =
|
|
8716
|
+
var audiencesCreateCommand = defineCommand38({
|
|
7346
8717
|
meta: {
|
|
7347
8718
|
name: "create",
|
|
7348
8719
|
description: `Stage a new matched audience. ${STAGED_NOTE}
|
|
@@ -7359,7 +8730,7 @@ Example: baker ads linkedin audiences create --name "ABM Tier-1" --type company-
|
|
|
7359
8730
|
run: async ({ args }) => {
|
|
7360
8731
|
const accountId = bareAccountId(args);
|
|
7361
8732
|
const list = parseListFileArg(args["list-file"], INLINE_ROWS_MAX);
|
|
7362
|
-
const raw = args.file ?
|
|
8733
|
+
const raw = args.file ? loadJsonFileArg2(args.file) : void 0;
|
|
7363
8734
|
await stageOp({
|
|
7364
8735
|
kind: "audience.create",
|
|
7365
8736
|
accountId,
|
|
@@ -7372,7 +8743,7 @@ Example: baker ads linkedin audiences create --name "ABM Tier-1" --type company-
|
|
|
7372
8743
|
});
|
|
7373
8744
|
}
|
|
7374
8745
|
});
|
|
7375
|
-
var audiencesUploadCommand =
|
|
8746
|
+
var audiencesUploadCommand = defineCommand38({
|
|
7376
8747
|
meta: {
|
|
7377
8748
|
name: "upload",
|
|
7378
8749
|
description: `Stage a list upload into an existing audience segment. ${STAGED_NOTE}
|
|
@@ -7387,20 +8758,20 @@ Example: baker ads linkedin audiences upload urn:li:dmpSegment:42 --list-file mo
|
|
|
7387
8758
|
const accountId = bareAccountId(args);
|
|
7388
8759
|
const list = parseListFileArg(args["list-file"], INLINE_ROWS_MAX);
|
|
7389
8760
|
if (!list) {
|
|
7390
|
-
|
|
8761
|
+
failWriteValidation2("--list-file is required");
|
|
7391
8762
|
}
|
|
7392
8763
|
await stageOp({
|
|
7393
8764
|
kind: "audience.uploadList",
|
|
7394
8765
|
accountId,
|
|
7395
8766
|
payload: {
|
|
7396
|
-
segment:
|
|
8767
|
+
segment: requireTarget2(args, "audience segment"),
|
|
7397
8768
|
listColumns: list.columns,
|
|
7398
8769
|
listRows: list.rows
|
|
7399
8770
|
}
|
|
7400
8771
|
});
|
|
7401
8772
|
}
|
|
7402
8773
|
});
|
|
7403
|
-
var
|
|
8774
|
+
var audiencesCommand2 = defineCommand38({
|
|
7404
8775
|
meta: {
|
|
7405
8776
|
name: "audiences",
|
|
7406
8777
|
description: "Stage LinkedIn matched-audience changes (create lists, upload rows). Staged until publish \u2014 never hits the API directly."
|
|
@@ -7410,7 +8781,7 @@ var audiencesCommand = defineCommand36({
|
|
|
7410
8781
|
upload: audiencesUploadCommand
|
|
7411
8782
|
}
|
|
7412
8783
|
});
|
|
7413
|
-
var conversionsCreateCommand =
|
|
8784
|
+
var conversionsCreateCommand = defineCommand38({
|
|
7414
8785
|
meta: {
|
|
7415
8786
|
name: "create",
|
|
7416
8787
|
description: `Stage a new conversion rule. ${STAGED_NOTE}
|
|
@@ -7429,7 +8800,7 @@ Example: baker ads linkedin conversions create --name "Demo booked" --type LEAD
|
|
|
7429
8800
|
},
|
|
7430
8801
|
run: async ({ args }) => {
|
|
7431
8802
|
const accountId = bareAccountId(args);
|
|
7432
|
-
const payload =
|
|
8803
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), {
|
|
7433
8804
|
name: args.name,
|
|
7434
8805
|
type: args.type ? String(args.type).toUpperCase() : void 0,
|
|
7435
8806
|
conversionMethod: args.method ? String(args.method).toUpperCase() : void 0,
|
|
@@ -7441,7 +8812,7 @@ Example: baker ads linkedin conversions create --name "Demo booked" --type LEAD
|
|
|
7441
8812
|
await stageOp({ kind: "conversion.create", accountId, payload });
|
|
7442
8813
|
}
|
|
7443
8814
|
});
|
|
7444
|
-
var conversionsUpdateCommand =
|
|
8815
|
+
var conversionsUpdateCommand = defineCommand38({
|
|
7445
8816
|
meta: {
|
|
7446
8817
|
name: "update",
|
|
7447
8818
|
description: `Stage changes to a conversion rule (windows, name, enabled). ${STAGED_NOTE}
|
|
@@ -7459,7 +8830,7 @@ Example: baker ads linkedin conversions update 104988516 --post-click-window 30
|
|
|
7459
8830
|
},
|
|
7460
8831
|
run: async ({ args }) => {
|
|
7461
8832
|
const accountId = bareAccountId(args);
|
|
7462
|
-
const payload =
|
|
8833
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), {
|
|
7463
8834
|
name: args.name,
|
|
7464
8835
|
postClickAttributionWindowSize: args["post-click-window"] ? Number(args["post-click-window"]) : void 0,
|
|
7465
8836
|
viewThroughAttributionWindowSize: args["view-window"] ? Number(args["view-window"]) : void 0,
|
|
@@ -7469,12 +8840,12 @@ Example: baker ads linkedin conversions update 104988516 --post-click-window 30
|
|
|
7469
8840
|
await stageOp({
|
|
7470
8841
|
kind: "conversion.update",
|
|
7471
8842
|
accountId,
|
|
7472
|
-
target:
|
|
8843
|
+
target: requireTarget2(args, "conversion rule"),
|
|
7473
8844
|
payload
|
|
7474
8845
|
});
|
|
7475
8846
|
}
|
|
7476
8847
|
});
|
|
7477
|
-
var leadFormsCreateCommand =
|
|
8848
|
+
var leadFormsCreateCommand = defineCommand38({
|
|
7478
8849
|
meta: {
|
|
7479
8850
|
name: "create",
|
|
7480
8851
|
description: `Stage a new Lead Gen Form from a JSON file. ${STAGED_NOTE}
|
|
@@ -7487,11 +8858,11 @@ The file needs: name, headline (\u226460), privacyPolicyUrl, questions[] (\u2264
|
|
|
7487
8858
|
},
|
|
7488
8859
|
run: async ({ args }) => {
|
|
7489
8860
|
const accountId = bareAccountId(args);
|
|
7490
|
-
const payload =
|
|
8861
|
+
const payload = mergePayload2(loadJsonFileArg2(args.file), { name: args.name });
|
|
7491
8862
|
await stageOp({ kind: "leadForm.create", accountId, payload });
|
|
7492
8863
|
}
|
|
7493
8864
|
});
|
|
7494
|
-
var leadFormsUpdateCommand =
|
|
8865
|
+
var leadFormsUpdateCommand = defineCommand38({
|
|
7495
8866
|
meta: {
|
|
7496
8867
|
name: "update",
|
|
7497
8868
|
description: `Stage changes to a Lead Gen Form from a JSON file. ${STAGED_NOTE}`
|
|
@@ -7504,16 +8875,16 @@ var leadFormsUpdateCommand = defineCommand36({
|
|
|
7504
8875
|
},
|
|
7505
8876
|
run: async ({ args }) => {
|
|
7506
8877
|
const accountId = bareAccountId(args);
|
|
7507
|
-
const payload =
|
|
8878
|
+
const payload = mergePayload2({ raw: loadJsonFileArg2(args.file) }, { name: args.name });
|
|
7508
8879
|
await stageOp({
|
|
7509
8880
|
kind: "leadForm.update",
|
|
7510
8881
|
accountId,
|
|
7511
|
-
target:
|
|
8882
|
+
target: requireTarget2(args, "lead form"),
|
|
7512
8883
|
payload
|
|
7513
8884
|
});
|
|
7514
8885
|
}
|
|
7515
8886
|
});
|
|
7516
|
-
var leadFormsCommand =
|
|
8887
|
+
var leadFormsCommand = defineCommand38({
|
|
7517
8888
|
meta: {
|
|
7518
8889
|
name: "lead-forms",
|
|
7519
8890
|
description: "Stage LinkedIn Lead Gen Form changes (file-first). Staged until publish \u2014 never hits the API directly."
|
|
@@ -7525,7 +8896,7 @@ var leadFormsCommand = defineCommand36({
|
|
|
7525
8896
|
});
|
|
7526
8897
|
|
|
7527
8898
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
7528
|
-
var campaignGroupsCommand =
|
|
8899
|
+
var campaignGroupsCommand = defineCommand39({
|
|
7529
8900
|
meta: {
|
|
7530
8901
|
name: "campaign-groups",
|
|
7531
8902
|
description: `List LinkedIn campaign groups, or stage writes (create/update/pause/resume/duplicate).
|
|
@@ -7576,8 +8947,8 @@ Examples:
|
|
|
7576
8947
|
});
|
|
7577
8948
|
|
|
7578
8949
|
// src/commands/ads/linkedin/campaigns.ts
|
|
7579
|
-
import { defineCommand as
|
|
7580
|
-
var
|
|
8950
|
+
import { defineCommand as defineCommand40 } from "citty";
|
|
8951
|
+
var campaignsCommand2 = defineCommand40({
|
|
7581
8952
|
meta: {
|
|
7582
8953
|
name: "campaigns",
|
|
7583
8954
|
description: `List LinkedIn campaigns, or stage writes (create/update/pause/resume/archive/duplicate).
|
|
@@ -7638,8 +9009,8 @@ Examples:
|
|
|
7638
9009
|
});
|
|
7639
9010
|
|
|
7640
9011
|
// src/commands/ads/linkedin/conversation.ts
|
|
7641
|
-
import { defineCommand as
|
|
7642
|
-
var conversationCommand =
|
|
9012
|
+
import { defineCommand as defineCommand41 } from "citty";
|
|
9013
|
+
var conversationCommand = defineCommand41({
|
|
7643
9014
|
meta: {
|
|
7644
9015
|
name: "conversation",
|
|
7645
9016
|
description: `Per-button click rates inside Sponsored Messaging / Conversation Ads.
|
|
@@ -7702,7 +9073,7 @@ Examples:
|
|
|
7702
9073
|
});
|
|
7703
9074
|
|
|
7704
9075
|
// src/commands/ads/linkedin/conversions.ts
|
|
7705
|
-
import { defineCommand as
|
|
9076
|
+
import { defineCommand as defineCommand42 } from "citty";
|
|
7706
9077
|
var DAY_MS3 = 864e5;
|
|
7707
9078
|
function healthOf(rules) {
|
|
7708
9079
|
const enabled = rules.filter((r) => r.enabled !== false);
|
|
@@ -7728,7 +9099,7 @@ function healthOf(rules) {
|
|
|
7728
9099
|
wrongLeadDedup: wrongDedup
|
|
7729
9100
|
};
|
|
7730
9101
|
}
|
|
7731
|
-
var listCmd =
|
|
9102
|
+
var listCmd = defineCommand42({
|
|
7732
9103
|
meta: {
|
|
7733
9104
|
name: "list",
|
|
7734
9105
|
description: `List conversion rules on the account.`
|
|
@@ -7756,7 +9127,7 @@ var listCmd = defineCommand40({
|
|
|
7756
9127
|
}
|
|
7757
9128
|
}
|
|
7758
9129
|
});
|
|
7759
|
-
var healthCmd =
|
|
9130
|
+
var healthCmd = defineCommand42({
|
|
7760
9131
|
meta: {
|
|
7761
9132
|
name: "health",
|
|
7762
9133
|
description: `5-point Insight Tag / CAPI health check (playbook \xA707).
|
|
@@ -7786,7 +9157,7 @@ Surfaces:
|
|
|
7786
9157
|
}
|
|
7787
9158
|
}
|
|
7788
9159
|
});
|
|
7789
|
-
var
|
|
9160
|
+
var conversionsCommand2 = defineCommand42({
|
|
7790
9161
|
meta: {
|
|
7791
9162
|
name: "conversions",
|
|
7792
9163
|
description: `Conversion rules \u2014 Insight Tag and Conversions API.
|
|
@@ -7805,8 +9176,8 @@ Subcommands:
|
|
|
7805
9176
|
});
|
|
7806
9177
|
|
|
7807
9178
|
// src/commands/ads/linkedin/creatives.ts
|
|
7808
|
-
import { defineCommand as
|
|
7809
|
-
var creativesCommand =
|
|
9179
|
+
import { defineCommand as defineCommand43 } from "citty";
|
|
9180
|
+
var creativesCommand = defineCommand43({
|
|
7810
9181
|
meta: {
|
|
7811
9182
|
name: "creatives",
|
|
7812
9183
|
description: `List LinkedIn creatives (ads), or stage writes (create/update/pause/resume/duplicate).
|
|
@@ -7865,7 +9236,7 @@ Examples:
|
|
|
7865
9236
|
});
|
|
7866
9237
|
|
|
7867
9238
|
// src/commands/ads/linkedin/demographics.ts
|
|
7868
|
-
import { defineCommand as
|
|
9239
|
+
import { defineCommand as defineCommand44 } from "citty";
|
|
7869
9240
|
var DEFAULT_PIVOTS = ["job-title", "company", "industry", "seniority", "job-function", "company-size"];
|
|
7870
9241
|
function numberOf2(v) {
|
|
7871
9242
|
if (typeof v === "number") return Number.isFinite(v) ? v : 0;
|
|
@@ -7878,7 +9249,7 @@ function numberOf2(v) {
|
|
|
7878
9249
|
function topByImpressions(rows, limit) {
|
|
7879
9250
|
return [...rows].sort((a, b) => numberOf2(b.impressions) - numberOf2(a.impressions)).slice(0, limit);
|
|
7880
9251
|
}
|
|
7881
|
-
var demographicsCommand =
|
|
9252
|
+
var demographicsCommand = defineCommand44({
|
|
7882
9253
|
meta: {
|
|
7883
9254
|
name: "demographics",
|
|
7884
9255
|
description: `Sweep all firmographic pivots in one command \u2014 LinkedIn's superpower.
|
|
@@ -7975,7 +9346,7 @@ function resolveRange(args) {
|
|
|
7975
9346
|
}
|
|
7976
9347
|
|
|
7977
9348
|
// src/commands/ads/linkedin/draft.ts
|
|
7978
|
-
import { defineCommand as
|
|
9349
|
+
import { defineCommand as defineCommand45 } from "citty";
|
|
7979
9350
|
async function listDraft() {
|
|
7980
9351
|
try {
|
|
7981
9352
|
const chatId = requireChatId();
|
|
@@ -7987,14 +9358,14 @@ async function listDraft() {
|
|
|
7987
9358
|
handleLinkedinError(err);
|
|
7988
9359
|
}
|
|
7989
9360
|
}
|
|
7990
|
-
var listCommand3 =
|
|
9361
|
+
var listCommand3 = defineCommand45({
|
|
7991
9362
|
meta: {
|
|
7992
9363
|
name: "list",
|
|
7993
9364
|
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"
|
|
7994
9365
|
},
|
|
7995
9366
|
run: listDraft
|
|
7996
9367
|
});
|
|
7997
|
-
var removeCommand2 =
|
|
9368
|
+
var removeCommand2 = defineCommand45({
|
|
7998
9369
|
meta: {
|
|
7999
9370
|
name: "remove",
|
|
8000
9371
|
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"
|
|
@@ -8019,7 +9390,7 @@ var removeCommand2 = defineCommand43({
|
|
|
8019
9390
|
}
|
|
8020
9391
|
}
|
|
8021
9392
|
});
|
|
8022
|
-
var clearCommand2 =
|
|
9393
|
+
var clearCommand2 = defineCommand45({
|
|
8023
9394
|
meta: {
|
|
8024
9395
|
name: "clear",
|
|
8025
9396
|
description: "Discard ALL staged LinkedIn ops in this chat's draft \u2014 nothing will apply on publish. Example: baker ads linkedin draft clear"
|
|
@@ -8036,7 +9407,7 @@ var clearCommand2 = defineCommand43({
|
|
|
8036
9407
|
}
|
|
8037
9408
|
}
|
|
8038
9409
|
});
|
|
8039
|
-
var linkedinDraftCommand =
|
|
9410
|
+
var linkedinDraftCommand = defineCommand45({
|
|
8040
9411
|
meta: {
|
|
8041
9412
|
name: "draft",
|
|
8042
9413
|
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."
|
|
@@ -8050,8 +9421,8 @@ var linkedinDraftCommand = defineCommand43({
|
|
|
8050
9421
|
});
|
|
8051
9422
|
|
|
8052
9423
|
// src/commands/ads/linkedin/facets.ts
|
|
8053
|
-
import { defineCommand as
|
|
8054
|
-
var listCmd2 =
|
|
9424
|
+
import { defineCommand as defineCommand46 } from "citty";
|
|
9425
|
+
var listCmd2 = defineCommand46({
|
|
8055
9426
|
meta: {
|
|
8056
9427
|
name: "list",
|
|
8057
9428
|
description: `List every targeting facet LinkedIn supports.
|
|
@@ -8079,7 +9450,7 @@ seniorities, titles, employers, growthRate, companyCategory, skills, etc.).`
|
|
|
8079
9450
|
}
|
|
8080
9451
|
}
|
|
8081
9452
|
});
|
|
8082
|
-
var valuesCmd =
|
|
9453
|
+
var valuesCmd = defineCommand46({
|
|
8083
9454
|
meta: {
|
|
8084
9455
|
name: "values",
|
|
8085
9456
|
description: `Look up entity values for a single facet \u2014 full list or typeahead search.
|
|
@@ -8120,7 +9491,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
|
|
|
8120
9491
|
}
|
|
8121
9492
|
}
|
|
8122
9493
|
});
|
|
8123
|
-
var facetsCommand =
|
|
9494
|
+
var facetsCommand = defineCommand46({
|
|
8124
9495
|
meta: {
|
|
8125
9496
|
name: "facets",
|
|
8126
9497
|
description: `LinkedIn targeting facets and entity lookup.
|
|
@@ -8137,8 +9508,8 @@ Subcommands:
|
|
|
8137
9508
|
});
|
|
8138
9509
|
|
|
8139
9510
|
// src/commands/ads/linkedin/forecast.ts
|
|
8140
|
-
import { readFileSync as
|
|
8141
|
-
import { defineCommand as
|
|
9511
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
9512
|
+
import { defineCommand as defineCommand47 } from "citty";
|
|
8142
9513
|
function loadTargeting3(args) {
|
|
8143
9514
|
const inline = args.targeting;
|
|
8144
9515
|
if (inline) {
|
|
@@ -8151,7 +9522,7 @@ function loadTargeting3(args) {
|
|
|
8151
9522
|
const file = args["targeting-file"];
|
|
8152
9523
|
if (file) {
|
|
8153
9524
|
try {
|
|
8154
|
-
return JSON.parse(
|
|
9525
|
+
return JSON.parse(readFileSync8(file, "utf-8"));
|
|
8155
9526
|
} catch (e) {
|
|
8156
9527
|
handleLinkedinError(
|
|
8157
9528
|
new Error(`Failed to read --targeting-file: ${e instanceof Error ? e.message : "I/O error"}`)
|
|
@@ -8168,7 +9539,7 @@ function parseMoney(raw) {
|
|
|
8168
9539
|
}
|
|
8169
9540
|
return { amount: m[1] ?? "0", currencyCode: m[2] ?? "USD" };
|
|
8170
9541
|
}
|
|
8171
|
-
var forecastCommand =
|
|
9542
|
+
var forecastCommand = defineCommand47({
|
|
8172
9543
|
meta: {
|
|
8173
9544
|
name: "forecast",
|
|
8174
9545
|
description: `Forecast reach + impressions + clicks + spend for a hypothetical campaign.
|
|
@@ -8215,9 +9586,9 @@ Examples:
|
|
|
8215
9586
|
});
|
|
8216
9587
|
|
|
8217
9588
|
// src/commands/ads/linkedin/leads.ts
|
|
8218
|
-
import { defineCommand as
|
|
9589
|
+
import { defineCommand as defineCommand48 } from "citty";
|
|
8219
9590
|
var DAY_MS4 = 864e5;
|
|
8220
|
-
var leadsCommand =
|
|
9591
|
+
var leadsCommand = defineCommand48({
|
|
8221
9592
|
meta: {
|
|
8222
9593
|
name: "leads",
|
|
8223
9594
|
description: `List Lead Gen Form responses (playbook \xA707).
|
|
@@ -8277,7 +9648,7 @@ Examples:
|
|
|
8277
9648
|
});
|
|
8278
9649
|
|
|
8279
9650
|
// src/commands/ads/linkedin/resolve.ts
|
|
8280
|
-
import { defineCommand as
|
|
9651
|
+
import { defineCommand as defineCommand49 } from "citty";
|
|
8281
9652
|
function toOrgUrn(raw) {
|
|
8282
9653
|
const trimmed = raw.trim();
|
|
8283
9654
|
if (trimmed.length === 0) {
|
|
@@ -8288,7 +9659,7 @@ function toOrgUrn(raw) {
|
|
|
8288
9659
|
}
|
|
8289
9660
|
return /^\d+$/.test(trimmed) ? `urn:li:organization:${trimmed}` : null;
|
|
8290
9661
|
}
|
|
8291
|
-
var resolveCommand =
|
|
9662
|
+
var resolveCommand = defineCommand49({
|
|
8292
9663
|
meta: {
|
|
8293
9664
|
name: "resolve",
|
|
8294
9665
|
description: `Resolve organization URNs to company names.
|
|
@@ -8330,8 +9701,8 @@ couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
|
|
|
8330
9701
|
});
|
|
8331
9702
|
|
|
8332
9703
|
// src/commands/ads/linkedin/top-companies.ts
|
|
8333
|
-
import { defineCommand as
|
|
8334
|
-
var topCompaniesCommand =
|
|
9704
|
+
import { defineCommand as defineCommand50 } from "citty";
|
|
9705
|
+
var topCompaniesCommand = defineCommand50({
|
|
8335
9706
|
meta: {
|
|
8336
9707
|
name: "top-companies",
|
|
8337
9708
|
description: `Top companies whose employees saw / clicked / converted on a campaign.
|
|
@@ -8402,7 +9773,7 @@ Examples:
|
|
|
8402
9773
|
});
|
|
8403
9774
|
|
|
8404
9775
|
// src/commands/ads/linkedin/index.ts
|
|
8405
|
-
var linkedinCommand =
|
|
9776
|
+
var linkedinCommand = defineCommand51({
|
|
8406
9777
|
meta: {
|
|
8407
9778
|
name: "linkedin",
|
|
8408
9779
|
description: `LinkedIn Marketing API \u2014 AI-first command surface for B2B ad insights.
|
|
@@ -8447,9 +9818,9 @@ Account ID format:
|
|
|
8447
9818
|
accounts: accountsCommand2,
|
|
8448
9819
|
account: accountCommand,
|
|
8449
9820
|
"campaign-groups": campaignGroupsCommand,
|
|
8450
|
-
campaigns:
|
|
9821
|
+
campaigns: campaignsCommand2,
|
|
8451
9822
|
creatives: creativesCommand,
|
|
8452
|
-
audiences:
|
|
9823
|
+
audiences: audiencesCommand2,
|
|
8453
9824
|
"lead-forms": leadFormsCommand,
|
|
8454
9825
|
draft: linkedinDraftCommand,
|
|
8455
9826
|
analytics: analyticsCommand,
|
|
@@ -8461,17 +9832,17 @@ Account ID format:
|
|
|
8461
9832
|
"bid-pricing": bidPricingCommand,
|
|
8462
9833
|
forecast: forecastCommand,
|
|
8463
9834
|
leads: leadsCommand,
|
|
8464
|
-
conversions:
|
|
9835
|
+
conversions: conversionsCommand2,
|
|
8465
9836
|
conversation: conversationCommand,
|
|
8466
9837
|
audit: auditCommand
|
|
8467
9838
|
}
|
|
8468
9839
|
});
|
|
8469
9840
|
|
|
8470
9841
|
// src/commands/ads/meta/index.ts
|
|
8471
|
-
import { defineCommand as
|
|
9842
|
+
import { defineCommand as defineCommand64 } from "citty";
|
|
8472
9843
|
|
|
8473
9844
|
// src/commands/ads/meta/account.ts
|
|
8474
|
-
import { defineCommand as
|
|
9845
|
+
import { defineCommand as defineCommand52 } from "citty";
|
|
8475
9846
|
|
|
8476
9847
|
// src/commands/ads/meta/shared.ts
|
|
8477
9848
|
var DAY_MS5 = 864e5;
|
|
@@ -8550,7 +9921,7 @@ function resolveEffectiveStatus(args) {
|
|
|
8550
9921
|
}
|
|
8551
9922
|
|
|
8552
9923
|
// src/commands/ads/meta/account.ts
|
|
8553
|
-
var accountCommand2 =
|
|
9924
|
+
var accountCommand2 = defineCommand52({
|
|
8554
9925
|
meta: {
|
|
8555
9926
|
name: "account",
|
|
8556
9927
|
description: `Show single Meta ad account detail (currency, timezone, balance, business).
|
|
@@ -8577,8 +9948,8 @@ Examples:
|
|
|
8577
9948
|
});
|
|
8578
9949
|
|
|
8579
9950
|
// src/commands/ads/meta/accounts.ts
|
|
8580
|
-
import { defineCommand as
|
|
8581
|
-
var accountsCommand3 =
|
|
9951
|
+
import { defineCommand as defineCommand53 } from "citty";
|
|
9952
|
+
var accountsCommand3 = defineCommand53({
|
|
8582
9953
|
meta: {
|
|
8583
9954
|
name: "accounts",
|
|
8584
9955
|
description: `List Meta ad accounts in this company's connected scope.
|
|
@@ -8626,8 +9997,8 @@ Examples:
|
|
|
8626
9997
|
});
|
|
8627
9998
|
|
|
8628
9999
|
// src/commands/ads/meta/activities.ts
|
|
8629
|
-
import { defineCommand as
|
|
8630
|
-
var activitiesCommand =
|
|
10000
|
+
import { defineCommand as defineCommand54 } from "citty";
|
|
10001
|
+
var activitiesCommand = defineCommand54({
|
|
8631
10002
|
meta: {
|
|
8632
10003
|
name: "activities",
|
|
8633
10004
|
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
@@ -8664,8 +10035,8 @@ Examples:
|
|
|
8664
10035
|
});
|
|
8665
10036
|
|
|
8666
10037
|
// src/commands/ads/meta/ads.ts
|
|
8667
|
-
import { defineCommand as
|
|
8668
|
-
var adsListCommand =
|
|
10038
|
+
import { defineCommand as defineCommand55 } from "citty";
|
|
10039
|
+
var adsListCommand = defineCommand55({
|
|
8669
10040
|
meta: {
|
|
8670
10041
|
name: "ads",
|
|
8671
10042
|
description: `List ads in a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -8713,8 +10084,8 @@ Examples:
|
|
|
8713
10084
|
});
|
|
8714
10085
|
|
|
8715
10086
|
// src/commands/ads/meta/adsets.ts
|
|
8716
|
-
import { defineCommand as
|
|
8717
|
-
var adsetsCommand =
|
|
10087
|
+
import { defineCommand as defineCommand56 } from "citty";
|
|
10088
|
+
var adsetsCommand = defineCommand56({
|
|
8718
10089
|
meta: {
|
|
8719
10090
|
name: "adsets",
|
|
8720
10091
|
description: `List ad sets in a Meta ad account, optionally scoped to one campaign. Defaults to ACTIVE only.
|
|
@@ -8756,8 +10127,8 @@ Examples:
|
|
|
8756
10127
|
});
|
|
8757
10128
|
|
|
8758
10129
|
// src/commands/ads/meta/audiences.ts
|
|
8759
|
-
import { defineCommand as
|
|
8760
|
-
var
|
|
10130
|
+
import { defineCommand as defineCommand57 } from "citty";
|
|
10131
|
+
var audiencesCommand3 = defineCommand57({
|
|
8761
10132
|
meta: {
|
|
8762
10133
|
name: "audiences",
|
|
8763
10134
|
description: `List custom audiences for a Meta ad account. Includes lookalikes, website-pixel audiences,
|
|
@@ -8792,8 +10163,8 @@ Examples:
|
|
|
8792
10163
|
});
|
|
8793
10164
|
|
|
8794
10165
|
// src/commands/ads/meta/businesses.ts
|
|
8795
|
-
import { defineCommand as
|
|
8796
|
-
var businessesCommand =
|
|
10166
|
+
import { defineCommand as defineCommand58 } from "citty";
|
|
10167
|
+
var businessesCommand = defineCommand58({
|
|
8797
10168
|
meta: {
|
|
8798
10169
|
name: "businesses",
|
|
8799
10170
|
description: `List Meta Business Manager accounts the connected user has access to. Required for ad-studies and product-catalogs commands.
|
|
@@ -8823,8 +10194,8 @@ Examples:
|
|
|
8823
10194
|
});
|
|
8824
10195
|
|
|
8825
10196
|
// src/commands/ads/meta/campaigns.ts
|
|
8826
|
-
import { defineCommand as
|
|
8827
|
-
var
|
|
10197
|
+
import { defineCommand as defineCommand59 } from "citty";
|
|
10198
|
+
var campaignsCommand3 = defineCommand59({
|
|
8828
10199
|
meta: {
|
|
8829
10200
|
name: "campaigns",
|
|
8830
10201
|
description: `List campaigns for a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -8868,8 +10239,8 @@ Examples:
|
|
|
8868
10239
|
});
|
|
8869
10240
|
|
|
8870
10241
|
// src/commands/ads/meta/creatives.ts
|
|
8871
|
-
import { defineCommand as
|
|
8872
|
-
var creativesCommand2 =
|
|
10242
|
+
import { defineCommand as defineCommand60 } from "citty";
|
|
10243
|
+
var creativesCommand2 = defineCommand60({
|
|
8873
10244
|
meta: {
|
|
8874
10245
|
name: "creatives",
|
|
8875
10246
|
description: `List ad creatives in an account, or fetch a single creative by ID.
|
|
@@ -8913,7 +10284,7 @@ Examples:
|
|
|
8913
10284
|
});
|
|
8914
10285
|
|
|
8915
10286
|
// src/commands/ads/meta/insights.ts
|
|
8916
|
-
import { defineCommand as
|
|
10287
|
+
import { defineCommand as defineCommand61 } from "citty";
|
|
8917
10288
|
|
|
8918
10289
|
// src/commands/ads/meta/presets.ts
|
|
8919
10290
|
var INSIGHTS_INTENTS = {
|
|
@@ -9118,7 +10489,7 @@ function sortRowsBySpendDesc(rows) {
|
|
|
9118
10489
|
return sb - sa;
|
|
9119
10490
|
});
|
|
9120
10491
|
}
|
|
9121
|
-
var insightsCommand =
|
|
10492
|
+
var insightsCommand = defineCommand61({
|
|
9122
10493
|
meta: {
|
|
9123
10494
|
name: "insights",
|
|
9124
10495
|
description: `Performance reporting \u2014 the main Meta tool for AI agents.
|
|
@@ -9219,8 +10590,8 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
|
|
|
9219
10590
|
});
|
|
9220
10591
|
|
|
9221
10592
|
// src/commands/ads/meta/pixels.ts
|
|
9222
|
-
import { defineCommand as
|
|
9223
|
-
var pixelsCommand =
|
|
10593
|
+
import { defineCommand as defineCommand62 } from "citty";
|
|
10594
|
+
var pixelsCommand = defineCommand62({
|
|
9224
10595
|
meta: {
|
|
9225
10596
|
name: "pixels",
|
|
9226
10597
|
description: `List Meta Pixels for an ad account, or fetch firing stats for one pixel.
|
|
@@ -9291,7 +10662,7 @@ function emit(data, args) {
|
|
|
9291
10662
|
|
|
9292
10663
|
// src/commands/ads/meta/preview.ts
|
|
9293
10664
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
9294
|
-
import { defineCommand as
|
|
10665
|
+
import { defineCommand as defineCommand63 } from "citty";
|
|
9295
10666
|
var VALID_AD_FORMATS = [
|
|
9296
10667
|
"DESKTOP_FEED_STANDARD",
|
|
9297
10668
|
"MOBILE_FEED_STANDARD",
|
|
@@ -9325,7 +10696,7 @@ var VALID_AD_FORMATS = [
|
|
|
9325
10696
|
"MARKETPLACE_MOBILE",
|
|
9326
10697
|
"BIZ_DISCO_FEED_MOBILE"
|
|
9327
10698
|
];
|
|
9328
|
-
var previewCommand =
|
|
10699
|
+
var previewCommand = defineCommand63({
|
|
9329
10700
|
meta: {
|
|
9330
10701
|
name: "preview",
|
|
9331
10702
|
description: `Generate a Meta-hosted preview iframe for a creative or ad. Returns iframe HTML which you
|
|
@@ -9372,7 +10743,7 @@ Examples:
|
|
|
9372
10743
|
});
|
|
9373
10744
|
|
|
9374
10745
|
// src/commands/ads/meta/index.ts
|
|
9375
|
-
var metaCommand =
|
|
10746
|
+
var metaCommand = defineCommand64({
|
|
9376
10747
|
meta: {
|
|
9377
10748
|
name: "meta",
|
|
9378
10749
|
description: `Meta Marketing API \u2014 AI-first command surface (Facebook + Instagram ads).
|
|
@@ -9411,11 +10782,11 @@ Audit & review:
|
|
|
9411
10782
|
accounts: accountsCommand3,
|
|
9412
10783
|
account: accountCommand2,
|
|
9413
10784
|
businesses: businessesCommand,
|
|
9414
|
-
campaigns:
|
|
10785
|
+
campaigns: campaignsCommand3,
|
|
9415
10786
|
adsets: adsetsCommand,
|
|
9416
10787
|
ads: adsListCommand,
|
|
9417
10788
|
creatives: creativesCommand2,
|
|
9418
|
-
audiences:
|
|
10789
|
+
audiences: audiencesCommand3,
|
|
9419
10790
|
pixels: pixelsCommand,
|
|
9420
10791
|
activities: activitiesCommand,
|
|
9421
10792
|
insights: insightsCommand,
|
|
@@ -9424,10 +10795,10 @@ Audit & review:
|
|
|
9424
10795
|
});
|
|
9425
10796
|
|
|
9426
10797
|
// src/commands/ads/x/index.ts
|
|
9427
|
-
import { defineCommand as
|
|
10798
|
+
import { defineCommand as defineCommand81 } from "citty";
|
|
9428
10799
|
|
|
9429
10800
|
// src/commands/ads/x/accounts.ts
|
|
9430
|
-
import { defineCommand as
|
|
10801
|
+
import { defineCommand as defineCommand65 } from "citty";
|
|
9431
10802
|
registerSchema({
|
|
9432
10803
|
command: "ads.x.accounts",
|
|
9433
10804
|
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.",
|
|
@@ -9455,7 +10826,7 @@ function handleAccountsError2(err) {
|
|
|
9455
10826
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
9456
10827
|
process.exit(1);
|
|
9457
10828
|
}
|
|
9458
|
-
var accountsCommand4 =
|
|
10829
|
+
var accountsCommand4 = defineCommand65({
|
|
9459
10830
|
meta: {
|
|
9460
10831
|
name: "accounts",
|
|
9461
10832
|
description: `List accessible X Ads accounts. Returns account IDs needed for all other commands.
|
|
@@ -9495,7 +10866,7 @@ Examples:
|
|
|
9495
10866
|
});
|
|
9496
10867
|
|
|
9497
10868
|
// src/commands/ads/x/active-entities.ts
|
|
9498
|
-
import { defineCommand as
|
|
10869
|
+
import { defineCommand as defineCommand66 } from "citty";
|
|
9499
10870
|
|
|
9500
10871
|
// src/commands/ads/x/error-parser.ts
|
|
9501
10872
|
function mapXErrorCode(message) {
|
|
@@ -9646,7 +11017,7 @@ function parseCsv(v) {
|
|
|
9646
11017
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
9647
11018
|
return parts.length > 0 ? parts : void 0;
|
|
9648
11019
|
}
|
|
9649
|
-
var activeEntitiesCommand =
|
|
11020
|
+
var activeEntitiesCommand = defineCommand66({
|
|
9650
11021
|
meta: {
|
|
9651
11022
|
name: "active-entities",
|
|
9652
11023
|
description: `List entities with metric activity in a time range.
|
|
@@ -9704,7 +11075,7 @@ Examples:
|
|
|
9704
11075
|
});
|
|
9705
11076
|
|
|
9706
11077
|
// src/commands/ads/x/audiences.ts
|
|
9707
|
-
import { defineCommand as
|
|
11078
|
+
import { defineCommand as defineCommand67 } from "citty";
|
|
9708
11079
|
registerSchema({
|
|
9709
11080
|
command: "ads.x.audiences",
|
|
9710
11081
|
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.",
|
|
@@ -9713,7 +11084,7 @@ registerSchema({
|
|
|
9713
11084
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
9714
11085
|
}
|
|
9715
11086
|
});
|
|
9716
|
-
var
|
|
11087
|
+
var audiencesCommand4 = defineCommand67({
|
|
9717
11088
|
meta: {
|
|
9718
11089
|
name: "audiences",
|
|
9719
11090
|
description: `List X Ads custom audiences.
|
|
@@ -9762,7 +11133,7 @@ Examples:
|
|
|
9762
11133
|
});
|
|
9763
11134
|
|
|
9764
11135
|
// src/commands/ads/x/campaigns.ts
|
|
9765
|
-
import { defineCommand as
|
|
11136
|
+
import { defineCommand as defineCommand68 } from "citty";
|
|
9766
11137
|
|
|
9767
11138
|
// src/commands/ads/x/run-list.ts
|
|
9768
11139
|
function buildCleanParams(opts) {
|
|
@@ -9825,7 +11196,7 @@ registerSchema({
|
|
|
9825
11196
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
9826
11197
|
}
|
|
9827
11198
|
});
|
|
9828
|
-
var
|
|
11199
|
+
var campaignsCommand4 = defineCommand68({
|
|
9829
11200
|
meta: {
|
|
9830
11201
|
name: "campaigns",
|
|
9831
11202
|
description: `List X Ads campaigns. Returns budget, schedule, funding instrument, status.
|
|
@@ -9867,7 +11238,7 @@ Examples:
|
|
|
9867
11238
|
});
|
|
9868
11239
|
|
|
9869
11240
|
// src/commands/ads/x/cards.ts
|
|
9870
|
-
import { defineCommand as
|
|
11241
|
+
import { defineCommand as defineCommand69 } from "citty";
|
|
9871
11242
|
registerSchema({
|
|
9872
11243
|
command: "ads.x.cards",
|
|
9873
11244
|
description: "List website cards, video cards, and carousels for an X Ads account.",
|
|
@@ -9876,7 +11247,7 @@ registerSchema({
|
|
|
9876
11247
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
9877
11248
|
}
|
|
9878
11249
|
});
|
|
9879
|
-
var cardsCommand =
|
|
11250
|
+
var cardsCommand = defineCommand69({
|
|
9880
11251
|
meta: {
|
|
9881
11252
|
name: "cards",
|
|
9882
11253
|
description: `List X Ads cards (rich creatives).
|
|
@@ -9925,7 +11296,7 @@ Examples:
|
|
|
9925
11296
|
});
|
|
9926
11297
|
|
|
9927
11298
|
// src/commands/ads/x/funding.ts
|
|
9928
|
-
import { defineCommand as
|
|
11299
|
+
import { defineCommand as defineCommand70 } from "citty";
|
|
9929
11300
|
registerSchema({
|
|
9930
11301
|
command: "ads.x.funding",
|
|
9931
11302
|
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.",
|
|
@@ -9934,7 +11305,7 @@ registerSchema({
|
|
|
9934
11305
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
9935
11306
|
}
|
|
9936
11307
|
});
|
|
9937
|
-
var fundingCommand =
|
|
11308
|
+
var fundingCommand = defineCommand70({
|
|
9938
11309
|
meta: {
|
|
9939
11310
|
name: "funding",
|
|
9940
11311
|
description: `List funding instruments for an X Ads account.
|
|
@@ -9983,7 +11354,7 @@ Examples:
|
|
|
9983
11354
|
});
|
|
9984
11355
|
|
|
9985
11356
|
// src/commands/ads/x/line-items.ts
|
|
9986
|
-
import { defineCommand as
|
|
11357
|
+
import { defineCommand as defineCommand71 } from "citty";
|
|
9987
11358
|
registerSchema({
|
|
9988
11359
|
command: "ads.x.lineItems",
|
|
9989
11360
|
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).",
|
|
@@ -9995,7 +11366,7 @@ registerSchema({
|
|
|
9995
11366
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
9996
11367
|
}
|
|
9997
11368
|
});
|
|
9998
|
-
var lineItemsCommand =
|
|
11369
|
+
var lineItemsCommand = defineCommand71({
|
|
9999
11370
|
meta: {
|
|
10000
11371
|
name: "line-items",
|
|
10001
11372
|
description: `List X Ads line items (ad groups).
|
|
@@ -10036,7 +11407,7 @@ Examples:
|
|
|
10036
11407
|
});
|
|
10037
11408
|
|
|
10038
11409
|
// src/commands/ads/x/media.ts
|
|
10039
|
-
import { defineCommand as
|
|
11410
|
+
import { defineCommand as defineCommand72 } from "citty";
|
|
10040
11411
|
registerSchema({
|
|
10041
11412
|
command: "ads.x.media",
|
|
10042
11413
|
description: "List media assets in the X Ads media library (images, GIFs, videos). Filter by media-type (IMAGE, GIF, VIDEO).",
|
|
@@ -10046,7 +11417,7 @@ registerSchema({
|
|
|
10046
11417
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
10047
11418
|
}
|
|
10048
11419
|
});
|
|
10049
|
-
var mediaCommand =
|
|
11420
|
+
var mediaCommand = defineCommand72({
|
|
10050
11421
|
meta: {
|
|
10051
11422
|
name: "media",
|
|
10052
11423
|
description: `List media assets in the X Ads media library.
|
|
@@ -10098,7 +11469,7 @@ Examples:
|
|
|
10098
11469
|
});
|
|
10099
11470
|
|
|
10100
11471
|
// src/commands/ads/x/promoted-tweets.ts
|
|
10101
|
-
import { defineCommand as
|
|
11472
|
+
import { defineCommand as defineCommand73 } from "citty";
|
|
10102
11473
|
registerSchema({
|
|
10103
11474
|
command: "ads.x.promotedTweets",
|
|
10104
11475
|
description: "List promoted tweets for an X Ads account. Returns id, line_item_id, tweet_id, approval_status. Filter by line-item-ids (CSV).",
|
|
@@ -10109,7 +11480,7 @@ registerSchema({
|
|
|
10109
11480
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
10110
11481
|
}
|
|
10111
11482
|
});
|
|
10112
|
-
var promotedTweetsCommand =
|
|
11483
|
+
var promotedTweetsCommand = defineCommand73({
|
|
10113
11484
|
meta: {
|
|
10114
11485
|
name: "promoted-tweets",
|
|
10115
11486
|
description: `List X Ads promoted tweets.
|
|
@@ -10163,11 +11534,11 @@ Examples:
|
|
|
10163
11534
|
});
|
|
10164
11535
|
|
|
10165
11536
|
// src/commands/ads/x/stats/index.ts
|
|
10166
|
-
import { defineCommand as
|
|
11537
|
+
import { defineCommand as defineCommand78 } from "citty";
|
|
10167
11538
|
|
|
10168
11539
|
// src/commands/ads/x/stats/job.ts
|
|
10169
11540
|
import { gunzipSync } from "zlib";
|
|
10170
|
-
import { defineCommand as
|
|
11541
|
+
import { defineCommand as defineCommand74 } from "citty";
|
|
10171
11542
|
var POLL_INTERVAL_MS2 = 1e4;
|
|
10172
11543
|
var DEADLINE_MS = 12 * 60 * 1e3;
|
|
10173
11544
|
var RESULT_CACHE_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
@@ -10237,7 +11608,7 @@ async function pollUntilDone(accountId, jobId) {
|
|
|
10237
11608
|
function buildCacheKey(body) {
|
|
10238
11609
|
return `stats-job:${JSON.stringify(body)}`;
|
|
10239
11610
|
}
|
|
10240
|
-
var statsJobCommand =
|
|
11611
|
+
var statsJobCommand = defineCommand74({
|
|
10241
11612
|
meta: {
|
|
10242
11613
|
name: "job",
|
|
10243
11614
|
description: `Async X Ads stats job, sync from the CLI's perspective. Creates \u2192 polls \u2192 downloads \u2192 returns.
|
|
@@ -10342,7 +11713,7 @@ For fine-grained control (don't wait, poll yourself), use:
|
|
|
10342
11713
|
});
|
|
10343
11714
|
|
|
10344
11715
|
// src/commands/ads/x/stats/job-create.ts
|
|
10345
|
-
import { defineCommand as
|
|
11716
|
+
import { defineCommand as defineCommand75 } from "citty";
|
|
10346
11717
|
registerSchema({
|
|
10347
11718
|
command: "ads.x.statsJobCreate",
|
|
10348
11719
|
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.",
|
|
@@ -10365,7 +11736,7 @@ function parseCsv3(v) {
|
|
|
10365
11736
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
10366
11737
|
return parts.length > 0 ? parts : void 0;
|
|
10367
11738
|
}
|
|
10368
|
-
var statsJobCreateCommand =
|
|
11739
|
+
var statsJobCreateCommand = defineCommand75({
|
|
10369
11740
|
meta: {
|
|
10370
11741
|
name: "job-create",
|
|
10371
11742
|
description: `Create an async X Ads stats job (up to 90 days, supports segmentation).
|
|
@@ -10428,7 +11799,7 @@ Examples:
|
|
|
10428
11799
|
});
|
|
10429
11800
|
|
|
10430
11801
|
// src/commands/ads/x/stats/job-status.ts
|
|
10431
|
-
import { defineCommand as
|
|
11802
|
+
import { defineCommand as defineCommand76 } from "citty";
|
|
10432
11803
|
registerSchema({
|
|
10433
11804
|
command: "ads.x.statsJobStatus",
|
|
10434
11805
|
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).",
|
|
@@ -10438,7 +11809,7 @@ registerSchema({
|
|
|
10438
11809
|
"job-ids": { type: "string", description: "CSV of job IDs", required: false }
|
|
10439
11810
|
}
|
|
10440
11811
|
});
|
|
10441
|
-
var statsJobStatusCommand =
|
|
11812
|
+
var statsJobStatusCommand = defineCommand76({
|
|
10442
11813
|
meta: {
|
|
10443
11814
|
name: "job-status",
|
|
10444
11815
|
description: `Poll the status of an async X Ads stats job.
|
|
@@ -10479,7 +11850,7 @@ Examples:
|
|
|
10479
11850
|
});
|
|
10480
11851
|
|
|
10481
11852
|
// src/commands/ads/x/stats/sync.ts
|
|
10482
|
-
import { defineCommand as
|
|
11853
|
+
import { defineCommand as defineCommand77 } from "citty";
|
|
10483
11854
|
|
|
10484
11855
|
// src/commands/ads/x/presets.ts
|
|
10485
11856
|
var X_STATS_PRESETS = [
|
|
@@ -10638,7 +12009,7 @@ async function runSync(args, q) {
|
|
|
10638
12009
|
process.exit(1);
|
|
10639
12010
|
}
|
|
10640
12011
|
}
|
|
10641
|
-
var statsSyncCommand =
|
|
12012
|
+
var statsSyncCommand = defineCommand77({
|
|
10642
12013
|
meta: {
|
|
10643
12014
|
name: "sync",
|
|
10644
12015
|
description: `Synchronous X Ads analytics (max 7-day window).
|
|
@@ -10681,7 +12052,7 @@ Examples:
|
|
|
10681
12052
|
});
|
|
10682
12053
|
|
|
10683
12054
|
// src/commands/ads/x/stats/index.ts
|
|
10684
|
-
var statsCommand =
|
|
12055
|
+
var statsCommand = defineCommand78({
|
|
10685
12056
|
meta: {
|
|
10686
12057
|
name: "stats",
|
|
10687
12058
|
description: `X Ads analytics. Sync (\u22647 days, no segmentation) or async jobs (\u226490 days, segmentable).
|
|
@@ -10709,7 +12080,7 @@ Examples:
|
|
|
10709
12080
|
});
|
|
10710
12081
|
|
|
10711
12082
|
// src/commands/ads/x/targeting-constants.ts
|
|
10712
|
-
import { defineCommand as
|
|
12083
|
+
import { defineCommand as defineCommand79 } from "citty";
|
|
10713
12084
|
var ALLOWED_CONSTANTS = [
|
|
10714
12085
|
"locations",
|
|
10715
12086
|
"interests",
|
|
@@ -10737,7 +12108,7 @@ registerSchema({
|
|
|
10737
12108
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
10738
12109
|
}
|
|
10739
12110
|
});
|
|
10740
|
-
var targetingConstantsCommand =
|
|
12111
|
+
var targetingConstantsCommand = defineCommand79({
|
|
10741
12112
|
meta: {
|
|
10742
12113
|
name: "targeting-constants",
|
|
10743
12114
|
description: `Lookup X Ads targeting constants.
|
|
@@ -10787,7 +12158,7 @@ Examples:
|
|
|
10787
12158
|
});
|
|
10788
12159
|
|
|
10789
12160
|
// src/commands/ads/x/targeting-criteria.ts
|
|
10790
|
-
import { defineCommand as
|
|
12161
|
+
import { defineCommand as defineCommand80 } from "citty";
|
|
10791
12162
|
registerSchema({
|
|
10792
12163
|
command: "ads.x.targetingCriteria",
|
|
10793
12164
|
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.",
|
|
@@ -10797,7 +12168,7 @@ registerSchema({
|
|
|
10797
12168
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
10798
12169
|
}
|
|
10799
12170
|
});
|
|
10800
|
-
var targetingCriteriaCommand =
|
|
12171
|
+
var targetingCriteriaCommand = defineCommand80({
|
|
10801
12172
|
meta: {
|
|
10802
12173
|
name: "targeting-criteria",
|
|
10803
12174
|
description: `List targeting criteria attached to line items.
|
|
@@ -10848,7 +12219,7 @@ Examples:
|
|
|
10848
12219
|
});
|
|
10849
12220
|
|
|
10850
12221
|
// src/commands/ads/x/index.ts
|
|
10851
|
-
var xCommand =
|
|
12222
|
+
var xCommand = defineCommand81({
|
|
10852
12223
|
meta: {
|
|
10853
12224
|
name: "x",
|
|
10854
12225
|
description: `X (Twitter) Ads commands. Read campaigns, line items, promoted tweets, creatives, audiences, and analytics.
|
|
@@ -10872,12 +12243,12 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
10872
12243
|
subCommands: {
|
|
10873
12244
|
accounts: accountsCommand4,
|
|
10874
12245
|
funding: fundingCommand,
|
|
10875
|
-
campaigns:
|
|
12246
|
+
campaigns: campaignsCommand4,
|
|
10876
12247
|
"line-items": lineItemsCommand,
|
|
10877
12248
|
"promoted-tweets": promotedTweetsCommand,
|
|
10878
12249
|
cards: cardsCommand,
|
|
10879
12250
|
media: mediaCommand,
|
|
10880
|
-
audiences:
|
|
12251
|
+
audiences: audiencesCommand4,
|
|
10881
12252
|
"targeting-criteria": targetingCriteriaCommand,
|
|
10882
12253
|
"targeting-constants": targetingConstantsCommand,
|
|
10883
12254
|
"active-entities": activeEntitiesCommand,
|
|
@@ -10886,7 +12257,7 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
10886
12257
|
});
|
|
10887
12258
|
|
|
10888
12259
|
// src/commands/ads/index.ts
|
|
10889
|
-
var
|
|
12260
|
+
var adsCommand2 = defineCommand82({
|
|
10890
12261
|
meta: {
|
|
10891
12262
|
name: "ads",
|
|
10892
12263
|
description: `Ad platform commands. Each platform exposes its own native command surface \u2014 no forced parity.
|
|
@@ -10916,11 +12287,11 @@ Examples:
|
|
|
10916
12287
|
});
|
|
10917
12288
|
|
|
10918
12289
|
// src/commands/canvas/index.ts
|
|
10919
|
-
import { defineCommand as
|
|
12290
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
10920
12291
|
|
|
10921
12292
|
// src/commands/canvas/catalog.ts
|
|
10922
|
-
import { defineCommand as
|
|
10923
|
-
var catalogCommand =
|
|
12293
|
+
import { defineCommand as defineCommand83 } from "citty";
|
|
12294
|
+
var catalogCommand = defineCommand83({
|
|
10924
12295
|
meta: {
|
|
10925
12296
|
name: "catalog",
|
|
10926
12297
|
description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
|
|
@@ -10937,9 +12308,9 @@ import { execFile } from "child_process";
|
|
|
10937
12308
|
import { readdir, readFile, stat } from "fs/promises";
|
|
10938
12309
|
import path from "path";
|
|
10939
12310
|
import { promisify } from "util";
|
|
10940
|
-
import { defineCommand as
|
|
12311
|
+
import { defineCommand as defineCommand84 } from "citty";
|
|
10941
12312
|
var execFileAsync = promisify(execFile);
|
|
10942
|
-
var inspectCommand =
|
|
12313
|
+
var inspectCommand = defineCommand84({
|
|
10943
12314
|
meta: {
|
|
10944
12315
|
name: "inspect",
|
|
10945
12316
|
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."
|
|
@@ -11048,7 +12419,7 @@ async function probeDuration(filePath) {
|
|
|
11048
12419
|
// src/commands/canvas/run.ts
|
|
11049
12420
|
import { readFile as readFile2 } from "fs/promises";
|
|
11050
12421
|
import path4 from "path";
|
|
11051
|
-
import { defineCommand as
|
|
12422
|
+
import { defineCommand as defineCommand85 } from "citty";
|
|
11052
12423
|
|
|
11053
12424
|
// src/commands/canvas/placeholders.ts
|
|
11054
12425
|
function unsuppliedPlaceholderAssets(canvas) {
|
|
@@ -11118,7 +12489,7 @@ async function pruneOldRuns(outputsDir, keep, currentRunId, log) {
|
|
|
11118
12489
|
}
|
|
11119
12490
|
|
|
11120
12491
|
// src/commands/canvas/run.ts
|
|
11121
|
-
var runCommand =
|
|
12492
|
+
var runCommand = defineCommand85({
|
|
11122
12493
|
meta: { name: "run", description: "Validate and execute a canvas JSON file." },
|
|
11123
12494
|
args: {
|
|
11124
12495
|
file: { type: "positional", required: true, description: "Path to canvas JSON" },
|
|
@@ -11214,30 +12585,30 @@ var runCommand = defineCommand83({
|
|
|
11214
12585
|
// src/commands/canvas/scaffold-static-ad.ts
|
|
11215
12586
|
import { readFile as readFile3, writeFile } from "fs/promises";
|
|
11216
12587
|
import path5 from "path";
|
|
11217
|
-
import { defineCommand as
|
|
12588
|
+
import { defineCommand as defineCommand86 } from "citty";
|
|
11218
12589
|
|
|
11219
12590
|
// src/engine/scaffold/staticAd.ts
|
|
11220
|
-
import { z as
|
|
12591
|
+
import { z as z10 } from "zod";
|
|
11221
12592
|
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"]);
|
|
11222
12593
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
11223
|
-
var Blueprint =
|
|
11224
|
-
meta:
|
|
11225
|
-
text_content:
|
|
12594
|
+
var Blueprint = z10.object({
|
|
12595
|
+
meta: z10.object({ estimated_aspect_ratio: z10.string().optional() }).loose().optional(),
|
|
12596
|
+
text_content: z10.array(z10.object({ text: z10.string().optional() }).loose()).optional()
|
|
11226
12597
|
}).loose();
|
|
11227
|
-
var ElementLocator =
|
|
11228
|
-
collection:
|
|
11229
|
-
index:
|
|
12598
|
+
var ElementLocator = z10.object({
|
|
12599
|
+
collection: z10.enum(["subjects", "people", "brands_logos"]),
|
|
12600
|
+
index: z10.number().int().nonnegative()
|
|
11230
12601
|
}).loose();
|
|
11231
|
-
var MainElement =
|
|
12602
|
+
var MainElement = z10.object({
|
|
11232
12603
|
// logo | product | person | animal | badge | other
|
|
11233
|
-
type:
|
|
11234
|
-
label:
|
|
11235
|
-
description:
|
|
11236
|
-
expression:
|
|
11237
|
-
reason:
|
|
12604
|
+
type: z10.string(),
|
|
12605
|
+
label: z10.string().optional(),
|
|
12606
|
+
description: z10.string().optional(),
|
|
12607
|
+
expression: z10.string().nullable().optional(),
|
|
12608
|
+
reason: z10.string().optional(),
|
|
11238
12609
|
locator: ElementLocator.optional()
|
|
11239
12610
|
}).loose();
|
|
11240
|
-
var MainElements =
|
|
12611
|
+
var MainElements = z10.array(MainElement);
|
|
11241
12612
|
function sanitizeId(raw, fallback) {
|
|
11242
12613
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
11243
12614
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -11548,7 +12919,7 @@ async function runVisionPasses(canvas) {
|
|
|
11548
12919
|
return fail("read_outputs", e instanceof Error ? e.message : String(e));
|
|
11549
12920
|
}
|
|
11550
12921
|
}
|
|
11551
|
-
var scaffoldStaticAdCommand =
|
|
12922
|
+
var scaffoldStaticAdCommand = defineCommand86({
|
|
11552
12923
|
meta: {
|
|
11553
12924
|
name: "scaffold-static-ad",
|
|
11554
12925
|
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."
|
|
@@ -11642,7 +13013,7 @@ var scaffoldStaticAdCommand = defineCommand84({
|
|
|
11642
13013
|
// src/commands/canvas/scaffold-video.ts
|
|
11643
13014
|
import { cp, mkdir, readFile as readFile6, writeFile as writeFile2 } from "fs/promises";
|
|
11644
13015
|
import path8 from "path";
|
|
11645
|
-
import { defineCommand as
|
|
13016
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
11646
13017
|
|
|
11647
13018
|
// src/engine/nodes/local/lib/sceneDetect.ts
|
|
11648
13019
|
import { execFile as execFile2 } from "child_process";
|
|
@@ -11747,7 +13118,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
11747
13118
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
11748
13119
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
11749
13120
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
11750
|
-
import { z as
|
|
13121
|
+
import { z as z11 } from "zod";
|
|
11751
13122
|
|
|
11752
13123
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
11753
13124
|
var SHOOT_MODES = [
|
|
@@ -12004,49 +13375,49 @@ function trimArgs(durationS, offsetS = 0) {
|
|
|
12004
13375
|
"{{out.video}}"
|
|
12005
13376
|
];
|
|
12006
13377
|
}
|
|
12007
|
-
var FrameAsset =
|
|
12008
|
-
var DialogueLine =
|
|
12009
|
-
speaker:
|
|
12010
|
-
line:
|
|
13378
|
+
var FrameAsset = z11.object({ url: z11.string().optional() }).loose().optional();
|
|
13379
|
+
var DialogueLine = z11.object({
|
|
13380
|
+
speaker: z11.string().optional(),
|
|
13381
|
+
line: z11.string().optional(),
|
|
12011
13382
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
12012
|
-
start_s:
|
|
12013
|
-
end_s:
|
|
12014
|
-
delivery:
|
|
12015
|
-
voice_description:
|
|
13383
|
+
start_s: z11.number().optional(),
|
|
13384
|
+
end_s: z11.number().optional(),
|
|
13385
|
+
delivery: z11.string().optional(),
|
|
13386
|
+
voice_description: z11.string().optional()
|
|
12016
13387
|
}).loose();
|
|
12017
|
-
var Sfx =
|
|
12018
|
-
at_s:
|
|
12019
|
-
duration_s:
|
|
12020
|
-
sound_effect_prompt:
|
|
12021
|
-
description:
|
|
13388
|
+
var Sfx = z11.object({
|
|
13389
|
+
at_s: z11.number().optional(),
|
|
13390
|
+
duration_s: z11.number().optional(),
|
|
13391
|
+
sound_effect_prompt: z11.string().optional(),
|
|
13392
|
+
description: z11.string().optional()
|
|
12022
13393
|
}).loose();
|
|
12023
|
-
var CompositionRegion =
|
|
13394
|
+
var CompositionRegion = z11.object({
|
|
12024
13395
|
// full | top | bottom | left | right | inset
|
|
12025
|
-
panel:
|
|
13396
|
+
panel: z11.string().optional(),
|
|
12026
13397
|
// 9-grid anchor for an `inset` presenter box.
|
|
12027
|
-
position:
|
|
12028
|
-
is_presenter:
|
|
13398
|
+
position: z11.string().optional(),
|
|
13399
|
+
is_presenter: z11.boolean().optional(),
|
|
12029
13400
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
12030
|
-
cast_ref:
|
|
12031
|
-
summary:
|
|
12032
|
-
frame_prompt:
|
|
12033
|
-
motion_prompt:
|
|
13401
|
+
cast_ref: z11.string().optional(),
|
|
13402
|
+
summary: z11.string().optional(),
|
|
13403
|
+
frame_prompt: z11.string().optional(),
|
|
13404
|
+
motion_prompt: z11.string().optional()
|
|
12034
13405
|
}).loose();
|
|
12035
|
-
var SceneComposition =
|
|
13406
|
+
var SceneComposition = z11.object({
|
|
12036
13407
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
12037
|
-
layout:
|
|
13408
|
+
layout: z11.string().optional(),
|
|
12038
13409
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
12039
|
-
split_axis:
|
|
12040
|
-
regions:
|
|
13410
|
+
split_axis: z11.string().optional(),
|
|
13411
|
+
regions: z11.array(CompositionRegion).optional()
|
|
12041
13412
|
}).loose();
|
|
12042
|
-
var CameraMotion =
|
|
12043
|
-
var TranscriptWord =
|
|
12044
|
-
var Scene =
|
|
12045
|
-
start_s:
|
|
12046
|
-
end_s:
|
|
12047
|
-
duration_s:
|
|
12048
|
-
summary:
|
|
12049
|
-
action_detail:
|
|
13413
|
+
var CameraMotion = z11.object({ movement: z11.string().optional(), detail: z11.string().optional() }).loose();
|
|
13414
|
+
var TranscriptWord = z11.object({ text: z11.string().optional() }).loose();
|
|
13415
|
+
var Scene = z11.object({
|
|
13416
|
+
start_s: z11.number().optional(),
|
|
13417
|
+
end_s: z11.number().optional(),
|
|
13418
|
+
duration_s: z11.number().optional(),
|
|
13419
|
+
summary: z11.string().optional(),
|
|
13420
|
+
action_detail: z11.string().optional(),
|
|
12050
13421
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
12051
13422
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
12052
13423
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -12054,77 +13425,77 @@ var Scene = z9.object({
|
|
|
12054
13425
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
12055
13426
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
12056
13427
|
// UGC/product mode; a human can override per scene by setting this.
|
|
12057
|
-
shoot_mode:
|
|
13428
|
+
shoot_mode: z11.string().optional(),
|
|
12058
13429
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
12059
13430
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
12060
|
-
ambient:
|
|
13431
|
+
ambient: z11.string().optional(),
|
|
12061
13432
|
camera_motion: CameraMotion.optional(),
|
|
12062
|
-
start_frame_prompt:
|
|
12063
|
-
end_frame_prompt:
|
|
12064
|
-
motion_prompt:
|
|
13433
|
+
start_frame_prompt: z11.string().optional(),
|
|
13434
|
+
end_frame_prompt: z11.string().optional(),
|
|
13435
|
+
motion_prompt: z11.string().optional(),
|
|
12065
13436
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
12066
13437
|
// script re-craft checklist. Inferred from position when absent.
|
|
12067
|
-
narrative_role:
|
|
13438
|
+
narrative_role: z11.string().optional(),
|
|
12068
13439
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
12069
13440
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
12070
13441
|
// into the hook's start-frame description so the generator renders that state,
|
|
12071
13442
|
// not a calm influencer (CCA-11).
|
|
12072
|
-
hook_mechanic:
|
|
13443
|
+
hook_mechanic: z11.object({ mechanic: z11.string().optional(), why_it_stops_scroll: z11.string().optional() }).loose().optional(),
|
|
12073
13444
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
12074
|
-
scene_setting:
|
|
13445
|
+
scene_setting: z11.string().optional(),
|
|
12075
13446
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
12076
13447
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
12077
13448
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
12078
13449
|
// ignored (nothing follows it).
|
|
12079
|
-
transition_out:
|
|
12080
|
-
dialogue:
|
|
12081
|
-
sfx:
|
|
12082
|
-
overlays:
|
|
12083
|
-
floating_elements:
|
|
12084
|
-
transcript_slice:
|
|
13450
|
+
transition_out: z11.object({ type: z11.string().optional(), description: z11.string().optional() }).loose().optional(),
|
|
13451
|
+
dialogue: z11.array(DialogueLine).optional(),
|
|
13452
|
+
sfx: z11.array(Sfx).optional(),
|
|
13453
|
+
overlays: z11.array(z11.unknown()).optional(),
|
|
13454
|
+
floating_elements: z11.array(z11.unknown()).optional(),
|
|
13455
|
+
transcript_slice: z11.array(TranscriptWord).optional(),
|
|
12085
13456
|
start_frame_asset: FrameAsset,
|
|
12086
13457
|
end_frame_asset: FrameAsset,
|
|
12087
13458
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
12088
13459
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
12089
13460
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
12090
13461
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
12091
|
-
continues_previous:
|
|
13462
|
+
continues_previous: z11.boolean().optional()
|
|
12092
13463
|
}).loose();
|
|
12093
|
-
var VideoBlueprint =
|
|
12094
|
-
source:
|
|
12095
|
-
global:
|
|
12096
|
-
music:
|
|
12097
|
-
present:
|
|
12098
|
-
music_prompt:
|
|
13464
|
+
var VideoBlueprint = z11.object({
|
|
13465
|
+
source: z11.object({ aspect_ratio: z11.string().optional(), duration_s: z11.number().optional() }).loose().optional(),
|
|
13466
|
+
global: z11.object({
|
|
13467
|
+
music: z11.object({
|
|
13468
|
+
present: z11.boolean().optional(),
|
|
13469
|
+
music_prompt: z11.string().optional(),
|
|
12099
13470
|
// Absolute second the music enters in the reference (the bed often
|
|
12100
13471
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
12101
13472
|
// instead of at 0 so the timing matches.
|
|
12102
|
-
starts_at_s:
|
|
13473
|
+
starts_at_s: z11.number().optional(),
|
|
12103
13474
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
12104
13475
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
12105
|
-
identified_track:
|
|
13476
|
+
identified_track: z11.object({ title: z11.string().optional(), artist: z11.string().optional() }).loose().nullish()
|
|
12106
13477
|
}).loose().optional(),
|
|
12107
|
-
cast:
|
|
12108
|
-
|
|
12109
|
-
id:
|
|
12110
|
-
description:
|
|
13478
|
+
cast: z11.array(
|
|
13479
|
+
z11.object({
|
|
13480
|
+
id: z11.string().optional(),
|
|
13481
|
+
description: z11.string().optional(),
|
|
12111
13482
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
12112
13483
|
// French speaker") — read to derive the spoken-track language code.
|
|
12113
|
-
market_localization_note:
|
|
13484
|
+
market_localization_note: z11.string().optional()
|
|
12114
13485
|
}).loose()
|
|
12115
13486
|
).optional(),
|
|
12116
|
-
voiceover:
|
|
13487
|
+
voiceover: z11.object({
|
|
12117
13488
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
12118
13489
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
12119
|
-
mode:
|
|
12120
|
-
voice_description:
|
|
12121
|
-
persona:
|
|
13490
|
+
mode: z11.string().optional(),
|
|
13491
|
+
voice_description: z11.string().optional(),
|
|
13492
|
+
persona: z11.string().optional()
|
|
12122
13493
|
}).loose().optional(),
|
|
12123
13494
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
12124
13495
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
12125
|
-
style:
|
|
13496
|
+
style: z11.object({ palette: z11.array(z11.object({ hex: z11.string().optional() }).loose()).optional() }).loose().optional()
|
|
12126
13497
|
}).loose().optional(),
|
|
12127
|
-
scenes:
|
|
13498
|
+
scenes: z11.array(Scene).min(1)
|
|
12128
13499
|
}).loose();
|
|
12129
13500
|
function injectHookPhysicality(blueprint) {
|
|
12130
13501
|
for (const scene of blueprint.scenes) {
|
|
@@ -12134,26 +13505,26 @@ function injectHookPhysicality(blueprint) {
|
|
|
12134
13505
|
scene.start_frame_prompt = `${prompt} The subject's physical state IS the scroll-stopper \u2014 render it explicitly, not a calm pose: ${why}.`;
|
|
12135
13506
|
}
|
|
12136
13507
|
}
|
|
12137
|
-
var AppearsItem =
|
|
12138
|
-
var RecurringElement =
|
|
13508
|
+
var AppearsItem = z11.union([z11.number(), z11.object({ scene: z11.number(), edge: z11.string().optional() }).loose()]);
|
|
13509
|
+
var RecurringElement = z11.object({
|
|
12139
13510
|
// person | animal | product | logo | badge | other
|
|
12140
|
-
type:
|
|
12141
|
-
label:
|
|
12142
|
-
description:
|
|
12143
|
-
expression:
|
|
13511
|
+
type: z11.string(),
|
|
13512
|
+
label: z11.string().optional(),
|
|
13513
|
+
description: z11.string().optional(),
|
|
13514
|
+
expression: z11.string().nullable().optional(),
|
|
12144
13515
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
12145
|
-
cast_id:
|
|
13516
|
+
cast_id: z11.string().nullable().optional(),
|
|
12146
13517
|
// The label of another element that is the SAME individual as this one, shown
|
|
12147
13518
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
12148
13519
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
12149
13520
|
// slot, but the face/identity must stay identical across them.
|
|
12150
|
-
same_as:
|
|
13521
|
+
same_as: z11.string().nullable().optional(),
|
|
12151
13522
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
12152
13523
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
12153
|
-
scenes:
|
|
12154
|
-
appears_in:
|
|
13524
|
+
scenes: z11.array(z11.number()).optional(),
|
|
13525
|
+
appears_in: z11.array(AppearsItem).optional()
|
|
12155
13526
|
}).loose();
|
|
12156
|
-
var RecurringElements =
|
|
13527
|
+
var RecurringElements = z11.array(RecurringElement);
|
|
12157
13528
|
function sanitizeId2(raw, fallback) {
|
|
12158
13529
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
12159
13530
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -13616,25 +14987,25 @@ function buildSfxMusic(blueprint, nodes) {
|
|
|
13616
14987
|
}
|
|
13617
14988
|
return tracks;
|
|
13618
14989
|
}
|
|
13619
|
-
var OverlayStyle =
|
|
13620
|
-
var Overlay =
|
|
13621
|
-
text:
|
|
13622
|
-
appears_at_s:
|
|
13623
|
-
duration_s:
|
|
13624
|
-
position:
|
|
13625
|
-
role:
|
|
13626
|
-
animation:
|
|
13627
|
-
animation_detail:
|
|
14990
|
+
var OverlayStyle = z11.object({ color_hex: z11.string().optional(), background: z11.string().optional(), size: z11.string().optional() }).loose();
|
|
14991
|
+
var Overlay = z11.object({
|
|
14992
|
+
text: z11.string().optional(),
|
|
14993
|
+
appears_at_s: z11.number().optional(),
|
|
14994
|
+
duration_s: z11.number().optional(),
|
|
14995
|
+
position: z11.string().optional(),
|
|
14996
|
+
role: z11.string().optional(),
|
|
14997
|
+
animation: z11.string().optional(),
|
|
14998
|
+
animation_detail: z11.string().optional(),
|
|
13628
14999
|
style: OverlayStyle.optional()
|
|
13629
15000
|
}).loose();
|
|
13630
|
-
var FloatingElement =
|
|
13631
|
-
kind:
|
|
13632
|
-
description:
|
|
13633
|
-
brand_name:
|
|
13634
|
-
what_it_represents:
|
|
13635
|
-
appears_at_s:
|
|
13636
|
-
duration_s:
|
|
13637
|
-
position:
|
|
15001
|
+
var FloatingElement = z11.object({
|
|
15002
|
+
kind: z11.string().optional(),
|
|
15003
|
+
description: z11.string().optional(),
|
|
15004
|
+
brand_name: z11.string().nullish(),
|
|
15005
|
+
what_it_represents: z11.string().optional(),
|
|
15006
|
+
appears_at_s: z11.number().optional(),
|
|
15007
|
+
duration_s: z11.number().optional(),
|
|
15008
|
+
position: z11.string().optional()
|
|
13638
15009
|
}).loose();
|
|
13639
15010
|
function escapeHtml(s) {
|
|
13640
15011
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -13666,7 +15037,7 @@ function positionClass(position) {
|
|
|
13666
15037
|
function collectCaptions(blueprint) {
|
|
13667
15038
|
return blueprint.scenes.flatMap((scene) => {
|
|
13668
15039
|
const sceneStart = scene.start_s ?? 0;
|
|
13669
|
-
const overlays =
|
|
15040
|
+
const overlays = z11.array(Overlay).safeParse(scene.overlays ?? []);
|
|
13670
15041
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
13671
15042
|
const at = ov.appears_at_s ?? sceneStart;
|
|
13672
15043
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -13775,7 +15146,7 @@ function buildOverlayHtml(input) {
|
|
|
13775
15146
|
if (ovParts.length > 0) blocks.push(ovParts.join("\n"));
|
|
13776
15147
|
for (const scene of blueprint.scenes) {
|
|
13777
15148
|
const sceneStart = scene.start_s ?? 0;
|
|
13778
|
-
const floats =
|
|
15149
|
+
const floats = z11.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
13779
15150
|
const parts = (floats.success ? floats.data.map((fe) => floatingStub(fe, sceneStart)) : []).filter(Boolean);
|
|
13780
15151
|
const pip = uiPipStub(scene);
|
|
13781
15152
|
if (pip) parts.push(pip);
|
|
@@ -14032,8 +15403,8 @@ function buildMotionBoard(blueprint) {
|
|
|
14032
15403
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
14033
15404
|
cursor = end_s;
|
|
14034
15405
|
const spoken = sceneSpokenText(scene);
|
|
14035
|
-
const overlays =
|
|
14036
|
-
const floats =
|
|
15406
|
+
const overlays = z11.array(Overlay).safeParse(scene.overlays ?? []);
|
|
15407
|
+
const floats = z11.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
14037
15408
|
const graphics = [
|
|
14038
15409
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
14039
15410
|
kind: "text",
|
|
@@ -14474,7 +15845,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
|
|
|
14474
15845
|
return fail2("deconstruct", e instanceof Error ? e.message : String(e));
|
|
14475
15846
|
}
|
|
14476
15847
|
}
|
|
14477
|
-
var scaffoldVideoCommand =
|
|
15848
|
+
var scaffoldVideoCommand = defineCommand87({
|
|
14478
15849
|
meta: {
|
|
14479
15850
|
name: "scaffold-video",
|
|
14480
15851
|
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`."
|
|
@@ -14619,7 +15990,7 @@ var scaffoldVideoCommand = defineCommand85({
|
|
|
14619
15990
|
// src/commands/canvas/set-prompt.ts
|
|
14620
15991
|
import { readFile as readFile7, writeFile as writeFile3 } from "fs/promises";
|
|
14621
15992
|
import path9 from "path";
|
|
14622
|
-
import { defineCommand as
|
|
15993
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
14623
15994
|
function setNodePrompt(canvas, nodeId, text) {
|
|
14624
15995
|
const nodes = canvas?.nodes;
|
|
14625
15996
|
if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
|
|
@@ -14634,7 +16005,7 @@ function setNodePrompt(canvas, nodeId, text) {
|
|
|
14634
16005
|
newNodes[idx] = newNode;
|
|
14635
16006
|
return { ...canvas, nodes: newNodes };
|
|
14636
16007
|
}
|
|
14637
|
-
var setPromptCommand =
|
|
16008
|
+
var setPromptCommand = defineCommand88({
|
|
14638
16009
|
meta: {
|
|
14639
16010
|
name: "set-prompt",
|
|
14640
16011
|
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."
|
|
@@ -14694,8 +16065,8 @@ var setPromptCommand = defineCommand86({
|
|
|
14694
16065
|
// src/commands/canvas/validate.ts
|
|
14695
16066
|
import { readFile as readFile8 } from "fs/promises";
|
|
14696
16067
|
import path10 from "path";
|
|
14697
|
-
import { defineCommand as
|
|
14698
|
-
var validateCommand =
|
|
16068
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
16069
|
+
var validateCommand = defineCommand89({
|
|
14699
16070
|
meta: {
|
|
14700
16071
|
name: "validate",
|
|
14701
16072
|
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)."
|
|
@@ -14738,7 +16109,7 @@ var validateCommand = defineCommand87({
|
|
|
14738
16109
|
});
|
|
14739
16110
|
|
|
14740
16111
|
// src/commands/canvas/index.ts
|
|
14741
|
-
var canvasCommand =
|
|
16112
|
+
var canvasCommand = defineCommand90({
|
|
14742
16113
|
meta: {
|
|
14743
16114
|
name: "canvas",
|
|
14744
16115
|
description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
|
|
@@ -14765,10 +16136,10 @@ Subcommands:
|
|
|
14765
16136
|
});
|
|
14766
16137
|
|
|
14767
16138
|
// src/commands/creatives/index.ts
|
|
14768
|
-
import { defineCommand as
|
|
16139
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
14769
16140
|
|
|
14770
16141
|
// src/commands/creatives/publish.ts
|
|
14771
|
-
import { defineCommand as
|
|
16142
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
14772
16143
|
|
|
14773
16144
|
// src/commands/images/api.ts
|
|
14774
16145
|
import { readFile as readFile9 } from "fs/promises";
|
|
@@ -14891,7 +16262,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
|
|
|
14891
16262
|
sourceReferenceUrl
|
|
14892
16263
|
});
|
|
14893
16264
|
}
|
|
14894
|
-
var publishCommand =
|
|
16265
|
+
var publishCommand = defineCommand91({
|
|
14895
16266
|
meta: {
|
|
14896
16267
|
name: "publish",
|
|
14897
16268
|
description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
|
|
@@ -14937,7 +16308,7 @@ var publishCommand = defineCommand89({
|
|
|
14937
16308
|
});
|
|
14938
16309
|
|
|
14939
16310
|
// src/commands/creatives/index.ts
|
|
14940
|
-
var creativesCommand3 =
|
|
16311
|
+
var creativesCommand3 = defineCommand92({
|
|
14941
16312
|
meta: {
|
|
14942
16313
|
name: "creatives",
|
|
14943
16314
|
description: `Publish static ad creatives as first-class Baker outputs.
|
|
@@ -14953,10 +16324,10 @@ Publishing uploads the image to the Company image library, applies the official
|
|
|
14953
16324
|
});
|
|
14954
16325
|
|
|
14955
16326
|
// src/commands/ga4/index.ts
|
|
14956
|
-
import { defineCommand as
|
|
16327
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
14957
16328
|
|
|
14958
16329
|
// src/commands/ga4/audit.ts
|
|
14959
|
-
import { defineCommand as
|
|
16330
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
14960
16331
|
|
|
14961
16332
|
// src/commands/ga4/resolve.ts
|
|
14962
16333
|
async function fetchProperties(useCache = true) {
|
|
@@ -15019,7 +16390,7 @@ registerSchema({
|
|
|
15019
16390
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
15020
16391
|
}
|
|
15021
16392
|
});
|
|
15022
|
-
var auditCommand2 =
|
|
16393
|
+
var auditCommand2 = defineCommand93({
|
|
15023
16394
|
meta: {
|
|
15024
16395
|
name: "audit",
|
|
15025
16396
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -15071,7 +16442,7 @@ Examples:
|
|
|
15071
16442
|
});
|
|
15072
16443
|
|
|
15073
16444
|
// src/commands/ga4/properties.ts
|
|
15074
|
-
import { defineCommand as
|
|
16445
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
15075
16446
|
registerSchema({
|
|
15076
16447
|
command: "ga4.properties",
|
|
15077
16448
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -15079,7 +16450,7 @@ registerSchema({
|
|
|
15079
16450
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
15080
16451
|
}
|
|
15081
16452
|
});
|
|
15082
|
-
var propertiesCommand =
|
|
16453
|
+
var propertiesCommand = defineCommand94({
|
|
15083
16454
|
meta: {
|
|
15084
16455
|
name: "properties",
|
|
15085
16456
|
description: `List accessible GA4 properties.
|
|
@@ -15127,9 +16498,9 @@ Examples:
|
|
|
15127
16498
|
});
|
|
15128
16499
|
|
|
15129
16500
|
// src/commands/ga4/query.ts
|
|
15130
|
-
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as
|
|
16501
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
|
|
15131
16502
|
import { resolve as resolve2 } from "path";
|
|
15132
|
-
import { defineCommand as
|
|
16503
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
15133
16504
|
|
|
15134
16505
|
// src/commands/ga4/presets.ts
|
|
15135
16506
|
var GA4_PRESETS = [
|
|
@@ -15218,7 +16589,7 @@ function writeRowsToFile2(filePath, rows, append) {
|
|
|
15218
16589
|
writeFileSync4(filePath, content, "utf-8");
|
|
15219
16590
|
}
|
|
15220
16591
|
} else if (append && existsSync5(filePath)) {
|
|
15221
|
-
const existing = JSON.parse(
|
|
16592
|
+
const existing = JSON.parse(readFileSync9(filePath, "utf-8"));
|
|
15222
16593
|
writeFileSync4(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
|
|
15223
16594
|
} else {
|
|
15224
16595
|
writeFileSync4(filePath, JSON.stringify(rows, null, 2), "utf-8");
|
|
@@ -15261,7 +16632,7 @@ function handleError(err) {
|
|
|
15261
16632
|
});
|
|
15262
16633
|
process.exit(1);
|
|
15263
16634
|
}
|
|
15264
|
-
var queryCommand2 =
|
|
16635
|
+
var queryCommand2 = defineCommand95({
|
|
15265
16636
|
meta: {
|
|
15266
16637
|
name: "query",
|
|
15267
16638
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -15332,7 +16703,7 @@ Free-form (escape hatch):
|
|
|
15332
16703
|
});
|
|
15333
16704
|
|
|
15334
16705
|
// src/commands/ga4/index.ts
|
|
15335
|
-
var ga4Command =
|
|
16706
|
+
var ga4Command = defineCommand96({
|
|
15336
16707
|
meta: {
|
|
15337
16708
|
name: "ga4",
|
|
15338
16709
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -15355,12 +16726,12 @@ Examples:
|
|
|
15355
16726
|
});
|
|
15356
16727
|
|
|
15357
16728
|
// src/commands/gsc/index.ts
|
|
15358
|
-
import { defineCommand as
|
|
16729
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
15359
16730
|
|
|
15360
16731
|
// src/commands/gsc/query.ts
|
|
15361
|
-
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as
|
|
16732
|
+
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync10, writeFileSync as writeFileSync5 } from "fs";
|
|
15362
16733
|
import { resolve as resolve3 } from "path";
|
|
15363
|
-
import { defineCommand as
|
|
16734
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
15364
16735
|
|
|
15365
16736
|
// src/commands/gsc/presets.ts
|
|
15366
16737
|
var GSC_PRESETS = [
|
|
@@ -15503,7 +16874,7 @@ function writeRowsToFile3(filePath, rows, append) {
|
|
|
15503
16874
|
writeFileSync5(filePath, content, "utf-8");
|
|
15504
16875
|
}
|
|
15505
16876
|
} else if (append && existsSync6(filePath)) {
|
|
15506
|
-
const existing = JSON.parse(
|
|
16877
|
+
const existing = JSON.parse(readFileSync10(filePath, "utf-8"));
|
|
15507
16878
|
writeFileSync5(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
|
|
15508
16879
|
} else {
|
|
15509
16880
|
writeFileSync5(filePath, JSON.stringify(rows, null, 2), "utf-8");
|
|
@@ -15548,7 +16919,7 @@ function handleError2(err) {
|
|
|
15548
16919
|
});
|
|
15549
16920
|
process.exit(1);
|
|
15550
16921
|
}
|
|
15551
|
-
var queryCommand3 =
|
|
16922
|
+
var queryCommand3 = defineCommand97({
|
|
15552
16923
|
meta: {
|
|
15553
16924
|
name: "query",
|
|
15554
16925
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -15626,7 +16997,7 @@ Free-form (escape hatch):
|
|
|
15626
16997
|
});
|
|
15627
16998
|
|
|
15628
16999
|
// src/commands/gsc/sitemaps.ts
|
|
15629
|
-
import { defineCommand as
|
|
17000
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
15630
17001
|
registerSchema({
|
|
15631
17002
|
command: "gsc.sitemaps",
|
|
15632
17003
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -15635,7 +17006,7 @@ registerSchema({
|
|
|
15635
17006
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
15636
17007
|
}
|
|
15637
17008
|
});
|
|
15638
|
-
var sitemapsCommand =
|
|
17009
|
+
var sitemapsCommand = defineCommand98({
|
|
15639
17010
|
meta: {
|
|
15640
17011
|
name: "sitemaps",
|
|
15641
17012
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -15685,7 +17056,7 @@ Examples:
|
|
|
15685
17056
|
});
|
|
15686
17057
|
|
|
15687
17058
|
// src/commands/gsc/sites.ts
|
|
15688
|
-
import { defineCommand as
|
|
17059
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
15689
17060
|
registerSchema({
|
|
15690
17061
|
command: "gsc.sites",
|
|
15691
17062
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -15693,7 +17064,7 @@ registerSchema({
|
|
|
15693
17064
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
15694
17065
|
}
|
|
15695
17066
|
});
|
|
15696
|
-
var sitesCommand =
|
|
17067
|
+
var sitesCommand = defineCommand99({
|
|
15697
17068
|
meta: {
|
|
15698
17069
|
name: "sites",
|
|
15699
17070
|
description: `List verified Search Console sites.
|
|
@@ -15741,7 +17112,7 @@ Examples:
|
|
|
15741
17112
|
});
|
|
15742
17113
|
|
|
15743
17114
|
// src/commands/gsc/index.ts
|
|
15744
|
-
var gscCommand =
|
|
17115
|
+
var gscCommand = defineCommand100({
|
|
15745
17116
|
meta: {
|
|
15746
17117
|
name: "gsc",
|
|
15747
17118
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -15764,10 +17135,10 @@ Examples:
|
|
|
15764
17135
|
});
|
|
15765
17136
|
|
|
15766
17137
|
// src/commands/images/index.ts
|
|
15767
|
-
import { defineCommand as
|
|
17138
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
15768
17139
|
|
|
15769
17140
|
// src/commands/images/crop.ts
|
|
15770
|
-
import { defineCommand as
|
|
17141
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
15771
17142
|
|
|
15772
17143
|
// src/lib/image/crop-sprite.ts
|
|
15773
17144
|
import sharp from "sharp";
|
|
@@ -15892,7 +17263,7 @@ function emitError2(err) {
|
|
|
15892
17263
|
}
|
|
15893
17264
|
process.exit(1);
|
|
15894
17265
|
}
|
|
15895
|
-
var cropCommand =
|
|
17266
|
+
var cropCommand = defineCommand101({
|
|
15896
17267
|
meta: {
|
|
15897
17268
|
name: "crop",
|
|
15898
17269
|
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"
|
|
@@ -15928,7 +17299,7 @@ var cropCommand = defineCommand99({
|
|
|
15928
17299
|
});
|
|
15929
17300
|
|
|
15930
17301
|
// src/commands/images/delete.ts
|
|
15931
|
-
import { defineCommand as
|
|
17302
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
15932
17303
|
registerSchema({
|
|
15933
17304
|
command: "images.delete",
|
|
15934
17305
|
description: "Delete an image by ID",
|
|
@@ -15942,7 +17313,7 @@ registerSchema({
|
|
|
15942
17313
|
}
|
|
15943
17314
|
}
|
|
15944
17315
|
});
|
|
15945
|
-
var deleteCommand =
|
|
17316
|
+
var deleteCommand = defineCommand102({
|
|
15946
17317
|
meta: {
|
|
15947
17318
|
name: "delete",
|
|
15948
17319
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -15983,7 +17354,7 @@ var deleteCommand = defineCommand100({
|
|
|
15983
17354
|
});
|
|
15984
17355
|
|
|
15985
17356
|
// src/commands/images/dimensions.ts
|
|
15986
|
-
import { defineCommand as
|
|
17357
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
15987
17358
|
|
|
15988
17359
|
// src/lib/image/dimensions.ts
|
|
15989
17360
|
import { imageSize } from "image-size";
|
|
@@ -16006,7 +17377,7 @@ registerSchema({
|
|
|
16006
17377
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
16007
17378
|
}
|
|
16008
17379
|
});
|
|
16009
|
-
var dimensionsCommand =
|
|
17380
|
+
var dimensionsCommand = defineCommand103({
|
|
16010
17381
|
meta: {
|
|
16011
17382
|
name: "dimensions",
|
|
16012
17383
|
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"
|
|
@@ -16050,7 +17421,7 @@ var dimensionsCommand = defineCommand101({
|
|
|
16050
17421
|
});
|
|
16051
17422
|
|
|
16052
17423
|
// src/commands/images/extract.ts
|
|
16053
|
-
import { defineCommand as
|
|
17424
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
16054
17425
|
registerSchema({
|
|
16055
17426
|
command: "images.extract",
|
|
16056
17427
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -16066,7 +17437,7 @@ registerSchema({
|
|
|
16066
17437
|
}
|
|
16067
17438
|
}
|
|
16068
17439
|
});
|
|
16069
|
-
var extractCommand =
|
|
17440
|
+
var extractCommand = defineCommand104({
|
|
16070
17441
|
meta: {
|
|
16071
17442
|
name: "extract",
|
|
16072
17443
|
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"
|
|
@@ -16104,7 +17475,7 @@ var extractCommand = defineCommand102({
|
|
|
16104
17475
|
});
|
|
16105
17476
|
|
|
16106
17477
|
// src/commands/images/find.ts
|
|
16107
|
-
import { defineCommand as
|
|
17478
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
16108
17479
|
registerSchema({
|
|
16109
17480
|
command: "images.find",
|
|
16110
17481
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -16136,7 +17507,7 @@ registerSchema({
|
|
|
16136
17507
|
}
|
|
16137
17508
|
}
|
|
16138
17509
|
});
|
|
16139
|
-
var findCommand =
|
|
17510
|
+
var findCommand = defineCommand105({
|
|
16140
17511
|
meta: {
|
|
16141
17512
|
name: "find",
|
|
16142
17513
|
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"
|
|
@@ -16185,7 +17556,7 @@ var findCommand = defineCommand103({
|
|
|
16185
17556
|
|
|
16186
17557
|
// src/commands/images/generate.ts
|
|
16187
17558
|
import { readFile as readFile11 } from "fs/promises";
|
|
16188
|
-
import { defineCommand as
|
|
17559
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
16189
17560
|
import sharp2 from "sharp";
|
|
16190
17561
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
16191
17562
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -16288,7 +17659,7 @@ async function resolveReferences(spec) {
|
|
|
16288
17659
|
}
|
|
16289
17660
|
return out;
|
|
16290
17661
|
}
|
|
16291
|
-
var generateCommand =
|
|
17662
|
+
var generateCommand = defineCommand106({
|
|
16292
17663
|
meta: {
|
|
16293
17664
|
name: "generate",
|
|
16294
17665
|
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]]'"
|
|
@@ -16340,7 +17711,7 @@ var generateCommand = defineCommand104({
|
|
|
16340
17711
|
});
|
|
16341
17712
|
|
|
16342
17713
|
// src/commands/images/get.ts
|
|
16343
|
-
import { defineCommand as
|
|
17714
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
16344
17715
|
registerSchema({
|
|
16345
17716
|
command: "images.get",
|
|
16346
17717
|
description: "Get a single image by ID",
|
|
@@ -16348,7 +17719,7 @@ registerSchema({
|
|
|
16348
17719
|
id: { type: "string", description: "Image ID", required: true }
|
|
16349
17720
|
}
|
|
16350
17721
|
});
|
|
16351
|
-
var getCommand2 =
|
|
17722
|
+
var getCommand2 = defineCommand107({
|
|
16352
17723
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
16353
17724
|
args: {
|
|
16354
17725
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -16384,7 +17755,7 @@ var getCommand2 = defineCommand105({
|
|
|
16384
17755
|
});
|
|
16385
17756
|
|
|
16386
17757
|
// src/commands/images/gif.ts
|
|
16387
|
-
import { defineCommand as
|
|
17758
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
16388
17759
|
registerSchema({
|
|
16389
17760
|
command: "images.gif",
|
|
16390
17761
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -16416,7 +17787,7 @@ registerSchema({
|
|
|
16416
17787
|
}
|
|
16417
17788
|
}
|
|
16418
17789
|
});
|
|
16419
|
-
var gifCommand =
|
|
17790
|
+
var gifCommand = defineCommand108({
|
|
16420
17791
|
meta: {
|
|
16421
17792
|
name: "gif",
|
|
16422
17793
|
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"
|
|
@@ -16463,7 +17834,7 @@ var gifCommand = defineCommand106({
|
|
|
16463
17834
|
});
|
|
16464
17835
|
|
|
16465
17836
|
// src/commands/images/google.ts
|
|
16466
|
-
import { defineCommand as
|
|
17837
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
16467
17838
|
registerSchema({
|
|
16468
17839
|
command: "images.google",
|
|
16469
17840
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -16499,7 +17870,7 @@ registerSchema({
|
|
|
16499
17870
|
}
|
|
16500
17871
|
}
|
|
16501
17872
|
});
|
|
16502
|
-
var googleCommand2 =
|
|
17873
|
+
var googleCommand2 = defineCommand109({
|
|
16503
17874
|
meta: {
|
|
16504
17875
|
name: "google",
|
|
16505
17876
|
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"
|
|
@@ -16547,7 +17918,7 @@ var googleCommand2 = defineCommand107({
|
|
|
16547
17918
|
});
|
|
16548
17919
|
|
|
16549
17920
|
// src/commands/images/icon.ts
|
|
16550
|
-
import { defineCommand as
|
|
17921
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
16551
17922
|
registerSchema({
|
|
16552
17923
|
command: "images.icon",
|
|
16553
17924
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -16573,7 +17944,7 @@ registerSchema({
|
|
|
16573
17944
|
}
|
|
16574
17945
|
}
|
|
16575
17946
|
});
|
|
16576
|
-
var iconCommand =
|
|
17947
|
+
var iconCommand = defineCommand110({
|
|
16577
17948
|
meta: {
|
|
16578
17949
|
name: "icon",
|
|
16579
17950
|
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'"
|
|
@@ -16613,7 +17984,7 @@ var iconCommand = defineCommand108({
|
|
|
16613
17984
|
});
|
|
16614
17985
|
|
|
16615
17986
|
// src/commands/images/ingest.ts
|
|
16616
|
-
import { defineCommand as
|
|
17987
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
16617
17988
|
registerSchema({
|
|
16618
17989
|
command: "images.ingest",
|
|
16619
17990
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -16625,7 +17996,7 @@ registerSchema({
|
|
|
16625
17996
|
context: { type: "string", description: "Description context hint", required: false }
|
|
16626
17997
|
}
|
|
16627
17998
|
});
|
|
16628
|
-
var ingestCommand =
|
|
17999
|
+
var ingestCommand = defineCommand111({
|
|
16629
18000
|
meta: {
|
|
16630
18001
|
name: "ingest",
|
|
16631
18002
|
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"
|
|
@@ -16667,7 +18038,7 @@ var ingestCommand = defineCommand109({
|
|
|
16667
18038
|
});
|
|
16668
18039
|
|
|
16669
18040
|
// src/commands/images/library.ts
|
|
16670
|
-
import { defineCommand as
|
|
18041
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
16671
18042
|
registerSchema({
|
|
16672
18043
|
command: "images.library",
|
|
16673
18044
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -16693,7 +18064,7 @@ registerSchema({
|
|
|
16693
18064
|
}
|
|
16694
18065
|
}
|
|
16695
18066
|
});
|
|
16696
|
-
var libraryCommand =
|
|
18067
|
+
var libraryCommand = defineCommand112({
|
|
16697
18068
|
meta: {
|
|
16698
18069
|
name: "library",
|
|
16699
18070
|
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"
|
|
@@ -16750,7 +18121,7 @@ var libraryCommand = defineCommand110({
|
|
|
16750
18121
|
});
|
|
16751
18122
|
|
|
16752
18123
|
// src/commands/images/logo.ts
|
|
16753
|
-
import { defineCommand as
|
|
18124
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
16754
18125
|
registerSchema({
|
|
16755
18126
|
command: "images.logo",
|
|
16756
18127
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -16775,7 +18146,7 @@ registerSchema({
|
|
|
16775
18146
|
}
|
|
16776
18147
|
}
|
|
16777
18148
|
});
|
|
16778
|
-
var logoCommand =
|
|
18149
|
+
var logoCommand = defineCommand113({
|
|
16779
18150
|
meta: {
|
|
16780
18151
|
name: "logo",
|
|
16781
18152
|
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"
|
|
@@ -16813,7 +18184,7 @@ var logoCommand = defineCommand111({
|
|
|
16813
18184
|
});
|
|
16814
18185
|
|
|
16815
18186
|
// src/commands/images/normalize.ts
|
|
16816
|
-
import { defineCommand as
|
|
18187
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
16817
18188
|
|
|
16818
18189
|
// src/lib/image/color-changer.ts
|
|
16819
18190
|
import quantize from "quantize";
|
|
@@ -17545,7 +18916,7 @@ function coerceRawArgs(args) {
|
|
|
17545
18916
|
"dry-run": bool(args["dry-run"])
|
|
17546
18917
|
};
|
|
17547
18918
|
}
|
|
17548
|
-
var normalizeCommand =
|
|
18919
|
+
var normalizeCommand = defineCommand114({
|
|
17549
18920
|
meta: {
|
|
17550
18921
|
name: "normalize",
|
|
17551
18922
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -17600,7 +18971,7 @@ Examples:
|
|
|
17600
18971
|
});
|
|
17601
18972
|
|
|
17602
18973
|
// src/commands/images/pinterest.ts
|
|
17603
|
-
import { defineCommand as
|
|
18974
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
17604
18975
|
registerSchema({
|
|
17605
18976
|
command: "images.pinterest",
|
|
17606
18977
|
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.",
|
|
@@ -17620,7 +18991,7 @@ registerSchema({
|
|
|
17620
18991
|
}
|
|
17621
18992
|
}
|
|
17622
18993
|
});
|
|
17623
|
-
var pinterestCommand =
|
|
18994
|
+
var pinterestCommand = defineCommand115({
|
|
17624
18995
|
meta: {
|
|
17625
18996
|
name: "pinterest",
|
|
17626
18997
|
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'"
|
|
@@ -17660,7 +19031,7 @@ var pinterestCommand = defineCommand113({
|
|
|
17660
19031
|
});
|
|
17661
19032
|
|
|
17662
19033
|
// src/commands/images/screenshot.ts
|
|
17663
|
-
import { defineCommand as
|
|
19034
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
17664
19035
|
registerSchema({
|
|
17665
19036
|
command: "images.screenshot",
|
|
17666
19037
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -17676,7 +19047,7 @@ registerSchema({
|
|
|
17676
19047
|
}
|
|
17677
19048
|
}
|
|
17678
19049
|
});
|
|
17679
|
-
var screenshotCommand =
|
|
19050
|
+
var screenshotCommand = defineCommand116({
|
|
17680
19051
|
meta: {
|
|
17681
19052
|
name: "screenshot",
|
|
17682
19053
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -17726,7 +19097,7 @@ var screenshotCommand = defineCommand114({
|
|
|
17726
19097
|
});
|
|
17727
19098
|
|
|
17728
19099
|
// src/commands/images/search.ts
|
|
17729
|
-
import { defineCommand as
|
|
19100
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
17730
19101
|
registerSchema({
|
|
17731
19102
|
command: "images.search",
|
|
17732
19103
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -17742,7 +19113,7 @@ registerSchema({
|
|
|
17742
19113
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
17743
19114
|
}
|
|
17744
19115
|
});
|
|
17745
|
-
var searchCommand =
|
|
19116
|
+
var searchCommand = defineCommand117({
|
|
17746
19117
|
meta: {
|
|
17747
19118
|
name: "search",
|
|
17748
19119
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -17802,7 +19173,7 @@ var searchCommand = defineCommand115({
|
|
|
17802
19173
|
});
|
|
17803
19174
|
|
|
17804
19175
|
// src/commands/images/sticker.ts
|
|
17805
|
-
import { defineCommand as
|
|
19176
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
17806
19177
|
registerSchema({
|
|
17807
19178
|
command: "images.sticker",
|
|
17808
19179
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -17834,7 +19205,7 @@ registerSchema({
|
|
|
17834
19205
|
}
|
|
17835
19206
|
}
|
|
17836
19207
|
});
|
|
17837
|
-
var stickerCommand =
|
|
19208
|
+
var stickerCommand = defineCommand118({
|
|
17838
19209
|
meta: {
|
|
17839
19210
|
name: "sticker",
|
|
17840
19211
|
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"
|
|
@@ -17881,7 +19252,7 @@ var stickerCommand = defineCommand116({
|
|
|
17881
19252
|
});
|
|
17882
19253
|
|
|
17883
19254
|
// src/commands/images/stock.ts
|
|
17884
|
-
import { defineCommand as
|
|
19255
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
17885
19256
|
registerSchema({
|
|
17886
19257
|
command: "images.stock",
|
|
17887
19258
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -17939,7 +19310,7 @@ registerSchema({
|
|
|
17939
19310
|
}
|
|
17940
19311
|
}
|
|
17941
19312
|
});
|
|
17942
|
-
var stockCommand =
|
|
19313
|
+
var stockCommand = defineCommand119({
|
|
17943
19314
|
meta: {
|
|
17944
19315
|
name: "stock",
|
|
17945
19316
|
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"
|
|
@@ -17995,7 +19366,7 @@ var stockCommand = defineCommand117({
|
|
|
17995
19366
|
});
|
|
17996
19367
|
|
|
17997
19368
|
// src/lib/tags-command.ts
|
|
17998
|
-
import { defineCommand as
|
|
19369
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
17999
19370
|
function makeTagsCommand(command, label, endpoint) {
|
|
18000
19371
|
registerSchema({
|
|
18001
19372
|
command: `${command}.tags`,
|
|
@@ -18004,7 +19375,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
18004
19375
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
18005
19376
|
}
|
|
18006
19377
|
});
|
|
18007
|
-
return
|
|
19378
|
+
return defineCommand120({
|
|
18008
19379
|
meta: {
|
|
18009
19380
|
name: "tags",
|
|
18010
19381
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -18040,7 +19411,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
18040
19411
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
18041
19412
|
|
|
18042
19413
|
// src/commands/images/upload.ts
|
|
18043
|
-
import { defineCommand as
|
|
19414
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
18044
19415
|
registerSchema({
|
|
18045
19416
|
command: "images.upload",
|
|
18046
19417
|
description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
|
|
@@ -18078,7 +19449,7 @@ registerSchema({
|
|
|
18078
19449
|
function isRemoteUrl2(value) {
|
|
18079
19450
|
return /^https?:\/\//i.test(value);
|
|
18080
19451
|
}
|
|
18081
|
-
var uploadCommand =
|
|
19452
|
+
var uploadCommand = defineCommand121({
|
|
18082
19453
|
meta: {
|
|
18083
19454
|
name: "upload",
|
|
18084
19455
|
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'"
|
|
@@ -18171,7 +19542,7 @@ async function uploadLocal(target, args) {
|
|
|
18171
19542
|
}
|
|
18172
19543
|
|
|
18173
19544
|
// src/commands/images/upscale.ts
|
|
18174
|
-
import { defineCommand as
|
|
19545
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
18175
19546
|
registerSchema({
|
|
18176
19547
|
command: "images.upscale",
|
|
18177
19548
|
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).",
|
|
@@ -18186,7 +19557,7 @@ registerSchema({
|
|
|
18186
19557
|
}
|
|
18187
19558
|
});
|
|
18188
19559
|
var POLL_INTERVAL_MS3 = 1500;
|
|
18189
|
-
var upscaleCommand =
|
|
19560
|
+
var upscaleCommand = defineCommand122({
|
|
18190
19561
|
meta: {
|
|
18191
19562
|
name: "upscale",
|
|
18192
19563
|
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"
|
|
@@ -18241,7 +19612,7 @@ var upscaleCommand = defineCommand120({
|
|
|
18241
19612
|
});
|
|
18242
19613
|
|
|
18243
19614
|
// src/commands/images/use.ts
|
|
18244
|
-
import { defineCommand as
|
|
19615
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
18245
19616
|
registerSchema({
|
|
18246
19617
|
command: "images.use",
|
|
18247
19618
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -18257,7 +19628,7 @@ registerSchema({
|
|
|
18257
19628
|
}
|
|
18258
19629
|
});
|
|
18259
19630
|
var POLL_INTERVAL_MS4 = 1500;
|
|
18260
|
-
var useCommand =
|
|
19631
|
+
var useCommand = defineCommand123({
|
|
18261
19632
|
meta: {
|
|
18262
19633
|
name: "use",
|
|
18263
19634
|
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"
|
|
@@ -18303,7 +19674,7 @@ var useCommand = defineCommand121({
|
|
|
18303
19674
|
});
|
|
18304
19675
|
|
|
18305
19676
|
// src/commands/images/index.ts
|
|
18306
|
-
var imagesCommand =
|
|
19677
|
+
var imagesCommand = defineCommand124({
|
|
18307
19678
|
meta: {
|
|
18308
19679
|
name: "images",
|
|
18309
19680
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -18373,7 +19744,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
18373
19744
|
});
|
|
18374
19745
|
|
|
18375
19746
|
// src/commands/mcp/index.ts
|
|
18376
|
-
import { defineCommand as
|
|
19747
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
18377
19748
|
var SCOPES = ["user", "company", "org"];
|
|
18378
19749
|
function parseScope(raw) {
|
|
18379
19750
|
const scope = raw === void 0 ? "company" : String(raw);
|
|
@@ -18412,7 +19783,7 @@ registerSchema({
|
|
|
18412
19783
|
description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
|
|
18413
19784
|
args: {}
|
|
18414
19785
|
});
|
|
18415
|
-
var listCommand4 =
|
|
19786
|
+
var listCommand4 = defineCommand125({
|
|
18416
19787
|
meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
|
|
18417
19788
|
run: async () => {
|
|
18418
19789
|
try {
|
|
@@ -18437,7 +19808,7 @@ registerSchema({
|
|
|
18437
19808
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
18438
19809
|
}
|
|
18439
19810
|
});
|
|
18440
|
-
var addCommand =
|
|
19811
|
+
var addCommand = defineCommand125({
|
|
18441
19812
|
meta: {
|
|
18442
19813
|
name: "add",
|
|
18443
19814
|
description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
|
|
@@ -18478,7 +19849,7 @@ registerSchema({
|
|
|
18478
19849
|
description: "Remove a company custom MCP server by name.",
|
|
18479
19850
|
args: { name: { type: "string", description: "Server name to remove", required: true } }
|
|
18480
19851
|
});
|
|
18481
|
-
var removeCommand3 =
|
|
19852
|
+
var removeCommand3 = defineCommand125({
|
|
18482
19853
|
meta: {
|
|
18483
19854
|
name: "remove",
|
|
18484
19855
|
description: `Remove a company custom MCP server by name.
|
|
@@ -18500,7 +19871,7 @@ Example:
|
|
|
18500
19871
|
}
|
|
18501
19872
|
}
|
|
18502
19873
|
});
|
|
18503
|
-
var mcpCommand =
|
|
19874
|
+
var mcpCommand = defineCommand125({
|
|
18504
19875
|
meta: {
|
|
18505
19876
|
name: "mcp",
|
|
18506
19877
|
description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
|
|
@@ -18524,10 +19895,10 @@ Examples:
|
|
|
18524
19895
|
});
|
|
18525
19896
|
|
|
18526
19897
|
// src/commands/research/index.ts
|
|
18527
|
-
import { defineCommand as
|
|
19898
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
18528
19899
|
|
|
18529
19900
|
// src/commands/research/advertisers.ts
|
|
18530
|
-
import { defineCommand as
|
|
19901
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
18531
19902
|
|
|
18532
19903
|
// src/commands/research/output.ts
|
|
18533
19904
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -18640,7 +20011,7 @@ var FIELDS3 = {
|
|
|
18640
20011
|
etv: "Estimated traffic value (USD)",
|
|
18641
20012
|
visibility: "SERP visibility score (0-1)"
|
|
18642
20013
|
};
|
|
18643
|
-
var advertisersCommand =
|
|
20014
|
+
var advertisersCommand = defineCommand126({
|
|
18644
20015
|
meta: {
|
|
18645
20016
|
name: "advertisers",
|
|
18646
20017
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -18687,7 +20058,7 @@ Examples:
|
|
|
18687
20058
|
});
|
|
18688
20059
|
|
|
18689
20060
|
// src/commands/research/autocomplete.ts
|
|
18690
|
-
import { defineCommand as
|
|
20061
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
18691
20062
|
registerSchema({
|
|
18692
20063
|
command: "research.autocomplete",
|
|
18693
20064
|
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).",
|
|
@@ -18710,7 +20081,7 @@ registerSchema({
|
|
|
18710
20081
|
var FIELDS4 = {
|
|
18711
20082
|
suggestion: "Autocomplete suggestion from Google"
|
|
18712
20083
|
};
|
|
18713
|
-
var autocompleteCommand =
|
|
20084
|
+
var autocompleteCommand = defineCommand127({
|
|
18714
20085
|
meta: {
|
|
18715
20086
|
name: "autocomplete",
|
|
18716
20087
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -18756,7 +20127,7 @@ Examples:
|
|
|
18756
20127
|
});
|
|
18757
20128
|
|
|
18758
20129
|
// src/commands/research/countries.ts
|
|
18759
|
-
import { defineCommand as
|
|
20130
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
18760
20131
|
registerSchema({
|
|
18761
20132
|
command: "research.countries",
|
|
18762
20133
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -18813,7 +20184,7 @@ var FIELDS5 = {
|
|
|
18813
20184
|
code: "Country code to pass as --location",
|
|
18814
20185
|
name: "Country name"
|
|
18815
20186
|
};
|
|
18816
|
-
var countriesCommand =
|
|
20187
|
+
var countriesCommand = defineCommand128({
|
|
18817
20188
|
meta: {
|
|
18818
20189
|
name: "countries",
|
|
18819
20190
|
description: "List all supported country codes for --location flag."
|
|
@@ -18824,7 +20195,7 @@ var countriesCommand = defineCommand126({
|
|
|
18824
20195
|
});
|
|
18825
20196
|
|
|
18826
20197
|
// src/commands/research/intent.ts
|
|
18827
|
-
import { defineCommand as
|
|
20198
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
18828
20199
|
registerSchema({
|
|
18829
20200
|
command: "research.intent",
|
|
18830
20201
|
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.",
|
|
@@ -18847,7 +20218,7 @@ var FIELDS6 = {
|
|
|
18847
20218
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
18848
20219
|
probability: "Confidence score 0.0-1.0"
|
|
18849
20220
|
};
|
|
18850
|
-
var intentCommand =
|
|
20221
|
+
var intentCommand = defineCommand129({
|
|
18851
20222
|
meta: {
|
|
18852
20223
|
name: "intent",
|
|
18853
20224
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -18895,7 +20266,7 @@ Examples:
|
|
|
18895
20266
|
});
|
|
18896
20267
|
|
|
18897
20268
|
// src/commands/research/keyword-gap.ts
|
|
18898
|
-
import { defineCommand as
|
|
20269
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
18899
20270
|
registerSchema({
|
|
18900
20271
|
command: "research.keyword-gap",
|
|
18901
20272
|
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.",
|
|
@@ -18924,7 +20295,7 @@ var FIELDS7 = {
|
|
|
18924
20295
|
cpc: "Cost per click USD",
|
|
18925
20296
|
their_position: "Competitor's ranking position"
|
|
18926
20297
|
};
|
|
18927
|
-
var keywordGapCommand =
|
|
20298
|
+
var keywordGapCommand = defineCommand130({
|
|
18928
20299
|
meta: {
|
|
18929
20300
|
name: "keyword-gap",
|
|
18930
20301
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -18998,7 +20369,7 @@ Examples:
|
|
|
18998
20369
|
});
|
|
18999
20370
|
|
|
19000
20371
|
// src/commands/research/keywords-for-site.ts
|
|
19001
|
-
import { defineCommand as
|
|
20372
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
19002
20373
|
registerSchema({
|
|
19003
20374
|
command: "research.keywords-for-site",
|
|
19004
20375
|
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.",
|
|
@@ -19031,7 +20402,7 @@ var FIELDS8 = {
|
|
|
19031
20402
|
competition: "LOW, MEDIUM, or HIGH",
|
|
19032
20403
|
competition_index: "Competition score 0-100"
|
|
19033
20404
|
};
|
|
19034
|
-
var keywordsForSiteCommand =
|
|
20405
|
+
var keywordsForSiteCommand = defineCommand131({
|
|
19035
20406
|
meta: {
|
|
19036
20407
|
name: "keywords-for-site",
|
|
19037
20408
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -19084,7 +20455,7 @@ Examples:
|
|
|
19084
20455
|
});
|
|
19085
20456
|
|
|
19086
20457
|
// src/commands/research/languages.ts
|
|
19087
|
-
import { defineCommand as
|
|
20458
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
19088
20459
|
registerSchema({
|
|
19089
20460
|
command: "research.languages",
|
|
19090
20461
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -19114,7 +20485,7 @@ var FIELDS9 = {
|
|
|
19114
20485
|
code: "Language code to pass as --language",
|
|
19115
20486
|
name: "Language name (also accepted by --language)"
|
|
19116
20487
|
};
|
|
19117
|
-
var languagesCommand2 =
|
|
20488
|
+
var languagesCommand2 = defineCommand132({
|
|
19118
20489
|
meta: {
|
|
19119
20490
|
name: "languages",
|
|
19120
20491
|
description: "List all supported language codes for --language flag."
|
|
@@ -19125,7 +20496,7 @@ var languagesCommand2 = defineCommand130({
|
|
|
19125
20496
|
});
|
|
19126
20497
|
|
|
19127
20498
|
// src/commands/research/lighthouse.ts
|
|
19128
|
-
import { defineCommand as
|
|
20499
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
19129
20500
|
registerSchema({
|
|
19130
20501
|
command: "research.lighthouse",
|
|
19131
20502
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -19144,7 +20515,7 @@ var FIELDS10 = {
|
|
|
19144
20515
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
19145
20516
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
19146
20517
|
};
|
|
19147
|
-
var lighthouseCommand =
|
|
20518
|
+
var lighthouseCommand = defineCommand133({
|
|
19148
20519
|
meta: {
|
|
19149
20520
|
name: "lighthouse",
|
|
19150
20521
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -19182,7 +20553,7 @@ Examples:
|
|
|
19182
20553
|
});
|
|
19183
20554
|
|
|
19184
20555
|
// src/commands/research/relevant-pages.ts
|
|
19185
|
-
import { defineCommand as
|
|
20556
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
19186
20557
|
registerSchema({
|
|
19187
20558
|
command: "research.relevant-pages",
|
|
19188
20559
|
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).",
|
|
@@ -19208,7 +20579,7 @@ var FIELDS11 = {
|
|
|
19208
20579
|
keywords: "Total organic keywords the page ranks for",
|
|
19209
20580
|
top_10: "Keywords in positions 1-10"
|
|
19210
20581
|
};
|
|
19211
|
-
var relevantPagesCommand =
|
|
20582
|
+
var relevantPagesCommand = defineCommand134({
|
|
19212
20583
|
meta: {
|
|
19213
20584
|
name: "relevant-pages",
|
|
19214
20585
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -19254,7 +20625,7 @@ Examples:
|
|
|
19254
20625
|
});
|
|
19255
20626
|
|
|
19256
20627
|
// src/commands/research/web.ts
|
|
19257
|
-
import { defineCommand as
|
|
20628
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
19258
20629
|
registerSchema({
|
|
19259
20630
|
command: "research.web",
|
|
19260
20631
|
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).",
|
|
@@ -19305,7 +20676,7 @@ async function runDeepResearch(question) {
|
|
|
19305
20676
|
}
|
|
19306
20677
|
throw new Error("Deep research timed out");
|
|
19307
20678
|
}
|
|
19308
|
-
var webCommand =
|
|
20679
|
+
var webCommand = defineCommand135({
|
|
19309
20680
|
meta: {
|
|
19310
20681
|
name: "web",
|
|
19311
20682
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -19365,7 +20736,7 @@ Examples:
|
|
|
19365
20736
|
});
|
|
19366
20737
|
|
|
19367
20738
|
// src/commands/research/index.ts
|
|
19368
|
-
var researchCommand =
|
|
20739
|
+
var researchCommand = defineCommand136({
|
|
19369
20740
|
meta: {
|
|
19370
20741
|
name: "research",
|
|
19371
20742
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -19405,10 +20776,10 @@ Examples:
|
|
|
19405
20776
|
});
|
|
19406
20777
|
|
|
19407
20778
|
// src/commands/scheduled-actions/index.ts
|
|
19408
|
-
import { defineCommand as
|
|
20779
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
19409
20780
|
|
|
19410
20781
|
// src/commands/scheduled-actions/create.ts
|
|
19411
|
-
import { defineCommand as
|
|
20782
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
19412
20783
|
|
|
19413
20784
|
// src/commands/scheduled-actions/shared.ts
|
|
19414
20785
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -19523,7 +20894,7 @@ registerSchema({
|
|
|
19523
20894
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
19524
20895
|
}
|
|
19525
20896
|
});
|
|
19526
|
-
var createCommand2 =
|
|
20897
|
+
var createCommand2 = defineCommand137({
|
|
19527
20898
|
meta: {
|
|
19528
20899
|
name: "create",
|
|
19529
20900
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -19572,7 +20943,7 @@ var createCommand2 = defineCommand135({
|
|
|
19572
20943
|
});
|
|
19573
20944
|
|
|
19574
20945
|
// src/commands/scheduled-actions/delete.ts
|
|
19575
|
-
import { defineCommand as
|
|
20946
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
19576
20947
|
registerSchema({
|
|
19577
20948
|
command: "scheduled-actions.delete",
|
|
19578
20949
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -19580,7 +20951,7 @@ registerSchema({
|
|
|
19580
20951
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
19581
20952
|
}
|
|
19582
20953
|
});
|
|
19583
|
-
var deleteCommand2 =
|
|
20954
|
+
var deleteCommand2 = defineCommand138({
|
|
19584
20955
|
meta: {
|
|
19585
20956
|
name: "delete",
|
|
19586
20957
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -19609,7 +20980,7 @@ var deleteCommand2 = defineCommand136({
|
|
|
19609
20980
|
});
|
|
19610
20981
|
|
|
19611
20982
|
// src/commands/scheduled-actions/get.ts
|
|
19612
|
-
import { defineCommand as
|
|
20983
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
19613
20984
|
registerSchema({
|
|
19614
20985
|
command: "scheduled-actions.get",
|
|
19615
20986
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -19617,7 +20988,7 @@ registerSchema({
|
|
|
19617
20988
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
19618
20989
|
}
|
|
19619
20990
|
});
|
|
19620
|
-
var getCommand3 =
|
|
20991
|
+
var getCommand3 = defineCommand139({
|
|
19621
20992
|
meta: {
|
|
19622
20993
|
name: "get",
|
|
19623
20994
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -19654,13 +21025,13 @@ var getCommand3 = defineCommand137({
|
|
|
19654
21025
|
});
|
|
19655
21026
|
|
|
19656
21027
|
// src/commands/scheduled-actions/list.ts
|
|
19657
|
-
import { defineCommand as
|
|
21028
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
19658
21029
|
registerSchema({
|
|
19659
21030
|
command: "scheduled-actions.list",
|
|
19660
21031
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
19661
21032
|
args: {}
|
|
19662
21033
|
});
|
|
19663
|
-
var listCommand5 =
|
|
21034
|
+
var listCommand5 = defineCommand140({
|
|
19664
21035
|
meta: {
|
|
19665
21036
|
name: "list",
|
|
19666
21037
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -19681,7 +21052,7 @@ var listCommand5 = defineCommand138({
|
|
|
19681
21052
|
});
|
|
19682
21053
|
|
|
19683
21054
|
// src/commands/scheduled-actions/trigger.ts
|
|
19684
|
-
import { defineCommand as
|
|
21055
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
19685
21056
|
registerSchema({
|
|
19686
21057
|
command: "scheduled-actions.trigger",
|
|
19687
21058
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -19689,7 +21060,7 @@ registerSchema({
|
|
|
19689
21060
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
19690
21061
|
}
|
|
19691
21062
|
});
|
|
19692
|
-
var triggerCommand =
|
|
21063
|
+
var triggerCommand = defineCommand141({
|
|
19693
21064
|
meta: {
|
|
19694
21065
|
name: "trigger",
|
|
19695
21066
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -19726,7 +21097,7 @@ var triggerCommand = defineCommand139({
|
|
|
19726
21097
|
});
|
|
19727
21098
|
|
|
19728
21099
|
// src/commands/scheduled-actions/update.ts
|
|
19729
|
-
import { defineCommand as
|
|
21100
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
19730
21101
|
registerSchema({
|
|
19731
21102
|
command: "scheduled-actions.update",
|
|
19732
21103
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -19751,7 +21122,7 @@ registerSchema({
|
|
|
19751
21122
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
19752
21123
|
}
|
|
19753
21124
|
});
|
|
19754
|
-
var updateCommand2 =
|
|
21125
|
+
var updateCommand2 = defineCommand142({
|
|
19755
21126
|
meta: {
|
|
19756
21127
|
name: "update",
|
|
19757
21128
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -19822,7 +21193,7 @@ var updateCommand2 = defineCommand140({
|
|
|
19822
21193
|
});
|
|
19823
21194
|
|
|
19824
21195
|
// src/commands/scheduled-actions/index.ts
|
|
19825
|
-
var scheduledActionsCommand =
|
|
21196
|
+
var scheduledActionsCommand = defineCommand143({
|
|
19826
21197
|
meta: {
|
|
19827
21198
|
name: "scheduled-actions",
|
|
19828
21199
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -19848,8 +21219,8 @@ Examples:
|
|
|
19848
21219
|
});
|
|
19849
21220
|
|
|
19850
21221
|
// src/commands/schema.ts
|
|
19851
|
-
import { defineCommand as
|
|
19852
|
-
var schemaCommand =
|
|
21222
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
21223
|
+
var schemaCommand = defineCommand144({
|
|
19853
21224
|
meta: {
|
|
19854
21225
|
name: "schema",
|
|
19855
21226
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -19885,10 +21256,10 @@ var schemaCommand = defineCommand142({
|
|
|
19885
21256
|
});
|
|
19886
21257
|
|
|
19887
21258
|
// src/commands/testimonials/index.ts
|
|
19888
|
-
import { defineCommand as
|
|
21259
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
19889
21260
|
|
|
19890
21261
|
// src/commands/testimonials/get.ts
|
|
19891
|
-
import { defineCommand as
|
|
21262
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
19892
21263
|
registerSchema({
|
|
19893
21264
|
command: "testimonials.get",
|
|
19894
21265
|
description: "Get a single testimonial by ID",
|
|
@@ -19896,7 +21267,7 @@ registerSchema({
|
|
|
19896
21267
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
19897
21268
|
}
|
|
19898
21269
|
});
|
|
19899
|
-
var getCommand4 =
|
|
21270
|
+
var getCommand4 = defineCommand145({
|
|
19900
21271
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
19901
21272
|
args: {
|
|
19902
21273
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -19933,7 +21304,7 @@ var getCommand4 = defineCommand143({
|
|
|
19933
21304
|
});
|
|
19934
21305
|
|
|
19935
21306
|
// src/commands/testimonials/list.ts
|
|
19936
|
-
import { defineCommand as
|
|
21307
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
19937
21308
|
registerSchema({
|
|
19938
21309
|
command: "testimonials.list",
|
|
19939
21310
|
description: "List testimonials with optional filters.",
|
|
@@ -19963,7 +21334,7 @@ registerSchema({
|
|
|
19963
21334
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
19964
21335
|
}
|
|
19965
21336
|
});
|
|
19966
|
-
var listCommand6 =
|
|
21337
|
+
var listCommand6 = defineCommand146({
|
|
19967
21338
|
meta: {
|
|
19968
21339
|
name: "list",
|
|
19969
21340
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -20012,7 +21383,7 @@ var listCommand6 = defineCommand144({
|
|
|
20012
21383
|
});
|
|
20013
21384
|
|
|
20014
21385
|
// src/commands/testimonials/search.ts
|
|
20015
|
-
import { defineCommand as
|
|
21386
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
20016
21387
|
registerSchema({
|
|
20017
21388
|
command: "testimonials.search",
|
|
20018
21389
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -20043,7 +21414,7 @@ registerSchema({
|
|
|
20043
21414
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
20044
21415
|
}
|
|
20045
21416
|
});
|
|
20046
|
-
var searchCommand2 =
|
|
21417
|
+
var searchCommand2 = defineCommand147({
|
|
20047
21418
|
meta: {
|
|
20048
21419
|
name: "search",
|
|
20049
21420
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -20117,7 +21488,7 @@ var searchCommand2 = defineCommand145({
|
|
|
20117
21488
|
var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
20118
21489
|
|
|
20119
21490
|
// src/commands/testimonials/index.ts
|
|
20120
|
-
var testimonialsCommand =
|
|
21491
|
+
var testimonialsCommand = defineCommand148({
|
|
20121
21492
|
meta: {
|
|
20122
21493
|
name: "testimonials",
|
|
20123
21494
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -20138,10 +21509,10 @@ Examples:
|
|
|
20138
21509
|
});
|
|
20139
21510
|
|
|
20140
21511
|
// src/commands/videos/index.ts
|
|
20141
|
-
import { defineCommand as
|
|
21512
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
20142
21513
|
|
|
20143
21514
|
// src/commands/videos/delete.ts
|
|
20144
|
-
import { defineCommand as
|
|
21515
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
20145
21516
|
registerSchema({
|
|
20146
21517
|
command: "videos.delete",
|
|
20147
21518
|
description: "Delete a video by ID",
|
|
@@ -20155,7 +21526,7 @@ registerSchema({
|
|
|
20155
21526
|
}
|
|
20156
21527
|
}
|
|
20157
21528
|
});
|
|
20158
|
-
var deleteCommand3 =
|
|
21529
|
+
var deleteCommand3 = defineCommand149({
|
|
20159
21530
|
meta: {
|
|
20160
21531
|
name: "delete",
|
|
20161
21532
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -20196,7 +21567,7 @@ var deleteCommand3 = defineCommand147({
|
|
|
20196
21567
|
});
|
|
20197
21568
|
|
|
20198
21569
|
// src/commands/videos/get.ts
|
|
20199
|
-
import { defineCommand as
|
|
21570
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
20200
21571
|
registerSchema({
|
|
20201
21572
|
command: "videos.get",
|
|
20202
21573
|
description: "Get a single video by ID",
|
|
@@ -20204,7 +21575,7 @@ registerSchema({
|
|
|
20204
21575
|
id: { type: "string", description: "Video ID", required: true }
|
|
20205
21576
|
}
|
|
20206
21577
|
});
|
|
20207
|
-
var getCommand5 =
|
|
21578
|
+
var getCommand5 = defineCommand150({
|
|
20208
21579
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
20209
21580
|
args: {
|
|
20210
21581
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -20241,7 +21612,7 @@ var getCommand5 = defineCommand148({
|
|
|
20241
21612
|
});
|
|
20242
21613
|
|
|
20243
21614
|
// src/commands/videos/search.ts
|
|
20244
|
-
import { defineCommand as
|
|
21615
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
20245
21616
|
registerSchema({
|
|
20246
21617
|
command: "videos.search",
|
|
20247
21618
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -20251,7 +21622,7 @@ registerSchema({
|
|
|
20251
21622
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
20252
21623
|
}
|
|
20253
21624
|
});
|
|
20254
|
-
var searchCommand3 =
|
|
21625
|
+
var searchCommand3 = defineCommand151({
|
|
20255
21626
|
meta: {
|
|
20256
21627
|
name: "search",
|
|
20257
21628
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -20303,7 +21674,7 @@ var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
20303
21674
|
// src/commands/videos/upload.ts
|
|
20304
21675
|
import { readFile as readFile12, stat as stat3 } from "fs/promises";
|
|
20305
21676
|
import { extname as extname3 } from "path";
|
|
20306
|
-
import { defineCommand as
|
|
21677
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
20307
21678
|
var MIME_MAP = {
|
|
20308
21679
|
".mp4": "video/mp4",
|
|
20309
21680
|
".mov": "video/quicktime",
|
|
@@ -20337,7 +21708,7 @@ function detectContentType(filePath) {
|
|
|
20337
21708
|
}
|
|
20338
21709
|
return mime;
|
|
20339
21710
|
}
|
|
20340
|
-
var uploadCommand2 =
|
|
21711
|
+
var uploadCommand2 = defineCommand152({
|
|
20341
21712
|
meta: {
|
|
20342
21713
|
name: "upload",
|
|
20343
21714
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -20391,7 +21762,7 @@ var uploadCommand2 = defineCommand150({
|
|
|
20391
21762
|
});
|
|
20392
21763
|
|
|
20393
21764
|
// src/commands/videos/index.ts
|
|
20394
|
-
var videosCommand =
|
|
21765
|
+
var videosCommand = defineCommand153({
|
|
20395
21766
|
meta: {
|
|
20396
21767
|
name: "videos",
|
|
20397
21768
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -20414,10 +21785,10 @@ Examples:
|
|
|
20414
21785
|
});
|
|
20415
21786
|
|
|
20416
21787
|
// src/commands/winning-ads/index.ts
|
|
20417
|
-
import { defineCommand as
|
|
21788
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
20418
21789
|
|
|
20419
21790
|
// src/commands/winning-ads/advertisers.ts
|
|
20420
|
-
import { defineCommand as
|
|
21791
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
20421
21792
|
registerSchema({
|
|
20422
21793
|
command: "winning-ads.advertisers",
|
|
20423
21794
|
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).",
|
|
@@ -20430,7 +21801,7 @@ registerSchema({
|
|
|
20430
21801
|
function identity(record) {
|
|
20431
21802
|
return record;
|
|
20432
21803
|
}
|
|
20433
|
-
var advertisersCommand2 =
|
|
21804
|
+
var advertisersCommand2 = defineCommand154({
|
|
20434
21805
|
meta: {
|
|
20435
21806
|
name: "advertisers",
|
|
20436
21807
|
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'
|
|
@@ -20481,7 +21852,7 @@ var advertisersCommand2 = defineCommand152({
|
|
|
20481
21852
|
});
|
|
20482
21853
|
|
|
20483
21854
|
// src/commands/winning-ads/search.ts
|
|
20484
|
-
import { defineCommand as
|
|
21855
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
20485
21856
|
registerSchema({
|
|
20486
21857
|
command: "winning-ads.search",
|
|
20487
21858
|
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.",
|
|
@@ -20589,7 +21960,7 @@ function buildSearchBody(args) {
|
|
|
20589
21960
|
}
|
|
20590
21961
|
return body;
|
|
20591
21962
|
}
|
|
20592
|
-
var searchCommand4 =
|
|
21963
|
+
var searchCommand4 = defineCommand155({
|
|
20593
21964
|
meta: {
|
|
20594
21965
|
name: "search",
|
|
20595
21966
|
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"
|
|
@@ -20701,7 +22072,7 @@ var searchCommand4 = defineCommand153({
|
|
|
20701
22072
|
});
|
|
20702
22073
|
|
|
20703
22074
|
// src/commands/winning-ads/index.ts
|
|
20704
|
-
var winningAdsCommand =
|
|
22075
|
+
var winningAdsCommand = defineCommand156({
|
|
20705
22076
|
meta: {
|
|
20706
22077
|
name: "winning-ads",
|
|
20707
22078
|
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.
|
|
@@ -20725,7 +22096,7 @@ Examples:
|
|
|
20725
22096
|
});
|
|
20726
22097
|
|
|
20727
22098
|
// src/version.ts
|
|
20728
|
-
import { readFileSync as
|
|
22099
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
20729
22100
|
function packageJsonUrl() {
|
|
20730
22101
|
return new URL("../package.json", import.meta.url);
|
|
20731
22102
|
}
|
|
@@ -20737,11 +22108,11 @@ function parsePackageVersion(raw) {
|
|
|
20737
22108
|
throw new Error("Invalid CLI package.json: missing version");
|
|
20738
22109
|
}
|
|
20739
22110
|
function getCliVersion() {
|
|
20740
|
-
return parsePackageVersion(
|
|
22111
|
+
return parsePackageVersion(readFileSync11(packageJsonUrl(), "utf8"));
|
|
20741
22112
|
}
|
|
20742
22113
|
|
|
20743
22114
|
// src/cli.ts
|
|
20744
|
-
var main =
|
|
22115
|
+
var main = defineCommand157({
|
|
20745
22116
|
meta: {
|
|
20746
22117
|
name: "baker",
|
|
20747
22118
|
version: getCliVersion(),
|
|
@@ -20756,7 +22127,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
20756
22127
|
subCommands: {
|
|
20757
22128
|
actions: actionsCommand,
|
|
20758
22129
|
"scheduled-actions": scheduledActionsCommand,
|
|
20759
|
-
ads:
|
|
22130
|
+
ads: adsCommand2,
|
|
20760
22131
|
ga4: ga4Command,
|
|
20761
22132
|
gsc: gscCommand,
|
|
20762
22133
|
research: researchCommand,
|