@koda-sl/baker-cli 0.111.0-dev.d06db2796 → 0.111.0

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