@koda-sl/baker-cli 0.135.0 → 0.135.1-dev.6a3e6978d

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
@@ -34,7 +34,7 @@ import {
34
34
  toModelSafeImage,
35
35
  ulid,
36
36
  validateCanvasDeep
37
- } from "./chunk-CIF62V7L.js";
37
+ } from "./chunk-GKL4CUCC.js";
38
38
  import {
39
39
  csvOrJson,
40
40
  daysAgoIso,
@@ -73,7 +73,7 @@ import {
73
73
  } from "./chunk-RK67WL4O.js";
74
74
 
75
75
  // src/cli.ts
76
- import { defineCommand as defineCommand172, runMain } from "citty";
76
+ import { defineCommand as defineCommand173, runMain } from "citty";
77
77
 
78
78
  // src/commands/actions/index.ts
79
79
  import { defineCommand as defineCommand18 } from "citty";
@@ -2053,9 +2053,55 @@ var flowsShowResponseSchema = z5.object({
2053
2053
  tree: z5.unknown().optional()
2054
2054
  });
2055
2055
 
2056
- // ../api/src/images.ts
2056
+ // ../api/src/history.ts
2057
2057
  import { z as z6 } from "zod";
2058
- var imageSourceSchema = z6.enum([
2058
+ var historyCategorySchema = z6.enum([
2059
+ "publish",
2060
+ "chat",
2061
+ "action",
2062
+ "team",
2063
+ "setup_link",
2064
+ "company",
2065
+ "tag",
2066
+ "schedule",
2067
+ "ads",
2068
+ "advertiser",
2069
+ "media",
2070
+ "creative",
2071
+ "report",
2072
+ "domain",
2073
+ "integration"
2074
+ ]);
2075
+ var historyListRequestSchema = z6.object({
2076
+ limit: z6.number().int().min(1).max(200).optional(),
2077
+ category: historyCategorySchema.optional(),
2078
+ /** Only entries from the last N days. */
2079
+ days: z6.number().int().min(1).max(365).optional(),
2080
+ /** Include raw metadata on each entry (compact by default). */
2081
+ full: z6.boolean().optional()
2082
+ });
2083
+ var historyEntrySchema = z6.object({
2084
+ id: z6.string(),
2085
+ /** Epoch ms. */
2086
+ at: z6.number(),
2087
+ category: historyCategorySchema,
2088
+ /** Dotted action id, e.g. "publish.commit", "member.invite_create". */
2089
+ action: z6.string(),
2090
+ actorType: z6.enum(["user", "agent", "system"]),
2091
+ /** Display name of the acting user, when the actor is a user. */
2092
+ actor: z6.string().nullable(),
2093
+ /** What the change touched — commit subject, chat title, member email, tag type, … */
2094
+ target: z6.string().nullable(),
2095
+ metadata: z6.record(z6.string(), z6.unknown()).optional()
2096
+ });
2097
+ var historyListResponseSchema = z6.object({
2098
+ ok: z6.literal(true),
2099
+ data: z6.object({ entries: z6.array(historyEntrySchema) })
2100
+ });
2101
+
2102
+ // ../api/src/images.ts
2103
+ import { z as z7 } from "zod";
2104
+ var imageSourceSchema = z7.enum([
2059
2105
  "uploaded",
2060
2106
  "website",
2061
2107
  "google_testimonial",
@@ -2071,49 +2117,49 @@ var imageSourceSchema = z6.enum([
2071
2117
  "pinterest",
2072
2118
  "ai_generated"
2073
2119
  ]);
2074
- var imageStatusSchema = z6.enum(["uploading", "processing", "ready", "error"]);
2075
- var upscaleConfigSchema = z6.object({
2076
- model: z6.literal("philz1337x/crystal-upscaler"),
2077
- input: z6.object({
2078
- scale_factor: z6.number(),
2079
- creativity: z6.number(),
2080
- output_format: z6.string()
2120
+ var imageStatusSchema = z7.enum(["uploading", "processing", "ready", "error"]);
2121
+ var upscaleConfigSchema = z7.object({
2122
+ model: z7.literal("philz1337x/crystal-upscaler"),
2123
+ input: z7.object({
2124
+ scale_factor: z7.number(),
2125
+ creativity: z7.number(),
2126
+ output_format: z7.string()
2081
2127
  }),
2082
- status: z6.enum(["pending", "completed"])
2128
+ status: z7.enum(["pending", "completed"])
2083
2129
  });
2084
- var imageDocSchema = z6.object({
2085
- _id: z6.string(),
2086
- _creationTime: z6.number(),
2087
- companyId: z6.string(),
2088
- storageKey: z6.string(),
2130
+ var imageDocSchema = z7.object({
2131
+ _id: z7.string(),
2132
+ _creationTime: z7.number(),
2133
+ companyId: z7.string(),
2134
+ storageKey: z7.string(),
2089
2135
  upscaleConfig: upscaleConfigSchema.optional(),
2090
- upscaledStorageKey: z6.string().optional(),
2091
- name: z6.string(),
2092
- description: z6.string(),
2093
- tags: z6.array(z6.string()),
2094
- source: z6.string(),
2095
- externalId: z6.string().optional(),
2096
- externalUrl: z6.string().optional(),
2097
- contentHash: z6.string().optional(),
2098
- sourceId: z6.string().optional(),
2099
- descriptionContext: z6.string().optional(),
2100
- width: z6.number().optional(),
2101
- height: z6.number().optional(),
2102
- aspectRatio: z6.number().optional(),
2103
- dominantColor: z6.string().optional(),
2104
- imagePalette: z6.array(z6.string()).optional(),
2105
- thumbhashDataUri: z6.string().optional(),
2106
- isLightImage: z6.boolean().optional(),
2107
- descriptionEmbedding: z6.array(z6.number()).optional(),
2108
- imageEmbedding: z6.array(z6.number()).optional(),
2109
- searchText: z6.string().optional(),
2136
+ upscaledStorageKey: z7.string().optional(),
2137
+ name: z7.string(),
2138
+ description: z7.string(),
2139
+ tags: z7.array(z7.string()),
2140
+ source: z7.string(),
2141
+ externalId: z7.string().optional(),
2142
+ externalUrl: z7.string().optional(),
2143
+ contentHash: z7.string().optional(),
2144
+ sourceId: z7.string().optional(),
2145
+ descriptionContext: z7.string().optional(),
2146
+ width: z7.number().optional(),
2147
+ height: z7.number().optional(),
2148
+ aspectRatio: z7.number().optional(),
2149
+ dominantColor: z7.string().optional(),
2150
+ imagePalette: z7.array(z7.string()).optional(),
2151
+ thumbhashDataUri: z7.string().optional(),
2152
+ isLightImage: z7.boolean().optional(),
2153
+ descriptionEmbedding: z7.array(z7.number()).optional(),
2154
+ imageEmbedding: z7.array(z7.number()).optional(),
2155
+ searchText: z7.string().optional(),
2110
2156
  status: imageStatusSchema,
2111
- errorMessage: z6.string().optional(),
2112
- createdAt: z6.number(),
2113
- updatedAt: z6.number(),
2114
- imageUrl: z6.string()
2157
+ errorMessage: z7.string().optional(),
2158
+ createdAt: z7.number(),
2159
+ updatedAt: z7.number(),
2160
+ imageUrl: z7.string()
2115
2161
  });
2116
- var imageHitSourceSchema = z6.enum([
2162
+ var imageHitSourceSchema = z7.enum([
2117
2163
  "library",
2118
2164
  "magnific",
2119
2165
  "google_images",
@@ -2124,242 +2170,242 @@ var imageHitSourceSchema = z6.enum([
2124
2170
  "giphy",
2125
2171
  "pinterest"
2126
2172
  ]);
2127
- var imageHitSchema = z6.object({
2173
+ var imageHitSchema = z7.object({
2128
2174
  source: imageHitSourceSchema,
2129
- url: z6.string(),
2130
- thumbnailUrl: z6.string().optional(),
2131
- width: z6.number().optional(),
2132
- height: z6.number().optional(),
2133
- aspectRatio: z6.number().optional(),
2134
- dominantColor: z6.string().optional(),
2135
- externalId: z6.string().optional(),
2136
- externalUrl: z6.string().optional(),
2137
- providerMeta: z6.record(z6.string(), z6.unknown()).optional(),
2138
- descriptionContext: z6.string().optional(),
2139
- _id: z6.string().optional(),
2140
- name: z6.string().optional(),
2141
- description: z6.string().optional(),
2142
- tags: z6.array(z6.string()).optional(),
2143
- score: z6.number().optional(),
2144
- alsoInLibrary: z6.string().optional(),
2145
- prefetchedBytes: z6.string().optional(),
2146
- prefetchedContentType: z6.string().optional()
2175
+ url: z7.string(),
2176
+ thumbnailUrl: z7.string().optional(),
2177
+ width: z7.number().optional(),
2178
+ height: z7.number().optional(),
2179
+ aspectRatio: z7.number().optional(),
2180
+ dominantColor: z7.string().optional(),
2181
+ externalId: z7.string().optional(),
2182
+ externalUrl: z7.string().optional(),
2183
+ providerMeta: z7.record(z7.string(), z7.unknown()).optional(),
2184
+ descriptionContext: z7.string().optional(),
2185
+ _id: z7.string().optional(),
2186
+ name: z7.string().optional(),
2187
+ description: z7.string().optional(),
2188
+ tags: z7.array(z7.string()).optional(),
2189
+ score: z7.number().optional(),
2190
+ alsoInLibrary: z7.string().optional(),
2191
+ prefetchedBytes: z7.string().optional(),
2192
+ prefetchedContentType: z7.string().optional()
2147
2193
  });
2148
2194
  var ingestedImageHitSchema = imageHitSchema.extend({
2149
- imageId: z6.string().optional(),
2150
- imageUrl: z6.string().optional(),
2151
- deduped: z6.boolean().optional(),
2152
- sourceUrl: z6.string().optional()
2153
- });
2154
- var autoIngestItemSchema = z6.object({
2155
- imageId: z6.string(),
2156
- deduped: z6.boolean(),
2157
- imageUrl: z6.string(),
2158
- sourceUrl: z6.string(),
2159
- externalUrl: z6.string().optional()
2195
+ imageId: z7.string().optional(),
2196
+ imageUrl: z7.string().optional(),
2197
+ deduped: z7.boolean().optional(),
2198
+ sourceUrl: z7.string().optional()
2199
+ });
2200
+ var autoIngestItemSchema = z7.object({
2201
+ imageId: z7.string(),
2202
+ deduped: z7.boolean(),
2203
+ imageUrl: z7.string(),
2204
+ sourceUrl: z7.string(),
2205
+ externalUrl: z7.string().optional()
2160
2206
  });
2161
2207
  function providerHitsResponseSchema() {
2162
- return z6.object({
2163
- hits: z6.array(ingestedImageHitSchema),
2164
- ingested: z6.array(autoIngestItemSchema)
2208
+ return z7.object({
2209
+ hits: z7.array(ingestedImageHitSchema),
2210
+ ingested: z7.array(autoIngestItemSchema)
2165
2211
  });
2166
2212
  }
2167
- var imagesGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
2168
- var imagesSearchRequestSchema = z6.object({
2169
- query: z6.string().min(1),
2170
- limit: z6.coerce.number().int().positive().max(100).optional(),
2171
- aspectRatio: z6.string().optional(),
2172
- tags: z6.array(z6.string()).optional(),
2173
- source: z6.string().optional(),
2174
- externalUrlHost: z6.string().optional()
2175
- });
2176
- var imageSearchResultSchema = z6.object({
2177
- _id: z6.string(),
2178
- imageUrl: z6.string(),
2179
- name: z6.string(),
2180
- description: z6.string(),
2181
- tags: z6.array(z6.string()),
2182
- width: z6.number().optional(),
2183
- height: z6.number().optional(),
2184
- aspectRatio: z6.number().optional(),
2185
- dominantColor: z6.string().optional(),
2186
- imagePalette: z6.array(z6.string()).optional(),
2187
- source: z6.string(),
2188
- externalUrl: z6.string().optional(),
2189
- score: z6.number()
2190
- });
2191
- var imagesSearchResponseSchema = z6.array(imageSearchResultSchema);
2192
- var imagesUploadRequestSchema = z6.object({
2193
- base64: z6.string().min(1),
2194
- contentType: z6.string().min(1),
2195
- source: z6.string().optional(),
2196
- descriptionContext: z6.string().optional()
2197
- });
2198
- var imagesUploadResponseSchema = z6.object({ imageId: z6.string() });
2199
- var imagesDeleteRequestSchema = z6.object({ id: z6.string().min(1, "Missing image ID") });
2200
- var imagesDeleteResponseSchema = z6.object({ ok: z6.literal(true) });
2201
- var imagesUpscaleRequestSchema = z6.object({ imageId: z6.string().min(1, "Missing image ID") });
2202
- var imagesUpscaleResponseSchema = z6.object({
2203
- imageId: z6.string(),
2204
- status: z6.literal("processing")
2213
+ var imagesGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2214
+ var imagesSearchRequestSchema = z7.object({
2215
+ query: z7.string().min(1),
2216
+ limit: z7.coerce.number().int().positive().max(100).optional(),
2217
+ aspectRatio: z7.string().optional(),
2218
+ tags: z7.array(z7.string()).optional(),
2219
+ source: z7.string().optional(),
2220
+ externalUrlHost: z7.string().optional()
2221
+ });
2222
+ var imageSearchResultSchema = z7.object({
2223
+ _id: z7.string(),
2224
+ imageUrl: z7.string(),
2225
+ name: z7.string(),
2226
+ description: z7.string(),
2227
+ tags: z7.array(z7.string()),
2228
+ width: z7.number().optional(),
2229
+ height: z7.number().optional(),
2230
+ aspectRatio: z7.number().optional(),
2231
+ dominantColor: z7.string().optional(),
2232
+ imagePalette: z7.array(z7.string()).optional(),
2233
+ source: z7.string(),
2234
+ externalUrl: z7.string().optional(),
2235
+ score: z7.number()
2236
+ });
2237
+ var imagesSearchResponseSchema = z7.array(imageSearchResultSchema);
2238
+ var imagesUploadRequestSchema = z7.object({
2239
+ base64: z7.string().min(1),
2240
+ contentType: z7.string().min(1),
2241
+ source: z7.string().optional(),
2242
+ descriptionContext: z7.string().optional()
2243
+ });
2244
+ var imagesUploadResponseSchema = z7.object({ imageId: z7.string() });
2245
+ var imagesDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing image ID") });
2246
+ var imagesDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
2247
+ var imagesUpscaleRequestSchema = z7.object({ imageId: z7.string().min(1, "Missing image ID") });
2248
+ var imagesUpscaleResponseSchema = z7.object({
2249
+ imageId: z7.string(),
2250
+ status: z7.literal("processing")
2205
2251
  });
2206
2252
  var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
2207
- var imagesFindRequestSchema = z6.object({
2208
- query: z6.string().min(1),
2209
- sources: z6.array(z6.enum(IMAGES_FIND_SOURCES)).optional(),
2210
- limit: z6.coerce.number().int().positive().max(50).optional(),
2211
- fallback: z6.boolean().optional(),
2212
- threshold: z6.number().min(0).max(1).optional(),
2213
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2214
- descriptionContext: z6.string().optional()
2215
- });
2216
- var imagesFindResponseSchema = z6.object({
2217
- groups: z6.object({
2218
- library: z6.array(imageHitSchema),
2219
- external: z6.array(ingestedImageHitSchema)
2253
+ var imagesFindRequestSchema = z7.object({
2254
+ query: z7.string().min(1),
2255
+ sources: z7.array(z7.enum(IMAGES_FIND_SOURCES)).optional(),
2256
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2257
+ fallback: z7.boolean().optional(),
2258
+ threshold: z7.number().min(0).max(1).optional(),
2259
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2260
+ descriptionContext: z7.string().optional()
2261
+ });
2262
+ var imagesFindResponseSchema = z7.object({
2263
+ groups: z7.object({
2264
+ library: z7.array(imageHitSchema),
2265
+ external: z7.array(ingestedImageHitSchema)
2220
2266
  }),
2221
- meta: z6.object({
2222
- counts: z6.record(z6.string(), z6.number()),
2223
- errors: z6.array(z6.object({ source: imageHitSourceSchema, message: z6.string() }))
2267
+ meta: z7.object({
2268
+ counts: z7.record(z7.string(), z7.number()),
2269
+ errors: z7.array(z7.object({ source: imageHitSourceSchema, message: z7.string() }))
2224
2270
  }),
2225
- ingested: z6.array(autoIngestItemSchema)
2226
- });
2227
- var imagesStockRequestSchema = z6.object({
2228
- query: z6.string().min(1),
2229
- orientation: z6.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2230
- contentType: z6.enum(["photo", "vector", "psd"]).optional(),
2231
- license: z6.enum(["freemium", "premium"]).optional(),
2232
- color: z6.string().optional(),
2233
- aiGenerated: z6.enum(["exclude", "only"]).optional(),
2234
- people: z6.enum(["include", "exclude", "only"]).optional(),
2235
- order: z6.enum(["relevance", "recent"]).optional(),
2236
- limit: z6.coerce.number().int().positive().max(50).optional(),
2237
- page: z6.coerce.number().int().positive().optional(),
2238
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2239
- descriptionContext: z6.string().optional()
2271
+ ingested: z7.array(autoIngestItemSchema)
2272
+ });
2273
+ var imagesStockRequestSchema = z7.object({
2274
+ query: z7.string().min(1),
2275
+ orientation: z7.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2276
+ contentType: z7.enum(["photo", "vector", "psd"]).optional(),
2277
+ license: z7.enum(["freemium", "premium"]).optional(),
2278
+ color: z7.string().optional(),
2279
+ aiGenerated: z7.enum(["exclude", "only"]).optional(),
2280
+ people: z7.enum(["include", "exclude", "only"]).optional(),
2281
+ order: z7.enum(["relevance", "recent"]).optional(),
2282
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2283
+ page: z7.coerce.number().int().positive().optional(),
2284
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2285
+ descriptionContext: z7.string().optional()
2240
2286
  });
2241
2287
  var imagesStockResponseSchema = providerHitsResponseSchema();
2242
- var imagesGoogleRequestSchema = z6.object({
2243
- query: z6.string().min(1),
2244
- type: z6.string().optional(),
2245
- size: z6.string().optional(),
2246
- color: z6.string().optional(),
2247
- safe: z6.enum(["off", "active"]).optional(),
2248
- limit: z6.coerce.number().int().positive().max(50).optional(),
2249
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2250
- descriptionContext: z6.string().optional()
2288
+ var imagesGoogleRequestSchema = z7.object({
2289
+ query: z7.string().min(1),
2290
+ type: z7.string().optional(),
2291
+ size: z7.string().optional(),
2292
+ color: z7.string().optional(),
2293
+ safe: z7.enum(["off", "active"]).optional(),
2294
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2295
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2296
+ descriptionContext: z7.string().optional()
2251
2297
  });
2252
2298
  var imagesGoogleResponseSchema = providerHitsResponseSchema();
2253
- var imagesPinterestRequestSchema = z6.object({
2254
- query: z6.string().min(1),
2255
- limit: z6.coerce.number().int().positive().max(20).optional(),
2256
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2257
- descriptionContext: z6.string().optional()
2299
+ var imagesPinterestRequestSchema = z7.object({
2300
+ query: z7.string().min(1),
2301
+ limit: z7.coerce.number().int().positive().max(20).optional(),
2302
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2303
+ descriptionContext: z7.string().optional()
2258
2304
  });
2259
2305
  var imagesPinterestResponseSchema = providerHitsResponseSchema();
2260
- var rgbTriple = z6.tuple([
2261
- z6.number().int().min(0).max(255),
2262
- z6.number().int().min(0).max(255),
2263
- z6.number().int().min(0).max(255)
2306
+ var rgbTriple = z7.tuple([
2307
+ z7.number().int().min(0).max(255),
2308
+ z7.number().int().min(0).max(255),
2309
+ z7.number().int().min(0).max(255)
2264
2310
  ]);
2265
- var imageGenerateModelSchema = z6.enum([
2311
+ var imageGenerateModelSchema = z7.enum([
2266
2312
  "openai/gpt-5.4-image-2",
2267
2313
  "google/gemini-3.5-flash",
2268
2314
  "google/gemini-3.1-flash-image-preview",
2269
2315
  "google/gemini-3-pro-image-preview",
2270
2316
  "recraft/recraft-v4.1-pro-vector"
2271
2317
  ]);
2272
- var imagesGenerateRequestSchema = z6.object({
2273
- prompt: z6.string().min(1),
2318
+ var imagesGenerateRequestSchema = z7.object({
2319
+ prompt: z7.string().min(1),
2274
2320
  model: imageGenerateModelSchema.optional(),
2275
2321
  // Aspect ratio + size are validated loosely as strings; the per-model enum
2276
2322
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
2277
- aspectRatio: z6.string().optional(),
2278
- imageSize: z6.string().optional(),
2323
+ aspectRatio: z7.string().optional(),
2324
+ imageSize: z7.string().optional(),
2279
2325
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
2280
- quality: z6.enum(["auto", "low", "medium", "high"]).optional(),
2326
+ quality: z7.enum(["auto", "low", "medium", "high"]).optional(),
2281
2327
  // Recraft v4.1 Pro Vector levers (ignored by other models).
2282
- strength: z6.coerce.number().min(0).max(1).optional(),
2283
- rgbColors: z6.array(rgbTriple).optional(),
2328
+ strength: z7.coerce.number().min(0).max(1).optional(),
2329
+ rgbColors: z7.array(rgbTriple).optional(),
2284
2330
  backgroundRgbColor: rgbTriple.optional(),
2285
2331
  // Public image URLs used as visual references (multi-reference, in order).
2286
- referenceUrls: z6.array(z6.string().url()).optional(),
2287
- descriptionContext: z6.string().optional()
2288
- });
2289
- var generatedImageSchema = z6.object({
2290
- imageId: z6.string(),
2291
- deduped: z6.boolean(),
2292
- imageUrl: z6.string(),
2293
- width: z6.number().optional(),
2294
- height: z6.number().optional()
2295
- });
2296
- var imagesGenerateResponseSchema = z6.object({
2297
- model: z6.string(),
2298
- costUsd: z6.number(),
2299
- images: z6.array(generatedImageSchema)
2300
- });
2301
- var imagesLogoRequestSchema = z6.object({
2302
- domain: z6.string().min(1),
2303
- variant: z6.enum(["icon", "logo", "symbol"]).optional(),
2304
- autoIngest: z6.coerce.number().int().min(0).max(5).optional(),
2305
- descriptionContext: z6.string().optional()
2332
+ referenceUrls: z7.array(z7.string().url()).optional(),
2333
+ descriptionContext: z7.string().optional()
2334
+ });
2335
+ var generatedImageSchema = z7.object({
2336
+ imageId: z7.string(),
2337
+ deduped: z7.boolean(),
2338
+ imageUrl: z7.string(),
2339
+ width: z7.number().optional(),
2340
+ height: z7.number().optional()
2341
+ });
2342
+ var imagesGenerateResponseSchema = z7.object({
2343
+ model: z7.string(),
2344
+ costUsd: z7.number(),
2345
+ images: z7.array(generatedImageSchema)
2346
+ });
2347
+ var imagesLogoRequestSchema = z7.object({
2348
+ domain: z7.string().min(1),
2349
+ variant: z7.enum(["icon", "logo", "symbol"]).optional(),
2350
+ autoIngest: z7.coerce.number().int().min(0).max(5).optional(),
2351
+ descriptionContext: z7.string().optional()
2306
2352
  });
2307
2353
  var imagesLogoResponseSchema = providerHitsResponseSchema();
2308
- var imagesIconRequestSchema = z6.object({
2309
- name: z6.string().min(1),
2310
- set: z6.string().optional(),
2311
- color: z6.string().optional(),
2312
- width: z6.coerce.number().int().positive().optional(),
2313
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2314
- descriptionContext: z6.string().optional()
2354
+ var imagesIconRequestSchema = z7.object({
2355
+ name: z7.string().min(1),
2356
+ set: z7.string().optional(),
2357
+ color: z7.string().optional(),
2358
+ width: z7.coerce.number().int().positive().optional(),
2359
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2360
+ descriptionContext: z7.string().optional()
2315
2361
  });
2316
2362
  var imagesIconResponseSchema = providerHitsResponseSchema();
2317
- var imagesExtractRequestSchema = z6.object({
2318
- url: z6.string().url(),
2319
- waitFor: z6.coerce.number().int().min(0).max(3e4).optional(),
2320
- limit: z6.coerce.number().int().positive().max(50).optional(),
2321
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2322
- descriptionContext: z6.string().optional()
2363
+ var imagesExtractRequestSchema = z7.object({
2364
+ url: z7.string().url(),
2365
+ waitFor: z7.coerce.number().int().min(0).max(3e4).optional(),
2366
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2367
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2368
+ descriptionContext: z7.string().optional()
2323
2369
  });
2324
2370
  var imagesExtractResponseSchema = providerHitsResponseSchema();
2325
- var imagesScreenshotRequestSchema = z6.object({
2326
- url: z6.string().url(),
2327
- fullPage: z6.boolean().optional(),
2328
- viewportWidth: z6.coerce.number().int().positive().max(3840).optional(),
2329
- viewportHeight: z6.coerce.number().int().positive().max(2160).optional(),
2330
- format: z6.enum(["webp", "png", "jpg"]).optional(),
2331
- descriptionContext: z6.string().optional()
2371
+ var imagesScreenshotRequestSchema = z7.object({
2372
+ url: z7.string().url(),
2373
+ fullPage: z7.boolean().optional(),
2374
+ viewportWidth: z7.coerce.number().int().positive().max(3840).optional(),
2375
+ viewportHeight: z7.coerce.number().int().positive().max(2160).optional(),
2376
+ format: z7.enum(["webp", "png", "jpg"]).optional(),
2377
+ descriptionContext: z7.string().optional()
2332
2378
  });
2333
2379
  var imagesScreenshotResponseSchema = providerHitsResponseSchema();
2334
- var imagesGiphyRequestSchema = z6.object({
2335
- query: z6.string().min(1).optional(),
2336
- trending: z6.coerce.boolean().optional(),
2337
- limit: z6.coerce.number().int().positive().max(50).optional(),
2338
- rating: z6.enum(["g", "pg", "pg-13", "r"]).optional(),
2339
- lang: z6.string().optional(),
2340
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2341
- descriptionContext: z6.string().optional()
2380
+ var imagesGiphyRequestSchema = z7.object({
2381
+ query: z7.string().min(1).optional(),
2382
+ trending: z7.coerce.boolean().optional(),
2383
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2384
+ rating: z7.enum(["g", "pg", "pg-13", "r"]).optional(),
2385
+ lang: z7.string().optional(),
2386
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2387
+ descriptionContext: z7.string().optional()
2342
2388
  });
2343
2389
  var imagesGifResponseSchema = providerHitsResponseSchema();
2344
2390
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2345
- var imagesIngestRequestSchema = z6.object({
2346
- url: z6.string().url(),
2391
+ var imagesIngestRequestSchema = z7.object({
2392
+ url: z7.string().url(),
2347
2393
  // Validate source at the HTTP boundary so unknown values produce the standard
2348
2394
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2349
2395
  // `assertImageSource` inside the action.
2350
2396
  source: imageSourceSchema,
2351
- externalId: z6.string().optional(),
2352
- externalUrl: z6.string().optional(),
2353
- descriptionContext: z6.string().optional()
2397
+ externalId: z7.string().optional(),
2398
+ externalUrl: z7.string().optional(),
2399
+ descriptionContext: z7.string().optional()
2354
2400
  });
2355
- var imagesIngestResponseSchema = z6.object({
2356
- imageId: z6.string(),
2357
- deduped: z6.boolean(),
2358
- contentHash: z6.string()
2401
+ var imagesIngestResponseSchema = z7.object({
2402
+ imageId: z7.string(),
2403
+ deduped: z7.boolean(),
2404
+ contentHash: z7.string()
2359
2405
  });
2360
2406
 
2361
2407
  // ../api/src/tags.ts
2362
- import { z as z7 } from "zod";
2408
+ import { z as z8 } from "zod";
2363
2409
  var TAG_TYPES = [
2364
2410
  "meta",
2365
2411
  "amplitude",
@@ -2380,7 +2426,7 @@ var TAG_TYPES = [
2380
2426
  "recaptcha",
2381
2427
  "twitterAds"
2382
2428
  ];
2383
- var tagTypeSchema = z7.enum(TAG_TYPES);
2429
+ var tagTypeSchema = z8.enum(TAG_TYPES);
2384
2430
  var TAG_IDENTIFYING_FIELD = {
2385
2431
  meta: "pixelId",
2386
2432
  googleAds: "conversionID",
@@ -2401,218 +2447,218 @@ var TAG_IDENTIFYING_FIELD = {
2401
2447
  recaptcha: "siteKey",
2402
2448
  twitterAds: "pixelId"
2403
2449
  };
2404
- var tagDraftOpKindSchema = z7.enum(["create", "update", "delete"]);
2405
- var tagDraftOpViewSchema = z7.object({
2450
+ var tagDraftOpKindSchema = z8.enum(["create", "update", "delete"]);
2451
+ var tagDraftOpViewSchema = z8.object({
2406
2452
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2407
- ref: z7.string(),
2453
+ ref: z8.string(),
2408
2454
  kind: tagDraftOpKindSchema,
2409
2455
  type: tagTypeSchema,
2410
2456
  /** Present on update/delete ops — the real tag this op targets. */
2411
- tagId: z7.string().optional(),
2457
+ tagId: z8.string().optional(),
2412
2458
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2413
- config: z7.record(z7.string(), z7.string()),
2459
+ config: z8.record(z8.string(), z8.string()),
2414
2460
  /** Update only — fields the op explicitly clears. */
2415
- clearFields: z7.array(z7.string()).optional(),
2461
+ clearFields: z8.array(z8.string()).optional(),
2416
2462
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2417
- secretsSet: z7.array(z7.string()),
2463
+ secretsSet: z8.array(z8.string()),
2418
2464
  /** Names of secret fields still awaiting user input. */
2419
- secretsPending: z7.array(z7.string()),
2420
- summary: z7.string(),
2421
- stagedAt: z7.number()
2465
+ secretsPending: z8.array(z8.string()),
2466
+ summary: z8.string(),
2467
+ stagedAt: z8.number()
2422
2468
  });
2423
- var tagsEffectiveEntrySchema = z7.object({
2469
+ var tagsEffectiveEntrySchema = z8.object({
2424
2470
  /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
2425
- ref: z7.string(),
2426
- tagId: z7.string().optional(),
2471
+ ref: z8.string(),
2472
+ tagId: z8.string().optional(),
2427
2473
  type: tagTypeSchema,
2428
2474
  /** Value of the type's identifying field, when set. */
2429
- identifier: z7.string().optional(),
2475
+ identifier: z8.string().optional(),
2430
2476
  /** Redacted config; for staged updates, production config with the patch merged. */
2431
- config: z7.record(z7.string(), z7.string()),
2477
+ config: z8.record(z8.string(), z8.string()),
2432
2478
  /** Absent = live production tag with no staged changes in this chat. */
2433
2479
  staged: tagDraftOpKindSchema.optional(),
2434
- secretsSet: z7.array(z7.string()),
2435
- secretsPending: z7.array(z7.string())
2480
+ secretsSet: z8.array(z8.string()),
2481
+ secretsPending: z8.array(z8.string())
2436
2482
  });
2437
- var tagsListRequestSchema = z7.object({ chatId: z7.string() });
2438
- var tagsListResponseSchema = z7.object({ tags: z7.array(tagsEffectiveEntrySchema) });
2439
- var tagsDraftListRequestSchema = z7.object({ chatId: z7.string() });
2440
- var tagsDraftListResponseSchema = z7.object({
2441
- status: z7.enum(["active", "publishing", "applied", "discarded", "none"]),
2442
- ops: z7.array(tagDraftOpViewSchema)
2483
+ var tagsListRequestSchema = z8.object({ chatId: z8.string() });
2484
+ var tagsListResponseSchema = z8.object({ tags: z8.array(tagsEffectiveEntrySchema) });
2485
+ var tagsDraftListRequestSchema = z8.object({ chatId: z8.string() });
2486
+ var tagsDraftListResponseSchema = z8.object({
2487
+ status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
2488
+ ops: z8.array(tagDraftOpViewSchema)
2443
2489
  });
2444
- var tagInputRequestSchema = z7.object({
2490
+ var tagInputRequestSchema = z8.object({
2445
2491
  // Every tag change is a tab in the approval form: create/edit show the full
2446
2492
  // body; delete shows a confirm. No tag change bypasses this approval.
2447
- mode: z7.enum(["create", "edit", "delete"]),
2493
+ mode: z8.enum(["create", "edit", "delete"]),
2448
2494
  tagType: tagTypeSchema,
2449
2495
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2450
- ref: z7.string().optional(),
2496
+ ref: z8.string().optional(),
2451
2497
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2452
- prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
2498
+ prefilledConfig: z8.record(z8.string(), z8.string()).optional(),
2453
2499
  /** Secret field names the agent asks the user to provide. */
2454
- requestedSecretFields: z7.array(z7.string()).optional(),
2500
+ requestedSecretFields: z8.array(z8.string()).optional(),
2455
2501
  /** Short message shown above the form explaining why the input is needed. */
2456
- message: z7.string().optional()
2502
+ message: z8.string().optional()
2457
2503
  });
2458
- var tagChangeToolInputSchema = z7.object({
2459
- changes: z7.array(tagInputRequestSchema).min(1).max(8)
2504
+ var tagChangeToolInputSchema = z8.object({
2505
+ changes: z8.array(tagInputRequestSchema).min(1).max(8)
2460
2506
  });
2461
- var tagInputResultSchema = z7.discriminatedUnion("status", [
2462
- z7.object({
2463
- status: z7.literal("submitted"),
2464
- ref: z7.string(),
2507
+ var tagInputResultSchema = z8.discriminatedUnion("status", [
2508
+ z8.object({
2509
+ status: z8.literal("submitted"),
2510
+ ref: z8.string(),
2465
2511
  type: tagTypeSchema,
2466
2512
  /** Identifying field name → value (non-secret), when the type has one. */
2467
- identifier: z7.record(z7.string(), z7.string()).optional(),
2468
- secretFieldsSet: z7.array(z7.string()),
2469
- note: z7.string().optional()
2513
+ identifier: z8.record(z8.string(), z8.string()).optional(),
2514
+ secretFieldsSet: z8.array(z8.string()),
2515
+ note: z8.string().optional()
2470
2516
  }),
2471
- z7.object({
2472
- status: z7.literal("declined"),
2473
- reason: z7.string().optional()
2517
+ z8.object({
2518
+ status: z8.literal("declined"),
2519
+ reason: z8.string().optional()
2474
2520
  })
2475
2521
  ]);
2476
- var tagChangeToolResultSchema = z7.object({
2477
- results: z7.array(tagInputResultSchema)
2522
+ var tagChangeToolResultSchema = z8.object({
2523
+ results: z8.array(tagInputResultSchema)
2478
2524
  });
2479
2525
 
2480
2526
  // ../api/src/testimonials.ts
2481
- import { z as z8 } from "zod";
2482
- var testimonialSourceTypeSchema = z8.enum(["google", "trustpilot"]);
2483
- var testimonialStatusSchema = z8.enum(["pending", "processing", "ready", "error"]);
2484
- var testimonialSentimentSchema = z8.enum(["positive", "neutral", "negative"]);
2485
- var testimonialDocSchema = z8.object({
2486
- _id: z8.string(),
2487
- _creationTime: z8.number(),
2488
- companyId: z8.string(),
2489
- sourceId: z8.string(),
2527
+ import { z as z9 } from "zod";
2528
+ var testimonialSourceTypeSchema = z9.enum(["google", "trustpilot"]);
2529
+ var testimonialStatusSchema = z9.enum(["pending", "processing", "ready", "error"]);
2530
+ var testimonialSentimentSchema = z9.enum(["positive", "neutral", "negative"]);
2531
+ var testimonialDocSchema = z9.object({
2532
+ _id: z9.string(),
2533
+ _creationTime: z9.number(),
2534
+ companyId: z9.string(),
2535
+ sourceId: z9.string(),
2490
2536
  sourceType: testimonialSourceTypeSchema,
2491
- reviewText: z8.string(),
2492
- reviewTitle: z8.string().optional(),
2493
- searchText: z8.string().optional(),
2494
- reviewerName: z8.string().optional(),
2495
- reviewerImageUrl: z8.string().optional(),
2496
- reviewerImageId: z8.string().optional(),
2497
- reviewerLocation: z8.string().optional(),
2498
- rating: z8.number().optional(),
2499
- reviewDate: z8.number().optional(),
2500
- ownerAnswer: z8.string().optional(),
2501
- mediaUrls: z8.array(z8.string()).optional(),
2502
- imageIds: z8.array(z8.string()).optional(),
2503
- videoIds: z8.array(z8.string()).optional(),
2504
- sourceUrl: z8.string().optional(),
2505
- rawData: z8.unknown().optional(),
2506
- tags: z8.array(z8.string()),
2507
- highlight: z8.string().optional(),
2508
- language: z8.string().optional(),
2509
- summary: z8.string().optional(),
2537
+ reviewText: z9.string(),
2538
+ reviewTitle: z9.string().optional(),
2539
+ searchText: z9.string().optional(),
2540
+ reviewerName: z9.string().optional(),
2541
+ reviewerImageUrl: z9.string().optional(),
2542
+ reviewerImageId: z9.string().optional(),
2543
+ reviewerLocation: z9.string().optional(),
2544
+ rating: z9.number().optional(),
2545
+ reviewDate: z9.number().optional(),
2546
+ ownerAnswer: z9.string().optional(),
2547
+ mediaUrls: z9.array(z9.string()).optional(),
2548
+ imageIds: z9.array(z9.string()).optional(),
2549
+ videoIds: z9.array(z9.string()).optional(),
2550
+ sourceUrl: z9.string().optional(),
2551
+ rawData: z9.unknown().optional(),
2552
+ tags: z9.array(z9.string()),
2553
+ highlight: z9.string().optional(),
2554
+ language: z9.string().optional(),
2555
+ summary: z9.string().optional(),
2510
2556
  sentiment: testimonialSentimentSchema.optional(),
2511
- textEmbedding: z8.array(z8.number()).optional(),
2512
- externalId: z8.string().optional(),
2513
- contentHash: z8.string().optional(),
2557
+ textEmbedding: z9.array(z9.number()).optional(),
2558
+ externalId: z9.string().optional(),
2559
+ contentHash: z9.string().optional(),
2514
2560
  status: testimonialStatusSchema,
2515
- errorMessage: z8.string().optional(),
2516
- createdAt: z8.number(),
2517
- updatedAt: z8.number()
2561
+ errorMessage: z9.string().optional(),
2562
+ createdAt: z9.number(),
2563
+ updatedAt: z9.number()
2518
2564
  });
2519
- var testimonialsListRequestSchema = z8.object({
2565
+ var testimonialsListRequestSchema = z9.object({
2520
2566
  source: testimonialSourceTypeSchema.optional(),
2521
- rating_min: z8.coerce.number().int().min(1).max(5).optional(),
2522
- rating_max: z8.coerce.number().int().min(1).max(5).optional(),
2523
- tags: z8.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2567
+ rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2568
+ rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2569
+ tags: z9.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2524
2570
  status: testimonialStatusSchema.optional(),
2525
2571
  sentiment: testimonialSentimentSchema.optional(),
2526
- language: z8.string().min(2).max(5).optional(),
2527
- limit: z8.coerce.number().int().positive().max(200).optional()
2528
- });
2529
- var testimonialsListResponseSchema = z8.array(testimonialDocSchema);
2530
- var testimonialsGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2531
- var testimonialsSearchRequestSchema = z8.object({
2532
- query: z8.string().min(1),
2533
- limit: z8.coerce.number().int().positive().max(100).optional(),
2572
+ language: z9.string().min(2).max(5).optional(),
2573
+ limit: z9.coerce.number().int().positive().max(200).optional()
2574
+ });
2575
+ var testimonialsListResponseSchema = z9.array(testimonialDocSchema);
2576
+ var testimonialsGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2577
+ var testimonialsSearchRequestSchema = z9.object({
2578
+ query: z9.string().min(1),
2579
+ limit: z9.coerce.number().int().positive().max(100).optional(),
2534
2580
  source: testimonialSourceTypeSchema.optional(),
2535
- rating_min: z8.coerce.number().int().min(1).max(5).optional(),
2536
- rating_max: z8.coerce.number().int().min(1).max(5).optional(),
2537
- tags: z8.array(z8.string()).optional(),
2581
+ rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2582
+ rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2583
+ tags: z9.array(z9.string()).optional(),
2538
2584
  status: testimonialStatusSchema.optional(),
2539
2585
  sentiment: testimonialSentimentSchema.optional(),
2540
- language: z8.string().min(2).max(5).optional()
2586
+ language: z9.string().min(2).max(5).optional()
2541
2587
  }).refine(
2542
2588
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2543
2589
  { message: "rating_min must be less than or equal to rating_max" }
2544
2590
  );
2545
- var testimonialsSearchResponseSchema = z8.array(testimonialDocSchema);
2546
- var testimonialsOutscraperWebhookResponseSchema = z8.object({
2547
- ok: z8.literal(true),
2548
- note: z8.string().optional()
2591
+ var testimonialsSearchResponseSchema = z9.array(testimonialDocSchema);
2592
+ var testimonialsOutscraperWebhookResponseSchema = z9.object({
2593
+ ok: z9.literal(true),
2594
+ note: z9.string().optional()
2549
2595
  });
2550
2596
 
2551
2597
  // ../api/src/videos.ts
2552
- import { z as z9 } from "zod";
2553
- var videoStatusSchema = z9.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2554
- var videoTranscriptSegmentSchema = z9.object({
2555
- text: z9.string(),
2556
- startSecond: z9.number(),
2557
- endSecond: z9.number()
2558
- });
2559
- var videoSceneSchema = z9.object({
2560
- title: z9.string(),
2561
- description: z9.string(),
2562
- startSecond: z9.number(),
2563
- endSecond: z9.number(),
2564
- thumbnailTime: z9.number()
2565
- });
2566
- var videoDocSchema = z9.object({
2567
- _id: z9.string(),
2568
- _creationTime: z9.number(),
2569
- companyId: z9.string(),
2570
- muxAssetId: z9.string(),
2571
- muxPlaybackId: z9.string(),
2572
- muxUploadId: z9.string(),
2573
- name: z9.string(),
2574
- description: z9.string(),
2575
- tags: z9.array(z9.string()),
2576
- source: z9.string(),
2577
- externalId: z9.string().optional(),
2578
- sourceId: z9.string().optional(),
2579
- width: z9.number().optional(),
2580
- height: z9.number().optional(),
2581
- aspectRatio: z9.number().optional(),
2582
- duration: z9.number().optional(),
2583
- transcript: z9.string().optional(),
2584
- transcriptSegments: z9.array(videoTranscriptSegmentSchema).optional(),
2585
- scenes: z9.array(videoSceneSchema).optional(),
2586
- descriptionEmbedding: z9.array(z9.number()).optional(),
2587
- searchText: z9.string().optional(),
2598
+ import { z as z10 } from "zod";
2599
+ var videoStatusSchema = z10.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2600
+ var videoTranscriptSegmentSchema = z10.object({
2601
+ text: z10.string(),
2602
+ startSecond: z10.number(),
2603
+ endSecond: z10.number()
2604
+ });
2605
+ var videoSceneSchema = z10.object({
2606
+ title: z10.string(),
2607
+ description: z10.string(),
2608
+ startSecond: z10.number(),
2609
+ endSecond: z10.number(),
2610
+ thumbnailTime: z10.number()
2611
+ });
2612
+ var videoDocSchema = z10.object({
2613
+ _id: z10.string(),
2614
+ _creationTime: z10.number(),
2615
+ companyId: z10.string(),
2616
+ muxAssetId: z10.string(),
2617
+ muxPlaybackId: z10.string(),
2618
+ muxUploadId: z10.string(),
2619
+ name: z10.string(),
2620
+ description: z10.string(),
2621
+ tags: z10.array(z10.string()),
2622
+ source: z10.string(),
2623
+ externalId: z10.string().optional(),
2624
+ sourceId: z10.string().optional(),
2625
+ width: z10.number().optional(),
2626
+ height: z10.number().optional(),
2627
+ aspectRatio: z10.number().optional(),
2628
+ duration: z10.number().optional(),
2629
+ transcript: z10.string().optional(),
2630
+ transcriptSegments: z10.array(videoTranscriptSegmentSchema).optional(),
2631
+ scenes: z10.array(videoSceneSchema).optional(),
2632
+ descriptionEmbedding: z10.array(z10.number()).optional(),
2633
+ searchText: z10.string().optional(),
2588
2634
  status: videoStatusSchema,
2589
- errorMessage: z9.string().optional(),
2590
- createdAt: z9.number(),
2591
- updatedAt: z9.number(),
2592
- thumbnailUrl: z9.string()
2593
- });
2594
- var videosWebhookResponseSchema = z9.object({ ok: z9.literal(true) });
2595
- var videosGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2596
- var videosSearchRequestSchema = z9.object({
2597
- query: z9.string().min(1),
2598
- limit: z9.coerce.number().int().positive().max(100).optional(),
2599
- tags: z9.array(z9.string()).optional()
2600
- });
2601
- var videoSearchResultSchema = z9.object({
2602
- _id: z9.string(),
2603
- thumbnailUrl: z9.string(),
2604
- name: z9.string(),
2605
- description: z9.string(),
2606
- tags: z9.array(z9.string()),
2607
- status: z9.string(),
2608
- duration: z9.number().optional(),
2609
- muxPlaybackId: z9.string(),
2610
- createdAt: z9.number()
2611
- });
2612
- var videosSearchResponseSchema = z9.array(videoSearchResultSchema);
2613
- var videosUploadResponseSchema = z9.object({ uploadUrl: z9.string(), videoId: z9.string() });
2614
- var videosDeleteRequestSchema = z9.object({ id: z9.string().min(1, "Missing video ID") });
2615
- var videosDeleteResponseSchema = z9.object({ ok: z9.literal(true) });
2635
+ errorMessage: z10.string().optional(),
2636
+ createdAt: z10.number(),
2637
+ updatedAt: z10.number(),
2638
+ thumbnailUrl: z10.string()
2639
+ });
2640
+ var videosWebhookResponseSchema = z10.object({ ok: z10.literal(true) });
2641
+ var videosGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2642
+ var videosSearchRequestSchema = z10.object({
2643
+ query: z10.string().min(1),
2644
+ limit: z10.coerce.number().int().positive().max(100).optional(),
2645
+ tags: z10.array(z10.string()).optional()
2646
+ });
2647
+ var videoSearchResultSchema = z10.object({
2648
+ _id: z10.string(),
2649
+ thumbnailUrl: z10.string(),
2650
+ name: z10.string(),
2651
+ description: z10.string(),
2652
+ tags: z10.array(z10.string()),
2653
+ status: z10.string(),
2654
+ duration: z10.number().optional(),
2655
+ muxPlaybackId: z10.string(),
2656
+ createdAt: z10.number()
2657
+ });
2658
+ var videosSearchResponseSchema = z10.array(videoSearchResultSchema);
2659
+ var videosUploadResponseSchema = z10.object({ uploadUrl: z10.string(), videoId: z10.string() });
2660
+ var videosDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing video ID") });
2661
+ var videosDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
2616
2662
 
2617
2663
  // src/commands/actions/complete.ts
2618
2664
  import { defineCommand as defineCommand2 } from "citty";
@@ -4425,37 +4471,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4425
4471
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4426
4472
 
4427
4473
  // ../api/src/ads-google/ops.ts
4428
- import { z as z10 } from "zod";
4429
- var tempRefSchema2 = z10.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4430
- var refSchema = z10.union([
4431
- z10.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4432
- z10.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4474
+ import { z as z11 } from "zod";
4475
+ var tempRefSchema2 = z11.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4476
+ var refSchema = z11.union([
4477
+ z11.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4478
+ z11.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4433
4479
  tempRefSchema2
4434
4480
  ]);
4435
4481
  var targetRefSchema = refSchema;
4436
- var microsSchema = z10.number().int().positive("expected a positive micros amount");
4437
- var httpsUrlSchema2 = z10.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4438
- var customerIdSchema = z10.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4439
- var stageableStatusSchema2 = z10.enum(STAGEABLE_CREATE_STATUSES2);
4440
- var matchTypeSchema = z10.enum(KEYWORD_MATCH_TYPES);
4441
- var keywordTextSchema = z10.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");
4442
- var budgetCreateSchema = z10.object({
4443
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4482
+ var microsSchema = z11.number().int().positive("expected a positive micros amount");
4483
+ var httpsUrlSchema2 = z11.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4484
+ var customerIdSchema = z11.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4485
+ var stageableStatusSchema2 = z11.enum(STAGEABLE_CREATE_STATUSES2);
4486
+ var matchTypeSchema = z11.enum(KEYWORD_MATCH_TYPES);
4487
+ var keywordTextSchema = z11.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");
4488
+ var budgetCreateSchema = z11.object({
4489
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4444
4490
  amountMicros: microsSchema,
4445
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4446
- explicitlyShared: z10.boolean().default(false)
4491
+ deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4492
+ explicitlyShared: z11.boolean().default(false)
4447
4493
  });
4448
- var budgetUpdateSchema = z10.object({
4449
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4494
+ var budgetUpdateSchema = z11.object({
4495
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4450
4496
  amountMicros: microsSchema.optional(),
4451
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).optional()
4497
+ deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).optional()
4452
4498
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4453
- var biddingConfigSchema = z10.object({
4454
- type: z10.enum(BIDDING_STRATEGY_TYPES),
4499
+ var biddingConfigSchema = z11.object({
4500
+ type: z11.enum(BIDDING_STRATEGY_TYPES),
4455
4501
  targetCpaMicros: microsSchema.optional(),
4456
- targetRoas: z10.number().positive().optional(),
4502
+ targetRoas: z11.number().positive().optional(),
4457
4503
  cpcBidCeilingMicros: microsSchema.optional(),
4458
- enhancedCpcEnabled: z10.boolean().optional()
4504
+ enhancedCpcEnabled: z11.boolean().optional()
4459
4505
  }).superRefine((p, ctx) => {
4460
4506
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4461
4507
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4464,17 +4510,17 @@ var biddingConfigSchema = z10.object({
4464
4510
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4465
4511
  }
4466
4512
  });
4467
- var networkSettingsSchema = z10.object({
4468
- targetGoogleSearch: z10.boolean().optional(),
4469
- targetSearchNetwork: z10.boolean().optional(),
4470
- targetContentNetwork: z10.boolean().optional(),
4471
- targetPartnerSearchNetwork: z10.boolean().optional()
4513
+ var networkSettingsSchema = z11.object({
4514
+ targetGoogleSearch: z11.boolean().optional(),
4515
+ targetSearchNetwork: z11.boolean().optional(),
4516
+ targetContentNetwork: z11.boolean().optional(),
4517
+ targetPartnerSearchNetwork: z11.boolean().optional()
4472
4518
  });
4473
- var dateSchema = z10.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4474
- var campaignCreateSchema2 = z10.object({
4475
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4476
- channelType: z10.enum(ADVERTISING_CHANNEL_TYPES),
4477
- channelSubType: z10.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4519
+ var dateSchema = z11.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4520
+ var campaignCreateSchema2 = z11.object({
4521
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4522
+ channelType: z11.enum(ADVERTISING_CHANNEL_TYPES),
4523
+ channelSubType: z11.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4478
4524
  budget: refSchema,
4479
4525
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4480
4526
  bidding: biddingConfigSchema.optional(),
@@ -4483,7 +4529,7 @@ var campaignCreateSchema2 = z10.object({
4483
4529
  startDate: dateSchema.optional(),
4484
4530
  endDate: dateSchema.optional(),
4485
4531
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4486
- objective: z10.enum(CAMPAIGN_OBJECTIVES).optional(),
4532
+ objective: z11.enum(CAMPAIGN_OBJECTIVES).optional(),
4487
4533
  status: stageableStatusSchema2.default("PAUSED")
4488
4534
  }).superRefine((p, ctx) => {
4489
4535
  if (!p.bidding && !p.biddingStrategy) {
@@ -4507,129 +4553,129 @@ var campaignCreateSchema2 = z10.object({
4507
4553
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4508
4554
  }
4509
4555
  });
4510
- var campaignUpdateSchema2 = z10.object({
4511
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4556
+ var campaignUpdateSchema2 = z11.object({
4557
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4512
4558
  budget: refSchema.optional(),
4513
4559
  bidding: biddingConfigSchema.optional(),
4514
4560
  networkSettings: networkSettingsSchema.optional(),
4515
4561
  startDate: dateSchema.optional(),
4516
4562
  endDate: dateSchema.optional(),
4517
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4563
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4518
4564
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4519
- var adGroupCreateSchema = z10.object({
4520
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4565
+ var adGroupCreateSchema = z11.object({
4566
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4521
4567
  campaign: refSchema,
4522
- type: z10.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4568
+ type: z11.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4523
4569
  cpcBidMicros: microsSchema.optional(),
4524
4570
  status: stageableStatusSchema2.default("PAUSED")
4525
4571
  });
4526
- var adGroupUpdateSchema = z10.object({
4527
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4572
+ var adGroupUpdateSchema = z11.object({
4573
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4528
4574
  cpcBidMicros: microsSchema.optional(),
4529
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4575
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4530
4576
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4531
- var keywordAddSchema = z10.object({
4577
+ var keywordAddSchema = z11.object({
4532
4578
  adGroup: refSchema,
4533
4579
  text: keywordTextSchema,
4534
4580
  matchType: matchTypeSchema,
4535
4581
  cpcBidMicros: microsSchema.optional(),
4536
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4582
+ finalUrls: z11.array(httpsUrlSchema2).optional(),
4537
4583
  status: stageableStatusSchema2.default("ENABLED")
4538
4584
  });
4539
- var keywordUpdateSchema = z10.object({
4585
+ var keywordUpdateSchema = z11.object({
4540
4586
  cpcBidMicros: microsSchema.optional(),
4541
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4542
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4587
+ finalUrls: z11.array(httpsUrlSchema2).optional(),
4588
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4543
4589
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4544
- var negativeKeywordAddSchema = z10.object({
4545
- level: z10.enum(["adGroup", "campaign"]),
4590
+ var negativeKeywordAddSchema = z11.object({
4591
+ level: z11.enum(["adGroup", "campaign"]),
4546
4592
  parent: refSchema,
4547
4593
  text: keywordTextSchema,
4548
4594
  matchType: matchTypeSchema
4549
4595
  });
4550
- var sharedSetCreateSchema = z10.object({
4551
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4552
- type: z10.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4596
+ var sharedSetCreateSchema = z11.object({
4597
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4598
+ type: z11.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4553
4599
  });
4554
- var sharedSetMemberAddSchema = z10.object({
4600
+ var sharedSetMemberAddSchema = z11.object({
4555
4601
  sharedSet: refSchema,
4556
4602
  text: keywordTextSchema,
4557
4603
  matchType: matchTypeSchema
4558
4604
  });
4559
- var campaignSharedSetAttachSchema = z10.object({
4605
+ var campaignSharedSetAttachSchema = z11.object({
4560
4606
  campaign: refSchema,
4561
4607
  sharedSet: refSchema
4562
4608
  });
4563
- var adTextAssetSchema = z10.object({
4564
- text: z10.string().min(1),
4565
- pinnedField: z10.enum(PINNED_FIELDS).optional()
4609
+ var adTextAssetSchema = z11.object({
4610
+ text: z11.string().min(1),
4611
+ pinnedField: z11.enum(PINNED_FIELDS).optional()
4566
4612
  });
4567
- var responsiveSearchAdSchema = z10.object({
4568
- format: z10.literal("responsiveSearch"),
4569
- headlines: z10.array(
4613
+ var responsiveSearchAdSchema = z11.object({
4614
+ format: z11.literal("responsiveSearch"),
4615
+ headlines: z11.array(
4570
4616
  adTextAssetSchema.refine(
4571
4617
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4572
4618
  "headline exceeds 30 chars"
4573
4619
  )
4574
4620
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4575
- descriptions: z10.array(
4621
+ descriptions: z11.array(
4576
4622
  adTextAssetSchema.refine(
4577
4623
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4578
4624
  "description exceeds 90 chars"
4579
4625
  )
4580
4626
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4581
- path1: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4582
- path2: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4583
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4584
- });
4585
- var responsiveDisplayAdSchema = z10.object({
4586
- format: z10.literal("responsiveDisplay"),
4587
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4588
- longHeadline: z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4589
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4590
- businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4627
+ path1: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4628
+ path2: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4629
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4630
+ });
4631
+ var responsiveDisplayAdSchema = z11.object({
4632
+ format: z11.literal("responsiveDisplay"),
4633
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4634
+ longHeadline: z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4635
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4636
+ businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4591
4637
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4592
4638
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4593
4639
  // image (1:1) to serve; the logo images are optional.
4594
- marketingImageAssets: z10.array(refSchema).optional(),
4595
- squareMarketingImageAssets: z10.array(refSchema).optional(),
4596
- logoImageAssets: z10.array(refSchema).optional(),
4597
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4598
- });
4599
- var callAdSchema = z10.object({
4600
- format: z10.literal("call"),
4601
- countryCode: z10.string().length(2),
4602
- phoneNumber: z10.string().min(3),
4603
- headline1: z10.string().min(1).max(30),
4604
- headline2: z10.string().min(1).max(30),
4605
- description1: z10.string().min(1).max(90),
4606
- description2: z10.string().min(1).max(90),
4607
- businessName: z10.string().min(1).max(25),
4608
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4609
- });
4610
- var appAdSchema = z10.object({
4611
- format: z10.literal("app"),
4612
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(30) })).min(1),
4613
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1)
4614
- });
4615
- var videoAdSchema = z10.object({
4616
- format: z10.literal("video"),
4640
+ marketingImageAssets: z11.array(refSchema).optional(),
4641
+ squareMarketingImageAssets: z11.array(refSchema).optional(),
4642
+ logoImageAssets: z11.array(refSchema).optional(),
4643
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4644
+ });
4645
+ var callAdSchema = z11.object({
4646
+ format: z11.literal("call"),
4647
+ countryCode: z11.string().length(2),
4648
+ phoneNumber: z11.string().min(3),
4649
+ headline1: z11.string().min(1).max(30),
4650
+ headline2: z11.string().min(1).max(30),
4651
+ description1: z11.string().min(1).max(90),
4652
+ description2: z11.string().min(1).max(90),
4653
+ businessName: z11.string().min(1).max(25),
4654
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4655
+ });
4656
+ var appAdSchema = z11.object({
4657
+ format: z11.literal("app"),
4658
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(30) })).min(1),
4659
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1)
4660
+ });
4661
+ var videoAdSchema = z11.object({
4662
+ format: z11.literal("video"),
4617
4663
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4618
4664
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4619
- videoAssets: z10.array(refSchema).min(1),
4620
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4621
- });
4622
- var demandGenAdSchema = z10.object({
4623
- format: z10.literal("demandGen"),
4624
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(40) })).min(1).max(5),
4625
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1).max(5),
4626
- businessName: z10.string().min(1).max(25),
4627
- finalUrls: z10.array(httpsUrlSchema2).min(1),
4628
- imageAssets: z10.array(refSchema).optional(),
4629
- squareImageAssets: z10.array(refSchema).optional(),
4630
- logoImageAssets: z10.array(refSchema).optional()
4631
- });
4632
- var adContentSchema = z10.discriminatedUnion("format", [
4665
+ videoAssets: z11.array(refSchema).min(1),
4666
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4667
+ });
4668
+ var demandGenAdSchema = z11.object({
4669
+ format: z11.literal("demandGen"),
4670
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(40) })).min(1).max(5),
4671
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1).max(5),
4672
+ businessName: z11.string().min(1).max(25),
4673
+ finalUrls: z11.array(httpsUrlSchema2).min(1),
4674
+ imageAssets: z11.array(refSchema).optional(),
4675
+ squareImageAssets: z11.array(refSchema).optional(),
4676
+ logoImageAssets: z11.array(refSchema).optional()
4677
+ });
4678
+ var adContentSchema = z11.discriminatedUnion("format", [
4633
4679
  responsiveSearchAdSchema,
4634
4680
  responsiveDisplayAdSchema,
4635
4681
  callAdSchema,
@@ -4637,45 +4683,45 @@ var adContentSchema = z10.discriminatedUnion("format", [
4637
4683
  videoAdSchema,
4638
4684
  demandGenAdSchema
4639
4685
  ]);
4640
- var adCreateSchema = z10.object({
4686
+ var adCreateSchema = z11.object({
4641
4687
  adGroup: refSchema,
4642
4688
  status: stageableStatusSchema2.default("PAUSED"),
4643
4689
  content: adContentSchema
4644
4690
  });
4645
- var adUpdateSchema = z10.object({
4646
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4691
+ var adUpdateSchema = z11.object({
4692
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4647
4693
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4648
- content: z10.record(z10.string(), z10.unknown()).optional()
4694
+ content: z11.record(z11.string(), z11.unknown()).optional()
4649
4695
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4650
- var textAssetSchema = z10.object({ type: z10.literal("text"), text: z10.string().min(1) });
4651
- var imageAssetSchema = z10.object({
4652
- type: z10.literal("image"),
4653
- imageId: z10.string().min(1),
4654
- name: z10.string().optional()
4655
- });
4656
- var youtubeVideoAssetSchema = z10.object({
4657
- type: z10.literal("youtubeVideo"),
4658
- youtubeVideoId: z10.string().min(1),
4659
- name: z10.string().optional()
4660
- });
4661
- var sitelinkAssetSchema = z10.object({
4662
- type: z10.literal("sitelink"),
4663
- linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4664
- description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4665
- description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4666
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4667
- });
4668
- var calloutAssetSchema = z10.object({
4669
- type: z10.literal("callout"),
4670
- calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4671
- });
4672
- var structuredSnippetAssetSchema = z10.object({
4673
- type: z10.literal("structuredSnippet"),
4674
- header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4675
- values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4676
- });
4677
- var callToActionAssetSchema = z10.object({ type: z10.literal("callToAction"), callToAction: z10.string().min(1) });
4678
- var assetCreateSchema = z10.discriminatedUnion("type", [
4696
+ var textAssetSchema = z11.object({ type: z11.literal("text"), text: z11.string().min(1) });
4697
+ var imageAssetSchema = z11.object({
4698
+ type: z11.literal("image"),
4699
+ imageId: z11.string().min(1),
4700
+ name: z11.string().optional()
4701
+ });
4702
+ var youtubeVideoAssetSchema = z11.object({
4703
+ type: z11.literal("youtubeVideo"),
4704
+ youtubeVideoId: z11.string().min(1),
4705
+ name: z11.string().optional()
4706
+ });
4707
+ var sitelinkAssetSchema = z11.object({
4708
+ type: z11.literal("sitelink"),
4709
+ linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4710
+ description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4711
+ description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4712
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4713
+ });
4714
+ var calloutAssetSchema = z11.object({
4715
+ type: z11.literal("callout"),
4716
+ calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4717
+ });
4718
+ var structuredSnippetAssetSchema = z11.object({
4719
+ type: z11.literal("structuredSnippet"),
4720
+ header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4721
+ values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4722
+ });
4723
+ var callToActionAssetSchema = z11.object({ type: z11.literal("callToAction"), callToAction: z11.string().min(1) });
4724
+ var assetCreateSchema = z11.discriminatedUnion("type", [
4679
4725
  textAssetSchema,
4680
4726
  imageAssetSchema,
4681
4727
  youtubeVideoAssetSchema,
@@ -4684,136 +4730,136 @@ var assetCreateSchema = z10.discriminatedUnion("type", [
4684
4730
  structuredSnippetAssetSchema,
4685
4731
  callToActionAssetSchema
4686
4732
  ]);
4687
- var assetUpdateSchema = z10.object({
4688
- name: z10.string().min(1).optional(),
4689
- linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4690
- description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4691
- description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4692
- finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
4693
- calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4694
- header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4695
- values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4696
- callToAction: z10.string().min(1).optional(),
4697
- text: z10.string().min(1).optional()
4733
+ var assetUpdateSchema = z11.object({
4734
+ name: z11.string().min(1).optional(),
4735
+ linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4736
+ description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4737
+ description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4738
+ finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4739
+ calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4740
+ header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4741
+ values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4742
+ callToAction: z11.string().min(1).optional(),
4743
+ text: z11.string().min(1).optional()
4698
4744
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4699
- var assetLinkAttachSchema = z10.object({
4700
- level: z10.enum(["campaign", "adGroup", "customer"]),
4745
+ var assetLinkAttachSchema = z11.object({
4746
+ level: z11.enum(["campaign", "adGroup", "customer"]),
4701
4747
  parent: refSchema.optional(),
4702
4748
  asset: refSchema,
4703
- fieldType: z10.enum(ASSET_FIELD_TYPES)
4749
+ fieldType: z11.enum(ASSET_FIELD_TYPES)
4704
4750
  }).superRefine((value, ctx) => {
4705
4751
  if (value.level !== "customer" && !value.parent) {
4706
4752
  ctx.addIssue({
4707
- code: z10.ZodIssueCode.custom,
4753
+ code: z11.ZodIssueCode.custom,
4708
4754
  path: ["parent"],
4709
4755
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4710
4756
  });
4711
4757
  }
4712
4758
  });
4713
- var assetGroupCreateSchema = z10.object({
4759
+ var assetGroupCreateSchema = z11.object({
4714
4760
  campaign: refSchema,
4715
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4716
- finalUrls: z10.array(httpsUrlSchema2).min(1),
4717
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4718
- longHeadlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4719
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4720
- businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4721
- imageAssets: z10.array(refSchema).optional(),
4722
- squareImageAssets: z10.array(refSchema).optional(),
4723
- logoAssets: z10.array(refSchema).optional(),
4724
- status: z10.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4725
- });
4726
- var assetGroupUpdateSchema = z10.object({
4727
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4728
- finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
4729
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4761
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4762
+ finalUrls: z11.array(httpsUrlSchema2).min(1),
4763
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4764
+ longHeadlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4765
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4766
+ businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4767
+ imageAssets: z11.array(refSchema).optional(),
4768
+ squareImageAssets: z11.array(refSchema).optional(),
4769
+ logoAssets: z11.array(refSchema).optional(),
4770
+ status: z11.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4771
+ });
4772
+ var assetGroupUpdateSchema = z11.object({
4773
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4774
+ finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4775
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4730
4776
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4731
- var audienceCreateSchema2 = z10.object({
4732
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4733
- type: z10.enum(USER_LIST_TYPES).default("BASIC"),
4734
- description: z10.string().optional(),
4777
+ var audienceCreateSchema2 = z11.object({
4778
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4779
+ type: z11.enum(USER_LIST_TYPES).default("BASIC"),
4780
+ description: z11.string().optional(),
4735
4781
  /** Customer-match members (crm-based) — file-first for large lists. */
4736
- members: z10.array(z10.record(z10.string(), z10.string())).optional(),
4737
- sourceFileRef: z10.string().optional()
4782
+ members: z11.array(z11.record(z11.string(), z11.string())).optional(),
4783
+ sourceFileRef: z11.string().optional()
4738
4784
  });
4739
- var audienceCriterionAttachSchema = z10.object({
4740
- level: z10.enum(["campaign", "adGroup"]),
4785
+ var audienceCriterionAttachSchema = z11.object({
4786
+ level: z11.enum(["campaign", "adGroup"]),
4741
4787
  parent: refSchema,
4742
4788
  userList: refSchema,
4743
- negative: z10.boolean().default(false)
4789
+ negative: z11.boolean().default(false)
4744
4790
  });
4745
- var conversionActionCreateSchema = z10.object({
4746
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4747
- type: z10.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4748
- category: z10.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4749
- countingType: z10.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4791
+ var conversionActionCreateSchema = z11.object({
4792
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4793
+ type: z11.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4794
+ category: z11.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4795
+ countingType: z11.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4750
4796
  defaultValueMicros: microsSchema.optional(),
4751
- defaultCurrencyCode: z10.string().length(3).optional(),
4752
- clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
4753
- viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
4754
- status: z10.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4755
- });
4756
- var conversionActionUpdateSchema = z10.object({
4757
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4758
- category: z10.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4759
- countingType: z10.enum(CONVERSION_COUNTING_TYPES).optional(),
4797
+ defaultCurrencyCode: z11.string().length(3).optional(),
4798
+ clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4799
+ viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4800
+ status: z11.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4801
+ });
4802
+ var conversionActionUpdateSchema = z11.object({
4803
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4804
+ category: z11.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4805
+ countingType: z11.enum(CONVERSION_COUNTING_TYPES).optional(),
4760
4806
  defaultValueMicros: microsSchema.optional(),
4761
- defaultCurrencyCode: z10.string().length(3).optional(),
4762
- clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
4763
- viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
4764
- status: z10.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4807
+ defaultCurrencyCode: z11.string().length(3).optional(),
4808
+ clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4809
+ viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4810
+ status: z11.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4765
4811
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4766
- var biddingStrategyCreateSchema = z10.object({
4767
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4812
+ var biddingStrategyCreateSchema = z11.object({
4813
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4768
4814
  config: biddingConfigSchema
4769
4815
  }).superRefine((p, ctx) => {
4770
4816
  if (p.config.type === "MANUAL_CPC") {
4771
4817
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4772
4818
  }
4773
4819
  });
4774
- var biddingStrategyUpdateSchema = z10.object({
4775
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4820
+ var biddingStrategyUpdateSchema = z11.object({
4821
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4776
4822
  config: biddingConfigSchema.optional()
4777
4823
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4778
- var labelCreateSchema = z10.object({
4779
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4780
- backgroundColor: z10.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4781
- description: z10.string().optional()
4824
+ var labelCreateSchema = z11.object({
4825
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4826
+ backgroundColor: z11.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4827
+ description: z11.string().optional()
4782
4828
  });
4783
- var labelAttachSchema = z10.object({
4784
- level: z10.enum(["campaign", "adGroup", "ad"]),
4829
+ var labelAttachSchema = z11.object({
4830
+ level: z11.enum(["campaign", "adGroup", "ad"]),
4785
4831
  parent: refSchema,
4786
4832
  label: refSchema
4787
4833
  });
4788
- var locationCriterionSchema = z10.object({
4789
- criterionType: z10.literal("location"),
4790
- geoTargetConstant: z10.union([z10.string().regex(GEO_TARGET_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
4791
- });
4792
- var languageCriterionSchema = z10.object({
4793
- criterionType: z10.literal("language"),
4794
- languageConstant: z10.union([z10.string().regex(LANGUAGE_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
4795
- });
4796
- var adScheduleCriterionSchema = z10.object({
4797
- criterionType: z10.literal("adSchedule"),
4798
- dayOfWeek: z10.enum(DAYS_OF_WEEK),
4799
- startHour: z10.number().int().min(0).max(23),
4800
- startMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4801
- endHour: z10.number().int().min(0).max(24),
4802
- endMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4803
- });
4804
- var deviceCriterionSchema = z10.object({
4805
- criterionType: z10.literal("device"),
4806
- device: z10.enum(DEVICE_TYPES),
4834
+ var locationCriterionSchema = z11.object({
4835
+ criterionType: z11.literal("location"),
4836
+ geoTargetConstant: z11.union([z11.string().regex(GEO_TARGET_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4837
+ });
4838
+ var languageCriterionSchema = z11.object({
4839
+ criterionType: z11.literal("language"),
4840
+ languageConstant: z11.union([z11.string().regex(LANGUAGE_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4841
+ });
4842
+ var adScheduleCriterionSchema = z11.object({
4843
+ criterionType: z11.literal("adSchedule"),
4844
+ dayOfWeek: z11.enum(DAYS_OF_WEEK),
4845
+ startHour: z11.number().int().min(0).max(23),
4846
+ startMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4847
+ endHour: z11.number().int().min(0).max(24),
4848
+ endMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4849
+ });
4850
+ var deviceCriterionSchema = z11.object({
4851
+ criterionType: z11.literal("device"),
4852
+ device: z11.enum(DEVICE_TYPES),
4807
4853
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4808
4854
  // to opt out of a Device type." So 0 (exclude the device) and 0.1–10.0 are valid; the (0, 0.1) gap is not.
4809
- bidModifier: z10.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4855
+ bidModifier: z11.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4810
4856
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4811
4857
  })
4812
4858
  });
4813
- var campaignCriterionAddSchema = z10.object({
4859
+ var campaignCriterionAddSchema = z11.object({
4814
4860
  campaign: refSchema,
4815
- negative: z10.boolean().default(false),
4816
- criterion: z10.discriminatedUnion("criterionType", [
4861
+ negative: z11.boolean().default(false),
4862
+ criterion: z11.discriminatedUnion("criterionType", [
4817
4863
  locationCriterionSchema,
4818
4864
  languageCriterionSchema,
4819
4865
  adScheduleCriterionSchema,
@@ -4823,7 +4869,7 @@ var campaignCriterionAddSchema = z10.object({
4823
4869
  const c = val.criterion;
4824
4870
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4825
4871
  ctx.addIssue({
4826
- code: z10.ZodIssueCode.custom,
4872
+ code: z11.ZodIssueCode.custom,
4827
4873
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4828
4874
  path: ["criterion", "endMinute"]
4829
4875
  });
@@ -4875,17 +4921,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4875
4921
  "google.campaignCriterion.add",
4876
4922
  "google.campaignCriterion.remove"
4877
4923
  ];
4878
- var googleDraftOpKindSchema = z10.enum(GOOGLE_DRAFT_OP_KINDS);
4924
+ var googleDraftOpKindSchema = z11.enum(GOOGLE_DRAFT_OP_KINDS);
4879
4925
  function createOp2(kind, payload) {
4880
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, payload });
4926
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, payload });
4881
4927
  }
4882
4928
  function updateOp2(kind, payload) {
4883
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4929
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4884
4930
  }
4885
4931
  function targetOp(kind) {
4886
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4932
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4887
4933
  }
4888
- var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4934
+ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
4889
4935
  createOp2("google.budget.create", budgetCreateSchema),
4890
4936
  updateOp2("google.budget.update", budgetUpdateSchema),
4891
4937
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4933,132 +4979,132 @@ var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4933
4979
  ]);
4934
4980
 
4935
4981
  // ../api/src/ads-google/wire.ts
4936
- import { z as z11 } from "zod";
4937
- var googleWriteModeSchema = z11.enum(["live", "simulated"]);
4938
- var googleDraftOpResultSchema = z11.object({
4939
- status: z11.enum(["applied", "simulated", "failed", "skipped"]),
4940
- resourceName: z11.string().optional(),
4941
- error: z11.string().optional(),
4942
- skippedBecause: z11.string().optional(),
4943
- executedAt: z11.number().optional()
4944
- });
4945
- var googleDraftStageRequestSchema = z11.object({
4946
- chatId: z11.string(),
4982
+ import { z as z12 } from "zod";
4983
+ var googleWriteModeSchema = z12.enum(["live", "simulated"]);
4984
+ var googleDraftOpResultSchema = z12.object({
4985
+ status: z12.enum(["applied", "simulated", "failed", "skipped"]),
4986
+ resourceName: z12.string().optional(),
4987
+ error: z12.string().optional(),
4988
+ skippedBecause: z12.string().optional(),
4989
+ executedAt: z12.number().optional()
4990
+ });
4991
+ var googleDraftStageRequestSchema = z12.object({
4992
+ chatId: z12.string(),
4947
4993
  op: googleDraftOpInputSchema
4948
4994
  });
4949
- var googleDraftStageResponseSchema = z11.object({
4950
- staged: z11.literal(true),
4951
- ref: z11.string(),
4995
+ var googleDraftStageResponseSchema = z12.object({
4996
+ staged: z12.literal(true),
4997
+ ref: z12.string(),
4952
4998
  kind: googleDraftOpKindSchema,
4953
4999
  mode: googleWriteModeSchema,
4954
- dependsOn: z11.array(z11.string()),
4955
- summary: z11.string(),
4956
- warnings: z11.array(z11.string()),
5000
+ dependsOn: z12.array(z12.string()),
5001
+ summary: z12.string(),
5002
+ warnings: z12.array(z12.string()),
4957
5003
  /** True when the op amended an already-staged op in place instead of appending a new one. */
4958
- amended: z11.boolean().optional()
5004
+ amended: z12.boolean().optional()
4959
5005
  });
4960
- var googleDraftAmendRequestSchema = z11.object({
4961
- chatId: z11.string(),
4962
- ref: z11.string(),
4963
- patch: z11.record(z11.string(), z11.unknown())
5006
+ var googleDraftAmendRequestSchema = z12.object({
5007
+ chatId: z12.string(),
5008
+ ref: z12.string(),
5009
+ patch: z12.record(z12.string(), z12.unknown())
4964
5010
  });
4965
- var googleDraftShowRequestSchema = z11.object({
4966
- chatId: z11.string(),
4967
- ref: z11.string()
5011
+ var googleDraftShowRequestSchema = z12.object({
5012
+ chatId: z12.string(),
5013
+ ref: z12.string()
4968
5014
  });
4969
5015
  var GOOGLE_DRAFT_BATCH_MAX = 500;
4970
- var googleDraftStageBatchRequestSchema = z11.object({
4971
- chatId: z11.string(),
4972
- ops: z11.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
5016
+ var googleDraftStageBatchRequestSchema = z12.object({
5017
+ chatId: z12.string(),
5018
+ ops: z12.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4973
5019
  });
4974
- var googleDraftStageBatchResponseSchema = z11.object({
4975
- staged: z11.literal(true),
5020
+ var googleDraftStageBatchResponseSchema = z12.object({
5021
+ staged: z12.literal(true),
4976
5022
  mode: googleWriteModeSchema,
4977
- count: z11.number(),
4978
- ops: z11.array(
4979
- z11.object({
4980
- ref: z11.string(),
5023
+ count: z12.number(),
5024
+ ops: z12.array(
5025
+ z12.object({
5026
+ ref: z12.string(),
4981
5027
  kind: googleDraftOpKindSchema,
4982
- dependsOn: z11.array(z11.string()),
4983
- summary: z11.string(),
4984
- warnings: z11.array(z11.string())
5028
+ dependsOn: z12.array(z12.string()),
5029
+ summary: z12.string(),
5030
+ warnings: z12.array(z12.string())
4985
5031
  })
4986
5032
  )
4987
5033
  });
4988
- var googleDraftOpViewSchema = z11.object({
4989
- ref: z11.string(),
5034
+ var googleDraftOpViewSchema = z12.object({
5035
+ ref: z12.string(),
4990
5036
  kind: googleDraftOpKindSchema,
4991
- customerId: z11.string(),
4992
- target: z11.string().optional(),
4993
- dependsOn: z11.array(z11.string()),
4994
- summary: z11.string(),
4995
- stagedAt: z11.number(),
5037
+ customerId: z12.string(),
5038
+ target: z12.string().optional(),
5039
+ dependsOn: z12.array(z12.string()),
5040
+ summary: z12.string(),
5041
+ stagedAt: z12.number(),
4996
5042
  result: googleDraftOpResultSchema.optional()
4997
5043
  });
4998
- var googleDraftShowResponseSchema = z11.object({
5044
+ var googleDraftShowResponseSchema = z12.object({
4999
5045
  op: googleDraftOpViewSchema.extend({
5000
- payload: z11.unknown().optional(),
5001
- warnings: z11.array(z11.string()).optional(),
5002
- annotations: z11.unknown().optional()
5046
+ payload: z12.unknown().optional(),
5047
+ warnings: z12.array(z12.string()).optional(),
5048
+ annotations: z12.unknown().optional()
5003
5049
  })
5004
5050
  });
5005
- var googleDraftListRequestSchema = z11.object({
5006
- chatId: z11.string()
5051
+ var googleDraftListRequestSchema = z12.object({
5052
+ chatId: z12.string()
5007
5053
  });
5008
- var googleDraftAdvisorySchema = z11.object({
5009
- scope: z11.enum(["campaign", "adGroup"]),
5010
- message: z11.string()
5054
+ var googleDraftAdvisorySchema = z12.object({
5055
+ scope: z12.enum(["campaign", "adGroup"]),
5056
+ message: z12.string()
5011
5057
  });
5012
- var googleDraftStatusCollectionSchema = z11.object({
5013
- label: z11.string(),
5014
- added: z11.number(),
5015
- removed: z11.number(),
5016
- existing: z11.number()
5058
+ var googleDraftStatusCollectionSchema = z12.object({
5059
+ label: z12.string(),
5060
+ added: z12.number(),
5061
+ removed: z12.number(),
5062
+ existing: z12.number()
5017
5063
  });
5018
- var googleDraftChangeOperationSchema = z11.enum(["create", "update", "pause", "resume", "remove"]);
5019
- var googleDraftStatusNodeSchema = z11.lazy(
5020
- () => z11.object({
5021
- entity: z11.string(),
5022
- name: z11.string(),
5064
+ var googleDraftChangeOperationSchema = z12.enum(["create", "update", "pause", "resume", "remove"]);
5065
+ var googleDraftStatusNodeSchema = z12.lazy(
5066
+ () => z12.object({
5067
+ entity: z12.string(),
5068
+ name: z12.string(),
5023
5069
  operation: googleDraftChangeOperationSchema.optional(),
5024
- existing: z11.boolean(),
5025
- collections: z11.array(googleDraftStatusCollectionSchema),
5026
- children: z11.array(googleDraftStatusNodeSchema),
5027
- warnings: z11.array(z11.string()).optional()
5070
+ existing: z12.boolean(),
5071
+ collections: z12.array(googleDraftStatusCollectionSchema),
5072
+ children: z12.array(googleDraftStatusNodeSchema),
5073
+ warnings: z12.array(z12.string()).optional()
5028
5074
  })
5029
5075
  );
5030
- var googleDraftListResponseSchema = z11.object({
5031
- status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
5076
+ var googleDraftListResponseSchema = z12.object({
5077
+ status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
5032
5078
  mode: googleWriteModeSchema,
5033
- count: z11.number(),
5034
- ops: z11.array(googleDraftOpViewSchema),
5079
+ count: z12.number(),
5080
+ ops: z12.array(googleDraftOpViewSchema),
5035
5081
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5036
- tree: z11.array(googleDraftStatusNodeSchema).optional(),
5082
+ tree: z12.array(googleDraftStatusNodeSchema).optional(),
5037
5083
  /** Non-blocking completeness advisories for the whole draft. */
5038
- advisories: z11.array(googleDraftAdvisorySchema).optional()
5084
+ advisories: z12.array(googleDraftAdvisorySchema).optional()
5039
5085
  });
5040
- var googleDraftRemoveRequestSchema = z11.object({
5041
- chatId: z11.string(),
5042
- ref: z11.string()
5086
+ var googleDraftRemoveRequestSchema = z12.object({
5087
+ chatId: z12.string(),
5088
+ ref: z12.string()
5043
5089
  });
5044
- var googleDraftRemoveResponseSchema = z11.object({
5090
+ var googleDraftRemoveResponseSchema = z12.object({
5045
5091
  /** The requested ref plus any dependents removed by cascade. */
5046
- removed: z11.array(z11.string())
5092
+ removed: z12.array(z12.string())
5047
5093
  });
5048
- var googleDraftClearRequestSchema = z11.object({
5049
- chatId: z11.string()
5094
+ var googleDraftClearRequestSchema = z12.object({
5095
+ chatId: z12.string()
5050
5096
  });
5051
- var googleDraftClearResponseSchema = z11.object({
5052
- cleared: z11.number()
5097
+ var googleDraftClearResponseSchema = z12.object({
5098
+ cleared: z12.number()
5053
5099
  });
5054
- var googleFieldErrorSchema = z11.object({
5055
- path: z11.string(),
5056
- message: z11.string()
5100
+ var googleFieldErrorSchema = z12.object({
5101
+ path: z12.string(),
5102
+ message: z12.string()
5057
5103
  });
5058
- var googleDraftErrorResponseSchema = z11.object({
5059
- code: z11.string(),
5060
- error: z11.string(),
5061
- fields: z11.array(googleFieldErrorSchema).optional()
5104
+ var googleDraftErrorResponseSchema = z12.object({
5105
+ code: z12.string(),
5106
+ error: z12.string(),
5107
+ fields: z12.array(googleFieldErrorSchema).optional()
5062
5108
  });
5063
5109
 
5064
5110
  // src/commands/ads/google/draft-status.ts
@@ -11101,17 +11147,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11101
11147
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11102
11148
 
11103
11149
  // ../api/src/ads-meta/ops.ts
11104
- import { z as z12 } from "zod";
11105
- var tempRefSchema3 = z12.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11106
- var parentRefSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11107
- var moneySchema2 = z12.object({
11108
- amount: z12.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11109
- currencyCode: z12.string().length(3).optional()
11110
- });
11111
- var httpsUrlSchema3 = z12.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11112
- var bakerMediaIdSchema2 = z12.string().min(1);
11113
- var stageableStatusSchema3 = z12.enum(STAGEABLE_CREATE_STATUSES3);
11114
- var updateStatusSchema = z12.enum(UPDATE_STATUSES);
11150
+ import { z as z13 } from "zod";
11151
+ var tempRefSchema3 = z13.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11152
+ var parentRefSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11153
+ var moneySchema2 = z13.object({
11154
+ amount: z13.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11155
+ currencyCode: z13.string().length(3).optional()
11156
+ });
11157
+ var httpsUrlSchema3 = z13.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11158
+ var bakerMediaIdSchema2 = z13.string().min(1);
11159
+ var stageableStatusSchema3 = z13.enum(STAGEABLE_CREATE_STATUSES3);
11160
+ var updateStatusSchema = z13.enum(UPDATE_STATUSES);
11115
11161
  function currencyMinimums2(currencyCode) {
11116
11162
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11117
11163
  }
@@ -11123,50 +11169,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
11123
11169
  }
11124
11170
  }
11125
11171
  }
11126
- var geoLocationsSchema = z12.object({
11127
- countries: z12.array(z12.string().length(2)).optional(),
11128
- regions: z12.array(z12.object({ key: z12.string() })).optional(),
11129
- cities: z12.array(z12.object({ key: z12.string(), radius: z12.number().optional(), distance_unit: z12.string().optional() })).optional(),
11130
- zips: z12.array(z12.object({ key: z12.string() })).optional(),
11131
- location_types: z12.array(z12.string()).optional()
11132
- }).catchall(z12.unknown());
11133
- var idNameSchema = z12.object({ id: z12.string(), name: z12.string().optional() });
11134
- var metaTargetingSchema = z12.object({
11172
+ var geoLocationsSchema = z13.object({
11173
+ countries: z13.array(z13.string().length(2)).optional(),
11174
+ regions: z13.array(z13.object({ key: z13.string() })).optional(),
11175
+ cities: z13.array(z13.object({ key: z13.string(), radius: z13.number().optional(), distance_unit: z13.string().optional() })).optional(),
11176
+ zips: z13.array(z13.object({ key: z13.string() })).optional(),
11177
+ location_types: z13.array(z13.string()).optional()
11178
+ }).catchall(z13.unknown());
11179
+ var idNameSchema = z13.object({ id: z13.string(), name: z13.string().optional() });
11180
+ var metaTargetingSchema = z13.object({
11135
11181
  geo_locations: geoLocationsSchema.optional(),
11136
11182
  excluded_geo_locations: geoLocationsSchema.optional(),
11137
- age_min: z12.number().int().min(13).max(65).optional(),
11138
- age_max: z12.number().int().min(13).max(65).optional(),
11139
- genders: z12.array(z12.union([z12.literal(1), z12.literal(2)])).optional(),
11140
- locales: z12.array(z12.number().int()).optional(),
11141
- interests: z12.array(idNameSchema).optional(),
11142
- behaviors: z12.array(idNameSchema).optional(),
11143
- custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
11144
- excluded_custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
11145
- flexible_spec: z12.array(z12.record(z12.string(), z12.unknown())).optional(),
11146
- exclusions: z12.record(z12.string(), z12.unknown()).optional(),
11147
- publisher_platforms: z12.array(z12.string()).optional(),
11148
- facebook_positions: z12.array(z12.string()).optional(),
11149
- instagram_positions: z12.array(z12.string()).optional(),
11150
- audience_network_positions: z12.array(z12.string()).optional(),
11151
- messenger_positions: z12.array(z12.string()).optional(),
11152
- device_platforms: z12.array(z12.string()).optional(),
11153
- targeting_automation: z12.object({ advantage_audience: z12.union([z12.literal(0), z12.literal(1)]) }).partial().optional()
11154
- }).catchall(z12.unknown());
11155
- var specialAdCategoriesSchema = z12.array(z12.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11156
- var campaignCreateSchema3 = z12.object({
11157
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax),
11158
- objective: z12.enum(OBJECTIVES),
11183
+ age_min: z13.number().int().min(13).max(65).optional(),
11184
+ age_max: z13.number().int().min(13).max(65).optional(),
11185
+ genders: z13.array(z13.union([z13.literal(1), z13.literal(2)])).optional(),
11186
+ locales: z13.array(z13.number().int()).optional(),
11187
+ interests: z13.array(idNameSchema).optional(),
11188
+ behaviors: z13.array(idNameSchema).optional(),
11189
+ custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11190
+ excluded_custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11191
+ flexible_spec: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
11192
+ exclusions: z13.record(z13.string(), z13.unknown()).optional(),
11193
+ publisher_platforms: z13.array(z13.string()).optional(),
11194
+ facebook_positions: z13.array(z13.string()).optional(),
11195
+ instagram_positions: z13.array(z13.string()).optional(),
11196
+ audience_network_positions: z13.array(z13.string()).optional(),
11197
+ messenger_positions: z13.array(z13.string()).optional(),
11198
+ device_platforms: z13.array(z13.string()).optional(),
11199
+ targeting_automation: z13.object({ advantage_audience: z13.union([z13.literal(0), z13.literal(1)]) }).partial().optional()
11200
+ }).catchall(z13.unknown());
11201
+ var specialAdCategoriesSchema = z13.array(z13.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11202
+ var campaignCreateSchema3 = z13.object({
11203
+ name: z13.string().min(1).max(META_LIMITS.campaign.nameMax),
11204
+ objective: z13.enum(OBJECTIVES),
11159
11205
  status: stageableStatusSchema3.default("PAUSED"),
11160
11206
  special_ad_categories: specialAdCategoriesSchema,
11161
- special_ad_category_country: z12.array(z12.string().length(2)).optional(),
11162
- buying_type: z12.enum(BUYING_TYPES).default("AUCTION"),
11163
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11207
+ special_ad_category_country: z13.array(z13.string().length(2)).optional(),
11208
+ buying_type: z13.enum(BUYING_TYPES).default("AUCTION"),
11209
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11164
11210
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11165
11211
  dailyBudget: moneySchema2.optional(),
11166
11212
  lifetimeBudget: moneySchema2.optional(),
11167
11213
  spendCap: moneySchema2.optional(),
11168
- start_time: z12.number().int().positive().optional(),
11169
- stop_time: z12.number().int().positive().optional()
11214
+ start_time: z13.number().int().positive().optional(),
11215
+ stop_time: z13.number().int().positive().optional()
11170
11216
  }).superRefine((p, ctx) => {
11171
11217
  if (p.dailyBudget && p.lifetimeBudget) {
11172
11218
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11176,15 +11222,15 @@ var campaignCreateSchema3 = z12.object({
11176
11222
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11177
11223
  }
11178
11224
  });
11179
- var campaignUpdateSchema3 = z12.object({
11180
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11225
+ var campaignUpdateSchema3 = z13.object({
11226
+ name: z13.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11181
11227
  status: updateStatusSchema.optional(),
11182
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11228
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11183
11229
  dailyBudget: moneySchema2.optional(),
11184
11230
  lifetimeBudget: moneySchema2.optional(),
11185
11231
  spendCap: moneySchema2.optional(),
11186
- start_time: z12.number().int().positive().optional(),
11187
- stop_time: z12.number().int().positive().optional()
11232
+ start_time: z13.number().int().positive().optional(),
11233
+ stop_time: z13.number().int().positive().optional()
11188
11234
  }).superRefine((p, ctx) => {
11189
11235
  if (!Object.values(p).some((val) => val !== void 0)) {
11190
11236
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11194,38 +11240,38 @@ var campaignUpdateSchema3 = z12.object({
11194
11240
  }
11195
11241
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11196
11242
  });
11197
- var promotedObjectSchema = z12.object({
11243
+ var promotedObjectSchema = z13.object({
11198
11244
  page_id: parentRefSchema2.optional(),
11199
- pixel_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11200
- custom_event_type: z12.enum(CUSTOM_EVENT_TYPES).optional(),
11201
- application_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11202
- object_store_url: z12.string().url().optional(),
11203
- product_catalog_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11204
- product_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11205
- whatsapp_phone_number: z12.string().optional(),
11206
- offline_conversion_data_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional()
11245
+ pixel_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11246
+ custom_event_type: z13.enum(CUSTOM_EVENT_TYPES).optional(),
11247
+ application_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11248
+ object_store_url: z13.string().url().optional(),
11249
+ product_catalog_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11250
+ product_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11251
+ whatsapp_phone_number: z13.string().optional(),
11252
+ offline_conversion_data_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional()
11207
11253
  }).partial();
11208
- var attributionSpecSchema = z12.array(
11209
- z12.object({
11210
- event_type: z12.enum(ATTRIBUTION_EVENT_TYPES),
11211
- window_days: z12.union([z12.literal(1), z12.literal(7), z12.literal(28)])
11254
+ var attributionSpecSchema = z13.array(
11255
+ z13.object({
11256
+ event_type: z13.enum(ATTRIBUTION_EVENT_TYPES),
11257
+ window_days: z13.union([z13.literal(1), z13.literal(7), z13.literal(28)])
11212
11258
  })
11213
11259
  );
11214
11260
  var adSetFields = {
11215
- name: z12.string().min(1).max(META_LIMITS.adSet.nameMax),
11261
+ name: z13.string().min(1).max(META_LIMITS.adSet.nameMax),
11216
11262
  campaign_id: parentRefSchema2,
11217
11263
  status: stageableStatusSchema3.default("PAUSED"),
11218
11264
  dailyBudget: moneySchema2.optional(),
11219
11265
  lifetimeBudget: moneySchema2.optional(),
11220
11266
  bidAmount: moneySchema2.optional(),
11221
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11222
- billing_event: z12.enum(BILLING_EVENTS),
11223
- optimization_goal: z12.enum(OPTIMIZATION_GOALS),
11224
- destination_type: z12.enum(DESTINATION_TYPES).optional(),
11267
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11268
+ billing_event: z13.enum(BILLING_EVENTS),
11269
+ optimization_goal: z13.enum(OPTIMIZATION_GOALS),
11270
+ destination_type: z13.enum(DESTINATION_TYPES).optional(),
11225
11271
  promoted_object: promotedObjectSchema.optional(),
11226
11272
  attribution_spec: attributionSpecSchema.optional(),
11227
- start_time: z12.number().int().positive().optional(),
11228
- end_time: z12.number().int().positive().optional(),
11273
+ start_time: z13.number().int().positive().optional(),
11274
+ end_time: z13.number().int().positive().optional(),
11229
11275
  targeting: metaTargetingSchema
11230
11276
  };
11231
11277
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11243,22 +11289,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11243
11289
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11244
11290
  }
11245
11291
  }
11246
- var adSetCreateSchema = z12.object(adSetFields).superRefine((p, ctx) => {
11292
+ var adSetCreateSchema = z13.object(adSetFields).superRefine((p, ctx) => {
11247
11293
  validateAdSetBudgetAndBid(p, ctx);
11248
11294
  });
11249
- var adSetUpdateSchema = z12.object({
11295
+ var adSetUpdateSchema = z13.object({
11250
11296
  name: adSetFields.name.optional(),
11251
11297
  status: updateStatusSchema.optional(),
11252
11298
  dailyBudget: moneySchema2.optional(),
11253
11299
  lifetimeBudget: moneySchema2.optional(),
11254
11300
  bidAmount: moneySchema2.optional(),
11255
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11256
- optimization_goal: z12.enum(OPTIMIZATION_GOALS).optional(),
11257
- destination_type: z12.enum(DESTINATION_TYPES).optional(),
11301
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11302
+ optimization_goal: z13.enum(OPTIMIZATION_GOALS).optional(),
11303
+ destination_type: z13.enum(DESTINATION_TYPES).optional(),
11258
11304
  promoted_object: promotedObjectSchema.optional(),
11259
11305
  attribution_spec: attributionSpecSchema.optional(),
11260
- start_time: z12.number().int().positive().optional(),
11261
- end_time: z12.number().int().positive().optional(),
11306
+ start_time: z13.number().int().positive().optional(),
11307
+ end_time: z13.number().int().positive().optional(),
11262
11308
  targeting: metaTargetingSchema.optional()
11263
11309
  }).superRefine((p, ctx) => {
11264
11310
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11266,38 +11312,38 @@ var adSetUpdateSchema = z12.object({
11266
11312
  }
11267
11313
  validateAdSetBudgetAndBid(p, ctx);
11268
11314
  });
11269
- var messageSchema = z12.string().min(1).max(META_LIMITS.creative.messageHardMax);
11270
- var headlineSchema2 = z12.string().min(1).max(META_LIMITS.creative.headlineMax);
11271
- var descriptionSchema = z12.string().min(1).max(META_LIMITS.creative.descriptionMax);
11272
- var callToActionSchema = z12.object({
11273
- type: z12.enum(CTA_TYPES2),
11315
+ var messageSchema = z13.string().min(1).max(META_LIMITS.creative.messageHardMax);
11316
+ var headlineSchema2 = z13.string().min(1).max(META_LIMITS.creative.headlineMax);
11317
+ var descriptionSchema = z13.string().min(1).max(META_LIMITS.creative.descriptionMax);
11318
+ var callToActionSchema = z13.object({
11319
+ type: z13.enum(CTA_TYPES2),
11274
11320
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11275
11321
  link: httpsUrlSchema3.optional()
11276
11322
  });
11277
- var creativeEnhancementsSchema = z12.object({
11278
- standardEnhancements: z12.enum(ENROLL_STATUSES).optional(),
11279
- features: z12.record(z12.string(), z12.enum(ENROLL_STATUSES)).optional()
11323
+ var creativeEnhancementsSchema = z13.object({
11324
+ standardEnhancements: z13.enum(ENROLL_STATUSES).optional(),
11325
+ features: z13.record(z13.string(), z13.enum(ENROLL_STATUSES)).optional()
11280
11326
  });
11281
11327
  var creativeSharedFields = {
11282
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11328
+ name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11283
11329
  /** Facebook Page id backing the ad's identity. */
11284
11330
  page_id: parentRefSchema2,
11285
11331
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11286
- instagram_user_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11332
+ instagram_user_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11287
11333
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11288
- url_tags: z12.string().max(1e3).optional(),
11334
+ url_tags: z13.string().max(1e3).optional(),
11289
11335
  enhancements: creativeEnhancementsSchema.optional()
11290
11336
  };
11291
11337
  var imageMediaFields = {
11292
- imageHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11338
+ imageHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11293
11339
  imageRef: tempRefSchema3.optional()
11294
11340
  };
11295
11341
  var videoMediaFields = {
11296
- videoId: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11342
+ videoId: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11297
11343
  videoRef: tempRefSchema3.optional(),
11298
11344
  /** Thumbnail for a video creative — image hash, ref, or public url. */
11299
- thumbnailHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11300
- imageUrl: z12.string().url().optional()
11345
+ thumbnailHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11346
+ imageUrl: z13.string().url().optional()
11301
11347
  };
11302
11348
  function countImageRefs(p) {
11303
11349
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11305,8 +11351,8 @@ function countImageRefs(p) {
11305
11351
  function countVideoRefs(p) {
11306
11352
  return [p.videoId, p.videoRef].filter(Boolean).length;
11307
11353
  }
11308
- var singleCreativeSchema = z12.object({
11309
- creativeType: z12.literal("single"),
11354
+ var singleCreativeSchema = z13.object({
11355
+ creativeType: z13.literal("single"),
11310
11356
  ...creativeSharedFields,
11311
11357
  /** Primary text. */
11312
11358
  message: messageSchema,
@@ -11315,7 +11361,7 @@ var singleCreativeSchema = z12.object({
11315
11361
  headline: headlineSchema2.optional(),
11316
11362
  description: descriptionSchema.optional(),
11317
11363
  /** Display URL / caption shown under the headline. */
11318
- caption: z12.string().max(255).optional(),
11364
+ caption: z13.string().max(255).optional(),
11319
11365
  call_to_action: callToActionSchema.optional(),
11320
11366
  ...imageMediaFields,
11321
11367
  ...videoMediaFields
@@ -11339,10 +11385,10 @@ var singleCreativeSchema = z12.object({
11339
11385
  });
11340
11386
  }
11341
11387
  });
11342
- var carouselCardSchema = z12.object({
11388
+ var carouselCardSchema = z13.object({
11343
11389
  link: httpsUrlSchema3,
11344
- headline: z12.string().max(META_LIMITS.creative.headlineMax).optional(),
11345
- description: z12.string().max(META_LIMITS.creative.descriptionMax).optional(),
11390
+ headline: z13.string().max(META_LIMITS.creative.headlineMax).optional(),
11391
+ description: z13.string().max(META_LIMITS.creative.descriptionMax).optional(),
11346
11392
  call_to_action: callToActionSchema.optional(),
11347
11393
  ...imageMediaFields,
11348
11394
  ...videoMediaFields
@@ -11362,35 +11408,35 @@ var carouselCardSchema = z12.object({
11362
11408
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11363
11409
  }
11364
11410
  });
11365
- var carouselCreativeSchema2 = z12.object({
11366
- creativeType: z12.literal("carousel"),
11411
+ var carouselCreativeSchema2 = z13.object({
11412
+ creativeType: z13.literal("carousel"),
11367
11413
  ...creativeSharedFields,
11368
11414
  message: messageSchema,
11369
11415
  /** Optional "see more" card destination applied when a card has no own link. */
11370
11416
  link: httpsUrlSchema3.optional(),
11371
11417
  call_to_action: callToActionSchema.optional(),
11372
- cards: z12.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11418
+ cards: z13.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11373
11419
  });
11374
- var dynamicImageSchema = z12.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11375
- var dynamicVideoSchema = z12.object({
11420
+ var dynamicImageSchema = z13.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11421
+ var dynamicVideoSchema = z13.object({
11376
11422
  videoId: videoMediaFields.videoId,
11377
11423
  videoRef: videoMediaFields.videoRef,
11378
11424
  thumbnailHash: videoMediaFields.thumbnailHash
11379
11425
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11380
11426
  var DYN = META_LIMITS.creative;
11381
- var dynamicCreativeSchema = z12.object({
11382
- creativeType: z12.literal("dynamic"),
11427
+ var dynamicCreativeSchema = z13.object({
11428
+ creativeType: z13.literal("dynamic"),
11383
11429
  ...creativeSharedFields,
11384
- bodies: z12.array(z12.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11385
- titles: z12.array(z12.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11386
- descriptions: z12.array(z12.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11387
- images: z12.array(dynamicImageSchema).optional(),
11388
- videos: z12.array(dynamicVideoSchema).optional(),
11389
- ad_formats: z12.array(z12.enum(AD_FORMATS2)).min(1),
11390
- call_to_action_types: z12.array(z12.enum(CTA_TYPES2)).optional(),
11391
- link_urls: z12.array(z12.object({ website_url: httpsUrlSchema3, display_url: z12.string().optional() })).min(1),
11430
+ bodies: z13.array(z13.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11431
+ titles: z13.array(z13.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11432
+ descriptions: z13.array(z13.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11433
+ images: z13.array(dynamicImageSchema).optional(),
11434
+ videos: z13.array(dynamicVideoSchema).optional(),
11435
+ ad_formats: z13.array(z13.enum(AD_FORMATS2)).min(1),
11436
+ call_to_action_types: z13.array(z13.enum(CTA_TYPES2)).optional(),
11437
+ link_urls: z13.array(z13.object({ website_url: httpsUrlSchema3, display_url: z13.string().optional() })).min(1),
11392
11438
  /** Multi-language / placement customization — structural passthrough for v1. */
11393
- asset_customization_rules: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11439
+ asset_customization_rules: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11394
11440
  }).superRefine((p, ctx) => {
11395
11441
  if (!(p.images?.length || p.videos?.length)) {
11396
11442
  ctx.addIssue({
@@ -11400,57 +11446,57 @@ var dynamicCreativeSchema = z12.object({
11400
11446
  });
11401
11447
  }
11402
11448
  });
11403
- var existingPostCreativeSchema = z12.object({
11404
- creativeType: z12.literal("existing_post"),
11449
+ var existingPostCreativeSchema = z13.object({
11450
+ creativeType: z13.literal("existing_post"),
11405
11451
  name: creativeSharedFields.name,
11406
11452
  /** "<page_id>_<post_id>" object story id of the post to promote. */
11407
- object_story_id: z12.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11453
+ object_story_id: z13.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11408
11454
  instagram_user_id: creativeSharedFields.instagram_user_id,
11409
11455
  url_tags: creativeSharedFields.url_tags,
11410
11456
  enhancements: creativeSharedFields.enhancements
11411
11457
  });
11412
- var creativeContentSchema2 = z12.discriminatedUnion("creativeType", [
11458
+ var creativeContentSchema2 = z13.discriminatedUnion("creativeType", [
11413
11459
  singleCreativeSchema,
11414
11460
  carouselCreativeSchema2,
11415
11461
  dynamicCreativeSchema,
11416
11462
  existingPostCreativeSchema
11417
11463
  ]);
11418
11464
  var adCreativeCreateSchema = creativeContentSchema2;
11419
- var adCreativeUpdateSchema = z12.object({
11420
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11465
+ var adCreativeUpdateSchema = z13.object({
11466
+ name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11421
11467
  status: updateStatusSchema.optional(),
11422
11468
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11423
- content: z12.record(z12.string(), z12.unknown()).optional()
11469
+ content: z13.record(z13.string(), z13.unknown()).optional()
11424
11470
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11425
- var adCreateSchema2 = z12.object({
11426
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax),
11471
+ var adCreateSchema2 = z13.object({
11472
+ name: z13.string().min(1).max(META_LIMITS.ad.nameMax),
11427
11473
  adset_id: parentRefSchema2,
11428
11474
  status: stageableStatusSchema3.default("PAUSED"),
11429
- creative: z12.object({ creative_id: parentRefSchema2 }),
11475
+ creative: z13.object({ creative_id: parentRefSchema2 }),
11430
11476
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11431
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11477
+ tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11432
11478
  });
11433
- var adUpdateSchema2 = z12.object({
11434
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11479
+ var adUpdateSchema2 = z13.object({
11480
+ name: z13.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11435
11481
  status: updateStatusSchema.optional(),
11436
11482
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
11437
- creative: z12.object({ creative_id: parentRefSchema2 }).optional(),
11438
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11483
+ creative: z13.object({ creative_id: parentRefSchema2 }).optional(),
11484
+ tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11439
11485
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11440
- var lookalikeSpecSchema = z12.object({
11441
- origin: z12.array(z12.object({ id: parentRefSchema2 })).min(1),
11442
- ratio: z12.number().min(0.01).max(0.2).optional(),
11443
- country: z12.string().length(2).optional()
11444
- });
11445
- var customAudienceCreateSchema = z12.object({
11446
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax),
11447
- subtype: z12.enum(CUSTOM_AUDIENCE_SUBTYPES),
11448
- description: z12.string().max(500).optional(),
11449
- customer_file_source: z12.string().optional(),
11450
- retention_days: z12.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11486
+ var lookalikeSpecSchema = z13.object({
11487
+ origin: z13.array(z13.object({ id: parentRefSchema2 })).min(1),
11488
+ ratio: z13.number().min(0.01).max(0.2).optional(),
11489
+ country: z13.string().length(2).optional()
11490
+ });
11491
+ var customAudienceCreateSchema = z13.object({
11492
+ name: z13.string().min(1).max(META_LIMITS.audience.nameMax),
11493
+ subtype: z13.enum(CUSTOM_AUDIENCE_SUBTYPES),
11494
+ description: z13.string().max(500).optional(),
11495
+ customer_file_source: z13.string().optional(),
11496
+ retention_days: z13.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11451
11497
  lookalike_spec: lookalikeSpecSchema.optional(),
11452
11498
  /** Website/engagement rule — structural passthrough validated by Meta. */
11453
- rule: z12.record(z12.string(), z12.unknown()).optional()
11499
+ rule: z13.record(z13.string(), z13.unknown()).optional()
11454
11500
  }).superRefine((p, ctx) => {
11455
11501
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11456
11502
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11459,16 +11505,16 @@ var customAudienceCreateSchema = z12.object({
11459
11505
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11460
11506
  }
11461
11507
  });
11462
- var customAudienceUpdateSchema = z12.object({
11463
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11464
- description: z12.string().max(500).optional()
11508
+ var customAudienceUpdateSchema = z13.object({
11509
+ name: z13.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11510
+ description: z13.string().max(500).optional()
11465
11511
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11466
- var mediaUploadSchema = z12.object({
11467
- kind: z12.enum(MEDIA_KINDS),
11512
+ var mediaUploadSchema = z13.object({
11513
+ kind: z13.enum(MEDIA_KINDS),
11468
11514
  bakerImageId: bakerMediaIdSchema2.optional(),
11469
11515
  bakerVideoId: bakerMediaIdSchema2.optional(),
11470
11516
  /** Optional display name / filename hint. */
11471
- name: z12.string().max(255).optional()
11517
+ name: z13.string().max(255).optional()
11472
11518
  }).superRefine((p, ctx) => {
11473
11519
  if (p.kind === "image" && !p.bakerImageId) {
11474
11520
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11490,16 +11536,16 @@ var META_DRAFT_OP_KINDS = [
11490
11536
  "customAudience.update",
11491
11537
  "media.upload"
11492
11538
  ];
11493
- var metaDraftOpKindSchema = z12.enum(META_DRAFT_OP_KINDS);
11494
- var accountIdSchema2 = z12.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11495
- var updateTargetSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11539
+ var metaDraftOpKindSchema = z13.enum(META_DRAFT_OP_KINDS);
11540
+ var accountIdSchema2 = z13.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11541
+ var updateTargetSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11496
11542
  function createOp3(kind, payload) {
11497
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, payload });
11543
+ return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, payload });
11498
11544
  }
11499
11545
  function updateOp3(kind, payload) {
11500
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11546
+ return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11501
11547
  }
11502
- var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11548
+ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11503
11549
  createOp3("campaign.create", campaignCreateSchema3),
11504
11550
  updateOp3("campaign.update", campaignUpdateSchema3),
11505
11551
  createOp3("adSet.create", adSetCreateSchema),
@@ -11514,89 +11560,89 @@ var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11514
11560
  ]);
11515
11561
 
11516
11562
  // ../api/src/ads-meta/wire.ts
11517
- import { z as z13 } from "zod";
11518
- var metaWriteModeSchema = z13.enum(["live", "simulated"]);
11519
- var metaDraftOpResultSchema = z13.object({
11520
- status: z13.enum(["applied", "simulated", "failed", "skipped"]),
11563
+ import { z as z14 } from "zod";
11564
+ var metaWriteModeSchema = z14.enum(["live", "simulated"]);
11565
+ var metaDraftOpResultSchema = z14.object({
11566
+ status: z14.enum(["applied", "simulated", "failed", "skipped"]),
11521
11567
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11522
- id: z13.string().optional(),
11568
+ id: z14.string().optional(),
11523
11569
  /** For media.upload ops: the resulting image hash. */
11524
- hash: z13.string().optional(),
11525
- error: z13.string().optional(),
11526
- skippedBecause: z13.string().optional(),
11527
- executedAt: z13.number().optional()
11570
+ hash: z14.string().optional(),
11571
+ error: z14.string().optional(),
11572
+ skippedBecause: z14.string().optional(),
11573
+ executedAt: z14.number().optional()
11528
11574
  });
11529
- var metaDraftStageRequestSchema = z13.object({
11530
- chatId: z13.string(),
11575
+ var metaDraftStageRequestSchema = z14.object({
11576
+ chatId: z14.string(),
11531
11577
  op: metaDraftOpInputSchema
11532
11578
  });
11533
- var metaDraftStageResponseSchema = z13.object({
11534
- staged: z13.literal(true),
11535
- ref: z13.string(),
11579
+ var metaDraftStageResponseSchema = z14.object({
11580
+ staged: z14.literal(true),
11581
+ ref: z14.string(),
11536
11582
  kind: metaDraftOpKindSchema,
11537
11583
  mode: metaWriteModeSchema,
11538
- dependsOn: z13.array(z13.string()),
11539
- summary: z13.string(),
11540
- warnings: z13.array(z13.string()),
11584
+ dependsOn: z14.array(z14.string()),
11585
+ summary: z14.string(),
11586
+ warnings: z14.array(z14.string()),
11541
11587
  /** True when the op amended an already-staged op in place instead of appending a new one. */
11542
- amended: z13.boolean().optional()
11543
- });
11544
- var metaDraftDuplicateRequestSchema = z13.object({
11545
- chatId: z13.string(),
11546
- accountId: z13.string(),
11547
- entity: z13.enum(["campaign", "adSet", "ad"]),
11548
- sourceId: z13.string(),
11549
- overrides: z13.record(z13.string(), z13.unknown()).optional(),
11588
+ amended: z14.boolean().optional()
11589
+ });
11590
+ var metaDraftDuplicateRequestSchema = z14.object({
11591
+ chatId: z14.string(),
11592
+ accountId: z14.string(),
11593
+ entity: z14.enum(["campaign", "adSet", "ad"]),
11594
+ sourceId: z14.string(),
11595
+ overrides: z14.record(z14.string(), z14.unknown()).optional(),
11550
11596
  /** Pause the original after the copy publishes. */
11551
- replace: z13.boolean().optional()
11597
+ replace: z14.boolean().optional()
11552
11598
  });
11553
- var metaDraftOpViewSchema = z13.object({
11554
- ref: z13.string(),
11599
+ var metaDraftOpViewSchema = z14.object({
11600
+ ref: z14.string(),
11555
11601
  kind: metaDraftOpKindSchema,
11556
- accountId: z13.string(),
11557
- target: z13.string().optional(),
11558
- dependsOn: z13.array(z13.string()),
11559
- summary: z13.string(),
11560
- stagedAt: z13.number(),
11602
+ accountId: z14.string(),
11603
+ target: z14.string().optional(),
11604
+ dependsOn: z14.array(z14.string()),
11605
+ summary: z14.string(),
11606
+ stagedAt: z14.number(),
11561
11607
  result: metaDraftOpResultSchema.optional()
11562
11608
  });
11563
- var metaDraftListRequestSchema = z13.object({
11564
- chatId: z13.string()
11609
+ var metaDraftListRequestSchema = z14.object({
11610
+ chatId: z14.string()
11565
11611
  });
11566
- var metaDraftAdvisorySchema = z13.object({
11567
- ref: z13.string(),
11568
- message: z13.string()
11612
+ var metaDraftAdvisorySchema = z14.object({
11613
+ ref: z14.string(),
11614
+ message: z14.string()
11569
11615
  });
11570
- var metaDraftListResponseSchema = z13.object({
11571
- status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
11616
+ var metaDraftListResponseSchema = z14.object({
11617
+ status: z14.enum(["active", "publishing", "applied", "discarded", "none"]),
11572
11618
  mode: metaWriteModeSchema,
11573
- count: z13.number(),
11574
- ops: z13.array(metaDraftOpViewSchema),
11619
+ count: z14.number(),
11620
+ ops: z14.array(metaDraftOpViewSchema),
11575
11621
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11576
- advisories: z13.array(metaDraftAdvisorySchema)
11622
+ advisories: z14.array(metaDraftAdvisorySchema)
11577
11623
  });
11578
- var metaDraftRemoveRequestSchema = z13.object({
11579
- chatId: z13.string(),
11580
- ref: z13.string()
11624
+ var metaDraftRemoveRequestSchema = z14.object({
11625
+ chatId: z14.string(),
11626
+ ref: z14.string()
11581
11627
  });
11582
- var metaDraftRemoveResponseSchema = z13.object({
11628
+ var metaDraftRemoveResponseSchema = z14.object({
11583
11629
  /** The requested ref plus any dependents removed by cascade. */
11584
- removed: z13.array(z13.string())
11630
+ removed: z14.array(z14.string())
11585
11631
  });
11586
- var metaDraftClearRequestSchema = z13.object({
11587
- chatId: z13.string()
11632
+ var metaDraftClearRequestSchema = z14.object({
11633
+ chatId: z14.string()
11588
11634
  });
11589
- var metaDraftClearResponseSchema = z13.object({
11590
- cleared: z13.number()
11635
+ var metaDraftClearResponseSchema = z14.object({
11636
+ cleared: z14.number()
11591
11637
  });
11592
- var metaFieldErrorSchema = z13.object({
11593
- path: z13.string(),
11594
- message: z13.string()
11638
+ var metaFieldErrorSchema = z14.object({
11639
+ path: z14.string(),
11640
+ message: z14.string()
11595
11641
  });
11596
- var metaDraftErrorResponseSchema = z13.object({
11597
- code: z13.string(),
11598
- error: z13.string(),
11599
- fields: z13.array(metaFieldErrorSchema).optional()
11642
+ var metaDraftErrorResponseSchema = z14.object({
11643
+ code: z14.string(),
11644
+ error: z14.string(),
11645
+ fields: z14.array(metaFieldErrorSchema).optional()
11600
11646
  });
11601
11647
 
11602
11648
  // src/commands/ads/meta/write-shared.ts
@@ -15009,7 +15055,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
15009
15055
  import { toCardinal as nwNl } from "n2words/nl-NL";
15010
15056
  import { toCardinal as nwPl } from "n2words/pl-PL";
15011
15057
  import { toCardinal as nwPt } from "n2words/pt-PT";
15012
- import { z as z14 } from "zod";
15058
+ import { z as z15 } from "zod";
15013
15059
 
15014
15060
  // src/engine/scaffold/lib/shoot-modes.ts
15015
15061
  var SHOOT_MODES = [
@@ -15345,71 +15391,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15345
15391
  "{{out.video}}"
15346
15392
  ];
15347
15393
  }
15348
- var FrameAsset = z14.object({ url: z14.string().optional() }).loose().optional();
15349
- var DialogueLine = z14.object({
15350
- speaker: z14.string().optional(),
15351
- line: z14.string().optional(),
15394
+ var FrameAsset = z15.object({ url: z15.string().optional() }).loose().optional();
15395
+ var DialogueLine = z15.object({
15396
+ speaker: z15.string().optional(),
15397
+ line: z15.string().optional(),
15352
15398
  // Absolute seconds on the source timeline (the deconstruct emits both).
15353
- start_s: z14.number().optional(),
15354
- end_s: z14.number().optional(),
15355
- delivery: z14.string().optional(),
15356
- voice_description: z14.string().optional(),
15399
+ start_s: z15.number().optional(),
15400
+ end_s: z15.number().optional(),
15401
+ delivery: z15.string().optional(),
15402
+ voice_description: z15.string().optional(),
15357
15403
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15358
15404
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15359
15405
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15360
15406
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15361
15407
  // the VO path; absent keeps the presence-based decision (old blueprints).
15362
- on_camera: z14.boolean().optional()
15408
+ on_camera: z15.boolean().optional()
15363
15409
  }).loose();
15364
- var Sfx = z14.object({
15365
- at_s: z14.number().optional(),
15366
- duration_s: z14.number().optional(),
15367
- sound_effect_prompt: z14.string().optional(),
15368
- description: z14.string().optional()
15410
+ var Sfx = z15.object({
15411
+ at_s: z15.number().optional(),
15412
+ duration_s: z15.number().optional(),
15413
+ sound_effect_prompt: z15.string().optional(),
15414
+ description: z15.string().optional()
15369
15415
  }).loose();
15370
- var CompositionRegion = z14.object({
15416
+ var CompositionRegion = z15.object({
15371
15417
  // full | top | bottom | left | right | inset
15372
- panel: z14.string().optional(),
15418
+ panel: z15.string().optional(),
15373
15419
  // 9-grid anchor for an `inset` presenter box.
15374
- position: z14.string().optional(),
15375
- is_presenter: z14.boolean().optional(),
15420
+ position: z15.string().optional(),
15421
+ is_presenter: z15.boolean().optional(),
15376
15422
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15377
- cast_ref: z14.string().optional(),
15423
+ cast_ref: z15.string().optional(),
15378
15424
  // What the region's content IS: camera | screen_capture | static_graphic |
15379
15425
  // generated. Authoritative for routing when present (regex-over-prose fallback
15380
15426
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15381
15427
  // overlay layer, never AI-generated.
15382
- kind: z14.string().optional(),
15428
+ kind: z15.string().optional(),
15383
15429
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15384
15430
  // screen_capture region shows. Two scenes share it only when they show the SAME
15385
15431
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15386
15432
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15387
15433
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15388
15434
  // instead of asking the operator for one screenshot that can't cover both.
15389
- surface_id: z14.string().optional(),
15435
+ surface_id: z15.string().optional(),
15390
15436
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15391
15437
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15392
15438
  // must re-composite, not paint into the surface.
15393
- nested: z14.array(z14.object({}).loose()).optional(),
15394
- summary: z14.string().optional(),
15395
- frame_prompt: z14.string().optional(),
15396
- motion_prompt: z14.string().optional()
15439
+ nested: z15.array(z15.object({}).loose()).optional(),
15440
+ summary: z15.string().optional(),
15441
+ frame_prompt: z15.string().optional(),
15442
+ motion_prompt: z15.string().optional()
15397
15443
  }).loose();
15398
- var SceneComposition = z14.object({
15444
+ var SceneComposition = z15.object({
15399
15445
  // full_frame (default) | split_screen | pip | keyed_overlay
15400
- layout: z14.string().optional(),
15446
+ layout: z15.string().optional(),
15401
15447
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15402
- split_axis: z14.string().optional(),
15403
- regions: z14.array(CompositionRegion).optional()
15448
+ split_axis: z15.string().optional(),
15449
+ regions: z15.array(CompositionRegion).optional()
15404
15450
  }).loose();
15405
- var CameraMotion = z14.object({ movement: z14.string().optional(), detail: z14.string().optional() }).loose();
15406
- var TranscriptWord = z14.object({ text: z14.string().optional() }).loose();
15407
- var Scene = z14.object({
15408
- start_s: z14.number().optional(),
15409
- end_s: z14.number().optional(),
15410
- duration_s: z14.number().optional(),
15411
- summary: z14.string().optional(),
15412
- action_detail: z14.string().optional(),
15451
+ var CameraMotion = z15.object({ movement: z15.string().optional(), detail: z15.string().optional() }).loose();
15452
+ var TranscriptWord = z15.object({ text: z15.string().optional() }).loose();
15453
+ var Scene = z15.object({
15454
+ start_s: z15.number().optional(),
15455
+ end_s: z15.number().optional(),
15456
+ duration_s: z15.number().optional(),
15457
+ summary: z15.string().optional(),
15458
+ action_detail: z15.string().optional(),
15413
15459
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15414
15460
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15415
15461
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15417,82 +15463,82 @@ var Scene = z14.object({
15417
15463
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15418
15464
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15419
15465
  // UGC/product mode; a human can override per scene by setting this.
15420
- shoot_mode: z14.string().optional(),
15466
+ shoot_mode: z15.string().optional(),
15421
15467
  // Diegetic ambient the clip's native audio should carry (no music). When
15422
15468
  // absent the scene falls back to its shoot mode's default ambience.
15423
- ambient: z14.string().optional(),
15469
+ ambient: z15.string().optional(),
15424
15470
  camera_motion: CameraMotion.optional(),
15425
- start_frame_prompt: z14.string().optional(),
15426
- end_frame_prompt: z14.string().optional(),
15427
- motion_prompt: z14.string().optional(),
15471
+ start_frame_prompt: z15.string().optional(),
15472
+ end_frame_prompt: z15.string().optional(),
15473
+ motion_prompt: z15.string().optional(),
15428
15474
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15429
15475
  // script re-craft checklist. Inferred from position when absent.
15430
- narrative_role: z14.string().optional(),
15476
+ narrative_role: z15.string().optional(),
15431
15477
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15432
15478
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15433
15479
  // into the hook's start-frame description so the generator renders that state,
15434
15480
  // not a calm influencer (CCA-11).
15435
- hook_mechanic: z14.object({ mechanic: z14.string().optional(), why_it_stops_scroll: z14.string().optional() }).loose().optional(),
15481
+ hook_mechanic: z15.object({ mechanic: z15.string().optional(), why_it_stops_scroll: z15.string().optional() }).loose().optional(),
15436
15482
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15437
- scene_setting: z14.string().optional(),
15483
+ scene_setting: z15.string().optional(),
15438
15484
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15439
15485
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15440
15486
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15441
15487
  // ignored (nothing follows it).
15442
- transition_out: z14.object({ type: z14.string().optional(), description: z14.string().optional() }).loose().optional(),
15443
- dialogue: z14.array(DialogueLine).optional(),
15444
- sfx: z14.array(Sfx).optional(),
15445
- overlays: z14.array(z14.unknown()).optional(),
15446
- floating_elements: z14.array(z14.unknown()).optional(),
15488
+ transition_out: z15.object({ type: z15.string().optional(), description: z15.string().optional() }).loose().optional(),
15489
+ dialogue: z15.array(DialogueLine).optional(),
15490
+ sfx: z15.array(Sfx).optional(),
15491
+ overlays: z15.array(z15.unknown()).optional(),
15492
+ floating_elements: z15.array(z15.unknown()).optional(),
15447
15493
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15448
15494
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15449
15495
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15450
15496
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
15451
- motion_level: z14.enum(["static", "subtle", "dynamic"]).optional(),
15452
- transcript_slice: z14.array(TranscriptWord).optional(),
15497
+ motion_level: z15.enum(["static", "subtle", "dynamic"]).optional(),
15498
+ transcript_slice: z15.array(TranscriptWord).optional(),
15453
15499
  start_frame_asset: FrameAsset,
15454
15500
  end_frame_asset: FrameAsset,
15455
15501
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15456
15502
  // previous one (the SAME physical shot, broken up only because it exceeded the
15457
15503
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15458
15504
  // start frame IS the previous scene's end frame — so the join is seamless.
15459
- continues_previous: z14.boolean().optional()
15505
+ continues_previous: z15.boolean().optional()
15460
15506
  }).loose();
15461
- var VideoBlueprint = z14.object({
15462
- source: z14.object({ aspect_ratio: z14.string().optional(), duration_s: z14.number().optional() }).loose().optional(),
15463
- global: z14.object({
15464
- music: z14.object({
15465
- present: z14.boolean().optional(),
15466
- music_prompt: z14.string().optional(),
15507
+ var VideoBlueprint = z15.object({
15508
+ source: z15.object({ aspect_ratio: z15.string().optional(), duration_s: z15.number().optional() }).loose().optional(),
15509
+ global: z15.object({
15510
+ music: z15.object({
15511
+ present: z15.boolean().optional(),
15512
+ music_prompt: z15.string().optional(),
15467
15513
  // Absolute second the music enters in the reference (the bed often
15468
15514
  // kicks in mid-ad, after the hook). We start the regenerated track here
15469
15515
  // instead of at 0 so the timing matches.
15470
- starts_at_s: z14.number().optional(),
15516
+ starts_at_s: z15.number().optional(),
15471
15517
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15472
15518
  // reference track. We never reuse it — only style the regenerated bed.
15473
- identified_track: z14.object({ title: z14.string().optional(), artist: z14.string().optional() }).loose().nullish()
15519
+ identified_track: z15.object({ title: z15.string().optional(), artist: z15.string().optional() }).loose().nullish()
15474
15520
  }).loose().optional(),
15475
- cast: z14.array(
15476
- z14.object({
15477
- id: z14.string().optional(),
15478
- description: z14.string().optional(),
15521
+ cast: z15.array(
15522
+ z15.object({
15523
+ id: z15.string().optional(),
15524
+ description: z15.string().optional(),
15479
15525
  // The deconstruct's note on the target-market localization (e.g. "native
15480
15526
  // French speaker") — read to derive the spoken-track language code.
15481
- market_localization_note: z14.string().optional()
15527
+ market_localization_note: z15.string().optional()
15482
15528
  }).loose()
15483
15529
  ).optional(),
15484
- voiceover: z14.object({
15530
+ voiceover: z15.object({
15485
15531
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15486
15532
  // voiceover | none → narration over the picture (no lip-sync).
15487
- mode: z14.string().optional(),
15488
- voice_description: z14.string().optional(),
15489
- persona: z14.string().optional()
15533
+ mode: z15.string().optional(),
15534
+ voice_description: z15.string().optional(),
15535
+ persona: z15.string().optional()
15490
15536
  }).loose().optional(),
15491
15537
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15492
15538
  // first hex is the dominant brand colour); never to drive frame generation.
15493
- style: z14.object({ palette: z14.array(z14.object({ hex: z14.string().optional() }).loose()).optional() }).loose().optional()
15539
+ style: z15.object({ palette: z15.array(z15.object({ hex: z15.string().optional() }).loose()).optional() }).loose().optional()
15494
15540
  }).loose().optional(),
15495
- scenes: z14.array(Scene).min(1)
15541
+ scenes: z15.array(Scene).min(1)
15496
15542
  }).loose();
15497
15543
  function injectHookPhysicality(blueprint) {
15498
15544
  for (const scene of blueprint.scenes) {
@@ -15509,26 +15555,26 @@ function clipIntentOf(scene, sceneIndex) {
15509
15555
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
15510
15556
  return "body";
15511
15557
  }
15512
- var AppearsItem = z14.union([z14.number(), z14.object({ scene: z14.number(), edge: z14.string().optional() }).loose()]);
15513
- var RecurringElement = z14.object({
15558
+ var AppearsItem = z15.union([z15.number(), z15.object({ scene: z15.number(), edge: z15.string().optional() }).loose()]);
15559
+ var RecurringElement = z15.object({
15514
15560
  // person | animal | product | logo | badge | other
15515
- type: z14.string(),
15516
- label: z14.string().optional(),
15517
- description: z14.string().optional(),
15518
- expression: z14.string().nullable().optional(),
15561
+ type: z15.string(),
15562
+ label: z15.string().optional(),
15563
+ description: z15.string().optional(),
15564
+ expression: z15.string().nullable().optional(),
15519
15565
  // When the element maps to a global cast entry, its stable id (for annotation).
15520
- cast_id: z14.string().nullable().optional(),
15566
+ cast_id: z15.string().nullable().optional(),
15521
15567
  // The label of another element that is the SAME individual as this one, shown
15522
15568
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15523
15569
  // pink shirt and believer in a white shirt). Each look gets its own reference
15524
15570
  // slot, but the face/identity must stay identical across them.
15525
- same_as: z14.string().nullable().optional(),
15571
+ same_as: z15.string().nullable().optional(),
15526
15572
  // Scenes the element appears in. Either a bare list of scene indices (both
15527
15573
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
15528
- scenes: z14.array(z14.number()).optional(),
15529
- appears_in: z14.array(AppearsItem).optional()
15574
+ scenes: z15.array(z15.number()).optional(),
15575
+ appears_in: z15.array(AppearsItem).optional()
15530
15576
  }).loose();
15531
- var RecurringElements = z14.array(RecurringElement);
15577
+ var RecurringElements = z15.array(RecurringElement);
15532
15578
  function sanitizeId(raw, fallback) {
15533
15579
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15534
15580
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -16001,7 +16047,7 @@ function scrubFloatSentences(text, floatDescs) {
16001
16047
  return kept;
16002
16048
  }
16003
16049
  function sceneFloatDescs(scene) {
16004
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16050
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16005
16051
  if (!floats.success) return [];
16006
16052
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
16007
16053
  }
@@ -17425,25 +17471,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
17425
17471
  }
17426
17472
  return tracks;
17427
17473
  }
17428
- var OverlayStyle = z14.object({ color_hex: z14.string().optional(), background: z14.string().optional(), size: z14.string().optional() }).loose();
17429
- var Overlay = z14.object({
17430
- text: z14.string().optional(),
17431
- appears_at_s: z14.number().optional(),
17432
- duration_s: z14.number().optional(),
17433
- position: z14.string().optional(),
17434
- role: z14.string().optional(),
17435
- animation: z14.string().optional(),
17436
- animation_detail: z14.string().optional(),
17474
+ var OverlayStyle = z15.object({ color_hex: z15.string().optional(), background: z15.string().optional(), size: z15.string().optional() }).loose();
17475
+ var Overlay = z15.object({
17476
+ text: z15.string().optional(),
17477
+ appears_at_s: z15.number().optional(),
17478
+ duration_s: z15.number().optional(),
17479
+ position: z15.string().optional(),
17480
+ role: z15.string().optional(),
17481
+ animation: z15.string().optional(),
17482
+ animation_detail: z15.string().optional(),
17437
17483
  style: OverlayStyle.optional()
17438
17484
  }).loose();
17439
- var FloatingElement = z14.object({
17440
- kind: z14.string().optional(),
17441
- description: z14.string().optional(),
17442
- brand_name: z14.string().nullish(),
17443
- what_it_represents: z14.string().optional(),
17444
- appears_at_s: z14.number().optional(),
17445
- duration_s: z14.number().optional(),
17446
- position: z14.string().optional()
17485
+ var FloatingElement = z15.object({
17486
+ kind: z15.string().optional(),
17487
+ description: z15.string().optional(),
17488
+ brand_name: z15.string().nullish(),
17489
+ what_it_represents: z15.string().optional(),
17490
+ appears_at_s: z15.number().optional(),
17491
+ duration_s: z15.number().optional(),
17492
+ position: z15.string().optional()
17447
17493
  }).loose();
17448
17494
  function escapeHtml(s) {
17449
17495
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17475,7 +17521,7 @@ function positionClass(position) {
17475
17521
  function collectCaptions(blueprint, clock) {
17476
17522
  return blueprint.scenes.flatMap((scene, i) => {
17477
17523
  const sceneStart = scene.start_s ?? 0;
17478
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17524
+ const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
17479
17525
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17480
17526
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
17481
17527
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17555,7 +17601,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
17555
17601
  const windows = /* @__PURE__ */ new Map();
17556
17602
  blueprint.scenes.forEach((scene, i) => {
17557
17603
  const sceneStart = scene.start_s ?? 0;
17558
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17604
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17559
17605
  if (!floats.success) return;
17560
17606
  for (const fe of floats.data) {
17561
17607
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -18003,8 +18049,8 @@ function buildMotionBoard(blueprint) {
18003
18049
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
18004
18050
  cursor = end_s;
18005
18051
  const spoken = sceneSpokenText(scene);
18006
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
18007
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18052
+ const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
18053
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18008
18054
  const graphics = [
18009
18055
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
18010
18056
  kind: "text",
@@ -19436,7 +19482,7 @@ import path17 from "path";
19436
19482
  import { defineCommand as defineCommand91 } from "citty";
19437
19483
 
19438
19484
  // src/engine/scaffold/staticAd.ts
19439
- import { z as z15 } from "zod";
19485
+ import { z as z16 } from "zod";
19440
19486
  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"]);
19441
19487
  var DEFAULT_ASPECT_RATIO = "9:16";
19442
19488
  var SHEET_SUBJECT_TYPE2 = {
@@ -19448,24 +19494,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
19448
19494
  var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
19449
19495
  var ADAPT_IMAGE_SIZE = "2K";
19450
19496
  var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
19451
- var Blueprint = z15.object({
19452
- meta: z15.object({ estimated_aspect_ratio: z15.string().optional() }).loose().optional(),
19453
- text_content: z15.array(z15.object({ text: z15.string().optional() }).loose()).optional()
19497
+ var Blueprint = z16.object({
19498
+ meta: z16.object({ estimated_aspect_ratio: z16.string().optional() }).loose().optional(),
19499
+ text_content: z16.array(z16.object({ text: z16.string().optional() }).loose()).optional()
19454
19500
  }).loose();
19455
- var ElementLocator = z15.object({
19456
- collection: z15.enum(["subjects", "people", "brands_logos"]),
19457
- index: z15.number().int().nonnegative()
19501
+ var ElementLocator = z16.object({
19502
+ collection: z16.enum(["subjects", "people", "brands_logos"]),
19503
+ index: z16.number().int().nonnegative()
19458
19504
  }).loose();
19459
- var MainElement = z15.object({
19505
+ var MainElement = z16.object({
19460
19506
  // logo | product | person | animal | badge | other
19461
- type: z15.string(),
19462
- label: z15.string().optional(),
19463
- description: z15.string().optional(),
19464
- expression: z15.string().nullable().optional(),
19465
- reason: z15.string().optional(),
19507
+ type: z16.string(),
19508
+ label: z16.string().optional(),
19509
+ description: z16.string().optional(),
19510
+ expression: z16.string().nullable().optional(),
19511
+ reason: z16.string().optional(),
19466
19512
  locator: ElementLocator.optional()
19467
19513
  }).loose();
19468
- var MainElements = z15.array(MainElement);
19514
+ var MainElements = z16.array(MainElement);
19469
19515
  function sanitizeId2(raw, fallback) {
19470
19516
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
19471
19517
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -22499,11 +22545,121 @@ Examples:
22499
22545
  }
22500
22546
  });
22501
22547
 
22548
+ // src/commands/history/index.ts
22549
+ import { defineCommand as defineCommand107 } from "citty";
22550
+ registerSchema({
22551
+ command: "history.list",
22552
+ description: "Start here: unified account history (audit log) \u2014 everything that changed on this account, newest first: publishes, chat lifecycle, backlog actions, team changes, setup links, tags, schedules, ad-platform writes, followed advertisers, media, creatives, reports, domains, and integrations. Use it to see what happened recently before planning work. Compact by default; add --full for raw metadata per entry.",
22553
+ args: {
22554
+ limit: {
22555
+ type: "string",
22556
+ description: "Max entries to return, 1-200 (default: 30)",
22557
+ required: false
22558
+ },
22559
+ category: {
22560
+ type: "string",
22561
+ description: "Filter: publish|chat|action|team|setup_link|company|tag|schedule|ads|advertiser|media|creative|report|domain|integration",
22562
+ required: false
22563
+ },
22564
+ days: {
22565
+ type: "string",
22566
+ description: "Only entries from the last N days (1-365)",
22567
+ required: false
22568
+ },
22569
+ full: {
22570
+ type: "boolean",
22571
+ description: "Include raw metadata for each entry",
22572
+ required: false,
22573
+ default: false
22574
+ }
22575
+ }
22576
+ });
22577
+ var CATEGORIES = [
22578
+ "publish",
22579
+ "chat",
22580
+ "action",
22581
+ "team",
22582
+ "setup_link",
22583
+ "company",
22584
+ "tag",
22585
+ "schedule",
22586
+ "ads",
22587
+ "advertiser",
22588
+ "media",
22589
+ "creative",
22590
+ "report",
22591
+ "domain",
22592
+ "integration"
22593
+ ];
22594
+ function parseBoundedInt(raw, name, min, max) {
22595
+ if (raw === void 0) {
22596
+ return void 0;
22597
+ }
22598
+ const value = Number.parseInt(raw, 10);
22599
+ if (Number.isNaN(value) || value < min || value > max) {
22600
+ throw new Error(`--${name} must be an integer between ${min} and ${max}`);
22601
+ }
22602
+ return value;
22603
+ }
22604
+ var listCommand6 = defineCommand107({
22605
+ meta: {
22606
+ name: "list",
22607
+ description: "List recent account changes (unified audit log), newest first."
22608
+ },
22609
+ args: {
22610
+ limit: { type: "string", description: "Max entries (1-200, default 30)", required: false },
22611
+ category: {
22612
+ type: "string",
22613
+ description: "Filter: publish|chat|action|team|setup_link|company|tag|schedule|ads|advertiser|media|creative|report|domain|integration",
22614
+ required: false
22615
+ },
22616
+ days: { type: "string", description: "Only the last N days (1-365)", required: false },
22617
+ full: { type: "boolean", description: "Include raw metadata", required: false, default: false }
22618
+ },
22619
+ run: async ({ args }) => {
22620
+ try {
22621
+ const body = {};
22622
+ const limit = parseBoundedInt(args.limit, "limit", 1, 200);
22623
+ if (limit !== void 0) {
22624
+ body.limit = limit;
22625
+ }
22626
+ const days = parseBoundedInt(args.days, "days", 1, 365);
22627
+ if (days !== void 0) {
22628
+ body.days = days;
22629
+ }
22630
+ if (args.category) {
22631
+ if (!CATEGORIES.includes(args.category)) {
22632
+ throw new Error(`--category must be one of: ${CATEGORIES.join("|")}`);
22633
+ }
22634
+ body.category = args.category;
22635
+ }
22636
+ if (args.full) {
22637
+ body.full = true;
22638
+ }
22639
+ const response = await apiPost("/api/history/list", body);
22640
+ writeJson({
22641
+ ...response,
22642
+ meta: { count: response.data.entries.length },
22643
+ ...response.data.entries.length === 0 ? { hints: ["No history entries matched. Widen with a larger --days or drop --category."] } : {}
22644
+ });
22645
+ } catch (err) {
22646
+ failApi(err);
22647
+ }
22648
+ }
22649
+ });
22650
+ var historyCommand = defineCommand107({
22651
+ meta: {
22652
+ name: "history",
22653
+ description: "Unified account history (audit log): what changed, who did it, and when."
22654
+ },
22655
+ subCommands: { list: listCommand6 }
22656
+ });
22657
+
22502
22658
  // src/commands/images/index.ts
22503
- import { defineCommand as defineCommand130 } from "citty";
22659
+ import { defineCommand as defineCommand131 } from "citty";
22504
22660
 
22505
22661
  // src/commands/images/crop.ts
22506
- import { defineCommand as defineCommand107 } from "citty";
22662
+ import { defineCommand as defineCommand108 } from "citty";
22507
22663
 
22508
22664
  // src/lib/image/crop-sprite.ts
22509
22665
  import sharp from "sharp";
@@ -22628,7 +22784,7 @@ function emitError2(err) {
22628
22784
  }
22629
22785
  process.exit(1);
22630
22786
  }
22631
- var cropCommand = defineCommand107({
22787
+ var cropCommand = defineCommand108({
22632
22788
  meta: {
22633
22789
  name: "crop",
22634
22790
  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"
@@ -22664,7 +22820,7 @@ var cropCommand = defineCommand107({
22664
22820
  });
22665
22821
 
22666
22822
  // src/commands/images/delete.ts
22667
- import { defineCommand as defineCommand108 } from "citty";
22823
+ import { defineCommand as defineCommand109 } from "citty";
22668
22824
  registerSchema({
22669
22825
  command: "images.delete",
22670
22826
  description: "Delete an image by ID",
@@ -22678,7 +22834,7 @@ registerSchema({
22678
22834
  }
22679
22835
  }
22680
22836
  });
22681
- var deleteCommand = defineCommand108({
22837
+ var deleteCommand = defineCommand109({
22682
22838
  meta: {
22683
22839
  name: "delete",
22684
22840
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -22719,7 +22875,7 @@ var deleteCommand = defineCommand108({
22719
22875
  });
22720
22876
 
22721
22877
  // src/commands/images/dimensions.ts
22722
- import { defineCommand as defineCommand109 } from "citty";
22878
+ import { defineCommand as defineCommand110 } from "citty";
22723
22879
 
22724
22880
  // src/lib/image/dimensions.ts
22725
22881
  import { imageSize } from "image-size";
@@ -22742,7 +22898,7 @@ registerSchema({
22742
22898
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
22743
22899
  }
22744
22900
  });
22745
- var dimensionsCommand = defineCommand109({
22901
+ var dimensionsCommand = defineCommand110({
22746
22902
  meta: {
22747
22903
  name: "dimensions",
22748
22904
  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"
@@ -22786,7 +22942,7 @@ var dimensionsCommand = defineCommand109({
22786
22942
  });
22787
22943
 
22788
22944
  // src/commands/images/extract.ts
22789
- import { defineCommand as defineCommand110 } from "citty";
22945
+ import { defineCommand as defineCommand111 } from "citty";
22790
22946
  registerSchema({
22791
22947
  command: "images.extract",
22792
22948
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -22802,7 +22958,7 @@ registerSchema({
22802
22958
  }
22803
22959
  }
22804
22960
  });
22805
- var extractCommand = defineCommand110({
22961
+ var extractCommand = defineCommand111({
22806
22962
  meta: {
22807
22963
  name: "extract",
22808
22964
  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"
@@ -22840,7 +22996,7 @@ var extractCommand = defineCommand110({
22840
22996
  });
22841
22997
 
22842
22998
  // src/commands/images/find.ts
22843
- import { defineCommand as defineCommand111 } from "citty";
22999
+ import { defineCommand as defineCommand112 } from "citty";
22844
23000
  registerSchema({
22845
23001
  command: "images.find",
22846
23002
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -22872,7 +23028,7 @@ registerSchema({
22872
23028
  }
22873
23029
  }
22874
23030
  });
22875
- var findCommand = defineCommand111({
23031
+ var findCommand = defineCommand112({
22876
23032
  meta: {
22877
23033
  name: "find",
22878
23034
  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"
@@ -22921,7 +23077,7 @@ var findCommand = defineCommand111({
22921
23077
 
22922
23078
  // src/commands/images/generate.ts
22923
23079
  import { readFile as readFile19 } from "fs/promises";
22924
- import { defineCommand as defineCommand112 } from "citty";
23080
+ import { defineCommand as defineCommand113 } from "citty";
22925
23081
  import sharp2 from "sharp";
22926
23082
  var GENERATE_TIMEOUT_MS = 18e4;
22927
23083
  var REFERENCE_MAX_EDGE = 1536;
@@ -23024,7 +23180,7 @@ async function resolveReferences(spec) {
23024
23180
  }
23025
23181
  return out;
23026
23182
  }
23027
- var generateCommand = defineCommand112({
23183
+ var generateCommand = defineCommand113({
23028
23184
  meta: {
23029
23185
  name: "generate",
23030
23186
  description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: google/gemini-3.1-flash-image-preview (Nano Banana flash \u2014 default, fast, extreme aspect ratios) & google/gemini-3.5-flash (fast), google/gemini-3-pro-image-preview (Nano Banana Pro \u2014 highest fidelity), openai/gpt-5.4-image-2 (photoreal, cleanest in-image text, best for ad/landing reproduction), 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 openai/gpt-5.4-image-2 --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]]'"
@@ -23076,7 +23232,7 @@ var generateCommand = defineCommand112({
23076
23232
  });
23077
23233
 
23078
23234
  // src/commands/images/get.ts
23079
- import { defineCommand as defineCommand113 } from "citty";
23235
+ import { defineCommand as defineCommand114 } from "citty";
23080
23236
  registerSchema({
23081
23237
  command: "images.get",
23082
23238
  description: "Get a single image by ID",
@@ -23084,7 +23240,7 @@ registerSchema({
23084
23240
  id: { type: "string", description: "Image ID", required: true }
23085
23241
  }
23086
23242
  });
23087
- var getCommand2 = defineCommand113({
23243
+ var getCommand2 = defineCommand114({
23088
23244
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
23089
23245
  args: {
23090
23246
  id: { type: "positional", description: "Image ID", required: false },
@@ -23120,7 +23276,7 @@ var getCommand2 = defineCommand113({
23120
23276
  });
23121
23277
 
23122
23278
  // src/commands/images/gif.ts
23123
- import { defineCommand as defineCommand114 } from "citty";
23279
+ import { defineCommand as defineCommand115 } from "citty";
23124
23280
  registerSchema({
23125
23281
  command: "images.gif",
23126
23282
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -23152,7 +23308,7 @@ registerSchema({
23152
23308
  }
23153
23309
  }
23154
23310
  });
23155
- var gifCommand = defineCommand114({
23311
+ var gifCommand = defineCommand115({
23156
23312
  meta: {
23157
23313
  name: "gif",
23158
23314
  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"
@@ -23199,7 +23355,7 @@ var gifCommand = defineCommand114({
23199
23355
  });
23200
23356
 
23201
23357
  // src/commands/images/google.ts
23202
- import { defineCommand as defineCommand115 } from "citty";
23358
+ import { defineCommand as defineCommand116 } from "citty";
23203
23359
  registerSchema({
23204
23360
  command: "images.google",
23205
23361
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -23235,7 +23391,7 @@ registerSchema({
23235
23391
  }
23236
23392
  }
23237
23393
  });
23238
- var googleCommand2 = defineCommand115({
23394
+ var googleCommand2 = defineCommand116({
23239
23395
  meta: {
23240
23396
  name: "google",
23241
23397
  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"
@@ -23283,7 +23439,7 @@ var googleCommand2 = defineCommand115({
23283
23439
  });
23284
23440
 
23285
23441
  // src/commands/images/icon.ts
23286
- import { defineCommand as defineCommand116 } from "citty";
23442
+ import { defineCommand as defineCommand117 } from "citty";
23287
23443
  registerSchema({
23288
23444
  command: "images.icon",
23289
23445
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -23309,7 +23465,7 @@ registerSchema({
23309
23465
  }
23310
23466
  }
23311
23467
  });
23312
- var iconCommand = defineCommand116({
23468
+ var iconCommand = defineCommand117({
23313
23469
  meta: {
23314
23470
  name: "icon",
23315
23471
  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'"
@@ -23349,7 +23505,7 @@ var iconCommand = defineCommand116({
23349
23505
  });
23350
23506
 
23351
23507
  // src/commands/images/ingest.ts
23352
- import { defineCommand as defineCommand117 } from "citty";
23508
+ import { defineCommand as defineCommand118 } from "citty";
23353
23509
  registerSchema({
23354
23510
  command: "images.ingest",
23355
23511
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -23361,7 +23517,7 @@ registerSchema({
23361
23517
  context: { type: "string", description: "Description context hint", required: false }
23362
23518
  }
23363
23519
  });
23364
- var ingestCommand = defineCommand117({
23520
+ var ingestCommand = defineCommand118({
23365
23521
  meta: {
23366
23522
  name: "ingest",
23367
23523
  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"
@@ -23403,7 +23559,7 @@ var ingestCommand = defineCommand117({
23403
23559
  });
23404
23560
 
23405
23561
  // src/commands/images/library.ts
23406
- import { defineCommand as defineCommand118 } from "citty";
23562
+ import { defineCommand as defineCommand119 } from "citty";
23407
23563
  registerSchema({
23408
23564
  command: "images.library",
23409
23565
  description: "Search the company image library. Returns only ready images.",
@@ -23429,7 +23585,7 @@ registerSchema({
23429
23585
  }
23430
23586
  }
23431
23587
  });
23432
- var libraryCommand = defineCommand118({
23588
+ var libraryCommand = defineCommand119({
23433
23589
  meta: {
23434
23590
  name: "library",
23435
23591
  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"
@@ -23486,7 +23642,7 @@ var libraryCommand = defineCommand118({
23486
23642
  });
23487
23643
 
23488
23644
  // src/commands/images/logo.ts
23489
- import { defineCommand as defineCommand119 } from "citty";
23645
+ import { defineCommand as defineCommand120 } from "citty";
23490
23646
  registerSchema({
23491
23647
  command: "images.logo",
23492
23648
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -23511,7 +23667,7 @@ registerSchema({
23511
23667
  }
23512
23668
  }
23513
23669
  });
23514
- var logoCommand = defineCommand119({
23670
+ var logoCommand = defineCommand120({
23515
23671
  meta: {
23516
23672
  name: "logo",
23517
23673
  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"
@@ -23549,7 +23705,7 @@ var logoCommand = defineCommand119({
23549
23705
  });
23550
23706
 
23551
23707
  // src/commands/images/normalize.ts
23552
- import { defineCommand as defineCommand120 } from "citty";
23708
+ import { defineCommand as defineCommand121 } from "citty";
23553
23709
 
23554
23710
  // src/lib/image/color-changer.ts
23555
23711
  import quantize from "quantize";
@@ -24281,7 +24437,7 @@ function coerceRawArgs(args) {
24281
24437
  "dry-run": bool(args["dry-run"])
24282
24438
  };
24283
24439
  }
24284
- var normalizeCommand = defineCommand120({
24440
+ var normalizeCommand = defineCommand121({
24285
24441
  meta: {
24286
24442
  name: "normalize",
24287
24443
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -24336,7 +24492,7 @@ Examples:
24336
24492
  });
24337
24493
 
24338
24494
  // src/commands/images/pinterest.ts
24339
- import { defineCommand as defineCommand121 } from "citty";
24495
+ import { defineCommand as defineCommand122 } from "citty";
24340
24496
  registerSchema({
24341
24497
  command: "images.pinterest",
24342
24498
  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.",
@@ -24356,7 +24512,7 @@ registerSchema({
24356
24512
  }
24357
24513
  }
24358
24514
  });
24359
- var pinterestCommand = defineCommand121({
24515
+ var pinterestCommand = defineCommand122({
24360
24516
  meta: {
24361
24517
  name: "pinterest",
24362
24518
  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'"
@@ -24396,7 +24552,7 @@ var pinterestCommand = defineCommand121({
24396
24552
  });
24397
24553
 
24398
24554
  // src/commands/images/screenshot.ts
24399
- import { defineCommand as defineCommand122 } from "citty";
24555
+ import { defineCommand as defineCommand123 } from "citty";
24400
24556
  registerSchema({
24401
24557
  command: "images.screenshot",
24402
24558
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -24412,7 +24568,7 @@ registerSchema({
24412
24568
  }
24413
24569
  }
24414
24570
  });
24415
- var screenshotCommand = defineCommand122({
24571
+ var screenshotCommand = defineCommand123({
24416
24572
  meta: {
24417
24573
  name: "screenshot",
24418
24574
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -24475,7 +24631,7 @@ var screenshotCommand = defineCommand122({
24475
24631
  });
24476
24632
 
24477
24633
  // src/commands/images/search.ts
24478
- import { defineCommand as defineCommand123 } from "citty";
24634
+ import { defineCommand as defineCommand124 } from "citty";
24479
24635
  registerSchema({
24480
24636
  command: "images.search",
24481
24637
  description: "Search images by text query. Only returns ready images.",
@@ -24491,7 +24647,7 @@ registerSchema({
24491
24647
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24492
24648
  }
24493
24649
  });
24494
- var searchCommand = defineCommand123({
24650
+ var searchCommand = defineCommand124({
24495
24651
  meta: {
24496
24652
  name: "search",
24497
24653
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -24551,7 +24707,7 @@ var searchCommand = defineCommand123({
24551
24707
  });
24552
24708
 
24553
24709
  // src/commands/images/sticker.ts
24554
- import { defineCommand as defineCommand124 } from "citty";
24710
+ import { defineCommand as defineCommand125 } from "citty";
24555
24711
  registerSchema({
24556
24712
  command: "images.sticker",
24557
24713
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -24583,7 +24739,7 @@ registerSchema({
24583
24739
  }
24584
24740
  }
24585
24741
  });
24586
- var stickerCommand = defineCommand124({
24742
+ var stickerCommand = defineCommand125({
24587
24743
  meta: {
24588
24744
  name: "sticker",
24589
24745
  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"
@@ -24630,7 +24786,7 @@ var stickerCommand = defineCommand124({
24630
24786
  });
24631
24787
 
24632
24788
  // src/commands/images/stock.ts
24633
- import { defineCommand as defineCommand125 } from "citty";
24789
+ import { defineCommand as defineCommand126 } from "citty";
24634
24790
  registerSchema({
24635
24791
  command: "images.stock",
24636
24792
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -24688,7 +24844,7 @@ registerSchema({
24688
24844
  }
24689
24845
  }
24690
24846
  });
24691
- var stockCommand = defineCommand125({
24847
+ var stockCommand = defineCommand126({
24692
24848
  meta: {
24693
24849
  name: "stock",
24694
24850
  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"
@@ -24744,7 +24900,7 @@ var stockCommand = defineCommand125({
24744
24900
  });
24745
24901
 
24746
24902
  // src/lib/tags-command.ts
24747
- import { defineCommand as defineCommand126 } from "citty";
24903
+ import { defineCommand as defineCommand127 } from "citty";
24748
24904
  function makeTagsCommand(command, label, endpoint) {
24749
24905
  registerSchema({
24750
24906
  command: `${command}.tags`,
@@ -24753,7 +24909,7 @@ function makeTagsCommand(command, label, endpoint) {
24753
24909
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
24754
24910
  }
24755
24911
  });
24756
- return defineCommand126({
24912
+ return defineCommand127({
24757
24913
  meta: {
24758
24914
  name: "tags",
24759
24915
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -24789,7 +24945,7 @@ function makeTagsCommand(command, label, endpoint) {
24789
24945
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
24790
24946
 
24791
24947
  // src/commands/images/upload.ts
24792
- import { defineCommand as defineCommand127 } from "citty";
24948
+ import { defineCommand as defineCommand128 } from "citty";
24793
24949
  registerSchema({
24794
24950
  command: "images.upload",
24795
24951
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -24827,7 +24983,7 @@ registerSchema({
24827
24983
  function isRemoteUrl2(value) {
24828
24984
  return /^https?:\/\//i.test(value);
24829
24985
  }
24830
- var uploadCommand = defineCommand127({
24986
+ var uploadCommand = defineCommand128({
24831
24987
  meta: {
24832
24988
  name: "upload",
24833
24989
  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'"
@@ -24920,7 +25076,7 @@ async function uploadLocal(target, args) {
24920
25076
  }
24921
25077
 
24922
25078
  // src/commands/images/upscale.ts
24923
- import { defineCommand as defineCommand128 } from "citty";
25079
+ import { defineCommand as defineCommand129 } from "citty";
24924
25080
  registerSchema({
24925
25081
  command: "images.upscale",
24926
25082
  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).",
@@ -24935,7 +25091,7 @@ registerSchema({
24935
25091
  }
24936
25092
  });
24937
25093
  var POLL_INTERVAL_MS3 = 1500;
24938
- var upscaleCommand = defineCommand128({
25094
+ var upscaleCommand = defineCommand129({
24939
25095
  meta: {
24940
25096
  name: "upscale",
24941
25097
  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"
@@ -24990,7 +25146,7 @@ var upscaleCommand = defineCommand128({
24990
25146
  });
24991
25147
 
24992
25148
  // src/commands/images/use.ts
24993
- import { defineCommand as defineCommand129 } from "citty";
25149
+ import { defineCommand as defineCommand130 } from "citty";
24994
25150
  registerSchema({
24995
25151
  command: "images.use",
24996
25152
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -25006,7 +25162,7 @@ registerSchema({
25006
25162
  }
25007
25163
  });
25008
25164
  var POLL_INTERVAL_MS4 = 1500;
25009
- var useCommand = defineCommand129({
25165
+ var useCommand = defineCommand130({
25010
25166
  meta: {
25011
25167
  name: "use",
25012
25168
  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"
@@ -25052,7 +25208,7 @@ var useCommand = defineCommand129({
25052
25208
  });
25053
25209
 
25054
25210
  // src/commands/images/index.ts
25055
- var imagesCommand = defineCommand130({
25211
+ var imagesCommand = defineCommand131({
25056
25212
  meta: {
25057
25213
  name: "images",
25058
25214
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -25122,7 +25278,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
25122
25278
  });
25123
25279
 
25124
25280
  // src/commands/mcp/index.ts
25125
- import { defineCommand as defineCommand131 } from "citty";
25281
+ import { defineCommand as defineCommand132 } from "citty";
25126
25282
  var SCOPES = ["user", "user_org", "company", "org"];
25127
25283
  function parseScope(raw) {
25128
25284
  const scope = raw === void 0 ? "company" : String(raw);
@@ -25161,7 +25317,7 @@ registerSchema({
25161
25317
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
25162
25318
  args: {}
25163
25319
  });
25164
- var listCommand6 = defineCommand131({
25320
+ var listCommand7 = defineCommand132({
25165
25321
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
25166
25322
  run: async () => {
25167
25323
  try {
@@ -25186,7 +25342,7 @@ registerSchema({
25186
25342
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
25187
25343
  }
25188
25344
  });
25189
- var addCommand = defineCommand131({
25345
+ var addCommand = defineCommand132({
25190
25346
  meta: {
25191
25347
  name: "add",
25192
25348
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -25227,7 +25383,7 @@ registerSchema({
25227
25383
  description: "Remove a company custom MCP server by name.",
25228
25384
  args: { name: { type: "string", description: "Server name to remove", required: true } }
25229
25385
  });
25230
- var removeCommand4 = defineCommand131({
25386
+ var removeCommand4 = defineCommand132({
25231
25387
  meta: {
25232
25388
  name: "remove",
25233
25389
  description: `Remove a company custom MCP server by name.
@@ -25249,7 +25405,7 @@ Example:
25249
25405
  }
25250
25406
  }
25251
25407
  });
25252
- var mcpCommand = defineCommand131({
25408
+ var mcpCommand = defineCommand132({
25253
25409
  meta: {
25254
25410
  name: "mcp",
25255
25411
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -25266,17 +25422,17 @@ Examples:
25266
25422
  baker mcp remove --name weather`
25267
25423
  },
25268
25424
  subCommands: {
25269
- list: listCommand6,
25425
+ list: listCommand7,
25270
25426
  add: addCommand,
25271
25427
  remove: removeCommand4
25272
25428
  }
25273
25429
  });
25274
25430
 
25275
25431
  // src/commands/research/index.ts
25276
- import { defineCommand as defineCommand142 } from "citty";
25432
+ import { defineCommand as defineCommand143 } from "citty";
25277
25433
 
25278
25434
  // src/commands/research/advertisers.ts
25279
- import { defineCommand as defineCommand132 } from "citty";
25435
+ import { defineCommand as defineCommand133 } from "citty";
25280
25436
 
25281
25437
  // src/commands/research/output.ts
25282
25438
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -25389,7 +25545,7 @@ var FIELDS3 = {
25389
25545
  etv: "Estimated traffic value (USD)",
25390
25546
  visibility: "SERP visibility score (0-1)"
25391
25547
  };
25392
- var advertisersCommand = defineCommand132({
25548
+ var advertisersCommand = defineCommand133({
25393
25549
  meta: {
25394
25550
  name: "advertisers",
25395
25551
  description: `Find domains competing for a keyword in Google SERPs.
@@ -25436,7 +25592,7 @@ Examples:
25436
25592
  });
25437
25593
 
25438
25594
  // src/commands/research/autocomplete.ts
25439
- import { defineCommand as defineCommand133 } from "citty";
25595
+ import { defineCommand as defineCommand134 } from "citty";
25440
25596
  registerSchema({
25441
25597
  command: "research.autocomplete",
25442
25598
  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).",
@@ -25459,7 +25615,7 @@ registerSchema({
25459
25615
  var FIELDS4 = {
25460
25616
  suggestion: "Autocomplete suggestion from Google"
25461
25617
  };
25462
- var autocompleteCommand = defineCommand133({
25618
+ var autocompleteCommand = defineCommand134({
25463
25619
  meta: {
25464
25620
  name: "autocomplete",
25465
25621
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -25505,7 +25661,7 @@ Examples:
25505
25661
  });
25506
25662
 
25507
25663
  // src/commands/research/countries.ts
25508
- import { defineCommand as defineCommand134 } from "citty";
25664
+ import { defineCommand as defineCommand135 } from "citty";
25509
25665
  registerSchema({
25510
25666
  command: "research.countries",
25511
25667
  description: "List all supported country codes for --location flag in research commands.",
@@ -25562,7 +25718,7 @@ var FIELDS5 = {
25562
25718
  code: "Country code to pass as --location",
25563
25719
  name: "Country name"
25564
25720
  };
25565
- var countriesCommand = defineCommand134({
25721
+ var countriesCommand = defineCommand135({
25566
25722
  meta: {
25567
25723
  name: "countries",
25568
25724
  description: "List all supported country codes for --location flag."
@@ -25573,7 +25729,7 @@ var countriesCommand = defineCommand134({
25573
25729
  });
25574
25730
 
25575
25731
  // src/commands/research/intent.ts
25576
- import { defineCommand as defineCommand135 } from "citty";
25732
+ import { defineCommand as defineCommand136 } from "citty";
25577
25733
  registerSchema({
25578
25734
  command: "research.intent",
25579
25735
  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.",
@@ -25596,7 +25752,7 @@ var FIELDS6 = {
25596
25752
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
25597
25753
  probability: "Confidence score 0.0-1.0"
25598
25754
  };
25599
- var intentCommand = defineCommand135({
25755
+ var intentCommand = defineCommand136({
25600
25756
  meta: {
25601
25757
  name: "intent",
25602
25758
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -25644,7 +25800,7 @@ Examples:
25644
25800
  });
25645
25801
 
25646
25802
  // src/commands/research/keyword-gap.ts
25647
- import { defineCommand as defineCommand136 } from "citty";
25803
+ import { defineCommand as defineCommand137 } from "citty";
25648
25804
  registerSchema({
25649
25805
  command: "research.keyword-gap",
25650
25806
  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.",
@@ -25673,7 +25829,7 @@ var FIELDS7 = {
25673
25829
  cpc: "Cost per click USD",
25674
25830
  their_position: "Competitor's ranking position"
25675
25831
  };
25676
- var keywordGapCommand = defineCommand136({
25832
+ var keywordGapCommand = defineCommand137({
25677
25833
  meta: {
25678
25834
  name: "keyword-gap",
25679
25835
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -25747,7 +25903,7 @@ Examples:
25747
25903
  });
25748
25904
 
25749
25905
  // src/commands/research/keywords-for-site.ts
25750
- import { defineCommand as defineCommand137 } from "citty";
25906
+ import { defineCommand as defineCommand138 } from "citty";
25751
25907
  registerSchema({
25752
25908
  command: "research.keywords-for-site",
25753
25909
  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.",
@@ -25780,7 +25936,7 @@ var FIELDS8 = {
25780
25936
  competition: "LOW, MEDIUM, or HIGH",
25781
25937
  competition_index: "Competition score 0-100"
25782
25938
  };
25783
- var keywordsForSiteCommand = defineCommand137({
25939
+ var keywordsForSiteCommand = defineCommand138({
25784
25940
  meta: {
25785
25941
  name: "keywords-for-site",
25786
25942
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -25833,7 +25989,7 @@ Examples:
25833
25989
  });
25834
25990
 
25835
25991
  // src/commands/research/languages.ts
25836
- import { defineCommand as defineCommand138 } from "citty";
25992
+ import { defineCommand as defineCommand139 } from "citty";
25837
25993
  registerSchema({
25838
25994
  command: "research.languages",
25839
25995
  description: "List all supported language codes for --language flag in research commands.",
@@ -25863,7 +26019,7 @@ var FIELDS9 = {
25863
26019
  code: "Language code to pass as --language",
25864
26020
  name: "Language name (also accepted by --language)"
25865
26021
  };
25866
- var languagesCommand2 = defineCommand138({
26022
+ var languagesCommand2 = defineCommand139({
25867
26023
  meta: {
25868
26024
  name: "languages",
25869
26025
  description: "List all supported language codes for --language flag."
@@ -25874,7 +26030,7 @@ var languagesCommand2 = defineCommand138({
25874
26030
  });
25875
26031
 
25876
26032
  // src/commands/research/lighthouse.ts
25877
- import { defineCommand as defineCommand139 } from "citty";
26033
+ import { defineCommand as defineCommand140 } from "citty";
25878
26034
  registerSchema({
25879
26035
  command: "research.lighthouse",
25880
26036
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -25893,7 +26049,7 @@ var FIELDS10 = {
25893
26049
  speed_index_ms: "Speed Index in ms (good: < 3400)",
25894
26050
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
25895
26051
  };
25896
- var lighthouseCommand = defineCommand139({
26052
+ var lighthouseCommand = defineCommand140({
25897
26053
  meta: {
25898
26054
  name: "lighthouse",
25899
26055
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -25931,7 +26087,7 @@ Examples:
25931
26087
  });
25932
26088
 
25933
26089
  // src/commands/research/relevant-pages.ts
25934
- import { defineCommand as defineCommand140 } from "citty";
26090
+ import { defineCommand as defineCommand141 } from "citty";
25935
26091
  registerSchema({
25936
26092
  command: "research.relevant-pages",
25937
26093
  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).",
@@ -25957,7 +26113,7 @@ var FIELDS11 = {
25957
26113
  keywords: "Total organic keywords the page ranks for",
25958
26114
  top_10: "Keywords in positions 1-10"
25959
26115
  };
25960
- var relevantPagesCommand = defineCommand140({
26116
+ var relevantPagesCommand = defineCommand141({
25961
26117
  meta: {
25962
26118
  name: "relevant-pages",
25963
26119
  description: `Get the top pages of a competitor domain with traffic data.
@@ -26003,7 +26159,7 @@ Examples:
26003
26159
  });
26004
26160
 
26005
26161
  // src/commands/research/web.ts
26006
- import { defineCommand as defineCommand141 } from "citty";
26162
+ import { defineCommand as defineCommand142 } from "citty";
26007
26163
  registerSchema({
26008
26164
  command: "research.web",
26009
26165
  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).",
@@ -26054,7 +26210,7 @@ async function runDeepResearch(question) {
26054
26210
  }
26055
26211
  throw new Error("Deep research timed out");
26056
26212
  }
26057
- var webCommand = defineCommand141({
26213
+ var webCommand = defineCommand142({
26058
26214
  meta: {
26059
26215
  name: "web",
26060
26216
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -26114,7 +26270,7 @@ Examples:
26114
26270
  });
26115
26271
 
26116
26272
  // src/commands/research/index.ts
26117
- var researchCommand = defineCommand142({
26273
+ var researchCommand = defineCommand143({
26118
26274
  meta: {
26119
26275
  name: "research",
26120
26276
  description: `Competitive intelligence and AI-powered research commands.
@@ -26154,10 +26310,10 @@ Examples:
26154
26310
  });
26155
26311
 
26156
26312
  // src/commands/scheduled-actions/index.ts
26157
- import { defineCommand as defineCommand149 } from "citty";
26313
+ import { defineCommand as defineCommand150 } from "citty";
26158
26314
 
26159
26315
  // src/commands/scheduled-actions/create.ts
26160
- import { defineCommand as defineCommand143 } from "citty";
26316
+ import { defineCommand as defineCommand144 } from "citty";
26161
26317
 
26162
26318
  // src/commands/scheduled-actions/shared.ts
26163
26319
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -26272,7 +26428,7 @@ registerSchema({
26272
26428
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
26273
26429
  }
26274
26430
  });
26275
- var createCommand2 = defineCommand143({
26431
+ var createCommand2 = defineCommand144({
26276
26432
  meta: {
26277
26433
  name: "create",
26278
26434
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -26321,7 +26477,7 @@ var createCommand2 = defineCommand143({
26321
26477
  });
26322
26478
 
26323
26479
  // src/commands/scheduled-actions/delete.ts
26324
- import { defineCommand as defineCommand144 } from "citty";
26480
+ import { defineCommand as defineCommand145 } from "citty";
26325
26481
  registerSchema({
26326
26482
  command: "scheduled-actions.delete",
26327
26483
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -26329,7 +26485,7 @@ registerSchema({
26329
26485
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26330
26486
  }
26331
26487
  });
26332
- var deleteCommand2 = defineCommand144({
26488
+ var deleteCommand2 = defineCommand145({
26333
26489
  meta: {
26334
26490
  name: "delete",
26335
26491
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -26358,7 +26514,7 @@ var deleteCommand2 = defineCommand144({
26358
26514
  });
26359
26515
 
26360
26516
  // src/commands/scheduled-actions/get.ts
26361
- import { defineCommand as defineCommand145 } from "citty";
26517
+ import { defineCommand as defineCommand146 } from "citty";
26362
26518
  registerSchema({
26363
26519
  command: "scheduled-actions.get",
26364
26520
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -26366,7 +26522,7 @@ registerSchema({
26366
26522
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26367
26523
  }
26368
26524
  });
26369
- var getCommand3 = defineCommand145({
26525
+ var getCommand3 = defineCommand146({
26370
26526
  meta: {
26371
26527
  name: "get",
26372
26528
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -26403,13 +26559,13 @@ var getCommand3 = defineCommand145({
26403
26559
  });
26404
26560
 
26405
26561
  // src/commands/scheduled-actions/list.ts
26406
- import { defineCommand as defineCommand146 } from "citty";
26562
+ import { defineCommand as defineCommand147 } from "citty";
26407
26563
  registerSchema({
26408
26564
  command: "scheduled-actions.list",
26409
26565
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
26410
26566
  args: {}
26411
26567
  });
26412
- var listCommand7 = defineCommand146({
26568
+ var listCommand8 = defineCommand147({
26413
26569
  meta: {
26414
26570
  name: "list",
26415
26571
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -26430,7 +26586,7 @@ var listCommand7 = defineCommand146({
26430
26586
  });
26431
26587
 
26432
26588
  // src/commands/scheduled-actions/trigger.ts
26433
- import { defineCommand as defineCommand147 } from "citty";
26589
+ import { defineCommand as defineCommand148 } from "citty";
26434
26590
  registerSchema({
26435
26591
  command: "scheduled-actions.trigger",
26436
26592
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -26438,7 +26594,7 @@ registerSchema({
26438
26594
  id: { type: "string", description: "Published scheduled action ID", required: true }
26439
26595
  }
26440
26596
  });
26441
- var triggerCommand = defineCommand147({
26597
+ var triggerCommand = defineCommand148({
26442
26598
  meta: {
26443
26599
  name: "trigger",
26444
26600
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -26475,7 +26631,7 @@ var triggerCommand = defineCommand147({
26475
26631
  });
26476
26632
 
26477
26633
  // src/commands/scheduled-actions/update.ts
26478
- import { defineCommand as defineCommand148 } from "citty";
26634
+ import { defineCommand as defineCommand149 } from "citty";
26479
26635
  registerSchema({
26480
26636
  command: "scheduled-actions.update",
26481
26637
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -26500,7 +26656,7 @@ registerSchema({
26500
26656
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
26501
26657
  }
26502
26658
  });
26503
- var updateCommand2 = defineCommand148({
26659
+ var updateCommand2 = defineCommand149({
26504
26660
  meta: {
26505
26661
  name: "update",
26506
26662
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -26571,7 +26727,7 @@ var updateCommand2 = defineCommand148({
26571
26727
  });
26572
26728
 
26573
26729
  // src/commands/scheduled-actions/index.ts
26574
- var scheduledActionsCommand = defineCommand149({
26730
+ var scheduledActionsCommand = defineCommand150({
26575
26731
  meta: {
26576
26732
  name: "scheduled-actions",
26577
26733
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -26587,7 +26743,7 @@ Examples:
26587
26743
  baker scheduled-actions trigger <id>`
26588
26744
  },
26589
26745
  subCommands: {
26590
- list: listCommand7,
26746
+ list: listCommand8,
26591
26747
  get: getCommand3,
26592
26748
  create: createCommand2,
26593
26749
  update: updateCommand2,
@@ -26597,8 +26753,8 @@ Examples:
26597
26753
  });
26598
26754
 
26599
26755
  // src/commands/schema.ts
26600
- import { defineCommand as defineCommand150 } from "citty";
26601
- var schemaCommand = defineCommand150({
26756
+ import { defineCommand as defineCommand151 } from "citty";
26757
+ var schemaCommand = defineCommand151({
26602
26758
  meta: {
26603
26759
  name: "schema",
26604
26760
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -26634,7 +26790,7 @@ var schemaCommand = defineCommand150({
26634
26790
  });
26635
26791
 
26636
26792
  // src/commands/tags/index.ts
26637
- import { defineCommand as defineCommand151 } from "citty";
26793
+ import { defineCommand as defineCommand152 } from "citty";
26638
26794
 
26639
26795
  // src/commands/tags/shared.ts
26640
26796
  function failApi3(err) {
@@ -26700,7 +26856,7 @@ async function listTags(json) {
26700
26856
  failApi3(err);
26701
26857
  }
26702
26858
  }
26703
- var listCommand8 = defineCommand151({
26859
+ var listCommand9 = defineCommand152({
26704
26860
  meta: {
26705
26861
  name: "list",
26706
26862
  description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
@@ -26719,7 +26875,7 @@ async function listDraft3() {
26719
26875
  failApi3(err);
26720
26876
  }
26721
26877
  }
26722
- var draftCommand3 = defineCommand151({
26878
+ var draftCommand3 = defineCommand152({
26723
26879
  meta: {
26724
26880
  name: "draft",
26725
26881
  description: "Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published; to amend or drop one, propose a follow-up change through the same tool (a delete on a tag_temp_* ref drops the staged create)."
@@ -26728,7 +26884,7 @@ var draftCommand3 = defineCommand151({
26728
26884
  await listDraft3();
26729
26885
  }
26730
26886
  });
26731
- var tagsCommand3 = defineCommand151({
26887
+ var tagsCommand3 = defineCommand152({
26732
26888
  meta: {
26733
26889
  name: "tags",
26734
26890
  description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, \u2026) \u2014 production tags plus the changes staged in this chat.
@@ -26744,7 +26900,7 @@ Examples:
26744
26900
  baker tags draft # review the staged changes awaiting publish`
26745
26901
  },
26746
26902
  subCommands: {
26747
- list: listCommand8,
26903
+ list: listCommand9,
26748
26904
  draft: draftCommand3
26749
26905
  },
26750
26906
  run: async () => {
@@ -26753,10 +26909,10 @@ Examples:
26753
26909
  });
26754
26910
 
26755
26911
  // src/commands/testimonials/index.ts
26756
- import { defineCommand as defineCommand155 } from "citty";
26912
+ import { defineCommand as defineCommand156 } from "citty";
26757
26913
 
26758
26914
  // src/commands/testimonials/get.ts
26759
- import { defineCommand as defineCommand152 } from "citty";
26915
+ import { defineCommand as defineCommand153 } from "citty";
26760
26916
  registerSchema({
26761
26917
  command: "testimonials.get",
26762
26918
  description: "Get a single testimonial by ID",
@@ -26764,7 +26920,7 @@ registerSchema({
26764
26920
  id: { type: "string", description: "Testimonial ID", required: true }
26765
26921
  }
26766
26922
  });
26767
- var getCommand4 = defineCommand152({
26923
+ var getCommand4 = defineCommand153({
26768
26924
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
26769
26925
  args: {
26770
26926
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -26801,7 +26957,7 @@ var getCommand4 = defineCommand152({
26801
26957
  });
26802
26958
 
26803
26959
  // src/commands/testimonials/list.ts
26804
- import { defineCommand as defineCommand153 } from "citty";
26960
+ import { defineCommand as defineCommand154 } from "citty";
26805
26961
  registerSchema({
26806
26962
  command: "testimonials.list",
26807
26963
  description: "List testimonials with optional filters.",
@@ -26831,7 +26987,7 @@ registerSchema({
26831
26987
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
26832
26988
  }
26833
26989
  });
26834
- var listCommand9 = defineCommand153({
26990
+ var listCommand10 = defineCommand154({
26835
26991
  meta: {
26836
26992
  name: "list",
26837
26993
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -26880,7 +27036,7 @@ var listCommand9 = defineCommand153({
26880
27036
  });
26881
27037
 
26882
27038
  // src/commands/testimonials/search.ts
26883
- import { defineCommand as defineCommand154 } from "citty";
27039
+ import { defineCommand as defineCommand155 } from "citty";
26884
27040
  registerSchema({
26885
27041
  command: "testimonials.search",
26886
27042
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -26911,7 +27067,7 @@ registerSchema({
26911
27067
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
26912
27068
  }
26913
27069
  });
26914
- var searchCommand2 = defineCommand154({
27070
+ var searchCommand2 = defineCommand155({
26915
27071
  meta: {
26916
27072
  name: "search",
26917
27073
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -26985,7 +27141,7 @@ var searchCommand2 = defineCommand154({
26985
27141
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
26986
27142
 
26987
27143
  // src/commands/testimonials/index.ts
26988
- var testimonialsCommand = defineCommand155({
27144
+ var testimonialsCommand = defineCommand156({
26989
27145
  meta: {
26990
27146
  name: "testimonials",
26991
27147
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -27000,16 +27156,16 @@ Examples:
27000
27156
  subCommands: {
27001
27157
  get: getCommand4,
27002
27158
  search: searchCommand2,
27003
- list: listCommand9,
27159
+ list: listCommand10,
27004
27160
  tags: tagsCommand4
27005
27161
  }
27006
27162
  });
27007
27163
 
27008
27164
  // src/commands/videos/index.ts
27009
- import { defineCommand as defineCommand160 } from "citty";
27165
+ import { defineCommand as defineCommand161 } from "citty";
27010
27166
 
27011
27167
  // src/commands/videos/delete.ts
27012
- import { defineCommand as defineCommand156 } from "citty";
27168
+ import { defineCommand as defineCommand157 } from "citty";
27013
27169
  registerSchema({
27014
27170
  command: "videos.delete",
27015
27171
  description: "Delete a video by ID",
@@ -27023,7 +27179,7 @@ registerSchema({
27023
27179
  }
27024
27180
  }
27025
27181
  });
27026
- var deleteCommand3 = defineCommand156({
27182
+ var deleteCommand3 = defineCommand157({
27027
27183
  meta: {
27028
27184
  name: "delete",
27029
27185
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -27064,7 +27220,7 @@ var deleteCommand3 = defineCommand156({
27064
27220
  });
27065
27221
 
27066
27222
  // src/commands/videos/get.ts
27067
- import { defineCommand as defineCommand157 } from "citty";
27223
+ import { defineCommand as defineCommand158 } from "citty";
27068
27224
  registerSchema({
27069
27225
  command: "videos.get",
27070
27226
  description: "Get a single video by ID",
@@ -27072,7 +27228,7 @@ registerSchema({
27072
27228
  id: { type: "string", description: "Video ID", required: true }
27073
27229
  }
27074
27230
  });
27075
- var getCommand5 = defineCommand157({
27231
+ var getCommand5 = defineCommand158({
27076
27232
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
27077
27233
  args: {
27078
27234
  id: { type: "positional", description: "Video ID", required: false },
@@ -27109,7 +27265,7 @@ var getCommand5 = defineCommand157({
27109
27265
  });
27110
27266
 
27111
27267
  // src/commands/videos/search.ts
27112
- import { defineCommand as defineCommand158 } from "citty";
27268
+ import { defineCommand as defineCommand159 } from "citty";
27113
27269
  registerSchema({
27114
27270
  command: "videos.search",
27115
27271
  description: "Search videos by text query. Only returns ready videos.",
@@ -27119,7 +27275,7 @@ registerSchema({
27119
27275
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27120
27276
  }
27121
27277
  });
27122
- var searchCommand3 = defineCommand158({
27278
+ var searchCommand3 = defineCommand159({
27123
27279
  meta: {
27124
27280
  name: "search",
27125
27281
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -27171,7 +27327,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
27171
27327
  // src/commands/videos/upload.ts
27172
27328
  import { readFile as readFile20, stat as stat5 } from "fs/promises";
27173
27329
  import { extname as extname3 } from "path";
27174
- import { defineCommand as defineCommand159 } from "citty";
27330
+ import { defineCommand as defineCommand160 } from "citty";
27175
27331
  var MIME_MAP = {
27176
27332
  ".mp4": "video/mp4",
27177
27333
  ".mov": "video/quicktime",
@@ -27205,7 +27361,7 @@ function detectContentType(filePath) {
27205
27361
  }
27206
27362
  return mime;
27207
27363
  }
27208
- var uploadCommand2 = defineCommand159({
27364
+ var uploadCommand2 = defineCommand160({
27209
27365
  meta: {
27210
27366
  name: "upload",
27211
27367
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -27259,7 +27415,7 @@ var uploadCommand2 = defineCommand159({
27259
27415
  });
27260
27416
 
27261
27417
  // src/commands/videos/index.ts
27262
- var videosCommand = defineCommand160({
27418
+ var videosCommand = defineCommand161({
27263
27419
  meta: {
27264
27420
  name: "videos",
27265
27421
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -27282,10 +27438,10 @@ Examples:
27282
27438
  });
27283
27439
 
27284
27440
  // src/commands/winning-ads/index.ts
27285
- import { defineCommand as defineCommand171 } from "citty";
27441
+ import { defineCommand as defineCommand172 } from "citty";
27286
27442
 
27287
27443
  // src/commands/winning-ads/advertisers.ts
27288
- import { defineCommand as defineCommand161 } from "citty";
27444
+ import { defineCommand as defineCommand162 } from "citty";
27289
27445
 
27290
27446
  // src/commands/winning-ads/shared.ts
27291
27447
  function splitList(value) {
@@ -27338,7 +27494,7 @@ function advertiserNormalizer(record, full) {
27338
27494
  last_synced_at: record.last_synced_at ?? null
27339
27495
  };
27340
27496
  }
27341
- var advertisersCommand2 = defineCommand161({
27497
+ var advertisersCommand2 = defineCommand162({
27342
27498
  meta: {
27343
27499
  name: "advertisers",
27344
27500
  description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
@@ -27396,7 +27552,7 @@ var advertisersCommand2 = defineCommand161({
27396
27552
  });
27397
27553
 
27398
27554
  // src/commands/winning-ads/brief.ts
27399
- import { defineCommand as defineCommand162 } from "citty";
27555
+ import { defineCommand as defineCommand163 } from "citty";
27400
27556
  registerSchema({
27401
27557
  command: "winning-ads.brief",
27402
27558
  description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
@@ -27442,7 +27598,7 @@ function parseDna(raw) {
27442
27598
  }
27443
27599
  return parsed;
27444
27600
  }
27445
- var briefCommand = defineCommand162({
27601
+ var briefCommand = defineCommand163({
27446
27602
  meta: {
27447
27603
  name: "brief",
27448
27604
  description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
@@ -27478,7 +27634,7 @@ var briefCommand = defineCommand162({
27478
27634
  });
27479
27635
 
27480
27636
  // src/commands/winning-ads/feed.ts
27481
- import { defineCommand as defineCommand163 } from "citty";
27637
+ import { defineCommand as defineCommand164 } from "citty";
27482
27638
  function buildFeedParams(input) {
27483
27639
  const params = {};
27484
27640
  const advertiser = splitList(input.advertiser);
@@ -27530,7 +27686,7 @@ registerSchema({
27530
27686
  format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
27531
27687
  }
27532
27688
  });
27533
- var feedCommand = defineCommand163({
27689
+ var feedCommand = defineCommand164({
27534
27690
  meta: {
27535
27691
  name: "feed",
27536
27692
  description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
@@ -27615,7 +27771,7 @@ var feedCommand = defineCommand163({
27615
27771
  });
27616
27772
 
27617
27773
  // src/commands/winning-ads/follow.ts
27618
- import { defineCommand as defineCommand164 } from "citty";
27774
+ import { defineCommand as defineCommand165 } from "citty";
27619
27775
  var PLATFORMS = ["meta", "linkedin"];
27620
27776
  registerSchema({
27621
27777
  command: "winning-ads.follow",
@@ -27630,7 +27786,7 @@ registerSchema({
27630
27786
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
27631
27787
  }
27632
27788
  });
27633
- var followCommand = defineCommand164({
27789
+ var followCommand = defineCommand165({
27634
27790
  meta: {
27635
27791
  name: "follow",
27636
27792
  description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
@@ -27677,7 +27833,7 @@ var followCommand = defineCommand164({
27677
27833
  });
27678
27834
 
27679
27835
  // src/commands/winning-ads/following.ts
27680
- import { defineCommand as defineCommand165 } from "citty";
27836
+ import { defineCommand as defineCommand166 } from "citty";
27681
27837
  registerSchema({
27682
27838
  command: "winning-ads.following",
27683
27839
  description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
@@ -27710,7 +27866,7 @@ function followingNormalizer(record, full) {
27710
27866
  platforms: Array.isArray(record.platforms) ? record.platforms : []
27711
27867
  };
27712
27868
  }
27713
- var followingCommand = defineCommand165({
27869
+ var followingCommand = defineCommand166({
27714
27870
  meta: {
27715
27871
  name: "following",
27716
27872
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -27745,7 +27901,7 @@ var followingCommand = defineCommand165({
27745
27901
  });
27746
27902
 
27747
27903
  // src/commands/winning-ads/patterns.ts
27748
- import { defineCommand as defineCommand166 } from "citty";
27904
+ import { defineCommand as defineCommand167 } from "citty";
27749
27905
  registerSchema({
27750
27906
  command: "winning-ads.patterns",
27751
27907
  description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
@@ -27784,7 +27940,7 @@ function discriminatorRow(record) {
27784
27940
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
27785
27941
  };
27786
27942
  }
27787
- var patternsCommand = defineCommand166({
27943
+ var patternsCommand = defineCommand167({
27788
27944
  meta: {
27789
27945
  name: "patterns",
27790
27946
  description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
@@ -27840,7 +27996,7 @@ var patternsCommand = defineCommand166({
27840
27996
  });
27841
27997
 
27842
27998
  // src/commands/winning-ads/search.ts
27843
- import { defineCommand as defineCommand167 } from "citty";
27999
+ import { defineCommand as defineCommand168 } from "citty";
27844
28000
  registerSchema({
27845
28001
  command: "winning-ads.search",
27846
28002
  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.",
@@ -27948,7 +28104,7 @@ function buildSearchBody(args) {
27948
28104
  }
27949
28105
  return body;
27950
28106
  }
27951
- var searchCommand4 = defineCommand167({
28107
+ var searchCommand4 = defineCommand168({
27952
28108
  meta: {
27953
28109
  name: "search",
27954
28110
  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"
@@ -28063,7 +28219,7 @@ var searchCommand4 = defineCommand167({
28063
28219
  });
28064
28220
 
28065
28221
  // src/commands/winning-ads/seeds.ts
28066
- import { defineCommand as defineCommand168 } from "citty";
28222
+ import { defineCommand as defineCommand169 } from "citty";
28067
28223
  function leanRow(r) {
28068
28224
  return {
28069
28225
  key: r.key,
@@ -28091,7 +28247,7 @@ function makeSeedCommand(opts) {
28091
28247
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
28092
28248
  }
28093
28249
  });
28094
- return defineCommand168({
28250
+ return defineCommand169({
28095
28251
  meta: { name: opts.name, description: opts.description },
28096
28252
  args: {
28097
28253
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -28140,7 +28296,7 @@ var formatsCommand = makeSeedCommand({
28140
28296
  });
28141
28297
 
28142
28298
  // src/commands/winning-ads/unfollow.ts
28143
- import { defineCommand as defineCommand169 } from "citty";
28299
+ import { defineCommand as defineCommand170 } from "citty";
28144
28300
  registerSchema({
28145
28301
  command: "winning-ads.unfollow",
28146
28302
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -28148,7 +28304,7 @@ registerSchema({
28148
28304
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
28149
28305
  }
28150
28306
  });
28151
- var unfollowCommand = defineCommand169({
28307
+ var unfollowCommand = defineCommand170({
28152
28308
  meta: {
28153
28309
  name: "unfollow",
28154
28310
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -28169,7 +28325,7 @@ var unfollowCommand = defineCommand169({
28169
28325
  });
28170
28326
 
28171
28327
  // src/commands/winning-ads/winners.ts
28172
- import { defineCommand as defineCommand170 } from "citty";
28328
+ import { defineCommand as defineCommand171 } from "citty";
28173
28329
  registerSchema({
28174
28330
  command: "winning-ads.winners",
28175
28331
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -28179,7 +28335,7 @@ registerSchema({
28179
28335
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
28180
28336
  }
28181
28337
  });
28182
- var winnersCommand = defineCommand170({
28338
+ var winnersCommand = defineCommand171({
28183
28339
  meta: {
28184
28340
  name: "winners",
28185
28341
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -28229,7 +28385,7 @@ var winnersCommand = defineCommand170({
28229
28385
  });
28230
28386
 
28231
28387
  // src/commands/winning-ads/index.ts
28232
- var winningAdsCommand = defineCommand171({
28388
+ var winningAdsCommand = defineCommand172({
28233
28389
  meta: {
28234
28390
  name: "winning-ads",
28235
28391
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -28294,11 +28450,11 @@ function getCliVersion() {
28294
28450
  }
28295
28451
 
28296
28452
  // src/cli.ts
28297
- var main = defineCommand172({
28453
+ var main = defineCommand173({
28298
28454
  meta: {
28299
28455
  name: "baker",
28300
28456
  version: getCliVersion(),
28301
- description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, marketing tags, and ad platform data in Baker.
28457
+ description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, marketing tags, account history, and ad platform data in Baker.
28302
28458
 
28303
28459
  Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
28304
28460
  Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
@@ -28320,6 +28476,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28320
28476
  testimonials: testimonialsCommand,
28321
28477
  canvas: canvasCommand,
28322
28478
  tags: tagsCommand3,
28479
+ history: historyCommand,
28323
28480
  "winning-ads": winningAdsCommand,
28324
28481
  mcp: mcpCommand,
28325
28482
  schema: schemaCommand