@koda-sl/baker-cli 0.135.0 → 0.135.1-dev.46c403ad4

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 defineCommand174, runMain } from "citty";
77
77
 
78
78
  // src/commands/actions/index.ts
79
79
  import { defineCommand as defineCommand18 } from "citty";
@@ -1928,8 +1928,207 @@ var linkedinDraftErrorResponseSchema = z4.object({
1928
1928
  fields: z4.array(linkedinFieldErrorSchema).optional()
1929
1929
  });
1930
1930
 
1931
- // ../api/src/flows.ts
1931
+ // ../api/src/chats.ts
1932
1932
  import { z as z5 } from "zod";
1933
+ var chatInspectStatusSchema = z5.enum([
1934
+ "draft",
1935
+ "in_progress",
1936
+ "publishing",
1937
+ "publish_failed",
1938
+ "completed",
1939
+ "discarded"
1940
+ ]);
1941
+ var chatStatusGroupSchema = z5.enum(["active", "archived", "all"]);
1942
+ var chatChangeTypeSchema = z5.enum([
1943
+ "landing",
1944
+ "document",
1945
+ "knowledge",
1946
+ "brand",
1947
+ "company",
1948
+ "flow",
1949
+ "action",
1950
+ "creative",
1951
+ "tags",
1952
+ "report",
1953
+ "linkedin-ads",
1954
+ "google-ads",
1955
+ "meta-ads",
1956
+ "briefs"
1957
+ ]);
1958
+ var chatChangeActionSchema = z5.enum(["created", "updated", "deleted"]);
1959
+ var chatChangeSummarySchema = z5.object({
1960
+ type: chatChangeTypeSchema,
1961
+ slug: z5.string(),
1962
+ action: chatChangeActionSchema,
1963
+ title: z5.string().optional()
1964
+ });
1965
+ var repoSurfaceSchema = z5.enum(["knowledge", "company", "brand", "landings", "flows", "creatives"]);
1966
+ var chatsListRequestSchema = z5.object({
1967
+ status: chatStatusGroupSchema.optional(),
1968
+ limit: z5.number().int().min(1).max(100).optional(),
1969
+ /** Include each Session's full `changes[]` list (compact returns counts only). */
1970
+ full: z5.boolean().optional()
1971
+ });
1972
+ var chatSummarySchema = z5.object({
1973
+ id: z5.string(),
1974
+ title: z5.string(),
1975
+ status: chatInspectStatusSchema,
1976
+ createdAt: z5.number(),
1977
+ updatedAt: z5.number(),
1978
+ /** Counts of produced outputs keyed by change type. */
1979
+ outputs: z5.record(z5.string(), z5.number()),
1980
+ outputTotal: z5.number(),
1981
+ changes: z5.array(chatChangeSummarySchema).optional()
1982
+ });
1983
+ var chatsListResponseSchema = z5.object({
1984
+ ok: z5.literal(true),
1985
+ data: z5.object({ chats: z5.array(chatSummarySchema) })
1986
+ });
1987
+ var chatsViewRequestSchema = z5.object({
1988
+ chatId: z5.string(),
1989
+ full: z5.boolean().optional()
1990
+ });
1991
+ var chatThreadSummarySchema = z5.object({
1992
+ id: z5.string(),
1993
+ title: z5.string().nullable(),
1994
+ status: z5.string(),
1995
+ createdAt: z5.number()
1996
+ });
1997
+ var chatCommitSummarySchema = z5.object({
1998
+ sha: z5.string(),
1999
+ message: z5.string().nullable(),
2000
+ surfaces: z5.array(z5.string()),
2001
+ createdAt: z5.number()
2002
+ });
2003
+ var effectOpSchema = z5.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
2004
+ var contentEffectSchema = z5.object({
2005
+ surface: chatChangeTypeSchema,
2006
+ slug: z5.string(),
2007
+ op: effectOpSchema,
2008
+ staged: z5.boolean()
2009
+ });
2010
+ var actionEffectSchema = z5.object({
2011
+ op: effectOpSchema,
2012
+ staged: z5.boolean(),
2013
+ name: z5.string(),
2014
+ description: z5.string().nullable(),
2015
+ priority: z5.string().nullable(),
2016
+ tags: z5.array(z5.string()),
2017
+ status: z5.string().nullable(),
2018
+ note: z5.string().nullable(),
2019
+ reason: z5.string().nullable()
2020
+ });
2021
+ var scheduledEffectSchema = z5.object({
2022
+ op: effectOpSchema,
2023
+ staged: z5.boolean(),
2024
+ name: z5.string(),
2025
+ summary: z5.string().nullable()
2026
+ });
2027
+ var tagEffectSchema = z5.object({
2028
+ op: effectOpSchema,
2029
+ staged: z5.boolean(),
2030
+ tagType: z5.string(),
2031
+ title: z5.string().nullable(),
2032
+ summary: z5.string().nullable(),
2033
+ configKeys: z5.array(z5.string()),
2034
+ hasSecrets: z5.boolean()
2035
+ });
2036
+ var adEffectSchema = z5.object({
2037
+ platform: z5.enum(["google", "meta", "linkedin"]),
2038
+ op: effectOpSchema,
2039
+ staged: z5.boolean(),
2040
+ entity: z5.string().nullable(),
2041
+ operation: z5.string().nullable(),
2042
+ summary: z5.string().nullable()
2043
+ });
2044
+ var creativeEffectSchema = z5.object({
2045
+ op: effectOpSchema,
2046
+ staged: z5.boolean(),
2047
+ slug: z5.string(),
2048
+ title: z5.string().nullable(),
2049
+ status: z5.string().nullable()
2050
+ });
2051
+ var chatEffectsSchema = z5.object({
2052
+ content: z5.array(contentEffectSchema),
2053
+ actions: z5.array(actionEffectSchema),
2054
+ scheduledActions: z5.array(scheduledEffectSchema),
2055
+ tags: z5.array(tagEffectSchema),
2056
+ ads: z5.object({
2057
+ google: z5.array(adEffectSchema),
2058
+ meta: z5.array(adEffectSchema),
2059
+ linkedin: z5.array(adEffectSchema)
2060
+ }),
2061
+ creatives: z5.array(creativeEffectSchema)
2062
+ });
2063
+ var chatDetailSchema = z5.object({
2064
+ id: z5.string(),
2065
+ title: z5.string(),
2066
+ status: chatInspectStatusSchema,
2067
+ createdAt: z5.number(),
2068
+ updatedAt: z5.number(),
2069
+ completedBySource: z5.enum(["user", "bridge"]).nullable(),
2070
+ publishedAt: z5.number().nullable(),
2071
+ /** The first user message — how this Session was originally asked. */
2072
+ kickoff: z5.string().nullable(),
2073
+ outputs: z5.record(z5.string(), z5.number()),
2074
+ outputTotal: z5.number(),
2075
+ /** The unified picture of everything this Session changed — git + DB. */
2076
+ effects: chatEffectsSchema,
2077
+ threads: z5.array(chatThreadSummarySchema),
2078
+ commits: z5.array(chatCommitSummarySchema),
2079
+ /** True when a real file-level diff is available via `baker chats diff`. */
2080
+ diffAvailable: z5.boolean()
2081
+ });
2082
+ var chatsViewResponseSchema = z5.object({
2083
+ ok: z5.literal(true),
2084
+ data: chatDetailSchema
2085
+ });
2086
+ var chatsTranscriptRequestSchema = z5.object({
2087
+ chatId: z5.string(),
2088
+ limit: z5.number().int().min(1).max(1e3).optional(),
2089
+ /** Return untruncated message text (compact truncates each entry). */
2090
+ full: z5.boolean().optional()
2091
+ });
2092
+ var transcriptEntrySchema = z5.object({
2093
+ role: z5.string(),
2094
+ text: z5.string()
2095
+ });
2096
+ var chatsTranscriptResponseSchema = z5.object({
2097
+ ok: z5.literal(true),
2098
+ data: z5.object({
2099
+ chatId: z5.string(),
2100
+ entries: z5.array(transcriptEntrySchema),
2101
+ /** True when older entries were dropped to fit `limit`. */
2102
+ truncated: z5.boolean()
2103
+ })
2104
+ });
2105
+ var chatsDiffRequestSchema = z5.object({
2106
+ chatId: z5.string(),
2107
+ surface: repoSurfaceSchema.optional(),
2108
+ /** Include the unified-diff `patch` text per file (compact omits it). */
2109
+ full: z5.boolean().optional()
2110
+ });
2111
+ var diffFileSchema = z5.object({
2112
+ path: z5.string(),
2113
+ surface: repoSurfaceSchema.nullable(),
2114
+ status: z5.string(),
2115
+ additions: z5.number(),
2116
+ deletions: z5.number(),
2117
+ patch: z5.string().optional()
2118
+ });
2119
+ var chatsDiffResponseSchema = z5.object({
2120
+ ok: z5.literal(true),
2121
+ data: z5.object({
2122
+ chatId: z5.string(),
2123
+ /** False when no published git diff exists (in-progress Session or unlinked repo). */
2124
+ available: z5.boolean(),
2125
+ reason: z5.string().optional(),
2126
+ files: z5.array(diffFileSchema)
2127
+ })
2128
+ });
2129
+
2130
+ // ../api/src/flows.ts
2131
+ import { z as z6 } from "zod";
1933
2132
  var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1934
2133
  "email",
1935
2134
  "zapier",
@@ -1940,7 +2139,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1940
2139
  "crmble",
1941
2140
  "goHighlevelContact"
1942
2141
  ];
1943
- var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
2142
+ var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1944
2143
  var FLOW_SECRET_FIELDS = {
1945
2144
  email: [],
1946
2145
  zapier: ["zapUrl"],
@@ -1968,94 +2167,140 @@ var FLOW_RESOURCE_NODE_TYPES = [
1968
2167
  "highlevel",
1969
2168
  "highlevelForm"
1970
2169
  ];
1971
- var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
1972
- var flowInputRequestSchema = z5.discriminatedUnion("target", [
1973
- z5.object({
2170
+ var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
2171
+ var flowInputRequestSchema = z6.discriminatedUnion("target", [
2172
+ z6.object({
1974
2173
  /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
1975
- target: z5.literal("sideEffect"),
1976
- flowSlug: z5.string(),
2174
+ target: z6.literal("sideEffect"),
2175
+ flowSlug: z6.string(),
1977
2176
  /** `id` of the FlowNode holding the side effect. */
1978
- nodeId: z5.string(),
2177
+ nodeId: z6.string(),
1979
2178
  /** `id` of the side effect within that node's `sideEffects[]`. */
1980
- sideEffectId: z5.string(),
2179
+ sideEffectId: z6.string(),
1981
2180
  sideEffectType: flowSideEffectTypeSchema,
1982
2181
  /** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
1983
- prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
2182
+ prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
1984
2183
  /** Secret credential field names the agent asks the user to provide. */
1985
- requestedSecretFields: z5.array(z5.string()).optional(),
1986
- message: z5.string().optional()
2184
+ requestedSecretFields: z6.array(z6.string()).optional(),
2185
+ message: z6.string().optional()
1987
2186
  }),
1988
- z5.object({
2187
+ z6.object({
1989
2188
  /** Configure a widget node's third-party `form.external` (+ `providerId`). */
1990
- target: z5.literal("node"),
1991
- flowSlug: z5.string(),
2189
+ target: z6.literal("node"),
2190
+ flowSlug: z6.string(),
1992
2191
  /** `id` of the widget FlowNode. */
1993
- nodeId: z5.string(),
2192
+ nodeId: z6.string(),
1994
2193
  nodeType: flowResourceNodeTypeSchema,
1995
- message: z5.string().optional()
2194
+ message: z6.string().optional()
1996
2195
  })
1997
2196
  ]);
1998
- var flowInputToolInputSchema = z5.object({
1999
- requests: z5.array(flowInputRequestSchema).min(1).max(8)
2197
+ var flowInputToolInputSchema = z6.object({
2198
+ requests: z6.array(flowInputRequestSchema).min(1).max(8)
2000
2199
  });
2001
- var flowInputResultSchema = z5.discriminatedUnion("status", [
2002
- z5.object({
2003
- status: z5.literal("submitted"),
2200
+ var flowInputResultSchema = z6.discriminatedUnion("status", [
2201
+ z6.object({
2202
+ status: z6.literal("submitted"),
2004
2203
  /** Echoes which piece this result resolves. */
2005
- nodeId: z5.string(),
2006
- sideEffectId: z5.string().optional(),
2204
+ nodeId: z6.string(),
2205
+ sideEffectId: z6.string().optional(),
2007
2206
  /** Names of secret fields the user provided. Never values. */
2008
- secretFieldsSet: z5.array(z5.string()),
2207
+ secretFieldsSet: z6.array(z6.string()),
2009
2208
  /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
2010
- note: z5.string().optional()
2209
+ note: z6.string().optional()
2011
2210
  }),
2012
- z5.object({
2013
- status: z5.literal("declined"),
2014
- nodeId: z5.string(),
2015
- sideEffectId: z5.string().optional(),
2016
- reason: z5.string().optional()
2211
+ z6.object({
2212
+ status: z6.literal("declined"),
2213
+ nodeId: z6.string(),
2214
+ sideEffectId: z6.string().optional(),
2215
+ reason: z6.string().optional()
2017
2216
  })
2018
2217
  ]);
2019
- var flowInputToolResultSchema = z5.object({
2020
- results: z5.array(flowInputResultSchema)
2218
+ var flowInputToolResultSchema = z6.object({
2219
+ results: z6.array(flowInputResultSchema)
2021
2220
  });
2022
- var flowsListRequestSchema = z5.object({ chatId: z5.string() });
2023
- var flowSummarySchema = z5.object({
2024
- slug: z5.string(),
2025
- name: z5.string(),
2221
+ var flowsListRequestSchema = z6.object({ chatId: z6.string() });
2222
+ var flowSummarySchema = z6.object({
2223
+ slug: z6.string(),
2224
+ name: z6.string(),
2026
2225
  /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
2027
- needsConfig: z5.number()
2226
+ needsConfig: z6.number()
2028
2227
  });
2029
- var flowsListResponseSchema = z5.object({ flows: z5.array(flowSummarySchema) });
2030
- var flowsShowRequestSchema = z5.object({
2031
- chatId: z5.string(),
2032
- slug: z5.string(),
2033
- full: z5.boolean().optional()
2228
+ var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
2229
+ var flowsShowRequestSchema = z6.object({
2230
+ chatId: z6.string(),
2231
+ slug: z6.string(),
2232
+ full: z6.boolean().optional()
2034
2233
  });
2035
- var flowConfigStatusSchema = z5.object({
2036
- nodeId: z5.string(),
2037
- nodeName: z5.string().optional(),
2234
+ var flowConfigStatusSchema = z6.object({
2235
+ nodeId: z6.string(),
2236
+ nodeName: z6.string().optional(),
2038
2237
  /** "sideEffect" credential/connection, or "node" widget resource. */
2039
- target: z5.enum(["sideEffect", "node"]),
2040
- sideEffectId: z5.string().optional(),
2041
- kind: z5.string(),
2238
+ target: z6.enum(["sideEffect", "node"]),
2239
+ sideEffectId: z6.string().optional(),
2240
+ kind: z6.string(),
2042
2241
  /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
2043
- status: z5.string(),
2242
+ status: z6.string(),
2044
2243
  /** True when a `request_flow_input` call is still needed for this piece. */
2045
- needsInput: z5.boolean()
2244
+ needsInput: z6.boolean()
2046
2245
  });
2047
- var flowsShowResponseSchema = z5.object({
2048
- slug: z5.string(),
2049
- name: z5.string(),
2246
+ var flowsShowResponseSchema = z6.object({
2247
+ slug: z6.string(),
2248
+ name: z6.string(),
2050
2249
  /** Confidential fields and whether each is configured. */
2051
- config: z5.array(flowConfigStatusSchema),
2250
+ config: z6.array(flowConfigStatusSchema),
2052
2251
  /** Present only with `--full`: the whole flow tree, secret values redacted. */
2053
- tree: z5.unknown().optional()
2252
+ tree: z6.unknown().optional()
2253
+ });
2254
+
2255
+ // ../api/src/history.ts
2256
+ import { z as z7 } from "zod";
2257
+ var historyCategorySchema = z7.enum([
2258
+ "publish",
2259
+ "chat",
2260
+ "action",
2261
+ "team",
2262
+ "setup_link",
2263
+ "company",
2264
+ "tag",
2265
+ "schedule",
2266
+ "ads",
2267
+ "advertiser",
2268
+ "media",
2269
+ "creative",
2270
+ "report",
2271
+ "domain",
2272
+ "integration"
2273
+ ]);
2274
+ var historyListRequestSchema = z7.object({
2275
+ limit: z7.number().int().min(1).max(200).optional(),
2276
+ category: historyCategorySchema.optional(),
2277
+ /** Only entries from the last N days. */
2278
+ days: z7.number().int().min(1).max(365).optional(),
2279
+ /** Include raw metadata on each entry (compact by default). */
2280
+ full: z7.boolean().optional()
2281
+ });
2282
+ var historyEntrySchema = z7.object({
2283
+ id: z7.string(),
2284
+ /** Epoch ms. */
2285
+ at: z7.number(),
2286
+ category: historyCategorySchema,
2287
+ /** Dotted action id, e.g. "publish.commit", "member.invite_create". */
2288
+ action: z7.string(),
2289
+ actorType: z7.enum(["user", "agent", "system"]),
2290
+ /** Display name of the acting user, when the actor is a user. */
2291
+ actor: z7.string().nullable(),
2292
+ /** What the change touched — commit subject, chat title, member email, tag type, … */
2293
+ target: z7.string().nullable(),
2294
+ metadata: z7.record(z7.string(), z7.unknown()).optional()
2295
+ });
2296
+ var historyListResponseSchema = z7.object({
2297
+ ok: z7.literal(true),
2298
+ data: z7.object({ entries: z7.array(historyEntrySchema) })
2054
2299
  });
2055
2300
 
2056
2301
  // ../api/src/images.ts
2057
- import { z as z6 } from "zod";
2058
- var imageSourceSchema = z6.enum([
2302
+ import { z as z8 } from "zod";
2303
+ var imageSourceSchema = z8.enum([
2059
2304
  "uploaded",
2060
2305
  "website",
2061
2306
  "google_testimonial",
@@ -2071,49 +2316,49 @@ var imageSourceSchema = z6.enum([
2071
2316
  "pinterest",
2072
2317
  "ai_generated"
2073
2318
  ]);
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()
2319
+ var imageStatusSchema = z8.enum(["uploading", "processing", "ready", "error"]);
2320
+ var upscaleConfigSchema = z8.object({
2321
+ model: z8.literal("philz1337x/crystal-upscaler"),
2322
+ input: z8.object({
2323
+ scale_factor: z8.number(),
2324
+ creativity: z8.number(),
2325
+ output_format: z8.string()
2081
2326
  }),
2082
- status: z6.enum(["pending", "completed"])
2327
+ status: z8.enum(["pending", "completed"])
2083
2328
  });
2084
- var imageDocSchema = z6.object({
2085
- _id: z6.string(),
2086
- _creationTime: z6.number(),
2087
- companyId: z6.string(),
2088
- storageKey: z6.string(),
2329
+ var imageDocSchema = z8.object({
2330
+ _id: z8.string(),
2331
+ _creationTime: z8.number(),
2332
+ companyId: z8.string(),
2333
+ storageKey: z8.string(),
2089
2334
  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(),
2335
+ upscaledStorageKey: z8.string().optional(),
2336
+ name: z8.string(),
2337
+ description: z8.string(),
2338
+ tags: z8.array(z8.string()),
2339
+ source: z8.string(),
2340
+ externalId: z8.string().optional(),
2341
+ externalUrl: z8.string().optional(),
2342
+ contentHash: z8.string().optional(),
2343
+ sourceId: z8.string().optional(),
2344
+ descriptionContext: z8.string().optional(),
2345
+ width: z8.number().optional(),
2346
+ height: z8.number().optional(),
2347
+ aspectRatio: z8.number().optional(),
2348
+ dominantColor: z8.string().optional(),
2349
+ imagePalette: z8.array(z8.string()).optional(),
2350
+ thumbhashDataUri: z8.string().optional(),
2351
+ isLightImage: z8.boolean().optional(),
2352
+ descriptionEmbedding: z8.array(z8.number()).optional(),
2353
+ imageEmbedding: z8.array(z8.number()).optional(),
2354
+ searchText: z8.string().optional(),
2110
2355
  status: imageStatusSchema,
2111
- errorMessage: z6.string().optional(),
2112
- createdAt: z6.number(),
2113
- updatedAt: z6.number(),
2114
- imageUrl: z6.string()
2356
+ errorMessage: z8.string().optional(),
2357
+ createdAt: z8.number(),
2358
+ updatedAt: z8.number(),
2359
+ imageUrl: z8.string()
2115
2360
  });
2116
- var imageHitSourceSchema = z6.enum([
2361
+ var imageHitSourceSchema = z8.enum([
2117
2362
  "library",
2118
2363
  "magnific",
2119
2364
  "google_images",
@@ -2124,242 +2369,242 @@ var imageHitSourceSchema = z6.enum([
2124
2369
  "giphy",
2125
2370
  "pinterest"
2126
2371
  ]);
2127
- var imageHitSchema = z6.object({
2372
+ var imageHitSchema = z8.object({
2128
2373
  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()
2374
+ url: z8.string(),
2375
+ thumbnailUrl: z8.string().optional(),
2376
+ width: z8.number().optional(),
2377
+ height: z8.number().optional(),
2378
+ aspectRatio: z8.number().optional(),
2379
+ dominantColor: z8.string().optional(),
2380
+ externalId: z8.string().optional(),
2381
+ externalUrl: z8.string().optional(),
2382
+ providerMeta: z8.record(z8.string(), z8.unknown()).optional(),
2383
+ descriptionContext: z8.string().optional(),
2384
+ _id: z8.string().optional(),
2385
+ name: z8.string().optional(),
2386
+ description: z8.string().optional(),
2387
+ tags: z8.array(z8.string()).optional(),
2388
+ score: z8.number().optional(),
2389
+ alsoInLibrary: z8.string().optional(),
2390
+ prefetchedBytes: z8.string().optional(),
2391
+ prefetchedContentType: z8.string().optional()
2147
2392
  });
2148
2393
  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()
2394
+ imageId: z8.string().optional(),
2395
+ imageUrl: z8.string().optional(),
2396
+ deduped: z8.boolean().optional(),
2397
+ sourceUrl: z8.string().optional()
2398
+ });
2399
+ var autoIngestItemSchema = z8.object({
2400
+ imageId: z8.string(),
2401
+ deduped: z8.boolean(),
2402
+ imageUrl: z8.string(),
2403
+ sourceUrl: z8.string(),
2404
+ externalUrl: z8.string().optional()
2160
2405
  });
2161
2406
  function providerHitsResponseSchema() {
2162
- return z6.object({
2163
- hits: z6.array(ingestedImageHitSchema),
2164
- ingested: z6.array(autoIngestItemSchema)
2407
+ return z8.object({
2408
+ hits: z8.array(ingestedImageHitSchema),
2409
+ ingested: z8.array(autoIngestItemSchema)
2165
2410
  });
2166
2411
  }
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")
2412
+ var imagesGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2413
+ var imagesSearchRequestSchema = z8.object({
2414
+ query: z8.string().min(1),
2415
+ limit: z8.coerce.number().int().positive().max(100).optional(),
2416
+ aspectRatio: z8.string().optional(),
2417
+ tags: z8.array(z8.string()).optional(),
2418
+ source: z8.string().optional(),
2419
+ externalUrlHost: z8.string().optional()
2420
+ });
2421
+ var imageSearchResultSchema = z8.object({
2422
+ _id: z8.string(),
2423
+ imageUrl: z8.string(),
2424
+ name: z8.string(),
2425
+ description: z8.string(),
2426
+ tags: z8.array(z8.string()),
2427
+ width: z8.number().optional(),
2428
+ height: z8.number().optional(),
2429
+ aspectRatio: z8.number().optional(),
2430
+ dominantColor: z8.string().optional(),
2431
+ imagePalette: z8.array(z8.string()).optional(),
2432
+ source: z8.string(),
2433
+ externalUrl: z8.string().optional(),
2434
+ score: z8.number()
2435
+ });
2436
+ var imagesSearchResponseSchema = z8.array(imageSearchResultSchema);
2437
+ var imagesUploadRequestSchema = z8.object({
2438
+ base64: z8.string().min(1),
2439
+ contentType: z8.string().min(1),
2440
+ source: z8.string().optional(),
2441
+ descriptionContext: z8.string().optional()
2442
+ });
2443
+ var imagesUploadResponseSchema = z8.object({ imageId: z8.string() });
2444
+ var imagesDeleteRequestSchema = z8.object({ id: z8.string().min(1, "Missing image ID") });
2445
+ var imagesDeleteResponseSchema = z8.object({ ok: z8.literal(true) });
2446
+ var imagesUpscaleRequestSchema = z8.object({ imageId: z8.string().min(1, "Missing image ID") });
2447
+ var imagesUpscaleResponseSchema = z8.object({
2448
+ imageId: z8.string(),
2449
+ status: z8.literal("processing")
2205
2450
  });
2206
2451
  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)
2452
+ var imagesFindRequestSchema = z8.object({
2453
+ query: z8.string().min(1),
2454
+ sources: z8.array(z8.enum(IMAGES_FIND_SOURCES)).optional(),
2455
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2456
+ fallback: z8.boolean().optional(),
2457
+ threshold: z8.number().min(0).max(1).optional(),
2458
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2459
+ descriptionContext: z8.string().optional()
2460
+ });
2461
+ var imagesFindResponseSchema = z8.object({
2462
+ groups: z8.object({
2463
+ library: z8.array(imageHitSchema),
2464
+ external: z8.array(ingestedImageHitSchema)
2220
2465
  }),
2221
- meta: z6.object({
2222
- counts: z6.record(z6.string(), z6.number()),
2223
- errors: z6.array(z6.object({ source: imageHitSourceSchema, message: z6.string() }))
2466
+ meta: z8.object({
2467
+ counts: z8.record(z8.string(), z8.number()),
2468
+ errors: z8.array(z8.object({ source: imageHitSourceSchema, message: z8.string() }))
2224
2469
  }),
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()
2470
+ ingested: z8.array(autoIngestItemSchema)
2471
+ });
2472
+ var imagesStockRequestSchema = z8.object({
2473
+ query: z8.string().min(1),
2474
+ orientation: z8.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2475
+ contentType: z8.enum(["photo", "vector", "psd"]).optional(),
2476
+ license: z8.enum(["freemium", "premium"]).optional(),
2477
+ color: z8.string().optional(),
2478
+ aiGenerated: z8.enum(["exclude", "only"]).optional(),
2479
+ people: z8.enum(["include", "exclude", "only"]).optional(),
2480
+ order: z8.enum(["relevance", "recent"]).optional(),
2481
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2482
+ page: z8.coerce.number().int().positive().optional(),
2483
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2484
+ descriptionContext: z8.string().optional()
2240
2485
  });
2241
2486
  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()
2487
+ var imagesGoogleRequestSchema = z8.object({
2488
+ query: z8.string().min(1),
2489
+ type: z8.string().optional(),
2490
+ size: z8.string().optional(),
2491
+ color: z8.string().optional(),
2492
+ safe: z8.enum(["off", "active"]).optional(),
2493
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2494
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2495
+ descriptionContext: z8.string().optional()
2251
2496
  });
2252
2497
  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()
2498
+ var imagesPinterestRequestSchema = z8.object({
2499
+ query: z8.string().min(1),
2500
+ limit: z8.coerce.number().int().positive().max(20).optional(),
2501
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2502
+ descriptionContext: z8.string().optional()
2258
2503
  });
2259
2504
  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)
2505
+ var rgbTriple = z8.tuple([
2506
+ z8.number().int().min(0).max(255),
2507
+ z8.number().int().min(0).max(255),
2508
+ z8.number().int().min(0).max(255)
2264
2509
  ]);
2265
- var imageGenerateModelSchema = z6.enum([
2510
+ var imageGenerateModelSchema = z8.enum([
2266
2511
  "openai/gpt-5.4-image-2",
2267
2512
  "google/gemini-3.5-flash",
2268
2513
  "google/gemini-3.1-flash-image-preview",
2269
2514
  "google/gemini-3-pro-image-preview",
2270
2515
  "recraft/recraft-v4.1-pro-vector"
2271
2516
  ]);
2272
- var imagesGenerateRequestSchema = z6.object({
2273
- prompt: z6.string().min(1),
2517
+ var imagesGenerateRequestSchema = z8.object({
2518
+ prompt: z8.string().min(1),
2274
2519
  model: imageGenerateModelSchema.optional(),
2275
2520
  // Aspect ratio + size are validated loosely as strings; the per-model enum
2276
2521
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
2277
- aspectRatio: z6.string().optional(),
2278
- imageSize: z6.string().optional(),
2522
+ aspectRatio: z8.string().optional(),
2523
+ imageSize: z8.string().optional(),
2279
2524
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
2280
- quality: z6.enum(["auto", "low", "medium", "high"]).optional(),
2525
+ quality: z8.enum(["auto", "low", "medium", "high"]).optional(),
2281
2526
  // 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(),
2527
+ strength: z8.coerce.number().min(0).max(1).optional(),
2528
+ rgbColors: z8.array(rgbTriple).optional(),
2284
2529
  backgroundRgbColor: rgbTriple.optional(),
2285
2530
  // 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()
2531
+ referenceUrls: z8.array(z8.string().url()).optional(),
2532
+ descriptionContext: z8.string().optional()
2533
+ });
2534
+ var generatedImageSchema = z8.object({
2535
+ imageId: z8.string(),
2536
+ deduped: z8.boolean(),
2537
+ imageUrl: z8.string(),
2538
+ width: z8.number().optional(),
2539
+ height: z8.number().optional()
2540
+ });
2541
+ var imagesGenerateResponseSchema = z8.object({
2542
+ model: z8.string(),
2543
+ costUsd: z8.number(),
2544
+ images: z8.array(generatedImageSchema)
2545
+ });
2546
+ var imagesLogoRequestSchema = z8.object({
2547
+ domain: z8.string().min(1),
2548
+ variant: z8.enum(["icon", "logo", "symbol"]).optional(),
2549
+ autoIngest: z8.coerce.number().int().min(0).max(5).optional(),
2550
+ descriptionContext: z8.string().optional()
2306
2551
  });
2307
2552
  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()
2553
+ var imagesIconRequestSchema = z8.object({
2554
+ name: z8.string().min(1),
2555
+ set: z8.string().optional(),
2556
+ color: z8.string().optional(),
2557
+ width: z8.coerce.number().int().positive().optional(),
2558
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2559
+ descriptionContext: z8.string().optional()
2315
2560
  });
2316
2561
  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()
2562
+ var imagesExtractRequestSchema = z8.object({
2563
+ url: z8.string().url(),
2564
+ waitFor: z8.coerce.number().int().min(0).max(3e4).optional(),
2565
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2566
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2567
+ descriptionContext: z8.string().optional()
2323
2568
  });
2324
2569
  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()
2570
+ var imagesScreenshotRequestSchema = z8.object({
2571
+ url: z8.string().url(),
2572
+ fullPage: z8.boolean().optional(),
2573
+ viewportWidth: z8.coerce.number().int().positive().max(3840).optional(),
2574
+ viewportHeight: z8.coerce.number().int().positive().max(2160).optional(),
2575
+ format: z8.enum(["webp", "png", "jpg"]).optional(),
2576
+ descriptionContext: z8.string().optional()
2332
2577
  });
2333
2578
  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()
2579
+ var imagesGiphyRequestSchema = z8.object({
2580
+ query: z8.string().min(1).optional(),
2581
+ trending: z8.coerce.boolean().optional(),
2582
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2583
+ rating: z8.enum(["g", "pg", "pg-13", "r"]).optional(),
2584
+ lang: z8.string().optional(),
2585
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2586
+ descriptionContext: z8.string().optional()
2342
2587
  });
2343
2588
  var imagesGifResponseSchema = providerHitsResponseSchema();
2344
2589
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2345
- var imagesIngestRequestSchema = z6.object({
2346
- url: z6.string().url(),
2590
+ var imagesIngestRequestSchema = z8.object({
2591
+ url: z8.string().url(),
2347
2592
  // Validate source at the HTTP boundary so unknown values produce the standard
2348
2593
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2349
2594
  // `assertImageSource` inside the action.
2350
2595
  source: imageSourceSchema,
2351
- externalId: z6.string().optional(),
2352
- externalUrl: z6.string().optional(),
2353
- descriptionContext: z6.string().optional()
2596
+ externalId: z8.string().optional(),
2597
+ externalUrl: z8.string().optional(),
2598
+ descriptionContext: z8.string().optional()
2354
2599
  });
2355
- var imagesIngestResponseSchema = z6.object({
2356
- imageId: z6.string(),
2357
- deduped: z6.boolean(),
2358
- contentHash: z6.string()
2600
+ var imagesIngestResponseSchema = z8.object({
2601
+ imageId: z8.string(),
2602
+ deduped: z8.boolean(),
2603
+ contentHash: z8.string()
2359
2604
  });
2360
2605
 
2361
2606
  // ../api/src/tags.ts
2362
- import { z as z7 } from "zod";
2607
+ import { z as z9 } from "zod";
2363
2608
  var TAG_TYPES = [
2364
2609
  "meta",
2365
2610
  "amplitude",
@@ -2380,7 +2625,7 @@ var TAG_TYPES = [
2380
2625
  "recaptcha",
2381
2626
  "twitterAds"
2382
2627
  ];
2383
- var tagTypeSchema = z7.enum(TAG_TYPES);
2628
+ var tagTypeSchema = z9.enum(TAG_TYPES);
2384
2629
  var TAG_IDENTIFYING_FIELD = {
2385
2630
  meta: "pixelId",
2386
2631
  googleAds: "conversionID",
@@ -2401,218 +2646,218 @@ var TAG_IDENTIFYING_FIELD = {
2401
2646
  recaptcha: "siteKey",
2402
2647
  twitterAds: "pixelId"
2403
2648
  };
2404
- var tagDraftOpKindSchema = z7.enum(["create", "update", "delete"]);
2405
- var tagDraftOpViewSchema = z7.object({
2649
+ var tagDraftOpKindSchema = z9.enum(["create", "update", "delete"]);
2650
+ var tagDraftOpViewSchema = z9.object({
2406
2651
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2407
- ref: z7.string(),
2652
+ ref: z9.string(),
2408
2653
  kind: tagDraftOpKindSchema,
2409
2654
  type: tagTypeSchema,
2410
2655
  /** Present on update/delete ops — the real tag this op targets. */
2411
- tagId: z7.string().optional(),
2656
+ tagId: z9.string().optional(),
2412
2657
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2413
- config: z7.record(z7.string(), z7.string()),
2658
+ config: z9.record(z9.string(), z9.string()),
2414
2659
  /** Update only — fields the op explicitly clears. */
2415
- clearFields: z7.array(z7.string()).optional(),
2660
+ clearFields: z9.array(z9.string()).optional(),
2416
2661
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2417
- secretsSet: z7.array(z7.string()),
2662
+ secretsSet: z9.array(z9.string()),
2418
2663
  /** Names of secret fields still awaiting user input. */
2419
- secretsPending: z7.array(z7.string()),
2420
- summary: z7.string(),
2421
- stagedAt: z7.number()
2664
+ secretsPending: z9.array(z9.string()),
2665
+ summary: z9.string(),
2666
+ stagedAt: z9.number()
2422
2667
  });
2423
- var tagsEffectiveEntrySchema = z7.object({
2668
+ var tagsEffectiveEntrySchema = z9.object({
2424
2669
  /** 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(),
2670
+ ref: z9.string(),
2671
+ tagId: z9.string().optional(),
2427
2672
  type: tagTypeSchema,
2428
2673
  /** Value of the type's identifying field, when set. */
2429
- identifier: z7.string().optional(),
2674
+ identifier: z9.string().optional(),
2430
2675
  /** Redacted config; for staged updates, production config with the patch merged. */
2431
- config: z7.record(z7.string(), z7.string()),
2676
+ config: z9.record(z9.string(), z9.string()),
2432
2677
  /** Absent = live production tag with no staged changes in this chat. */
2433
2678
  staged: tagDraftOpKindSchema.optional(),
2434
- secretsSet: z7.array(z7.string()),
2435
- secretsPending: z7.array(z7.string())
2679
+ secretsSet: z9.array(z9.string()),
2680
+ secretsPending: z9.array(z9.string())
2436
2681
  });
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)
2682
+ var tagsListRequestSchema = z9.object({ chatId: z9.string() });
2683
+ var tagsListResponseSchema = z9.object({ tags: z9.array(tagsEffectiveEntrySchema) });
2684
+ var tagsDraftListRequestSchema = z9.object({ chatId: z9.string() });
2685
+ var tagsDraftListResponseSchema = z9.object({
2686
+ status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
2687
+ ops: z9.array(tagDraftOpViewSchema)
2443
2688
  });
2444
- var tagInputRequestSchema = z7.object({
2689
+ var tagInputRequestSchema = z9.object({
2445
2690
  // Every tag change is a tab in the approval form: create/edit show the full
2446
2691
  // body; delete shows a confirm. No tag change bypasses this approval.
2447
- mode: z7.enum(["create", "edit", "delete"]),
2692
+ mode: z9.enum(["create", "edit", "delete"]),
2448
2693
  tagType: tagTypeSchema,
2449
2694
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2450
- ref: z7.string().optional(),
2695
+ ref: z9.string().optional(),
2451
2696
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2452
- prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
2697
+ prefilledConfig: z9.record(z9.string(), z9.string()).optional(),
2453
2698
  /** Secret field names the agent asks the user to provide. */
2454
- requestedSecretFields: z7.array(z7.string()).optional(),
2699
+ requestedSecretFields: z9.array(z9.string()).optional(),
2455
2700
  /** Short message shown above the form explaining why the input is needed. */
2456
- message: z7.string().optional()
2701
+ message: z9.string().optional()
2457
2702
  });
2458
- var tagChangeToolInputSchema = z7.object({
2459
- changes: z7.array(tagInputRequestSchema).min(1).max(8)
2703
+ var tagChangeToolInputSchema = z9.object({
2704
+ changes: z9.array(tagInputRequestSchema).min(1).max(8)
2460
2705
  });
2461
- var tagInputResultSchema = z7.discriminatedUnion("status", [
2462
- z7.object({
2463
- status: z7.literal("submitted"),
2464
- ref: z7.string(),
2706
+ var tagInputResultSchema = z9.discriminatedUnion("status", [
2707
+ z9.object({
2708
+ status: z9.literal("submitted"),
2709
+ ref: z9.string(),
2465
2710
  type: tagTypeSchema,
2466
2711
  /** 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()
2712
+ identifier: z9.record(z9.string(), z9.string()).optional(),
2713
+ secretFieldsSet: z9.array(z9.string()),
2714
+ note: z9.string().optional()
2470
2715
  }),
2471
- z7.object({
2472
- status: z7.literal("declined"),
2473
- reason: z7.string().optional()
2716
+ z9.object({
2717
+ status: z9.literal("declined"),
2718
+ reason: z9.string().optional()
2474
2719
  })
2475
2720
  ]);
2476
- var tagChangeToolResultSchema = z7.object({
2477
- results: z7.array(tagInputResultSchema)
2721
+ var tagChangeToolResultSchema = z9.object({
2722
+ results: z9.array(tagInputResultSchema)
2478
2723
  });
2479
2724
 
2480
2725
  // ../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(),
2726
+ import { z as z10 } from "zod";
2727
+ var testimonialSourceTypeSchema = z10.enum(["google", "trustpilot"]);
2728
+ var testimonialStatusSchema = z10.enum(["pending", "processing", "ready", "error"]);
2729
+ var testimonialSentimentSchema = z10.enum(["positive", "neutral", "negative"]);
2730
+ var testimonialDocSchema = z10.object({
2731
+ _id: z10.string(),
2732
+ _creationTime: z10.number(),
2733
+ companyId: z10.string(),
2734
+ sourceId: z10.string(),
2490
2735
  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(),
2736
+ reviewText: z10.string(),
2737
+ reviewTitle: z10.string().optional(),
2738
+ searchText: z10.string().optional(),
2739
+ reviewerName: z10.string().optional(),
2740
+ reviewerImageUrl: z10.string().optional(),
2741
+ reviewerImageId: z10.string().optional(),
2742
+ reviewerLocation: z10.string().optional(),
2743
+ rating: z10.number().optional(),
2744
+ reviewDate: z10.number().optional(),
2745
+ ownerAnswer: z10.string().optional(),
2746
+ mediaUrls: z10.array(z10.string()).optional(),
2747
+ imageIds: z10.array(z10.string()).optional(),
2748
+ videoIds: z10.array(z10.string()).optional(),
2749
+ sourceUrl: z10.string().optional(),
2750
+ rawData: z10.unknown().optional(),
2751
+ tags: z10.array(z10.string()),
2752
+ highlight: z10.string().optional(),
2753
+ language: z10.string().optional(),
2754
+ summary: z10.string().optional(),
2510
2755
  sentiment: testimonialSentimentSchema.optional(),
2511
- textEmbedding: z8.array(z8.number()).optional(),
2512
- externalId: z8.string().optional(),
2513
- contentHash: z8.string().optional(),
2756
+ textEmbedding: z10.array(z10.number()).optional(),
2757
+ externalId: z10.string().optional(),
2758
+ contentHash: z10.string().optional(),
2514
2759
  status: testimonialStatusSchema,
2515
- errorMessage: z8.string().optional(),
2516
- createdAt: z8.number(),
2517
- updatedAt: z8.number()
2760
+ errorMessage: z10.string().optional(),
2761
+ createdAt: z10.number(),
2762
+ updatedAt: z10.number()
2518
2763
  });
2519
- var testimonialsListRequestSchema = z8.object({
2764
+ var testimonialsListRequestSchema = z10.object({
2520
2765
  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(),
2766
+ rating_min: z10.coerce.number().int().min(1).max(5).optional(),
2767
+ rating_max: z10.coerce.number().int().min(1).max(5).optional(),
2768
+ tags: z10.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2524
2769
  status: testimonialStatusSchema.optional(),
2525
2770
  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(),
2771
+ language: z10.string().min(2).max(5).optional(),
2772
+ limit: z10.coerce.number().int().positive().max(200).optional()
2773
+ });
2774
+ var testimonialsListResponseSchema = z10.array(testimonialDocSchema);
2775
+ var testimonialsGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2776
+ var testimonialsSearchRequestSchema = z10.object({
2777
+ query: z10.string().min(1),
2778
+ limit: z10.coerce.number().int().positive().max(100).optional(),
2534
2779
  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(),
2780
+ rating_min: z10.coerce.number().int().min(1).max(5).optional(),
2781
+ rating_max: z10.coerce.number().int().min(1).max(5).optional(),
2782
+ tags: z10.array(z10.string()).optional(),
2538
2783
  status: testimonialStatusSchema.optional(),
2539
2784
  sentiment: testimonialSentimentSchema.optional(),
2540
- language: z8.string().min(2).max(5).optional()
2785
+ language: z10.string().min(2).max(5).optional()
2541
2786
  }).refine(
2542
2787
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2543
2788
  { message: "rating_min must be less than or equal to rating_max" }
2544
2789
  );
2545
- var testimonialsSearchResponseSchema = z8.array(testimonialDocSchema);
2546
- var testimonialsOutscraperWebhookResponseSchema = z8.object({
2547
- ok: z8.literal(true),
2548
- note: z8.string().optional()
2790
+ var testimonialsSearchResponseSchema = z10.array(testimonialDocSchema);
2791
+ var testimonialsOutscraperWebhookResponseSchema = z10.object({
2792
+ ok: z10.literal(true),
2793
+ note: z10.string().optional()
2549
2794
  });
2550
2795
 
2551
2796
  // ../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(),
2797
+ import { z as z11 } from "zod";
2798
+ var videoStatusSchema = z11.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2799
+ var videoTranscriptSegmentSchema = z11.object({
2800
+ text: z11.string(),
2801
+ startSecond: z11.number(),
2802
+ endSecond: z11.number()
2803
+ });
2804
+ var videoSceneSchema = z11.object({
2805
+ title: z11.string(),
2806
+ description: z11.string(),
2807
+ startSecond: z11.number(),
2808
+ endSecond: z11.number(),
2809
+ thumbnailTime: z11.number()
2810
+ });
2811
+ var videoDocSchema = z11.object({
2812
+ _id: z11.string(),
2813
+ _creationTime: z11.number(),
2814
+ companyId: z11.string(),
2815
+ muxAssetId: z11.string(),
2816
+ muxPlaybackId: z11.string(),
2817
+ muxUploadId: z11.string(),
2818
+ name: z11.string(),
2819
+ description: z11.string(),
2820
+ tags: z11.array(z11.string()),
2821
+ source: z11.string(),
2822
+ externalId: z11.string().optional(),
2823
+ sourceId: z11.string().optional(),
2824
+ width: z11.number().optional(),
2825
+ height: z11.number().optional(),
2826
+ aspectRatio: z11.number().optional(),
2827
+ duration: z11.number().optional(),
2828
+ transcript: z11.string().optional(),
2829
+ transcriptSegments: z11.array(videoTranscriptSegmentSchema).optional(),
2830
+ scenes: z11.array(videoSceneSchema).optional(),
2831
+ descriptionEmbedding: z11.array(z11.number()).optional(),
2832
+ searchText: z11.string().optional(),
2588
2833
  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) });
2834
+ errorMessage: z11.string().optional(),
2835
+ createdAt: z11.number(),
2836
+ updatedAt: z11.number(),
2837
+ thumbnailUrl: z11.string()
2838
+ });
2839
+ var videosWebhookResponseSchema = z11.object({ ok: z11.literal(true) });
2840
+ var videosGetRequestSchema = z11.object({ id: z11.string().min(1, "Missing id parameter") });
2841
+ var videosSearchRequestSchema = z11.object({
2842
+ query: z11.string().min(1),
2843
+ limit: z11.coerce.number().int().positive().max(100).optional(),
2844
+ tags: z11.array(z11.string()).optional()
2845
+ });
2846
+ var videoSearchResultSchema = z11.object({
2847
+ _id: z11.string(),
2848
+ thumbnailUrl: z11.string(),
2849
+ name: z11.string(),
2850
+ description: z11.string(),
2851
+ tags: z11.array(z11.string()),
2852
+ status: z11.string(),
2853
+ duration: z11.number().optional(),
2854
+ muxPlaybackId: z11.string(),
2855
+ createdAt: z11.number()
2856
+ });
2857
+ var videosSearchResponseSchema = z11.array(videoSearchResultSchema);
2858
+ var videosUploadResponseSchema = z11.object({ uploadUrl: z11.string(), videoId: z11.string() });
2859
+ var videosDeleteRequestSchema = z11.object({ id: z11.string().min(1, "Missing video ID") });
2860
+ var videosDeleteResponseSchema = z11.object({ ok: z11.literal(true) });
2616
2861
 
2617
2862
  // src/commands/actions/complete.ts
2618
2863
  import { defineCommand as defineCommand2 } from "citty";
@@ -4425,37 +4670,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4425
4670
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4426
4671
 
4427
4672
  // ../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"),
4673
+ import { z as z12 } from "zod";
4674
+ var tempRefSchema2 = z12.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4675
+ var refSchema = z12.union([
4676
+ z12.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4677
+ z12.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4433
4678
  tempRefSchema2
4434
4679
  ]);
4435
4680
  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),
4681
+ var microsSchema = z12.number().int().positive("expected a positive micros amount");
4682
+ var httpsUrlSchema2 = z12.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4683
+ var customerIdSchema = z12.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4684
+ var stageableStatusSchema2 = z12.enum(STAGEABLE_CREATE_STATUSES2);
4685
+ var matchTypeSchema = z12.enum(KEYWORD_MATCH_TYPES);
4686
+ var keywordTextSchema = z12.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");
4687
+ var budgetCreateSchema = z12.object({
4688
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4444
4689
  amountMicros: microsSchema,
4445
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4446
- explicitlyShared: z10.boolean().default(false)
4690
+ deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4691
+ explicitlyShared: z12.boolean().default(false)
4447
4692
  });
4448
- var budgetUpdateSchema = z10.object({
4449
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4693
+ var budgetUpdateSchema = z12.object({
4694
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4450
4695
  amountMicros: microsSchema.optional(),
4451
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).optional()
4696
+ deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).optional()
4452
4697
  }).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),
4698
+ var biddingConfigSchema = z12.object({
4699
+ type: z12.enum(BIDDING_STRATEGY_TYPES),
4455
4700
  targetCpaMicros: microsSchema.optional(),
4456
- targetRoas: z10.number().positive().optional(),
4701
+ targetRoas: z12.number().positive().optional(),
4457
4702
  cpcBidCeilingMicros: microsSchema.optional(),
4458
- enhancedCpcEnabled: z10.boolean().optional()
4703
+ enhancedCpcEnabled: z12.boolean().optional()
4459
4704
  }).superRefine((p, ctx) => {
4460
4705
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4461
4706
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4464,17 +4709,17 @@ var biddingConfigSchema = z10.object({
4464
4709
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4465
4710
  }
4466
4711
  });
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()
4712
+ var networkSettingsSchema = z12.object({
4713
+ targetGoogleSearch: z12.boolean().optional(),
4714
+ targetSearchNetwork: z12.boolean().optional(),
4715
+ targetContentNetwork: z12.boolean().optional(),
4716
+ targetPartnerSearchNetwork: z12.boolean().optional()
4472
4717
  });
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(),
4718
+ var dateSchema = z12.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4719
+ var campaignCreateSchema2 = z12.object({
4720
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4721
+ channelType: z12.enum(ADVERTISING_CHANNEL_TYPES),
4722
+ channelSubType: z12.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4478
4723
  budget: refSchema,
4479
4724
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4480
4725
  bidding: biddingConfigSchema.optional(),
@@ -4483,7 +4728,7 @@ var campaignCreateSchema2 = z10.object({
4483
4728
  startDate: dateSchema.optional(),
4484
4729
  endDate: dateSchema.optional(),
4485
4730
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4486
- objective: z10.enum(CAMPAIGN_OBJECTIVES).optional(),
4731
+ objective: z12.enum(CAMPAIGN_OBJECTIVES).optional(),
4487
4732
  status: stageableStatusSchema2.default("PAUSED")
4488
4733
  }).superRefine((p, ctx) => {
4489
4734
  if (!p.bidding && !p.biddingStrategy) {
@@ -4507,129 +4752,129 @@ var campaignCreateSchema2 = z10.object({
4507
4752
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4508
4753
  }
4509
4754
  });
4510
- var campaignUpdateSchema2 = z10.object({
4511
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4755
+ var campaignUpdateSchema2 = z12.object({
4756
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4512
4757
  budget: refSchema.optional(),
4513
4758
  bidding: biddingConfigSchema.optional(),
4514
4759
  networkSettings: networkSettingsSchema.optional(),
4515
4760
  startDate: dateSchema.optional(),
4516
4761
  endDate: dateSchema.optional(),
4517
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4762
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4518
4763
  }).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),
4764
+ var adGroupCreateSchema = z12.object({
4765
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4521
4766
  campaign: refSchema,
4522
- type: z10.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4767
+ type: z12.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4523
4768
  cpcBidMicros: microsSchema.optional(),
4524
4769
  status: stageableStatusSchema2.default("PAUSED")
4525
4770
  });
4526
- var adGroupUpdateSchema = z10.object({
4527
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4771
+ var adGroupUpdateSchema = z12.object({
4772
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4528
4773
  cpcBidMicros: microsSchema.optional(),
4529
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4774
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4530
4775
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4531
- var keywordAddSchema = z10.object({
4776
+ var keywordAddSchema = z12.object({
4532
4777
  adGroup: refSchema,
4533
4778
  text: keywordTextSchema,
4534
4779
  matchType: matchTypeSchema,
4535
4780
  cpcBidMicros: microsSchema.optional(),
4536
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4781
+ finalUrls: z12.array(httpsUrlSchema2).optional(),
4537
4782
  status: stageableStatusSchema2.default("ENABLED")
4538
4783
  });
4539
- var keywordUpdateSchema = z10.object({
4784
+ var keywordUpdateSchema = z12.object({
4540
4785
  cpcBidMicros: microsSchema.optional(),
4541
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4542
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4786
+ finalUrls: z12.array(httpsUrlSchema2).optional(),
4787
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4543
4788
  }).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"]),
4789
+ var negativeKeywordAddSchema = z12.object({
4790
+ level: z12.enum(["adGroup", "campaign"]),
4546
4791
  parent: refSchema,
4547
4792
  text: keywordTextSchema,
4548
4793
  matchType: matchTypeSchema
4549
4794
  });
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")
4795
+ var sharedSetCreateSchema = z12.object({
4796
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4797
+ type: z12.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4553
4798
  });
4554
- var sharedSetMemberAddSchema = z10.object({
4799
+ var sharedSetMemberAddSchema = z12.object({
4555
4800
  sharedSet: refSchema,
4556
4801
  text: keywordTextSchema,
4557
4802
  matchType: matchTypeSchema
4558
4803
  });
4559
- var campaignSharedSetAttachSchema = z10.object({
4804
+ var campaignSharedSetAttachSchema = z12.object({
4560
4805
  campaign: refSchema,
4561
4806
  sharedSet: refSchema
4562
4807
  });
4563
- var adTextAssetSchema = z10.object({
4564
- text: z10.string().min(1),
4565
- pinnedField: z10.enum(PINNED_FIELDS).optional()
4808
+ var adTextAssetSchema = z12.object({
4809
+ text: z12.string().min(1),
4810
+ pinnedField: z12.enum(PINNED_FIELDS).optional()
4566
4811
  });
4567
- var responsiveSearchAdSchema = z10.object({
4568
- format: z10.literal("responsiveSearch"),
4569
- headlines: z10.array(
4812
+ var responsiveSearchAdSchema = z12.object({
4813
+ format: z12.literal("responsiveSearch"),
4814
+ headlines: z12.array(
4570
4815
  adTextAssetSchema.refine(
4571
4816
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4572
4817
  "headline exceeds 30 chars"
4573
4818
  )
4574
4819
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4575
- descriptions: z10.array(
4820
+ descriptions: z12.array(
4576
4821
  adTextAssetSchema.refine(
4577
4822
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4578
4823
  "description exceeds 90 chars"
4579
4824
  )
4580
4825
  ).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),
4826
+ path1: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4827
+ path2: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4828
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4829
+ });
4830
+ var responsiveDisplayAdSchema = z12.object({
4831
+ format: z12.literal("responsiveDisplay"),
4832
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4833
+ longHeadline: z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4834
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4835
+ businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4591
4836
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4592
4837
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4593
4838
  // 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"),
4839
+ marketingImageAssets: z12.array(refSchema).optional(),
4840
+ squareMarketingImageAssets: z12.array(refSchema).optional(),
4841
+ logoImageAssets: z12.array(refSchema).optional(),
4842
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4843
+ });
4844
+ var callAdSchema = z12.object({
4845
+ format: z12.literal("call"),
4846
+ countryCode: z12.string().length(2),
4847
+ phoneNumber: z12.string().min(3),
4848
+ headline1: z12.string().min(1).max(30),
4849
+ headline2: z12.string().min(1).max(30),
4850
+ description1: z12.string().min(1).max(90),
4851
+ description2: z12.string().min(1).max(90),
4852
+ businessName: z12.string().min(1).max(25),
4853
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4854
+ });
4855
+ var appAdSchema = z12.object({
4856
+ format: z12.literal("app"),
4857
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(30) })).min(1),
4858
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1)
4859
+ });
4860
+ var videoAdSchema = z12.object({
4861
+ format: z12.literal("video"),
4617
4862
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4618
4863
  // 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", [
4864
+ videoAssets: z12.array(refSchema).min(1),
4865
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4866
+ });
4867
+ var demandGenAdSchema = z12.object({
4868
+ format: z12.literal("demandGen"),
4869
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(40) })).min(1).max(5),
4870
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1).max(5),
4871
+ businessName: z12.string().min(1).max(25),
4872
+ finalUrls: z12.array(httpsUrlSchema2).min(1),
4873
+ imageAssets: z12.array(refSchema).optional(),
4874
+ squareImageAssets: z12.array(refSchema).optional(),
4875
+ logoImageAssets: z12.array(refSchema).optional()
4876
+ });
4877
+ var adContentSchema = z12.discriminatedUnion("format", [
4633
4878
  responsiveSearchAdSchema,
4634
4879
  responsiveDisplayAdSchema,
4635
4880
  callAdSchema,
@@ -4637,45 +4882,45 @@ var adContentSchema = z10.discriminatedUnion("format", [
4637
4882
  videoAdSchema,
4638
4883
  demandGenAdSchema
4639
4884
  ]);
4640
- var adCreateSchema = z10.object({
4885
+ var adCreateSchema = z12.object({
4641
4886
  adGroup: refSchema,
4642
4887
  status: stageableStatusSchema2.default("PAUSED"),
4643
4888
  content: adContentSchema
4644
4889
  });
4645
- var adUpdateSchema = z10.object({
4646
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4890
+ var adUpdateSchema = z12.object({
4891
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4647
4892
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4648
- content: z10.record(z10.string(), z10.unknown()).optional()
4893
+ content: z12.record(z12.string(), z12.unknown()).optional()
4649
4894
  }).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", [
4895
+ var textAssetSchema = z12.object({ type: z12.literal("text"), text: z12.string().min(1) });
4896
+ var imageAssetSchema = z12.object({
4897
+ type: z12.literal("image"),
4898
+ imageId: z12.string().min(1),
4899
+ name: z12.string().optional()
4900
+ });
4901
+ var youtubeVideoAssetSchema = z12.object({
4902
+ type: z12.literal("youtubeVideo"),
4903
+ youtubeVideoId: z12.string().min(1),
4904
+ name: z12.string().optional()
4905
+ });
4906
+ var sitelinkAssetSchema = z12.object({
4907
+ type: z12.literal("sitelink"),
4908
+ linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4909
+ description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4910
+ description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4911
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4912
+ });
4913
+ var calloutAssetSchema = z12.object({
4914
+ type: z12.literal("callout"),
4915
+ calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4916
+ });
4917
+ var structuredSnippetAssetSchema = z12.object({
4918
+ type: z12.literal("structuredSnippet"),
4919
+ header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4920
+ values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4921
+ });
4922
+ var callToActionAssetSchema = z12.object({ type: z12.literal("callToAction"), callToAction: z12.string().min(1) });
4923
+ var assetCreateSchema = z12.discriminatedUnion("type", [
4679
4924
  textAssetSchema,
4680
4925
  imageAssetSchema,
4681
4926
  youtubeVideoAssetSchema,
@@ -4684,136 +4929,136 @@ var assetCreateSchema = z10.discriminatedUnion("type", [
4684
4929
  structuredSnippetAssetSchema,
4685
4930
  callToActionAssetSchema
4686
4931
  ]);
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()
4932
+ var assetUpdateSchema = z12.object({
4933
+ name: z12.string().min(1).optional(),
4934
+ linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4935
+ description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4936
+ description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4937
+ finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
4938
+ calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4939
+ header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4940
+ values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4941
+ callToAction: z12.string().min(1).optional(),
4942
+ text: z12.string().min(1).optional()
4698
4943
  }).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"]),
4944
+ var assetLinkAttachSchema = z12.object({
4945
+ level: z12.enum(["campaign", "adGroup", "customer"]),
4701
4946
  parent: refSchema.optional(),
4702
4947
  asset: refSchema,
4703
- fieldType: z10.enum(ASSET_FIELD_TYPES)
4948
+ fieldType: z12.enum(ASSET_FIELD_TYPES)
4704
4949
  }).superRefine((value, ctx) => {
4705
4950
  if (value.level !== "customer" && !value.parent) {
4706
4951
  ctx.addIssue({
4707
- code: z10.ZodIssueCode.custom,
4952
+ code: z12.ZodIssueCode.custom,
4708
4953
  path: ["parent"],
4709
4954
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4710
4955
  });
4711
4956
  }
4712
4957
  });
4713
- var assetGroupCreateSchema = z10.object({
4958
+ var assetGroupCreateSchema = z12.object({
4714
4959
  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()
4960
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4961
+ finalUrls: z12.array(httpsUrlSchema2).min(1),
4962
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4963
+ longHeadlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4964
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4965
+ businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4966
+ imageAssets: z12.array(refSchema).optional(),
4967
+ squareImageAssets: z12.array(refSchema).optional(),
4968
+ logoAssets: z12.array(refSchema).optional(),
4969
+ status: z12.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4970
+ });
4971
+ var assetGroupUpdateSchema = z12.object({
4972
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4973
+ finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
4974
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4730
4975
  }).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(),
4976
+ var audienceCreateSchema2 = z12.object({
4977
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4978
+ type: z12.enum(USER_LIST_TYPES).default("BASIC"),
4979
+ description: z12.string().optional(),
4735
4980
  /** 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()
4981
+ members: z12.array(z12.record(z12.string(), z12.string())).optional(),
4982
+ sourceFileRef: z12.string().optional()
4738
4983
  });
4739
- var audienceCriterionAttachSchema = z10.object({
4740
- level: z10.enum(["campaign", "adGroup"]),
4984
+ var audienceCriterionAttachSchema = z12.object({
4985
+ level: z12.enum(["campaign", "adGroup"]),
4741
4986
  parent: refSchema,
4742
4987
  userList: refSchema,
4743
- negative: z10.boolean().default(false)
4988
+ negative: z12.boolean().default(false)
4744
4989
  });
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"),
4990
+ var conversionActionCreateSchema = z12.object({
4991
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4992
+ type: z12.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4993
+ category: z12.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4994
+ countingType: z12.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4750
4995
  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(),
4996
+ defaultCurrencyCode: z12.string().length(3).optional(),
4997
+ clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
4998
+ viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
4999
+ status: z12.enum(["ENABLED", "PAUSED"]).default("ENABLED")
5000
+ });
5001
+ var conversionActionUpdateSchema = z12.object({
5002
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
5003
+ category: z12.enum(CONVERSION_ACTION_CATEGORIES).optional(),
5004
+ countingType: z12.enum(CONVERSION_COUNTING_TYPES).optional(),
4760
5005
  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()
5006
+ defaultCurrencyCode: z12.string().length(3).optional(),
5007
+ clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
5008
+ viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
5009
+ status: z12.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4765
5010
  }).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),
5011
+ var biddingStrategyCreateSchema = z12.object({
5012
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4768
5013
  config: biddingConfigSchema
4769
5014
  }).superRefine((p, ctx) => {
4770
5015
  if (p.config.type === "MANUAL_CPC") {
4771
5016
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4772
5017
  }
4773
5018
  });
4774
- var biddingStrategyUpdateSchema = z10.object({
4775
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
5019
+ var biddingStrategyUpdateSchema = z12.object({
5020
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4776
5021
  config: biddingConfigSchema.optional()
4777
5022
  }).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()
5023
+ var labelCreateSchema = z12.object({
5024
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
5025
+ backgroundColor: z12.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
5026
+ description: z12.string().optional()
4782
5027
  });
4783
- var labelAttachSchema = z10.object({
4784
- level: z10.enum(["campaign", "adGroup", "ad"]),
5028
+ var labelAttachSchema = z12.object({
5029
+ level: z12.enum(["campaign", "adGroup", "ad"]),
4785
5030
  parent: refSchema,
4786
5031
  label: refSchema
4787
5032
  });
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),
5033
+ var locationCriterionSchema = z12.object({
5034
+ criterionType: z12.literal("location"),
5035
+ geoTargetConstant: z12.union([z12.string().regex(GEO_TARGET_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
5036
+ });
5037
+ var languageCriterionSchema = z12.object({
5038
+ criterionType: z12.literal("language"),
5039
+ languageConstant: z12.union([z12.string().regex(LANGUAGE_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
5040
+ });
5041
+ var adScheduleCriterionSchema = z12.object({
5042
+ criterionType: z12.literal("adSchedule"),
5043
+ dayOfWeek: z12.enum(DAYS_OF_WEEK),
5044
+ startHour: z12.number().int().min(0).max(23),
5045
+ startMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
5046
+ endHour: z12.number().int().min(0).max(24),
5047
+ endMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
5048
+ });
5049
+ var deviceCriterionSchema = z12.object({
5050
+ criterionType: z12.literal("device"),
5051
+ device: z12.enum(DEVICE_TYPES),
4807
5052
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4808
5053
  // 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, {
5054
+ bidModifier: z12.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4810
5055
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4811
5056
  })
4812
5057
  });
4813
- var campaignCriterionAddSchema = z10.object({
5058
+ var campaignCriterionAddSchema = z12.object({
4814
5059
  campaign: refSchema,
4815
- negative: z10.boolean().default(false),
4816
- criterion: z10.discriminatedUnion("criterionType", [
5060
+ negative: z12.boolean().default(false),
5061
+ criterion: z12.discriminatedUnion("criterionType", [
4817
5062
  locationCriterionSchema,
4818
5063
  languageCriterionSchema,
4819
5064
  adScheduleCriterionSchema,
@@ -4823,7 +5068,7 @@ var campaignCriterionAddSchema = z10.object({
4823
5068
  const c = val.criterion;
4824
5069
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4825
5070
  ctx.addIssue({
4826
- code: z10.ZodIssueCode.custom,
5071
+ code: z12.ZodIssueCode.custom,
4827
5072
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4828
5073
  path: ["criterion", "endMinute"]
4829
5074
  });
@@ -4875,17 +5120,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4875
5120
  "google.campaignCriterion.add",
4876
5121
  "google.campaignCriterion.remove"
4877
5122
  ];
4878
- var googleDraftOpKindSchema = z10.enum(GOOGLE_DRAFT_OP_KINDS);
5123
+ var googleDraftOpKindSchema = z12.enum(GOOGLE_DRAFT_OP_KINDS);
4879
5124
  function createOp2(kind, payload) {
4880
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, payload });
5125
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, payload });
4881
5126
  }
4882
5127
  function updateOp2(kind, payload) {
4883
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
5128
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4884
5129
  }
4885
5130
  function targetOp(kind) {
4886
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5131
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4887
5132
  }
4888
- var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
5133
+ var googleDraftOpInputSchema = z12.discriminatedUnion("kind", [
4889
5134
  createOp2("google.budget.create", budgetCreateSchema),
4890
5135
  updateOp2("google.budget.update", budgetUpdateSchema),
4891
5136
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4933,132 +5178,132 @@ var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4933
5178
  ]);
4934
5179
 
4935
5180
  // ../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(),
5181
+ import { z as z13 } from "zod";
5182
+ var googleWriteModeSchema = z13.enum(["live", "simulated"]);
5183
+ var googleDraftOpResultSchema = z13.object({
5184
+ status: z13.enum(["applied", "simulated", "failed", "skipped"]),
5185
+ resourceName: z13.string().optional(),
5186
+ error: z13.string().optional(),
5187
+ skippedBecause: z13.string().optional(),
5188
+ executedAt: z13.number().optional()
5189
+ });
5190
+ var googleDraftStageRequestSchema = z13.object({
5191
+ chatId: z13.string(),
4947
5192
  op: googleDraftOpInputSchema
4948
5193
  });
4949
- var googleDraftStageResponseSchema = z11.object({
4950
- staged: z11.literal(true),
4951
- ref: z11.string(),
5194
+ var googleDraftStageResponseSchema = z13.object({
5195
+ staged: z13.literal(true),
5196
+ ref: z13.string(),
4952
5197
  kind: googleDraftOpKindSchema,
4953
5198
  mode: googleWriteModeSchema,
4954
- dependsOn: z11.array(z11.string()),
4955
- summary: z11.string(),
4956
- warnings: z11.array(z11.string()),
5199
+ dependsOn: z13.array(z13.string()),
5200
+ summary: z13.string(),
5201
+ warnings: z13.array(z13.string()),
4957
5202
  /** True when the op amended an already-staged op in place instead of appending a new one. */
4958
- amended: z11.boolean().optional()
5203
+ amended: z13.boolean().optional()
4959
5204
  });
4960
- var googleDraftAmendRequestSchema = z11.object({
4961
- chatId: z11.string(),
4962
- ref: z11.string(),
4963
- patch: z11.record(z11.string(), z11.unknown())
5205
+ var googleDraftAmendRequestSchema = z13.object({
5206
+ chatId: z13.string(),
5207
+ ref: z13.string(),
5208
+ patch: z13.record(z13.string(), z13.unknown())
4964
5209
  });
4965
- var googleDraftShowRequestSchema = z11.object({
4966
- chatId: z11.string(),
4967
- ref: z11.string()
5210
+ var googleDraftShowRequestSchema = z13.object({
5211
+ chatId: z13.string(),
5212
+ ref: z13.string()
4968
5213
  });
4969
5214
  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)
5215
+ var googleDraftStageBatchRequestSchema = z13.object({
5216
+ chatId: z13.string(),
5217
+ ops: z13.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4973
5218
  });
4974
- var googleDraftStageBatchResponseSchema = z11.object({
4975
- staged: z11.literal(true),
5219
+ var googleDraftStageBatchResponseSchema = z13.object({
5220
+ staged: z13.literal(true),
4976
5221
  mode: googleWriteModeSchema,
4977
- count: z11.number(),
4978
- ops: z11.array(
4979
- z11.object({
4980
- ref: z11.string(),
5222
+ count: z13.number(),
5223
+ ops: z13.array(
5224
+ z13.object({
5225
+ ref: z13.string(),
4981
5226
  kind: googleDraftOpKindSchema,
4982
- dependsOn: z11.array(z11.string()),
4983
- summary: z11.string(),
4984
- warnings: z11.array(z11.string())
5227
+ dependsOn: z13.array(z13.string()),
5228
+ summary: z13.string(),
5229
+ warnings: z13.array(z13.string())
4985
5230
  })
4986
5231
  )
4987
5232
  });
4988
- var googleDraftOpViewSchema = z11.object({
4989
- ref: z11.string(),
5233
+ var googleDraftOpViewSchema = z13.object({
5234
+ ref: z13.string(),
4990
5235
  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(),
5236
+ customerId: z13.string(),
5237
+ target: z13.string().optional(),
5238
+ dependsOn: z13.array(z13.string()),
5239
+ summary: z13.string(),
5240
+ stagedAt: z13.number(),
4996
5241
  result: googleDraftOpResultSchema.optional()
4997
5242
  });
4998
- var googleDraftShowResponseSchema = z11.object({
5243
+ var googleDraftShowResponseSchema = z13.object({
4999
5244
  op: googleDraftOpViewSchema.extend({
5000
- payload: z11.unknown().optional(),
5001
- warnings: z11.array(z11.string()).optional(),
5002
- annotations: z11.unknown().optional()
5245
+ payload: z13.unknown().optional(),
5246
+ warnings: z13.array(z13.string()).optional(),
5247
+ annotations: z13.unknown().optional()
5003
5248
  })
5004
5249
  });
5005
- var googleDraftListRequestSchema = z11.object({
5006
- chatId: z11.string()
5007
- });
5008
- var googleDraftAdvisorySchema = z11.object({
5009
- scope: z11.enum(["campaign", "adGroup"]),
5010
- message: z11.string()
5250
+ var googleDraftListRequestSchema = z13.object({
5251
+ chatId: z13.string()
5011
5252
  });
5012
- var googleDraftStatusCollectionSchema = z11.object({
5013
- label: z11.string(),
5014
- added: z11.number(),
5015
- removed: z11.number(),
5016
- existing: z11.number()
5253
+ var googleDraftAdvisorySchema = z13.object({
5254
+ scope: z13.enum(["campaign", "adGroup"]),
5255
+ message: z13.string()
5017
5256
  });
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(),
5257
+ var googleDraftStatusCollectionSchema = z13.object({
5258
+ label: z13.string(),
5259
+ added: z13.number(),
5260
+ removed: z13.number(),
5261
+ existing: z13.number()
5262
+ });
5263
+ var googleDraftChangeOperationSchema = z13.enum(["create", "update", "pause", "resume", "remove"]);
5264
+ var googleDraftStatusNodeSchema = z13.lazy(
5265
+ () => z13.object({
5266
+ entity: z13.string(),
5267
+ name: z13.string(),
5023
5268
  operation: googleDraftChangeOperationSchema.optional(),
5024
- existing: z11.boolean(),
5025
- collections: z11.array(googleDraftStatusCollectionSchema),
5026
- children: z11.array(googleDraftStatusNodeSchema),
5027
- warnings: z11.array(z11.string()).optional()
5269
+ existing: z13.boolean(),
5270
+ collections: z13.array(googleDraftStatusCollectionSchema),
5271
+ children: z13.array(googleDraftStatusNodeSchema),
5272
+ warnings: z13.array(z13.string()).optional()
5028
5273
  })
5029
5274
  );
5030
- var googleDraftListResponseSchema = z11.object({
5031
- status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
5275
+ var googleDraftListResponseSchema = z13.object({
5276
+ status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
5032
5277
  mode: googleWriteModeSchema,
5033
- count: z11.number(),
5034
- ops: z11.array(googleDraftOpViewSchema),
5278
+ count: z13.number(),
5279
+ ops: z13.array(googleDraftOpViewSchema),
5035
5280
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5036
- tree: z11.array(googleDraftStatusNodeSchema).optional(),
5281
+ tree: z13.array(googleDraftStatusNodeSchema).optional(),
5037
5282
  /** Non-blocking completeness advisories for the whole draft. */
5038
- advisories: z11.array(googleDraftAdvisorySchema).optional()
5283
+ advisories: z13.array(googleDraftAdvisorySchema).optional()
5039
5284
  });
5040
- var googleDraftRemoveRequestSchema = z11.object({
5041
- chatId: z11.string(),
5042
- ref: z11.string()
5285
+ var googleDraftRemoveRequestSchema = z13.object({
5286
+ chatId: z13.string(),
5287
+ ref: z13.string()
5043
5288
  });
5044
- var googleDraftRemoveResponseSchema = z11.object({
5289
+ var googleDraftRemoveResponseSchema = z13.object({
5045
5290
  /** The requested ref plus any dependents removed by cascade. */
5046
- removed: z11.array(z11.string())
5291
+ removed: z13.array(z13.string())
5047
5292
  });
5048
- var googleDraftClearRequestSchema = z11.object({
5049
- chatId: z11.string()
5293
+ var googleDraftClearRequestSchema = z13.object({
5294
+ chatId: z13.string()
5050
5295
  });
5051
- var googleDraftClearResponseSchema = z11.object({
5052
- cleared: z11.number()
5296
+ var googleDraftClearResponseSchema = z13.object({
5297
+ cleared: z13.number()
5053
5298
  });
5054
- var googleFieldErrorSchema = z11.object({
5055
- path: z11.string(),
5056
- message: z11.string()
5299
+ var googleFieldErrorSchema = z13.object({
5300
+ path: z13.string(),
5301
+ message: z13.string()
5057
5302
  });
5058
- var googleDraftErrorResponseSchema = z11.object({
5059
- code: z11.string(),
5060
- error: z11.string(),
5061
- fields: z11.array(googleFieldErrorSchema).optional()
5303
+ var googleDraftErrorResponseSchema = z13.object({
5304
+ code: z13.string(),
5305
+ error: z13.string(),
5306
+ fields: z13.array(googleFieldErrorSchema).optional()
5062
5307
  });
5063
5308
 
5064
5309
  // src/commands/ads/google/draft-status.ts
@@ -11101,17 +11346,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11101
11346
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11102
11347
 
11103
11348
  // ../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);
11349
+ import { z as z14 } from "zod";
11350
+ var tempRefSchema3 = z14.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11351
+ var parentRefSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11352
+ var moneySchema2 = z14.object({
11353
+ amount: z14.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"),
11354
+ currencyCode: z14.string().length(3).optional()
11355
+ });
11356
+ var httpsUrlSchema3 = z14.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11357
+ var bakerMediaIdSchema2 = z14.string().min(1);
11358
+ var stageableStatusSchema3 = z14.enum(STAGEABLE_CREATE_STATUSES3);
11359
+ var updateStatusSchema = z14.enum(UPDATE_STATUSES);
11115
11360
  function currencyMinimums2(currencyCode) {
11116
11361
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11117
11362
  }
@@ -11123,50 +11368,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
11123
11368
  }
11124
11369
  }
11125
11370
  }
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({
11371
+ var geoLocationsSchema = z14.object({
11372
+ countries: z14.array(z14.string().length(2)).optional(),
11373
+ regions: z14.array(z14.object({ key: z14.string() })).optional(),
11374
+ cities: z14.array(z14.object({ key: z14.string(), radius: z14.number().optional(), distance_unit: z14.string().optional() })).optional(),
11375
+ zips: z14.array(z14.object({ key: z14.string() })).optional(),
11376
+ location_types: z14.array(z14.string()).optional()
11377
+ }).catchall(z14.unknown());
11378
+ var idNameSchema = z14.object({ id: z14.string(), name: z14.string().optional() });
11379
+ var metaTargetingSchema = z14.object({
11135
11380
  geo_locations: geoLocationsSchema.optional(),
11136
11381
  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),
11382
+ age_min: z14.number().int().min(13).max(65).optional(),
11383
+ age_max: z14.number().int().min(13).max(65).optional(),
11384
+ genders: z14.array(z14.union([z14.literal(1), z14.literal(2)])).optional(),
11385
+ locales: z14.array(z14.number().int()).optional(),
11386
+ interests: z14.array(idNameSchema).optional(),
11387
+ behaviors: z14.array(idNameSchema).optional(),
11388
+ custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
11389
+ excluded_custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
11390
+ flexible_spec: z14.array(z14.record(z14.string(), z14.unknown())).optional(),
11391
+ exclusions: z14.record(z14.string(), z14.unknown()).optional(),
11392
+ publisher_platforms: z14.array(z14.string()).optional(),
11393
+ facebook_positions: z14.array(z14.string()).optional(),
11394
+ instagram_positions: z14.array(z14.string()).optional(),
11395
+ audience_network_positions: z14.array(z14.string()).optional(),
11396
+ messenger_positions: z14.array(z14.string()).optional(),
11397
+ device_platforms: z14.array(z14.string()).optional(),
11398
+ targeting_automation: z14.object({ advantage_audience: z14.union([z14.literal(0), z14.literal(1)]) }).partial().optional()
11399
+ }).catchall(z14.unknown());
11400
+ var specialAdCategoriesSchema = z14.array(z14.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11401
+ var campaignCreateSchema3 = z14.object({
11402
+ name: z14.string().min(1).max(META_LIMITS.campaign.nameMax),
11403
+ objective: z14.enum(OBJECTIVES),
11159
11404
  status: stageableStatusSchema3.default("PAUSED"),
11160
11405
  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(),
11406
+ special_ad_category_country: z14.array(z14.string().length(2)).optional(),
11407
+ buying_type: z14.enum(BUYING_TYPES).default("AUCTION"),
11408
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11164
11409
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11165
11410
  dailyBudget: moneySchema2.optional(),
11166
11411
  lifetimeBudget: moneySchema2.optional(),
11167
11412
  spendCap: moneySchema2.optional(),
11168
- start_time: z12.number().int().positive().optional(),
11169
- stop_time: z12.number().int().positive().optional()
11413
+ start_time: z14.number().int().positive().optional(),
11414
+ stop_time: z14.number().int().positive().optional()
11170
11415
  }).superRefine((p, ctx) => {
11171
11416
  if (p.dailyBudget && p.lifetimeBudget) {
11172
11417
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11176,15 +11421,15 @@ var campaignCreateSchema3 = z12.object({
11176
11421
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11177
11422
  }
11178
11423
  });
11179
- var campaignUpdateSchema3 = z12.object({
11180
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11424
+ var campaignUpdateSchema3 = z14.object({
11425
+ name: z14.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11181
11426
  status: updateStatusSchema.optional(),
11182
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11427
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11183
11428
  dailyBudget: moneySchema2.optional(),
11184
11429
  lifetimeBudget: moneySchema2.optional(),
11185
11430
  spendCap: moneySchema2.optional(),
11186
- start_time: z12.number().int().positive().optional(),
11187
- stop_time: z12.number().int().positive().optional()
11431
+ start_time: z14.number().int().positive().optional(),
11432
+ stop_time: z14.number().int().positive().optional()
11188
11433
  }).superRefine((p, ctx) => {
11189
11434
  if (!Object.values(p).some((val) => val !== void 0)) {
11190
11435
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11194,38 +11439,38 @@ var campaignUpdateSchema3 = z12.object({
11194
11439
  }
11195
11440
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11196
11441
  });
11197
- var promotedObjectSchema = z12.object({
11442
+ var promotedObjectSchema = z14.object({
11198
11443
  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()
11444
+ pixel_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11445
+ custom_event_type: z14.enum(CUSTOM_EVENT_TYPES).optional(),
11446
+ application_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11447
+ object_store_url: z14.string().url().optional(),
11448
+ product_catalog_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11449
+ product_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11450
+ whatsapp_phone_number: z14.string().optional(),
11451
+ offline_conversion_data_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional()
11207
11452
  }).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)])
11453
+ var attributionSpecSchema = z14.array(
11454
+ z14.object({
11455
+ event_type: z14.enum(ATTRIBUTION_EVENT_TYPES),
11456
+ window_days: z14.union([z14.literal(1), z14.literal(7), z14.literal(28)])
11212
11457
  })
11213
11458
  );
11214
11459
  var adSetFields = {
11215
- name: z12.string().min(1).max(META_LIMITS.adSet.nameMax),
11460
+ name: z14.string().min(1).max(META_LIMITS.adSet.nameMax),
11216
11461
  campaign_id: parentRefSchema2,
11217
11462
  status: stageableStatusSchema3.default("PAUSED"),
11218
11463
  dailyBudget: moneySchema2.optional(),
11219
11464
  lifetimeBudget: moneySchema2.optional(),
11220
11465
  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(),
11466
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11467
+ billing_event: z14.enum(BILLING_EVENTS),
11468
+ optimization_goal: z14.enum(OPTIMIZATION_GOALS),
11469
+ destination_type: z14.enum(DESTINATION_TYPES).optional(),
11225
11470
  promoted_object: promotedObjectSchema.optional(),
11226
11471
  attribution_spec: attributionSpecSchema.optional(),
11227
- start_time: z12.number().int().positive().optional(),
11228
- end_time: z12.number().int().positive().optional(),
11472
+ start_time: z14.number().int().positive().optional(),
11473
+ end_time: z14.number().int().positive().optional(),
11229
11474
  targeting: metaTargetingSchema
11230
11475
  };
11231
11476
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11243,22 +11488,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11243
11488
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11244
11489
  }
11245
11490
  }
11246
- var adSetCreateSchema = z12.object(adSetFields).superRefine((p, ctx) => {
11491
+ var adSetCreateSchema = z14.object(adSetFields).superRefine((p, ctx) => {
11247
11492
  validateAdSetBudgetAndBid(p, ctx);
11248
11493
  });
11249
- var adSetUpdateSchema = z12.object({
11494
+ var adSetUpdateSchema = z14.object({
11250
11495
  name: adSetFields.name.optional(),
11251
11496
  status: updateStatusSchema.optional(),
11252
11497
  dailyBudget: moneySchema2.optional(),
11253
11498
  lifetimeBudget: moneySchema2.optional(),
11254
11499
  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(),
11500
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11501
+ optimization_goal: z14.enum(OPTIMIZATION_GOALS).optional(),
11502
+ destination_type: z14.enum(DESTINATION_TYPES).optional(),
11258
11503
  promoted_object: promotedObjectSchema.optional(),
11259
11504
  attribution_spec: attributionSpecSchema.optional(),
11260
- start_time: z12.number().int().positive().optional(),
11261
- end_time: z12.number().int().positive().optional(),
11505
+ start_time: z14.number().int().positive().optional(),
11506
+ end_time: z14.number().int().positive().optional(),
11262
11507
  targeting: metaTargetingSchema.optional()
11263
11508
  }).superRefine((p, ctx) => {
11264
11509
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11266,38 +11511,38 @@ var adSetUpdateSchema = z12.object({
11266
11511
  }
11267
11512
  validateAdSetBudgetAndBid(p, ctx);
11268
11513
  });
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),
11514
+ var messageSchema = z14.string().min(1).max(META_LIMITS.creative.messageHardMax);
11515
+ var headlineSchema2 = z14.string().min(1).max(META_LIMITS.creative.headlineMax);
11516
+ var descriptionSchema = z14.string().min(1).max(META_LIMITS.creative.descriptionMax);
11517
+ var callToActionSchema = z14.object({
11518
+ type: z14.enum(CTA_TYPES2),
11274
11519
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11275
11520
  link: httpsUrlSchema3.optional()
11276
11521
  });
11277
- var creativeEnhancementsSchema = z12.object({
11278
- standardEnhancements: z12.enum(ENROLL_STATUSES).optional(),
11279
- features: z12.record(z12.string(), z12.enum(ENROLL_STATUSES)).optional()
11522
+ var creativeEnhancementsSchema = z14.object({
11523
+ standardEnhancements: z14.enum(ENROLL_STATUSES).optional(),
11524
+ features: z14.record(z14.string(), z14.enum(ENROLL_STATUSES)).optional()
11280
11525
  });
11281
11526
  var creativeSharedFields = {
11282
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11527
+ name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
11283
11528
  /** Facebook Page id backing the ad's identity. */
11284
11529
  page_id: parentRefSchema2,
11285
11530
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11286
- instagram_user_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11531
+ instagram_user_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11287
11532
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11288
- url_tags: z12.string().max(1e3).optional(),
11533
+ url_tags: z14.string().max(1e3).optional(),
11289
11534
  enhancements: creativeEnhancementsSchema.optional()
11290
11535
  };
11291
11536
  var imageMediaFields = {
11292
- imageHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11537
+ imageHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
11293
11538
  imageRef: tempRefSchema3.optional()
11294
11539
  };
11295
11540
  var videoMediaFields = {
11296
- videoId: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11541
+ videoId: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11297
11542
  videoRef: tempRefSchema3.optional(),
11298
11543
  /** 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()
11544
+ thumbnailHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
11545
+ imageUrl: z14.string().url().optional()
11301
11546
  };
11302
11547
  function countImageRefs(p) {
11303
11548
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11305,8 +11550,8 @@ function countImageRefs(p) {
11305
11550
  function countVideoRefs(p) {
11306
11551
  return [p.videoId, p.videoRef].filter(Boolean).length;
11307
11552
  }
11308
- var singleCreativeSchema = z12.object({
11309
- creativeType: z12.literal("single"),
11553
+ var singleCreativeSchema = z14.object({
11554
+ creativeType: z14.literal("single"),
11310
11555
  ...creativeSharedFields,
11311
11556
  /** Primary text. */
11312
11557
  message: messageSchema,
@@ -11315,7 +11560,7 @@ var singleCreativeSchema = z12.object({
11315
11560
  headline: headlineSchema2.optional(),
11316
11561
  description: descriptionSchema.optional(),
11317
11562
  /** Display URL / caption shown under the headline. */
11318
- caption: z12.string().max(255).optional(),
11563
+ caption: z14.string().max(255).optional(),
11319
11564
  call_to_action: callToActionSchema.optional(),
11320
11565
  ...imageMediaFields,
11321
11566
  ...videoMediaFields
@@ -11339,10 +11584,10 @@ var singleCreativeSchema = z12.object({
11339
11584
  });
11340
11585
  }
11341
11586
  });
11342
- var carouselCardSchema = z12.object({
11587
+ var carouselCardSchema = z14.object({
11343
11588
  link: httpsUrlSchema3,
11344
- headline: z12.string().max(META_LIMITS.creative.headlineMax).optional(),
11345
- description: z12.string().max(META_LIMITS.creative.descriptionMax).optional(),
11589
+ headline: z14.string().max(META_LIMITS.creative.headlineMax).optional(),
11590
+ description: z14.string().max(META_LIMITS.creative.descriptionMax).optional(),
11346
11591
  call_to_action: callToActionSchema.optional(),
11347
11592
  ...imageMediaFields,
11348
11593
  ...videoMediaFields
@@ -11362,35 +11607,35 @@ var carouselCardSchema = z12.object({
11362
11607
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11363
11608
  }
11364
11609
  });
11365
- var carouselCreativeSchema2 = z12.object({
11366
- creativeType: z12.literal("carousel"),
11610
+ var carouselCreativeSchema2 = z14.object({
11611
+ creativeType: z14.literal("carousel"),
11367
11612
  ...creativeSharedFields,
11368
11613
  message: messageSchema,
11369
11614
  /** Optional "see more" card destination applied when a card has no own link. */
11370
11615
  link: httpsUrlSchema3.optional(),
11371
11616
  call_to_action: callToActionSchema.optional(),
11372
- cards: z12.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11617
+ cards: z14.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11373
11618
  });
11374
- var dynamicImageSchema = z12.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11375
- var dynamicVideoSchema = z12.object({
11619
+ var dynamicImageSchema = z14.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11620
+ var dynamicVideoSchema = z14.object({
11376
11621
  videoId: videoMediaFields.videoId,
11377
11622
  videoRef: videoMediaFields.videoRef,
11378
11623
  thumbnailHash: videoMediaFields.thumbnailHash
11379
11624
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11380
11625
  var DYN = META_LIMITS.creative;
11381
- var dynamicCreativeSchema = z12.object({
11382
- creativeType: z12.literal("dynamic"),
11626
+ var dynamicCreativeSchema = z14.object({
11627
+ creativeType: z14.literal("dynamic"),
11383
11628
  ...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),
11629
+ bodies: z14.array(z14.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11630
+ titles: z14.array(z14.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11631
+ descriptions: z14.array(z14.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11632
+ images: z14.array(dynamicImageSchema).optional(),
11633
+ videos: z14.array(dynamicVideoSchema).optional(),
11634
+ ad_formats: z14.array(z14.enum(AD_FORMATS2)).min(1),
11635
+ call_to_action_types: z14.array(z14.enum(CTA_TYPES2)).optional(),
11636
+ link_urls: z14.array(z14.object({ website_url: httpsUrlSchema3, display_url: z14.string().optional() })).min(1),
11392
11637
  /** Multi-language / placement customization — structural passthrough for v1. */
11393
- asset_customization_rules: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11638
+ asset_customization_rules: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11394
11639
  }).superRefine((p, ctx) => {
11395
11640
  if (!(p.images?.length || p.videos?.length)) {
11396
11641
  ctx.addIssue({
@@ -11400,57 +11645,57 @@ var dynamicCreativeSchema = z12.object({
11400
11645
  });
11401
11646
  }
11402
11647
  });
11403
- var existingPostCreativeSchema = z12.object({
11404
- creativeType: z12.literal("existing_post"),
11648
+ var existingPostCreativeSchema = z14.object({
11649
+ creativeType: z14.literal("existing_post"),
11405
11650
  name: creativeSharedFields.name,
11406
11651
  /** "<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>"'),
11652
+ object_story_id: z14.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11408
11653
  instagram_user_id: creativeSharedFields.instagram_user_id,
11409
11654
  url_tags: creativeSharedFields.url_tags,
11410
11655
  enhancements: creativeSharedFields.enhancements
11411
11656
  });
11412
- var creativeContentSchema2 = z12.discriminatedUnion("creativeType", [
11657
+ var creativeContentSchema2 = z14.discriminatedUnion("creativeType", [
11413
11658
  singleCreativeSchema,
11414
11659
  carouselCreativeSchema2,
11415
11660
  dynamicCreativeSchema,
11416
11661
  existingPostCreativeSchema
11417
11662
  ]);
11418
11663
  var adCreativeCreateSchema = creativeContentSchema2;
11419
- var adCreativeUpdateSchema = z12.object({
11420
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11664
+ var adCreativeUpdateSchema = z14.object({
11665
+ name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
11421
11666
  status: updateStatusSchema.optional(),
11422
11667
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11423
- content: z12.record(z12.string(), z12.unknown()).optional()
11668
+ content: z14.record(z14.string(), z14.unknown()).optional()
11424
11669
  }).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),
11670
+ var adCreateSchema2 = z14.object({
11671
+ name: z14.string().min(1).max(META_LIMITS.ad.nameMax),
11427
11672
  adset_id: parentRefSchema2,
11428
11673
  status: stageableStatusSchema3.default("PAUSED"),
11429
- creative: z12.object({ creative_id: parentRefSchema2 }),
11674
+ creative: z14.object({ creative_id: parentRefSchema2 }),
11430
11675
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11431
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11676
+ tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11432
11677
  });
11433
- var adUpdateSchema2 = z12.object({
11434
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11678
+ var adUpdateSchema2 = z14.object({
11679
+ name: z14.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11435
11680
  status: updateStatusSchema.optional(),
11436
11681
  /** 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()
11682
+ creative: z14.object({ creative_id: parentRefSchema2 }).optional(),
11683
+ tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11439
11684
  }).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(),
11685
+ var lookalikeSpecSchema = z14.object({
11686
+ origin: z14.array(z14.object({ id: parentRefSchema2 })).min(1),
11687
+ ratio: z14.number().min(0.01).max(0.2).optional(),
11688
+ country: z14.string().length(2).optional()
11689
+ });
11690
+ var customAudienceCreateSchema = z14.object({
11691
+ name: z14.string().min(1).max(META_LIMITS.audience.nameMax),
11692
+ subtype: z14.enum(CUSTOM_AUDIENCE_SUBTYPES),
11693
+ description: z14.string().max(500).optional(),
11694
+ customer_file_source: z14.string().optional(),
11695
+ retention_days: z14.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11451
11696
  lookalike_spec: lookalikeSpecSchema.optional(),
11452
11697
  /** Website/engagement rule — structural passthrough validated by Meta. */
11453
- rule: z12.record(z12.string(), z12.unknown()).optional()
11698
+ rule: z14.record(z14.string(), z14.unknown()).optional()
11454
11699
  }).superRefine((p, ctx) => {
11455
11700
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11456
11701
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11459,16 +11704,16 @@ var customAudienceCreateSchema = z12.object({
11459
11704
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11460
11705
  }
11461
11706
  });
11462
- var customAudienceUpdateSchema = z12.object({
11463
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11464
- description: z12.string().max(500).optional()
11707
+ var customAudienceUpdateSchema = z14.object({
11708
+ name: z14.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11709
+ description: z14.string().max(500).optional()
11465
11710
  }).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),
11711
+ var mediaUploadSchema = z14.object({
11712
+ kind: z14.enum(MEDIA_KINDS),
11468
11713
  bakerImageId: bakerMediaIdSchema2.optional(),
11469
11714
  bakerVideoId: bakerMediaIdSchema2.optional(),
11470
11715
  /** Optional display name / filename hint. */
11471
- name: z12.string().max(255).optional()
11716
+ name: z14.string().max(255).optional()
11472
11717
  }).superRefine((p, ctx) => {
11473
11718
  if (p.kind === "image" && !p.bakerImageId) {
11474
11719
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11490,16 +11735,16 @@ var META_DRAFT_OP_KINDS = [
11490
11735
  "customAudience.update",
11491
11736
  "media.upload"
11492
11737
  ];
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]);
11738
+ var metaDraftOpKindSchema = z14.enum(META_DRAFT_OP_KINDS);
11739
+ var accountIdSchema2 = z14.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11740
+ var updateTargetSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11496
11741
  function createOp3(kind, payload) {
11497
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, payload });
11742
+ return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, payload });
11498
11743
  }
11499
11744
  function updateOp3(kind, payload) {
11500
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11745
+ return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11501
11746
  }
11502
- var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11747
+ var metaDraftOpInputSchema = z14.discriminatedUnion("kind", [
11503
11748
  createOp3("campaign.create", campaignCreateSchema3),
11504
11749
  updateOp3("campaign.update", campaignUpdateSchema3),
11505
11750
  createOp3("adSet.create", adSetCreateSchema),
@@ -11514,89 +11759,89 @@ var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11514
11759
  ]);
11515
11760
 
11516
11761
  // ../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"]),
11762
+ import { z as z15 } from "zod";
11763
+ var metaWriteModeSchema = z15.enum(["live", "simulated"]);
11764
+ var metaDraftOpResultSchema = z15.object({
11765
+ status: z15.enum(["applied", "simulated", "failed", "skipped"]),
11521
11766
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11522
- id: z13.string().optional(),
11767
+ id: z15.string().optional(),
11523
11768
  /** 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()
11769
+ hash: z15.string().optional(),
11770
+ error: z15.string().optional(),
11771
+ skippedBecause: z15.string().optional(),
11772
+ executedAt: z15.number().optional()
11528
11773
  });
11529
- var metaDraftStageRequestSchema = z13.object({
11530
- chatId: z13.string(),
11774
+ var metaDraftStageRequestSchema = z15.object({
11775
+ chatId: z15.string(),
11531
11776
  op: metaDraftOpInputSchema
11532
11777
  });
11533
- var metaDraftStageResponseSchema = z13.object({
11534
- staged: z13.literal(true),
11535
- ref: z13.string(),
11778
+ var metaDraftStageResponseSchema = z15.object({
11779
+ staged: z15.literal(true),
11780
+ ref: z15.string(),
11536
11781
  kind: metaDraftOpKindSchema,
11537
11782
  mode: metaWriteModeSchema,
11538
- dependsOn: z13.array(z13.string()),
11539
- summary: z13.string(),
11540
- warnings: z13.array(z13.string()),
11783
+ dependsOn: z15.array(z15.string()),
11784
+ summary: z15.string(),
11785
+ warnings: z15.array(z15.string()),
11541
11786
  /** 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(),
11787
+ amended: z15.boolean().optional()
11788
+ });
11789
+ var metaDraftDuplicateRequestSchema = z15.object({
11790
+ chatId: z15.string(),
11791
+ accountId: z15.string(),
11792
+ entity: z15.enum(["campaign", "adSet", "ad"]),
11793
+ sourceId: z15.string(),
11794
+ overrides: z15.record(z15.string(), z15.unknown()).optional(),
11550
11795
  /** Pause the original after the copy publishes. */
11551
- replace: z13.boolean().optional()
11796
+ replace: z15.boolean().optional()
11552
11797
  });
11553
- var metaDraftOpViewSchema = z13.object({
11554
- ref: z13.string(),
11798
+ var metaDraftOpViewSchema = z15.object({
11799
+ ref: z15.string(),
11555
11800
  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(),
11801
+ accountId: z15.string(),
11802
+ target: z15.string().optional(),
11803
+ dependsOn: z15.array(z15.string()),
11804
+ summary: z15.string(),
11805
+ stagedAt: z15.number(),
11561
11806
  result: metaDraftOpResultSchema.optional()
11562
11807
  });
11563
- var metaDraftListRequestSchema = z13.object({
11564
- chatId: z13.string()
11808
+ var metaDraftListRequestSchema = z15.object({
11809
+ chatId: z15.string()
11565
11810
  });
11566
- var metaDraftAdvisorySchema = z13.object({
11567
- ref: z13.string(),
11568
- message: z13.string()
11811
+ var metaDraftAdvisorySchema = z15.object({
11812
+ ref: z15.string(),
11813
+ message: z15.string()
11569
11814
  });
11570
- var metaDraftListResponseSchema = z13.object({
11571
- status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
11815
+ var metaDraftListResponseSchema = z15.object({
11816
+ status: z15.enum(["active", "publishing", "applied", "discarded", "none"]),
11572
11817
  mode: metaWriteModeSchema,
11573
- count: z13.number(),
11574
- ops: z13.array(metaDraftOpViewSchema),
11818
+ count: z15.number(),
11819
+ ops: z15.array(metaDraftOpViewSchema),
11575
11820
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11576
- advisories: z13.array(metaDraftAdvisorySchema)
11821
+ advisories: z15.array(metaDraftAdvisorySchema)
11577
11822
  });
11578
- var metaDraftRemoveRequestSchema = z13.object({
11579
- chatId: z13.string(),
11580
- ref: z13.string()
11823
+ var metaDraftRemoveRequestSchema = z15.object({
11824
+ chatId: z15.string(),
11825
+ ref: z15.string()
11581
11826
  });
11582
- var metaDraftRemoveResponseSchema = z13.object({
11827
+ var metaDraftRemoveResponseSchema = z15.object({
11583
11828
  /** The requested ref plus any dependents removed by cascade. */
11584
- removed: z13.array(z13.string())
11829
+ removed: z15.array(z15.string())
11585
11830
  });
11586
- var metaDraftClearRequestSchema = z13.object({
11587
- chatId: z13.string()
11831
+ var metaDraftClearRequestSchema = z15.object({
11832
+ chatId: z15.string()
11588
11833
  });
11589
- var metaDraftClearResponseSchema = z13.object({
11590
- cleared: z13.number()
11834
+ var metaDraftClearResponseSchema = z15.object({
11835
+ cleared: z15.number()
11591
11836
  });
11592
- var metaFieldErrorSchema = z13.object({
11593
- path: z13.string(),
11594
- message: z13.string()
11837
+ var metaFieldErrorSchema = z15.object({
11838
+ path: z15.string(),
11839
+ message: z15.string()
11595
11840
  });
11596
- var metaDraftErrorResponseSchema = z13.object({
11597
- code: z13.string(),
11598
- error: z13.string(),
11599
- fields: z13.array(metaFieldErrorSchema).optional()
11841
+ var metaDraftErrorResponseSchema = z15.object({
11842
+ code: z15.string(),
11843
+ error: z15.string(),
11844
+ fields: z15.array(metaFieldErrorSchema).optional()
11600
11845
  });
11601
11846
 
11602
11847
  // src/commands/ads/meta/write-shared.ts
@@ -15009,7 +15254,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
15009
15254
  import { toCardinal as nwNl } from "n2words/nl-NL";
15010
15255
  import { toCardinal as nwPl } from "n2words/pl-PL";
15011
15256
  import { toCardinal as nwPt } from "n2words/pt-PT";
15012
- import { z as z14 } from "zod";
15257
+ import { z as z16 } from "zod";
15013
15258
 
15014
15259
  // src/engine/scaffold/lib/shoot-modes.ts
15015
15260
  var SHOOT_MODES = [
@@ -15345,71 +15590,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15345
15590
  "{{out.video}}"
15346
15591
  ];
15347
15592
  }
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(),
15593
+ var FrameAsset = z16.object({ url: z16.string().optional() }).loose().optional();
15594
+ var DialogueLine = z16.object({
15595
+ speaker: z16.string().optional(),
15596
+ line: z16.string().optional(),
15352
15597
  // 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(),
15598
+ start_s: z16.number().optional(),
15599
+ end_s: z16.number().optional(),
15600
+ delivery: z16.string().optional(),
15601
+ voice_description: z16.string().optional(),
15357
15602
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15358
15603
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15359
15604
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15360
15605
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15361
15606
  // the VO path; absent keeps the presence-based decision (old blueprints).
15362
- on_camera: z14.boolean().optional()
15607
+ on_camera: z16.boolean().optional()
15363
15608
  }).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()
15609
+ var Sfx = z16.object({
15610
+ at_s: z16.number().optional(),
15611
+ duration_s: z16.number().optional(),
15612
+ sound_effect_prompt: z16.string().optional(),
15613
+ description: z16.string().optional()
15369
15614
  }).loose();
15370
- var CompositionRegion = z14.object({
15615
+ var CompositionRegion = z16.object({
15371
15616
  // full | top | bottom | left | right | inset
15372
- panel: z14.string().optional(),
15617
+ panel: z16.string().optional(),
15373
15618
  // 9-grid anchor for an `inset` presenter box.
15374
- position: z14.string().optional(),
15375
- is_presenter: z14.boolean().optional(),
15619
+ position: z16.string().optional(),
15620
+ is_presenter: z16.boolean().optional(),
15376
15621
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15377
- cast_ref: z14.string().optional(),
15622
+ cast_ref: z16.string().optional(),
15378
15623
  // What the region's content IS: camera | screen_capture | static_graphic |
15379
15624
  // generated. Authoritative for routing when present (regex-over-prose fallback
15380
15625
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15381
15626
  // overlay layer, never AI-generated.
15382
- kind: z14.string().optional(),
15627
+ kind: z16.string().optional(),
15383
15628
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15384
15629
  // screen_capture region shows. Two scenes share it only when they show the SAME
15385
15630
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15386
15631
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15387
15632
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15388
15633
  // instead of asking the operator for one screenshot that can't cover both.
15389
- surface_id: z14.string().optional(),
15634
+ surface_id: z16.string().optional(),
15390
15635
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15391
15636
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15392
15637
  // 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()
15638
+ nested: z16.array(z16.object({}).loose()).optional(),
15639
+ summary: z16.string().optional(),
15640
+ frame_prompt: z16.string().optional(),
15641
+ motion_prompt: z16.string().optional()
15397
15642
  }).loose();
15398
- var SceneComposition = z14.object({
15643
+ var SceneComposition = z16.object({
15399
15644
  // full_frame (default) | split_screen | pip | keyed_overlay
15400
- layout: z14.string().optional(),
15645
+ layout: z16.string().optional(),
15401
15646
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15402
- split_axis: z14.string().optional(),
15403
- regions: z14.array(CompositionRegion).optional()
15647
+ split_axis: z16.string().optional(),
15648
+ regions: z16.array(CompositionRegion).optional()
15404
15649
  }).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(),
15650
+ var CameraMotion = z16.object({ movement: z16.string().optional(), detail: z16.string().optional() }).loose();
15651
+ var TranscriptWord = z16.object({ text: z16.string().optional() }).loose();
15652
+ var Scene = z16.object({
15653
+ start_s: z16.number().optional(),
15654
+ end_s: z16.number().optional(),
15655
+ duration_s: z16.number().optional(),
15656
+ summary: z16.string().optional(),
15657
+ action_detail: z16.string().optional(),
15413
15658
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15414
15659
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15415
15660
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15417,82 +15662,82 @@ var Scene = z14.object({
15417
15662
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15418
15663
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15419
15664
  // UGC/product mode; a human can override per scene by setting this.
15420
- shoot_mode: z14.string().optional(),
15665
+ shoot_mode: z16.string().optional(),
15421
15666
  // Diegetic ambient the clip's native audio should carry (no music). When
15422
15667
  // absent the scene falls back to its shoot mode's default ambience.
15423
- ambient: z14.string().optional(),
15668
+ ambient: z16.string().optional(),
15424
15669
  camera_motion: CameraMotion.optional(),
15425
- start_frame_prompt: z14.string().optional(),
15426
- end_frame_prompt: z14.string().optional(),
15427
- motion_prompt: z14.string().optional(),
15670
+ start_frame_prompt: z16.string().optional(),
15671
+ end_frame_prompt: z16.string().optional(),
15672
+ motion_prompt: z16.string().optional(),
15428
15673
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15429
15674
  // script re-craft checklist. Inferred from position when absent.
15430
- narrative_role: z14.string().optional(),
15675
+ narrative_role: z16.string().optional(),
15431
15676
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15432
15677
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15433
15678
  // into the hook's start-frame description so the generator renders that state,
15434
15679
  // not a calm influencer (CCA-11).
15435
- hook_mechanic: z14.object({ mechanic: z14.string().optional(), why_it_stops_scroll: z14.string().optional() }).loose().optional(),
15680
+ hook_mechanic: z16.object({ mechanic: z16.string().optional(), why_it_stops_scroll: z16.string().optional() }).loose().optional(),
15436
15681
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15437
- scene_setting: z14.string().optional(),
15682
+ scene_setting: z16.string().optional(),
15438
15683
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15439
15684
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15440
15685
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15441
15686
  // 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(),
15687
+ transition_out: z16.object({ type: z16.string().optional(), description: z16.string().optional() }).loose().optional(),
15688
+ dialogue: z16.array(DialogueLine).optional(),
15689
+ sfx: z16.array(Sfx).optional(),
15690
+ overlays: z16.array(z16.unknown()).optional(),
15691
+ floating_elements: z16.array(z16.unknown()).optional(),
15447
15692
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15448
15693
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15449
15694
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15450
15695
  // 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(),
15696
+ motion_level: z16.enum(["static", "subtle", "dynamic"]).optional(),
15697
+ transcript_slice: z16.array(TranscriptWord).optional(),
15453
15698
  start_frame_asset: FrameAsset,
15454
15699
  end_frame_asset: FrameAsset,
15455
15700
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15456
15701
  // previous one (the SAME physical shot, broken up only because it exceeded the
15457
15702
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15458
15703
  // start frame IS the previous scene's end frame — so the join is seamless.
15459
- continues_previous: z14.boolean().optional()
15704
+ continues_previous: z16.boolean().optional()
15460
15705
  }).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(),
15706
+ var VideoBlueprint = z16.object({
15707
+ source: z16.object({ aspect_ratio: z16.string().optional(), duration_s: z16.number().optional() }).loose().optional(),
15708
+ global: z16.object({
15709
+ music: z16.object({
15710
+ present: z16.boolean().optional(),
15711
+ music_prompt: z16.string().optional(),
15467
15712
  // Absolute second the music enters in the reference (the bed often
15468
15713
  // kicks in mid-ad, after the hook). We start the regenerated track here
15469
15714
  // instead of at 0 so the timing matches.
15470
- starts_at_s: z14.number().optional(),
15715
+ starts_at_s: z16.number().optional(),
15471
15716
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15472
15717
  // 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()
15718
+ identified_track: z16.object({ title: z16.string().optional(), artist: z16.string().optional() }).loose().nullish()
15474
15719
  }).loose().optional(),
15475
- cast: z14.array(
15476
- z14.object({
15477
- id: z14.string().optional(),
15478
- description: z14.string().optional(),
15720
+ cast: z16.array(
15721
+ z16.object({
15722
+ id: z16.string().optional(),
15723
+ description: z16.string().optional(),
15479
15724
  // The deconstruct's note on the target-market localization (e.g. "native
15480
15725
  // French speaker") — read to derive the spoken-track language code.
15481
- market_localization_note: z14.string().optional()
15726
+ market_localization_note: z16.string().optional()
15482
15727
  }).loose()
15483
15728
  ).optional(),
15484
- voiceover: z14.object({
15729
+ voiceover: z16.object({
15485
15730
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15486
15731
  // 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()
15732
+ mode: z16.string().optional(),
15733
+ voice_description: z16.string().optional(),
15734
+ persona: z16.string().optional()
15490
15735
  }).loose().optional(),
15491
15736
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15492
15737
  // 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()
15738
+ style: z16.object({ palette: z16.array(z16.object({ hex: z16.string().optional() }).loose()).optional() }).loose().optional()
15494
15739
  }).loose().optional(),
15495
- scenes: z14.array(Scene).min(1)
15740
+ scenes: z16.array(Scene).min(1)
15496
15741
  }).loose();
15497
15742
  function injectHookPhysicality(blueprint) {
15498
15743
  for (const scene of blueprint.scenes) {
@@ -15509,26 +15754,26 @@ function clipIntentOf(scene, sceneIndex) {
15509
15754
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
15510
15755
  return "body";
15511
15756
  }
15512
- var AppearsItem = z14.union([z14.number(), z14.object({ scene: z14.number(), edge: z14.string().optional() }).loose()]);
15513
- var RecurringElement = z14.object({
15757
+ var AppearsItem = z16.union([z16.number(), z16.object({ scene: z16.number(), edge: z16.string().optional() }).loose()]);
15758
+ var RecurringElement = z16.object({
15514
15759
  // 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(),
15760
+ type: z16.string(),
15761
+ label: z16.string().optional(),
15762
+ description: z16.string().optional(),
15763
+ expression: z16.string().nullable().optional(),
15519
15764
  // When the element maps to a global cast entry, its stable id (for annotation).
15520
- cast_id: z14.string().nullable().optional(),
15765
+ cast_id: z16.string().nullable().optional(),
15521
15766
  // The label of another element that is the SAME individual as this one, shown
15522
15767
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15523
15768
  // pink shirt and believer in a white shirt). Each look gets its own reference
15524
15769
  // slot, but the face/identity must stay identical across them.
15525
- same_as: z14.string().nullable().optional(),
15770
+ same_as: z16.string().nullable().optional(),
15526
15771
  // Scenes the element appears in. Either a bare list of scene indices (both
15527
15772
  // 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()
15773
+ scenes: z16.array(z16.number()).optional(),
15774
+ appears_in: z16.array(AppearsItem).optional()
15530
15775
  }).loose();
15531
- var RecurringElements = z14.array(RecurringElement);
15776
+ var RecurringElements = z16.array(RecurringElement);
15532
15777
  function sanitizeId(raw, fallback) {
15533
15778
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15534
15779
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -16001,7 +16246,7 @@ function scrubFloatSentences(text, floatDescs) {
16001
16246
  return kept;
16002
16247
  }
16003
16248
  function sceneFloatDescs(scene) {
16004
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16249
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16005
16250
  if (!floats.success) return [];
16006
16251
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
16007
16252
  }
@@ -17425,25 +17670,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
17425
17670
  }
17426
17671
  return tracks;
17427
17672
  }
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(),
17673
+ var OverlayStyle = z16.object({ color_hex: z16.string().optional(), background: z16.string().optional(), size: z16.string().optional() }).loose();
17674
+ var Overlay = z16.object({
17675
+ text: z16.string().optional(),
17676
+ appears_at_s: z16.number().optional(),
17677
+ duration_s: z16.number().optional(),
17678
+ position: z16.string().optional(),
17679
+ role: z16.string().optional(),
17680
+ animation: z16.string().optional(),
17681
+ animation_detail: z16.string().optional(),
17437
17682
  style: OverlayStyle.optional()
17438
17683
  }).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()
17684
+ var FloatingElement = z16.object({
17685
+ kind: z16.string().optional(),
17686
+ description: z16.string().optional(),
17687
+ brand_name: z16.string().nullish(),
17688
+ what_it_represents: z16.string().optional(),
17689
+ appears_at_s: z16.number().optional(),
17690
+ duration_s: z16.number().optional(),
17691
+ position: z16.string().optional()
17447
17692
  }).loose();
17448
17693
  function escapeHtml(s) {
17449
17694
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17475,7 +17720,7 @@ function positionClass(position) {
17475
17720
  function collectCaptions(blueprint, clock) {
17476
17721
  return blueprint.scenes.flatMap((scene, i) => {
17477
17722
  const sceneStart = scene.start_s ?? 0;
17478
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17723
+ const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
17479
17724
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17480
17725
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
17481
17726
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17555,7 +17800,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
17555
17800
  const windows = /* @__PURE__ */ new Map();
17556
17801
  blueprint.scenes.forEach((scene, i) => {
17557
17802
  const sceneStart = scene.start_s ?? 0;
17558
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17803
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17559
17804
  if (!floats.success) return;
17560
17805
  for (const fe of floats.data) {
17561
17806
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -18003,8 +18248,8 @@ function buildMotionBoard(blueprint) {
18003
18248
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
18004
18249
  cursor = end_s;
18005
18250
  const spoken = sceneSpokenText(scene);
18006
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
18007
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18251
+ const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
18252
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18008
18253
  const graphics = [
18009
18254
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
18010
18255
  kind: "text",
@@ -19436,7 +19681,7 @@ import path17 from "path";
19436
19681
  import { defineCommand as defineCommand91 } from "citty";
19437
19682
 
19438
19683
  // src/engine/scaffold/staticAd.ts
19439
- import { z as z15 } from "zod";
19684
+ import { z as z17 } from "zod";
19440
19685
  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
19686
  var DEFAULT_ASPECT_RATIO = "9:16";
19442
19687
  var SHEET_SUBJECT_TYPE2 = {
@@ -19448,24 +19693,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
19448
19693
  var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
19449
19694
  var ADAPT_IMAGE_SIZE = "2K";
19450
19695
  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()
19696
+ var Blueprint = z17.object({
19697
+ meta: z17.object({ estimated_aspect_ratio: z17.string().optional() }).loose().optional(),
19698
+ text_content: z17.array(z17.object({ text: z17.string().optional() }).loose()).optional()
19454
19699
  }).loose();
19455
- var ElementLocator = z15.object({
19456
- collection: z15.enum(["subjects", "people", "brands_logos"]),
19457
- index: z15.number().int().nonnegative()
19700
+ var ElementLocator = z17.object({
19701
+ collection: z17.enum(["subjects", "people", "brands_logos"]),
19702
+ index: z17.number().int().nonnegative()
19458
19703
  }).loose();
19459
- var MainElement = z15.object({
19704
+ var MainElement = z17.object({
19460
19705
  // 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(),
19706
+ type: z17.string(),
19707
+ label: z17.string().optional(),
19708
+ description: z17.string().optional(),
19709
+ expression: z17.string().nullable().optional(),
19710
+ reason: z17.string().optional(),
19466
19711
  locator: ElementLocator.optional()
19467
19712
  }).loose();
19468
- var MainElements = z15.array(MainElement);
19713
+ var MainElements = z17.array(MainElement);
19469
19714
  function sanitizeId2(raw, fallback) {
19470
19715
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
19471
19716
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -21250,11 +21495,219 @@ Subcommands:
21250
21495
  }
21251
21496
  });
21252
21497
 
21498
+ // src/commands/chats/index.ts
21499
+ import { defineCommand as defineCommand96 } from "citty";
21500
+ var STATUS_GROUPS = ["active", "archived", "all"];
21501
+ var REPO_SURFACES = ["knowledge", "company", "brand", "landings", "flows", "creatives"];
21502
+ function parseBoundedInt(raw, name, min, max) {
21503
+ if (raw === void 0) {
21504
+ return void 0;
21505
+ }
21506
+ const value = Number.parseInt(raw, 10);
21507
+ if (Number.isNaN(value) || value < min || value > max) {
21508
+ throw new Error(`--${name} must be an integer between ${min} and ${max}`);
21509
+ }
21510
+ return value;
21511
+ }
21512
+ registerSchema({
21513
+ command: "chats.list",
21514
+ description: "Start here: list other Sessions on this account (newest first) so you can reuse what was done before. Each row shows the Session id, title, status, and a count of what it produced (creatives, landings, actions, flows, reports\u2026). Then drill in with `baker chats view <id>`, `baker chats transcript <id>`, or `baker chats diff <id>`. Read-only.",
21515
+ args: {
21516
+ status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
21517
+ limit: { type: "string", description: "Max Sessions to return, 1-100 (default: 20)", required: false },
21518
+ full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
21519
+ }
21520
+ });
21521
+ var listCommand5 = defineCommand96({
21522
+ meta: { name: "list", description: "List other Sessions on this account, newest first." },
21523
+ args: {
21524
+ status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
21525
+ limit: { type: "string", description: "Max Sessions (1-100, default 20)", required: false },
21526
+ full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
21527
+ },
21528
+ run: async ({ args }) => {
21529
+ try {
21530
+ const body = {};
21531
+ if (args.status) {
21532
+ if (!STATUS_GROUPS.includes(args.status)) {
21533
+ throw new Error(`--status must be one of: ${STATUS_GROUPS.join("|")}`);
21534
+ }
21535
+ body.status = args.status;
21536
+ }
21537
+ const limit = parseBoundedInt(args.limit, "limit", 1, 100);
21538
+ if (limit !== void 0) {
21539
+ body.limit = limit;
21540
+ }
21541
+ if (args.full) {
21542
+ body.full = true;
21543
+ }
21544
+ const response = await apiPost("/api/chats/list", body);
21545
+ writeJson({
21546
+ ...response,
21547
+ meta: { count: response.data.chats.length },
21548
+ ...response.data.chats.length === 0 ? { hints: ["No Sessions matched. Widen with --status all or a larger --limit."] } : {
21549
+ hints: [
21550
+ "Drill in: `baker chats view <id>` for outputs, `chats transcript <id>` for the conversation, `chats diff <id>` for the real file changes."
21551
+ ]
21552
+ }
21553
+ });
21554
+ } catch (err) {
21555
+ failApi(err);
21556
+ }
21557
+ }
21558
+ });
21559
+ registerSchema({
21560
+ command: "chats.view",
21561
+ description: "Inspect one Session's FULL picture of what it changed \u2014 the unified `effects`: git content (landings, creatives, flows, knowledge, brand), plus DB-only effects that never touch the repo \u2014 Actions, Scheduled Actions, Tags, and ad-platform writes \u2014 each resolved to real detail (names, descriptions, priorities, tag types, ad operations). Also the kickoff (how it was asked), threads, and commits. Effects are `staged` (in-progress draft) or applied. Use after `baker chats list` to decide whether to reuse it. Read-only.",
21562
+ args: {
21563
+ id: { type: "positional", description: "The Session id (from `baker chats list`)", required: true },
21564
+ full: {
21565
+ type: "boolean",
21566
+ description: "No-op today; view already returns full effect detail",
21567
+ required: false,
21568
+ default: false
21569
+ }
21570
+ }
21571
+ });
21572
+ var viewCommand = defineCommand96({
21573
+ meta: {
21574
+ name: "view",
21575
+ description: "Inspect one Session's full effects \u2014 git content + actions/tags/ads, kickoff, commits."
21576
+ },
21577
+ args: {
21578
+ id: { type: "positional", description: "The Session id", required: true },
21579
+ full: { type: "boolean", description: "Include full detail", required: false, default: false }
21580
+ },
21581
+ run: async ({ args }) => {
21582
+ try {
21583
+ const response = await apiPost("/api/chats/view", {
21584
+ chatId: args.id,
21585
+ ...args.full ? { full: true } : {}
21586
+ });
21587
+ const hints = [];
21588
+ if (response.data.diffAvailable) {
21589
+ hints.push("See the real file-level diff of the git content with `baker chats diff <id> --full`.");
21590
+ }
21591
+ hints.push("Read the conversation with `baker chats transcript <id>`.");
21592
+ writeJson({ ...response, hints });
21593
+ } catch (err) {
21594
+ failApi(err);
21595
+ }
21596
+ }
21597
+ });
21598
+ registerSchema({
21599
+ command: "chats.transcript",
21600
+ description: "Read another Session's conversation (user + agent turns), most-recent first-capped. Use to see exactly how a past request was phrased and iterated before replaying it for a new goal. Compact truncates long messages; add --full for verbatim text. Read-only.",
21601
+ args: {
21602
+ id: { type: "positional", description: "The Session id", required: true },
21603
+ limit: { type: "string", description: "Max messages to return, 1-1000 (default: 100)", required: false },
21604
+ full: {
21605
+ type: "boolean",
21606
+ description: "Return verbatim (untruncated) message text",
21607
+ required: false,
21608
+ default: false
21609
+ }
21610
+ }
21611
+ });
21612
+ var transcriptCommand = defineCommand96({
21613
+ meta: { name: "transcript", description: "Read another Session's conversation." },
21614
+ args: {
21615
+ id: { type: "positional", description: "The Session id", required: true },
21616
+ limit: { type: "string", description: "Max messages (1-1000, default 100)", required: false },
21617
+ full: { type: "boolean", description: "Verbatim message text", required: false, default: false }
21618
+ },
21619
+ run: async ({ args }) => {
21620
+ try {
21621
+ const body = { chatId: args.id };
21622
+ const limit = parseBoundedInt(args.limit, "limit", 1, 1e3);
21623
+ if (limit !== void 0) {
21624
+ body.limit = limit;
21625
+ }
21626
+ if (args.full) {
21627
+ body.full = true;
21628
+ }
21629
+ const response = await apiPost("/api/chats/transcript", body);
21630
+ writeJson({
21631
+ ...response,
21632
+ meta: { count: response.data.entries.length },
21633
+ ...response.data.truncated ? { hints: ["Older messages were dropped to fit --limit. Raise --limit to see more."] } : {}
21634
+ });
21635
+ } catch (err) {
21636
+ failApi(err);
21637
+ }
21638
+ }
21639
+ });
21640
+ registerSchema({
21641
+ command: "chats.diff",
21642
+ description: "See the real file-level changes a Session made (landings, creatives, brand, flows, knowledge). Only available for published Sessions; in-progress ones return available:false \u2014 use `baker chats view` for their staged summary. Compact lists changed files with +/- counts; add --full for the actual diff text. Read-only.",
21643
+ args: {
21644
+ id: { type: "positional", description: "The Session id", required: true },
21645
+ surface: {
21646
+ type: "string",
21647
+ description: "Filter to one surface: knowledge|company|brand|landings|flows|creatives",
21648
+ required: false
21649
+ },
21650
+ full: {
21651
+ type: "boolean",
21652
+ description: "Include the unified-diff patch text per file",
21653
+ required: false,
21654
+ default: false
21655
+ }
21656
+ }
21657
+ });
21658
+ var diffCommand = defineCommand96({
21659
+ meta: { name: "diff", description: "See a published Session's real file-level changes." },
21660
+ args: {
21661
+ id: { type: "positional", description: "The Session id", required: true },
21662
+ surface: {
21663
+ type: "string",
21664
+ description: "Filter: knowledge|company|brand|landings|flows|creatives",
21665
+ required: false
21666
+ },
21667
+ full: { type: "boolean", description: "Include the diff patch text per file", required: false, default: false }
21668
+ },
21669
+ run: async ({ args }) => {
21670
+ try {
21671
+ const body = { chatId: args.id };
21672
+ if (args.surface) {
21673
+ if (!REPO_SURFACES.includes(args.surface)) {
21674
+ throw new Error(`--surface must be one of: ${REPO_SURFACES.join("|")}`);
21675
+ }
21676
+ body.surface = args.surface;
21677
+ }
21678
+ if (args.full) {
21679
+ body.full = true;
21680
+ }
21681
+ const response = await apiPost("/api/chats/diff", body);
21682
+ writeJson({
21683
+ ...response,
21684
+ meta: { count: response.data.files.length },
21685
+ ...!response.data.available && response.data.reason ? { hints: [response.data.reason] } : {},
21686
+ ...response.data.available && !args.full && response.data.files.length > 0 ? { hints: ["Add --full to read the actual diff text for each file."] } : {}
21687
+ });
21688
+ } catch (err) {
21689
+ failApi(err);
21690
+ }
21691
+ }
21692
+ });
21693
+ var chatsCommand = defineCommand96({
21694
+ meta: {
21695
+ name: "chats",
21696
+ description: "Inspect other Sessions on this account (read-only): list them, view what they produced, read their conversation, and see their real file changes \u2014 so you can reuse past work for a new goal."
21697
+ },
21698
+ subCommands: {
21699
+ list: listCommand5,
21700
+ view: viewCommand,
21701
+ transcript: transcriptCommand,
21702
+ diff: diffCommand
21703
+ }
21704
+ });
21705
+
21253
21706
  // src/commands/creatives/index.ts
21254
- import { defineCommand as defineCommand97 } from "citty";
21707
+ import { defineCommand as defineCommand98 } from "citty";
21255
21708
 
21256
21709
  // src/commands/creatives/publish.ts
21257
- import { defineCommand as defineCommand96 } from "citty";
21710
+ import { defineCommand as defineCommand97 } from "citty";
21258
21711
 
21259
21712
  // src/commands/images/api.ts
21260
21713
  import { readFile as readFile17 } from "fs/promises";
@@ -21398,7 +21851,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
21398
21851
  chatId: chatIdFromEnv()
21399
21852
  });
21400
21853
  }
21401
- var publishCommand = defineCommand96({
21854
+ var publishCommand = defineCommand97({
21402
21855
  meta: {
21403
21856
  name: "publish",
21404
21857
  description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
@@ -21456,7 +21909,7 @@ var publishCommand = defineCommand96({
21456
21909
  });
21457
21910
 
21458
21911
  // src/commands/creatives/index.ts
21459
- var creativesCommand3 = defineCommand97({
21912
+ var creativesCommand3 = defineCommand98({
21460
21913
  meta: {
21461
21914
  name: "creatives",
21462
21915
  description: `Publish static ad creatives as first-class Baker outputs.
@@ -21472,7 +21925,7 @@ Publishing uploads the image to the Company image library, applies the official
21472
21925
  });
21473
21926
 
21474
21927
  // src/commands/flows/index.ts
21475
- import { defineCommand as defineCommand98 } from "citty";
21928
+ import { defineCommand as defineCommand99 } from "citty";
21476
21929
 
21477
21930
  // src/commands/flows/shared.ts
21478
21931
  import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
@@ -21627,7 +22080,7 @@ function displayName(slug) {
21627
22080
  const name = tree.displayName;
21628
22081
  return typeof name === "string" && name.trim() ? name.trim() : slug;
21629
22082
  }
21630
- var listCommand5 = defineCommand98({
22083
+ var listCommand6 = defineCommand99({
21631
22084
  meta: {
21632
22085
  name: "list",
21633
22086
  description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
@@ -21641,7 +22094,7 @@ var listCommand5 = defineCommand98({
21641
22094
  writeJson({ ok: true, data: { flows } });
21642
22095
  }
21643
22096
  });
21644
- var showCommand2 = defineCommand98({
22097
+ var showCommand2 = defineCommand99({
21645
22098
  meta: {
21646
22099
  name: "show",
21647
22100
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -21662,7 +22115,7 @@ var showCommand2 = defineCommand98({
21662
22115
  writeJson({ ok: true, data: response });
21663
22116
  }
21664
22117
  });
21665
- var flowsCommand = defineCommand98({
22118
+ var flowsCommand = defineCommand99({
21666
22119
  meta: {
21667
22120
  name: "flows",
21668
22121
  description: `Read this workspace's Forms (flows) and the configuration status of their confidential fields \u2014 connection secrets, OAuth connections, and third-party field definitions (HubSpot, Calendly, HighLevel, SavvyCal).
@@ -21675,7 +22128,7 @@ Examples:
21675
22128
  baker flows show contact --full`
21676
22129
  },
21677
22130
  subCommands: {
21678
- list: listCommand5,
22131
+ list: listCommand6,
21679
22132
  show: showCommand2
21680
22133
  },
21681
22134
  run: () => {
@@ -21689,10 +22142,10 @@ Examples:
21689
22142
  });
21690
22143
 
21691
22144
  // src/commands/ga4/index.ts
21692
- import { defineCommand as defineCommand102 } from "citty";
22145
+ import { defineCommand as defineCommand103 } from "citty";
21693
22146
 
21694
22147
  // src/commands/ga4/audit.ts
21695
- import { defineCommand as defineCommand99 } from "citty";
22148
+ import { defineCommand as defineCommand100 } from "citty";
21696
22149
 
21697
22150
  // src/commands/ga4/resolve.ts
21698
22151
  async function fetchProperties(useCache = true) {
@@ -21755,7 +22208,7 @@ registerSchema({
21755
22208
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21756
22209
  }
21757
22210
  });
21758
- var auditCommand2 = defineCommand99({
22211
+ var auditCommand2 = defineCommand100({
21759
22212
  meta: {
21760
22213
  name: "audit",
21761
22214
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -21807,7 +22260,7 @@ Examples:
21807
22260
  });
21808
22261
 
21809
22262
  // src/commands/ga4/properties.ts
21810
- import { defineCommand as defineCommand100 } from "citty";
22263
+ import { defineCommand as defineCommand101 } from "citty";
21811
22264
  registerSchema({
21812
22265
  command: "ga4.properties",
21813
22266
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -21815,7 +22268,7 @@ registerSchema({
21815
22268
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21816
22269
  }
21817
22270
  });
21818
- var propertiesCommand = defineCommand100({
22271
+ var propertiesCommand = defineCommand101({
21819
22272
  meta: {
21820
22273
  name: "properties",
21821
22274
  description: `List accessible GA4 properties.
@@ -21865,7 +22318,7 @@ Examples:
21865
22318
  // src/commands/ga4/query.ts
21866
22319
  import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
21867
22320
  import { resolve as resolve2 } from "path";
21868
- import { defineCommand as defineCommand101 } from "citty";
22321
+ import { defineCommand as defineCommand102 } from "citty";
21869
22322
 
21870
22323
  // src/commands/ga4/presets.ts
21871
22324
  var GA4_PRESETS = [
@@ -21997,7 +22450,7 @@ function handleError(err) {
21997
22450
  });
21998
22451
  process.exit(1);
21999
22452
  }
22000
- var queryCommand2 = defineCommand101({
22453
+ var queryCommand2 = defineCommand102({
22001
22454
  meta: {
22002
22455
  name: "query",
22003
22456
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -22068,7 +22521,7 @@ Free-form (escape hatch):
22068
22521
  });
22069
22522
 
22070
22523
  // src/commands/ga4/index.ts
22071
- var ga4Command = defineCommand102({
22524
+ var ga4Command = defineCommand103({
22072
22525
  meta: {
22073
22526
  name: "ga4",
22074
22527
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -22091,12 +22544,12 @@ Examples:
22091
22544
  });
22092
22545
 
22093
22546
  // src/commands/gsc/index.ts
22094
- import { defineCommand as defineCommand106 } from "citty";
22547
+ import { defineCommand as defineCommand107 } from "citty";
22095
22548
 
22096
22549
  // src/commands/gsc/query.ts
22097
22550
  import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
22098
22551
  import { resolve as resolve3 } from "path";
22099
- import { defineCommand as defineCommand103 } from "citty";
22552
+ import { defineCommand as defineCommand104 } from "citty";
22100
22553
 
22101
22554
  // src/commands/gsc/presets.ts
22102
22555
  var GSC_PRESETS = [
@@ -22284,7 +22737,7 @@ function handleError2(err) {
22284
22737
  });
22285
22738
  process.exit(1);
22286
22739
  }
22287
- var queryCommand3 = defineCommand103({
22740
+ var queryCommand3 = defineCommand104({
22288
22741
  meta: {
22289
22742
  name: "query",
22290
22743
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -22362,7 +22815,7 @@ Free-form (escape hatch):
22362
22815
  });
22363
22816
 
22364
22817
  // src/commands/gsc/sitemaps.ts
22365
- import { defineCommand as defineCommand104 } from "citty";
22818
+ import { defineCommand as defineCommand105 } from "citty";
22366
22819
  registerSchema({
22367
22820
  command: "gsc.sitemaps",
22368
22821
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -22371,7 +22824,7 @@ registerSchema({
22371
22824
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22372
22825
  }
22373
22826
  });
22374
- var sitemapsCommand = defineCommand104({
22827
+ var sitemapsCommand = defineCommand105({
22375
22828
  meta: {
22376
22829
  name: "sitemaps",
22377
22830
  description: `List sitemaps for a site. Check health and errors.
@@ -22421,7 +22874,7 @@ Examples:
22421
22874
  });
22422
22875
 
22423
22876
  // src/commands/gsc/sites.ts
22424
- import { defineCommand as defineCommand105 } from "citty";
22877
+ import { defineCommand as defineCommand106 } from "citty";
22425
22878
  registerSchema({
22426
22879
  command: "gsc.sites",
22427
22880
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -22429,7 +22882,7 @@ registerSchema({
22429
22882
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22430
22883
  }
22431
22884
  });
22432
- var sitesCommand = defineCommand105({
22885
+ var sitesCommand = defineCommand106({
22433
22886
  meta: {
22434
22887
  name: "sites",
22435
22888
  description: `List verified Search Console sites.
@@ -22477,7 +22930,7 @@ Examples:
22477
22930
  });
22478
22931
 
22479
22932
  // src/commands/gsc/index.ts
22480
- var gscCommand = defineCommand106({
22933
+ var gscCommand = defineCommand107({
22481
22934
  meta: {
22482
22935
  name: "gsc",
22483
22936
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -22499,11 +22952,121 @@ Examples:
22499
22952
  }
22500
22953
  });
22501
22954
 
22955
+ // src/commands/history/index.ts
22956
+ import { defineCommand as defineCommand108 } from "citty";
22957
+ registerSchema({
22958
+ command: "history.list",
22959
+ 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.",
22960
+ args: {
22961
+ limit: {
22962
+ type: "string",
22963
+ description: "Max entries to return, 1-200 (default: 30)",
22964
+ required: false
22965
+ },
22966
+ category: {
22967
+ type: "string",
22968
+ description: "Filter: publish|chat|action|team|setup_link|company|tag|schedule|ads|advertiser|media|creative|report|domain|integration",
22969
+ required: false
22970
+ },
22971
+ days: {
22972
+ type: "string",
22973
+ description: "Only entries from the last N days (1-365)",
22974
+ required: false
22975
+ },
22976
+ full: {
22977
+ type: "boolean",
22978
+ description: "Include raw metadata for each entry",
22979
+ required: false,
22980
+ default: false
22981
+ }
22982
+ }
22983
+ });
22984
+ var CATEGORIES = [
22985
+ "publish",
22986
+ "chat",
22987
+ "action",
22988
+ "team",
22989
+ "setup_link",
22990
+ "company",
22991
+ "tag",
22992
+ "schedule",
22993
+ "ads",
22994
+ "advertiser",
22995
+ "media",
22996
+ "creative",
22997
+ "report",
22998
+ "domain",
22999
+ "integration"
23000
+ ];
23001
+ function parseBoundedInt2(raw, name, min, max) {
23002
+ if (raw === void 0) {
23003
+ return void 0;
23004
+ }
23005
+ const value = Number.parseInt(raw, 10);
23006
+ if (Number.isNaN(value) || value < min || value > max) {
23007
+ throw new Error(`--${name} must be an integer between ${min} and ${max}`);
23008
+ }
23009
+ return value;
23010
+ }
23011
+ var listCommand7 = defineCommand108({
23012
+ meta: {
23013
+ name: "list",
23014
+ description: "List recent account changes (unified audit log), newest first."
23015
+ },
23016
+ args: {
23017
+ limit: { type: "string", description: "Max entries (1-200, default 30)", required: false },
23018
+ category: {
23019
+ type: "string",
23020
+ description: "Filter: publish|chat|action|team|setup_link|company|tag|schedule|ads|advertiser|media|creative|report|domain|integration",
23021
+ required: false
23022
+ },
23023
+ days: { type: "string", description: "Only the last N days (1-365)", required: false },
23024
+ full: { type: "boolean", description: "Include raw metadata", required: false, default: false }
23025
+ },
23026
+ run: async ({ args }) => {
23027
+ try {
23028
+ const body = {};
23029
+ const limit = parseBoundedInt2(args.limit, "limit", 1, 200);
23030
+ if (limit !== void 0) {
23031
+ body.limit = limit;
23032
+ }
23033
+ const days = parseBoundedInt2(args.days, "days", 1, 365);
23034
+ if (days !== void 0) {
23035
+ body.days = days;
23036
+ }
23037
+ if (args.category) {
23038
+ if (!CATEGORIES.includes(args.category)) {
23039
+ throw new Error(`--category must be one of: ${CATEGORIES.join("|")}`);
23040
+ }
23041
+ body.category = args.category;
23042
+ }
23043
+ if (args.full) {
23044
+ body.full = true;
23045
+ }
23046
+ const response = await apiPost("/api/history/list", body);
23047
+ writeJson({
23048
+ ...response,
23049
+ meta: { count: response.data.entries.length },
23050
+ ...response.data.entries.length === 0 ? { hints: ["No history entries matched. Widen with a larger --days or drop --category."] } : {}
23051
+ });
23052
+ } catch (err) {
23053
+ failApi(err);
23054
+ }
23055
+ }
23056
+ });
23057
+ var historyCommand = defineCommand108({
23058
+ meta: {
23059
+ name: "history",
23060
+ description: "Unified account history (audit log): what changed, who did it, and when."
23061
+ },
23062
+ subCommands: { list: listCommand7 }
23063
+ });
23064
+
22502
23065
  // src/commands/images/index.ts
22503
- import { defineCommand as defineCommand130 } from "citty";
23066
+ import { defineCommand as defineCommand132 } from "citty";
22504
23067
 
22505
23068
  // src/commands/images/crop.ts
22506
- import { defineCommand as defineCommand107 } from "citty";
23069
+ import { defineCommand as defineCommand109 } from "citty";
22507
23070
 
22508
23071
  // src/lib/image/crop-sprite.ts
22509
23072
  import sharp from "sharp";
@@ -22628,7 +23191,7 @@ function emitError2(err) {
22628
23191
  }
22629
23192
  process.exit(1);
22630
23193
  }
22631
- var cropCommand = defineCommand107({
23194
+ var cropCommand = defineCommand109({
22632
23195
  meta: {
22633
23196
  name: "crop",
22634
23197
  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 +23227,7 @@ var cropCommand = defineCommand107({
22664
23227
  });
22665
23228
 
22666
23229
  // src/commands/images/delete.ts
22667
- import { defineCommand as defineCommand108 } from "citty";
23230
+ import { defineCommand as defineCommand110 } from "citty";
22668
23231
  registerSchema({
22669
23232
  command: "images.delete",
22670
23233
  description: "Delete an image by ID",
@@ -22678,7 +23241,7 @@ registerSchema({
22678
23241
  }
22679
23242
  }
22680
23243
  });
22681
- var deleteCommand = defineCommand108({
23244
+ var deleteCommand = defineCommand110({
22682
23245
  meta: {
22683
23246
  name: "delete",
22684
23247
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -22719,7 +23282,7 @@ var deleteCommand = defineCommand108({
22719
23282
  });
22720
23283
 
22721
23284
  // src/commands/images/dimensions.ts
22722
- import { defineCommand as defineCommand109 } from "citty";
23285
+ import { defineCommand as defineCommand111 } from "citty";
22723
23286
 
22724
23287
  // src/lib/image/dimensions.ts
22725
23288
  import { imageSize } from "image-size";
@@ -22742,7 +23305,7 @@ registerSchema({
22742
23305
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
22743
23306
  }
22744
23307
  });
22745
- var dimensionsCommand = defineCommand109({
23308
+ var dimensionsCommand = defineCommand111({
22746
23309
  meta: {
22747
23310
  name: "dimensions",
22748
23311
  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 +23349,7 @@ var dimensionsCommand = defineCommand109({
22786
23349
  });
22787
23350
 
22788
23351
  // src/commands/images/extract.ts
22789
- import { defineCommand as defineCommand110 } from "citty";
23352
+ import { defineCommand as defineCommand112 } from "citty";
22790
23353
  registerSchema({
22791
23354
  command: "images.extract",
22792
23355
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -22802,7 +23365,7 @@ registerSchema({
22802
23365
  }
22803
23366
  }
22804
23367
  });
22805
- var extractCommand = defineCommand110({
23368
+ var extractCommand = defineCommand112({
22806
23369
  meta: {
22807
23370
  name: "extract",
22808
23371
  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 +23403,7 @@ var extractCommand = defineCommand110({
22840
23403
  });
22841
23404
 
22842
23405
  // src/commands/images/find.ts
22843
- import { defineCommand as defineCommand111 } from "citty";
23406
+ import { defineCommand as defineCommand113 } from "citty";
22844
23407
  registerSchema({
22845
23408
  command: "images.find",
22846
23409
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -22872,7 +23435,7 @@ registerSchema({
22872
23435
  }
22873
23436
  }
22874
23437
  });
22875
- var findCommand = defineCommand111({
23438
+ var findCommand = defineCommand113({
22876
23439
  meta: {
22877
23440
  name: "find",
22878
23441
  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 +23484,7 @@ var findCommand = defineCommand111({
22921
23484
 
22922
23485
  // src/commands/images/generate.ts
22923
23486
  import { readFile as readFile19 } from "fs/promises";
22924
- import { defineCommand as defineCommand112 } from "citty";
23487
+ import { defineCommand as defineCommand114 } from "citty";
22925
23488
  import sharp2 from "sharp";
22926
23489
  var GENERATE_TIMEOUT_MS = 18e4;
22927
23490
  var REFERENCE_MAX_EDGE = 1536;
@@ -23024,7 +23587,7 @@ async function resolveReferences(spec) {
23024
23587
  }
23025
23588
  return out;
23026
23589
  }
23027
- var generateCommand = defineCommand112({
23590
+ var generateCommand = defineCommand114({
23028
23591
  meta: {
23029
23592
  name: "generate",
23030
23593
  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 +23639,7 @@ var generateCommand = defineCommand112({
23076
23639
  });
23077
23640
 
23078
23641
  // src/commands/images/get.ts
23079
- import { defineCommand as defineCommand113 } from "citty";
23642
+ import { defineCommand as defineCommand115 } from "citty";
23080
23643
  registerSchema({
23081
23644
  command: "images.get",
23082
23645
  description: "Get a single image by ID",
@@ -23084,7 +23647,7 @@ registerSchema({
23084
23647
  id: { type: "string", description: "Image ID", required: true }
23085
23648
  }
23086
23649
  });
23087
- var getCommand2 = defineCommand113({
23650
+ var getCommand2 = defineCommand115({
23088
23651
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
23089
23652
  args: {
23090
23653
  id: { type: "positional", description: "Image ID", required: false },
@@ -23120,7 +23683,7 @@ var getCommand2 = defineCommand113({
23120
23683
  });
23121
23684
 
23122
23685
  // src/commands/images/gif.ts
23123
- import { defineCommand as defineCommand114 } from "citty";
23686
+ import { defineCommand as defineCommand116 } from "citty";
23124
23687
  registerSchema({
23125
23688
  command: "images.gif",
23126
23689
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -23152,7 +23715,7 @@ registerSchema({
23152
23715
  }
23153
23716
  }
23154
23717
  });
23155
- var gifCommand = defineCommand114({
23718
+ var gifCommand = defineCommand116({
23156
23719
  meta: {
23157
23720
  name: "gif",
23158
23721
  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 +23762,7 @@ var gifCommand = defineCommand114({
23199
23762
  });
23200
23763
 
23201
23764
  // src/commands/images/google.ts
23202
- import { defineCommand as defineCommand115 } from "citty";
23765
+ import { defineCommand as defineCommand117 } from "citty";
23203
23766
  registerSchema({
23204
23767
  command: "images.google",
23205
23768
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -23235,7 +23798,7 @@ registerSchema({
23235
23798
  }
23236
23799
  }
23237
23800
  });
23238
- var googleCommand2 = defineCommand115({
23801
+ var googleCommand2 = defineCommand117({
23239
23802
  meta: {
23240
23803
  name: "google",
23241
23804
  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 +23846,7 @@ var googleCommand2 = defineCommand115({
23283
23846
  });
23284
23847
 
23285
23848
  // src/commands/images/icon.ts
23286
- import { defineCommand as defineCommand116 } from "citty";
23849
+ import { defineCommand as defineCommand118 } from "citty";
23287
23850
  registerSchema({
23288
23851
  command: "images.icon",
23289
23852
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -23309,7 +23872,7 @@ registerSchema({
23309
23872
  }
23310
23873
  }
23311
23874
  });
23312
- var iconCommand = defineCommand116({
23875
+ var iconCommand = defineCommand118({
23313
23876
  meta: {
23314
23877
  name: "icon",
23315
23878
  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 +23912,7 @@ var iconCommand = defineCommand116({
23349
23912
  });
23350
23913
 
23351
23914
  // src/commands/images/ingest.ts
23352
- import { defineCommand as defineCommand117 } from "citty";
23915
+ import { defineCommand as defineCommand119 } from "citty";
23353
23916
  registerSchema({
23354
23917
  command: "images.ingest",
23355
23918
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -23361,7 +23924,7 @@ registerSchema({
23361
23924
  context: { type: "string", description: "Description context hint", required: false }
23362
23925
  }
23363
23926
  });
23364
- var ingestCommand = defineCommand117({
23927
+ var ingestCommand = defineCommand119({
23365
23928
  meta: {
23366
23929
  name: "ingest",
23367
23930
  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 +23966,7 @@ var ingestCommand = defineCommand117({
23403
23966
  });
23404
23967
 
23405
23968
  // src/commands/images/library.ts
23406
- import { defineCommand as defineCommand118 } from "citty";
23969
+ import { defineCommand as defineCommand120 } from "citty";
23407
23970
  registerSchema({
23408
23971
  command: "images.library",
23409
23972
  description: "Search the company image library. Returns only ready images.",
@@ -23429,7 +23992,7 @@ registerSchema({
23429
23992
  }
23430
23993
  }
23431
23994
  });
23432
- var libraryCommand = defineCommand118({
23995
+ var libraryCommand = defineCommand120({
23433
23996
  meta: {
23434
23997
  name: "library",
23435
23998
  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 +24049,7 @@ var libraryCommand = defineCommand118({
23486
24049
  });
23487
24050
 
23488
24051
  // src/commands/images/logo.ts
23489
- import { defineCommand as defineCommand119 } from "citty";
24052
+ import { defineCommand as defineCommand121 } from "citty";
23490
24053
  registerSchema({
23491
24054
  command: "images.logo",
23492
24055
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -23511,7 +24074,7 @@ registerSchema({
23511
24074
  }
23512
24075
  }
23513
24076
  });
23514
- var logoCommand = defineCommand119({
24077
+ var logoCommand = defineCommand121({
23515
24078
  meta: {
23516
24079
  name: "logo",
23517
24080
  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 +24112,7 @@ var logoCommand = defineCommand119({
23549
24112
  });
23550
24113
 
23551
24114
  // src/commands/images/normalize.ts
23552
- import { defineCommand as defineCommand120 } from "citty";
24115
+ import { defineCommand as defineCommand122 } from "citty";
23553
24116
 
23554
24117
  // src/lib/image/color-changer.ts
23555
24118
  import quantize from "quantize";
@@ -24281,7 +24844,7 @@ function coerceRawArgs(args) {
24281
24844
  "dry-run": bool(args["dry-run"])
24282
24845
  };
24283
24846
  }
24284
- var normalizeCommand = defineCommand120({
24847
+ var normalizeCommand = defineCommand122({
24285
24848
  meta: {
24286
24849
  name: "normalize",
24287
24850
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -24336,7 +24899,7 @@ Examples:
24336
24899
  });
24337
24900
 
24338
24901
  // src/commands/images/pinterest.ts
24339
- import { defineCommand as defineCommand121 } from "citty";
24902
+ import { defineCommand as defineCommand123 } from "citty";
24340
24903
  registerSchema({
24341
24904
  command: "images.pinterest",
24342
24905
  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 +24919,7 @@ registerSchema({
24356
24919
  }
24357
24920
  }
24358
24921
  });
24359
- var pinterestCommand = defineCommand121({
24922
+ var pinterestCommand = defineCommand123({
24360
24923
  meta: {
24361
24924
  name: "pinterest",
24362
24925
  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 +24959,7 @@ var pinterestCommand = defineCommand121({
24396
24959
  });
24397
24960
 
24398
24961
  // src/commands/images/screenshot.ts
24399
- import { defineCommand as defineCommand122 } from "citty";
24962
+ import { defineCommand as defineCommand124 } from "citty";
24400
24963
  registerSchema({
24401
24964
  command: "images.screenshot",
24402
24965
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -24412,7 +24975,7 @@ registerSchema({
24412
24975
  }
24413
24976
  }
24414
24977
  });
24415
- var screenshotCommand = defineCommand122({
24978
+ var screenshotCommand = defineCommand124({
24416
24979
  meta: {
24417
24980
  name: "screenshot",
24418
24981
  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 +25038,7 @@ var screenshotCommand = defineCommand122({
24475
25038
  });
24476
25039
 
24477
25040
  // src/commands/images/search.ts
24478
- import { defineCommand as defineCommand123 } from "citty";
25041
+ import { defineCommand as defineCommand125 } from "citty";
24479
25042
  registerSchema({
24480
25043
  command: "images.search",
24481
25044
  description: "Search images by text query. Only returns ready images.",
@@ -24491,7 +25054,7 @@ registerSchema({
24491
25054
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24492
25055
  }
24493
25056
  });
24494
- var searchCommand = defineCommand123({
25057
+ var searchCommand = defineCommand125({
24495
25058
  meta: {
24496
25059
  name: "search",
24497
25060
  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 +25114,7 @@ var searchCommand = defineCommand123({
24551
25114
  });
24552
25115
 
24553
25116
  // src/commands/images/sticker.ts
24554
- import { defineCommand as defineCommand124 } from "citty";
25117
+ import { defineCommand as defineCommand126 } from "citty";
24555
25118
  registerSchema({
24556
25119
  command: "images.sticker",
24557
25120
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -24583,7 +25146,7 @@ registerSchema({
24583
25146
  }
24584
25147
  }
24585
25148
  });
24586
- var stickerCommand = defineCommand124({
25149
+ var stickerCommand = defineCommand126({
24587
25150
  meta: {
24588
25151
  name: "sticker",
24589
25152
  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 +25193,7 @@ var stickerCommand = defineCommand124({
24630
25193
  });
24631
25194
 
24632
25195
  // src/commands/images/stock.ts
24633
- import { defineCommand as defineCommand125 } from "citty";
25196
+ import { defineCommand as defineCommand127 } from "citty";
24634
25197
  registerSchema({
24635
25198
  command: "images.stock",
24636
25199
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -24688,7 +25251,7 @@ registerSchema({
24688
25251
  }
24689
25252
  }
24690
25253
  });
24691
- var stockCommand = defineCommand125({
25254
+ var stockCommand = defineCommand127({
24692
25255
  meta: {
24693
25256
  name: "stock",
24694
25257
  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 +25307,7 @@ var stockCommand = defineCommand125({
24744
25307
  });
24745
25308
 
24746
25309
  // src/lib/tags-command.ts
24747
- import { defineCommand as defineCommand126 } from "citty";
25310
+ import { defineCommand as defineCommand128 } from "citty";
24748
25311
  function makeTagsCommand(command, label, endpoint) {
24749
25312
  registerSchema({
24750
25313
  command: `${command}.tags`,
@@ -24753,7 +25316,7 @@ function makeTagsCommand(command, label, endpoint) {
24753
25316
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
24754
25317
  }
24755
25318
  });
24756
- return defineCommand126({
25319
+ return defineCommand128({
24757
25320
  meta: {
24758
25321
  name: "tags",
24759
25322
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -24789,7 +25352,7 @@ function makeTagsCommand(command, label, endpoint) {
24789
25352
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
24790
25353
 
24791
25354
  // src/commands/images/upload.ts
24792
- import { defineCommand as defineCommand127 } from "citty";
25355
+ import { defineCommand as defineCommand129 } from "citty";
24793
25356
  registerSchema({
24794
25357
  command: "images.upload",
24795
25358
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -24827,7 +25390,7 @@ registerSchema({
24827
25390
  function isRemoteUrl2(value) {
24828
25391
  return /^https?:\/\//i.test(value);
24829
25392
  }
24830
- var uploadCommand = defineCommand127({
25393
+ var uploadCommand = defineCommand129({
24831
25394
  meta: {
24832
25395
  name: "upload",
24833
25396
  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 +25483,7 @@ async function uploadLocal(target, args) {
24920
25483
  }
24921
25484
 
24922
25485
  // src/commands/images/upscale.ts
24923
- import { defineCommand as defineCommand128 } from "citty";
25486
+ import { defineCommand as defineCommand130 } from "citty";
24924
25487
  registerSchema({
24925
25488
  command: "images.upscale",
24926
25489
  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 +25498,7 @@ registerSchema({
24935
25498
  }
24936
25499
  });
24937
25500
  var POLL_INTERVAL_MS3 = 1500;
24938
- var upscaleCommand = defineCommand128({
25501
+ var upscaleCommand = defineCommand130({
24939
25502
  meta: {
24940
25503
  name: "upscale",
24941
25504
  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 +25553,7 @@ var upscaleCommand = defineCommand128({
24990
25553
  });
24991
25554
 
24992
25555
  // src/commands/images/use.ts
24993
- import { defineCommand as defineCommand129 } from "citty";
25556
+ import { defineCommand as defineCommand131 } from "citty";
24994
25557
  registerSchema({
24995
25558
  command: "images.use",
24996
25559
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -25006,7 +25569,7 @@ registerSchema({
25006
25569
  }
25007
25570
  });
25008
25571
  var POLL_INTERVAL_MS4 = 1500;
25009
- var useCommand = defineCommand129({
25572
+ var useCommand = defineCommand131({
25010
25573
  meta: {
25011
25574
  name: "use",
25012
25575
  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 +25615,7 @@ var useCommand = defineCommand129({
25052
25615
  });
25053
25616
 
25054
25617
  // src/commands/images/index.ts
25055
- var imagesCommand = defineCommand130({
25618
+ var imagesCommand = defineCommand132({
25056
25619
  meta: {
25057
25620
  name: "images",
25058
25621
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -25122,7 +25685,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
25122
25685
  });
25123
25686
 
25124
25687
  // src/commands/mcp/index.ts
25125
- import { defineCommand as defineCommand131 } from "citty";
25688
+ import { defineCommand as defineCommand133 } from "citty";
25126
25689
  var SCOPES = ["user", "user_org", "company", "org"];
25127
25690
  function parseScope(raw) {
25128
25691
  const scope = raw === void 0 ? "company" : String(raw);
@@ -25161,7 +25724,7 @@ registerSchema({
25161
25724
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
25162
25725
  args: {}
25163
25726
  });
25164
- var listCommand6 = defineCommand131({
25727
+ var listCommand8 = defineCommand133({
25165
25728
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
25166
25729
  run: async () => {
25167
25730
  try {
@@ -25186,7 +25749,7 @@ registerSchema({
25186
25749
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
25187
25750
  }
25188
25751
  });
25189
- var addCommand = defineCommand131({
25752
+ var addCommand = defineCommand133({
25190
25753
  meta: {
25191
25754
  name: "add",
25192
25755
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -25227,7 +25790,7 @@ registerSchema({
25227
25790
  description: "Remove a company custom MCP server by name.",
25228
25791
  args: { name: { type: "string", description: "Server name to remove", required: true } }
25229
25792
  });
25230
- var removeCommand4 = defineCommand131({
25793
+ var removeCommand4 = defineCommand133({
25231
25794
  meta: {
25232
25795
  name: "remove",
25233
25796
  description: `Remove a company custom MCP server by name.
@@ -25249,7 +25812,7 @@ Example:
25249
25812
  }
25250
25813
  }
25251
25814
  });
25252
- var mcpCommand = defineCommand131({
25815
+ var mcpCommand = defineCommand133({
25253
25816
  meta: {
25254
25817
  name: "mcp",
25255
25818
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -25266,17 +25829,17 @@ Examples:
25266
25829
  baker mcp remove --name weather`
25267
25830
  },
25268
25831
  subCommands: {
25269
- list: listCommand6,
25832
+ list: listCommand8,
25270
25833
  add: addCommand,
25271
25834
  remove: removeCommand4
25272
25835
  }
25273
25836
  });
25274
25837
 
25275
25838
  // src/commands/research/index.ts
25276
- import { defineCommand as defineCommand142 } from "citty";
25839
+ import { defineCommand as defineCommand144 } from "citty";
25277
25840
 
25278
25841
  // src/commands/research/advertisers.ts
25279
- import { defineCommand as defineCommand132 } from "citty";
25842
+ import { defineCommand as defineCommand134 } from "citty";
25280
25843
 
25281
25844
  // src/commands/research/output.ts
25282
25845
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -25389,7 +25952,7 @@ var FIELDS3 = {
25389
25952
  etv: "Estimated traffic value (USD)",
25390
25953
  visibility: "SERP visibility score (0-1)"
25391
25954
  };
25392
- var advertisersCommand = defineCommand132({
25955
+ var advertisersCommand = defineCommand134({
25393
25956
  meta: {
25394
25957
  name: "advertisers",
25395
25958
  description: `Find domains competing for a keyword in Google SERPs.
@@ -25436,7 +25999,7 @@ Examples:
25436
25999
  });
25437
26000
 
25438
26001
  // src/commands/research/autocomplete.ts
25439
- import { defineCommand as defineCommand133 } from "citty";
26002
+ import { defineCommand as defineCommand135 } from "citty";
25440
26003
  registerSchema({
25441
26004
  command: "research.autocomplete",
25442
26005
  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 +26022,7 @@ registerSchema({
25459
26022
  var FIELDS4 = {
25460
26023
  suggestion: "Autocomplete suggestion from Google"
25461
26024
  };
25462
- var autocompleteCommand = defineCommand133({
26025
+ var autocompleteCommand = defineCommand135({
25463
26026
  meta: {
25464
26027
  name: "autocomplete",
25465
26028
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -25505,7 +26068,7 @@ Examples:
25505
26068
  });
25506
26069
 
25507
26070
  // src/commands/research/countries.ts
25508
- import { defineCommand as defineCommand134 } from "citty";
26071
+ import { defineCommand as defineCommand136 } from "citty";
25509
26072
  registerSchema({
25510
26073
  command: "research.countries",
25511
26074
  description: "List all supported country codes for --location flag in research commands.",
@@ -25562,7 +26125,7 @@ var FIELDS5 = {
25562
26125
  code: "Country code to pass as --location",
25563
26126
  name: "Country name"
25564
26127
  };
25565
- var countriesCommand = defineCommand134({
26128
+ var countriesCommand = defineCommand136({
25566
26129
  meta: {
25567
26130
  name: "countries",
25568
26131
  description: "List all supported country codes for --location flag."
@@ -25573,7 +26136,7 @@ var countriesCommand = defineCommand134({
25573
26136
  });
25574
26137
 
25575
26138
  // src/commands/research/intent.ts
25576
- import { defineCommand as defineCommand135 } from "citty";
26139
+ import { defineCommand as defineCommand137 } from "citty";
25577
26140
  registerSchema({
25578
26141
  command: "research.intent",
25579
26142
  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 +26159,7 @@ var FIELDS6 = {
25596
26159
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
25597
26160
  probability: "Confidence score 0.0-1.0"
25598
26161
  };
25599
- var intentCommand = defineCommand135({
26162
+ var intentCommand = defineCommand137({
25600
26163
  meta: {
25601
26164
  name: "intent",
25602
26165
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -25644,7 +26207,7 @@ Examples:
25644
26207
  });
25645
26208
 
25646
26209
  // src/commands/research/keyword-gap.ts
25647
- import { defineCommand as defineCommand136 } from "citty";
26210
+ import { defineCommand as defineCommand138 } from "citty";
25648
26211
  registerSchema({
25649
26212
  command: "research.keyword-gap",
25650
26213
  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 +26236,7 @@ var FIELDS7 = {
25673
26236
  cpc: "Cost per click USD",
25674
26237
  their_position: "Competitor's ranking position"
25675
26238
  };
25676
- var keywordGapCommand = defineCommand136({
26239
+ var keywordGapCommand = defineCommand138({
25677
26240
  meta: {
25678
26241
  name: "keyword-gap",
25679
26242
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -25747,7 +26310,7 @@ Examples:
25747
26310
  });
25748
26311
 
25749
26312
  // src/commands/research/keywords-for-site.ts
25750
- import { defineCommand as defineCommand137 } from "citty";
26313
+ import { defineCommand as defineCommand139 } from "citty";
25751
26314
  registerSchema({
25752
26315
  command: "research.keywords-for-site",
25753
26316
  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 +26343,7 @@ var FIELDS8 = {
25780
26343
  competition: "LOW, MEDIUM, or HIGH",
25781
26344
  competition_index: "Competition score 0-100"
25782
26345
  };
25783
- var keywordsForSiteCommand = defineCommand137({
26346
+ var keywordsForSiteCommand = defineCommand139({
25784
26347
  meta: {
25785
26348
  name: "keywords-for-site",
25786
26349
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -25833,7 +26396,7 @@ Examples:
25833
26396
  });
25834
26397
 
25835
26398
  // src/commands/research/languages.ts
25836
- import { defineCommand as defineCommand138 } from "citty";
26399
+ import { defineCommand as defineCommand140 } from "citty";
25837
26400
  registerSchema({
25838
26401
  command: "research.languages",
25839
26402
  description: "List all supported language codes for --language flag in research commands.",
@@ -25863,7 +26426,7 @@ var FIELDS9 = {
25863
26426
  code: "Language code to pass as --language",
25864
26427
  name: "Language name (also accepted by --language)"
25865
26428
  };
25866
- var languagesCommand2 = defineCommand138({
26429
+ var languagesCommand2 = defineCommand140({
25867
26430
  meta: {
25868
26431
  name: "languages",
25869
26432
  description: "List all supported language codes for --language flag."
@@ -25874,7 +26437,7 @@ var languagesCommand2 = defineCommand138({
25874
26437
  });
25875
26438
 
25876
26439
  // src/commands/research/lighthouse.ts
25877
- import { defineCommand as defineCommand139 } from "citty";
26440
+ import { defineCommand as defineCommand141 } from "citty";
25878
26441
  registerSchema({
25879
26442
  command: "research.lighthouse",
25880
26443
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -25893,7 +26456,7 @@ var FIELDS10 = {
25893
26456
  speed_index_ms: "Speed Index in ms (good: < 3400)",
25894
26457
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
25895
26458
  };
25896
- var lighthouseCommand = defineCommand139({
26459
+ var lighthouseCommand = defineCommand141({
25897
26460
  meta: {
25898
26461
  name: "lighthouse",
25899
26462
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -25931,7 +26494,7 @@ Examples:
25931
26494
  });
25932
26495
 
25933
26496
  // src/commands/research/relevant-pages.ts
25934
- import { defineCommand as defineCommand140 } from "citty";
26497
+ import { defineCommand as defineCommand142 } from "citty";
25935
26498
  registerSchema({
25936
26499
  command: "research.relevant-pages",
25937
26500
  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 +26520,7 @@ var FIELDS11 = {
25957
26520
  keywords: "Total organic keywords the page ranks for",
25958
26521
  top_10: "Keywords in positions 1-10"
25959
26522
  };
25960
- var relevantPagesCommand = defineCommand140({
26523
+ var relevantPagesCommand = defineCommand142({
25961
26524
  meta: {
25962
26525
  name: "relevant-pages",
25963
26526
  description: `Get the top pages of a competitor domain with traffic data.
@@ -26003,7 +26566,7 @@ Examples:
26003
26566
  });
26004
26567
 
26005
26568
  // src/commands/research/web.ts
26006
- import { defineCommand as defineCommand141 } from "citty";
26569
+ import { defineCommand as defineCommand143 } from "citty";
26007
26570
  registerSchema({
26008
26571
  command: "research.web",
26009
26572
  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 +26617,7 @@ async function runDeepResearch(question) {
26054
26617
  }
26055
26618
  throw new Error("Deep research timed out");
26056
26619
  }
26057
- var webCommand = defineCommand141({
26620
+ var webCommand = defineCommand143({
26058
26621
  meta: {
26059
26622
  name: "web",
26060
26623
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -26114,7 +26677,7 @@ Examples:
26114
26677
  });
26115
26678
 
26116
26679
  // src/commands/research/index.ts
26117
- var researchCommand = defineCommand142({
26680
+ var researchCommand = defineCommand144({
26118
26681
  meta: {
26119
26682
  name: "research",
26120
26683
  description: `Competitive intelligence and AI-powered research commands.
@@ -26154,10 +26717,10 @@ Examples:
26154
26717
  });
26155
26718
 
26156
26719
  // src/commands/scheduled-actions/index.ts
26157
- import { defineCommand as defineCommand149 } from "citty";
26720
+ import { defineCommand as defineCommand151 } from "citty";
26158
26721
 
26159
26722
  // src/commands/scheduled-actions/create.ts
26160
- import { defineCommand as defineCommand143 } from "citty";
26723
+ import { defineCommand as defineCommand145 } from "citty";
26161
26724
 
26162
26725
  // src/commands/scheduled-actions/shared.ts
26163
26726
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -26272,7 +26835,7 @@ registerSchema({
26272
26835
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
26273
26836
  }
26274
26837
  });
26275
- var createCommand2 = defineCommand143({
26838
+ var createCommand2 = defineCommand145({
26276
26839
  meta: {
26277
26840
  name: "create",
26278
26841
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -26321,7 +26884,7 @@ var createCommand2 = defineCommand143({
26321
26884
  });
26322
26885
 
26323
26886
  // src/commands/scheduled-actions/delete.ts
26324
- import { defineCommand as defineCommand144 } from "citty";
26887
+ import { defineCommand as defineCommand146 } from "citty";
26325
26888
  registerSchema({
26326
26889
  command: "scheduled-actions.delete",
26327
26890
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -26329,7 +26892,7 @@ registerSchema({
26329
26892
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26330
26893
  }
26331
26894
  });
26332
- var deleteCommand2 = defineCommand144({
26895
+ var deleteCommand2 = defineCommand146({
26333
26896
  meta: {
26334
26897
  name: "delete",
26335
26898
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -26358,7 +26921,7 @@ var deleteCommand2 = defineCommand144({
26358
26921
  });
26359
26922
 
26360
26923
  // src/commands/scheduled-actions/get.ts
26361
- import { defineCommand as defineCommand145 } from "citty";
26924
+ import { defineCommand as defineCommand147 } from "citty";
26362
26925
  registerSchema({
26363
26926
  command: "scheduled-actions.get",
26364
26927
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -26366,7 +26929,7 @@ registerSchema({
26366
26929
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26367
26930
  }
26368
26931
  });
26369
- var getCommand3 = defineCommand145({
26932
+ var getCommand3 = defineCommand147({
26370
26933
  meta: {
26371
26934
  name: "get",
26372
26935
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -26403,13 +26966,13 @@ var getCommand3 = defineCommand145({
26403
26966
  });
26404
26967
 
26405
26968
  // src/commands/scheduled-actions/list.ts
26406
- import { defineCommand as defineCommand146 } from "citty";
26969
+ import { defineCommand as defineCommand148 } from "citty";
26407
26970
  registerSchema({
26408
26971
  command: "scheduled-actions.list",
26409
26972
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
26410
26973
  args: {}
26411
26974
  });
26412
- var listCommand7 = defineCommand146({
26975
+ var listCommand9 = defineCommand148({
26413
26976
  meta: {
26414
26977
  name: "list",
26415
26978
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -26430,7 +26993,7 @@ var listCommand7 = defineCommand146({
26430
26993
  });
26431
26994
 
26432
26995
  // src/commands/scheduled-actions/trigger.ts
26433
- import { defineCommand as defineCommand147 } from "citty";
26996
+ import { defineCommand as defineCommand149 } from "citty";
26434
26997
  registerSchema({
26435
26998
  command: "scheduled-actions.trigger",
26436
26999
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -26438,7 +27001,7 @@ registerSchema({
26438
27001
  id: { type: "string", description: "Published scheduled action ID", required: true }
26439
27002
  }
26440
27003
  });
26441
- var triggerCommand = defineCommand147({
27004
+ var triggerCommand = defineCommand149({
26442
27005
  meta: {
26443
27006
  name: "trigger",
26444
27007
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -26475,7 +27038,7 @@ var triggerCommand = defineCommand147({
26475
27038
  });
26476
27039
 
26477
27040
  // src/commands/scheduled-actions/update.ts
26478
- import { defineCommand as defineCommand148 } from "citty";
27041
+ import { defineCommand as defineCommand150 } from "citty";
26479
27042
  registerSchema({
26480
27043
  command: "scheduled-actions.update",
26481
27044
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -26500,7 +27063,7 @@ registerSchema({
26500
27063
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
26501
27064
  }
26502
27065
  });
26503
- var updateCommand2 = defineCommand148({
27066
+ var updateCommand2 = defineCommand150({
26504
27067
  meta: {
26505
27068
  name: "update",
26506
27069
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -26571,7 +27134,7 @@ var updateCommand2 = defineCommand148({
26571
27134
  });
26572
27135
 
26573
27136
  // src/commands/scheduled-actions/index.ts
26574
- var scheduledActionsCommand = defineCommand149({
27137
+ var scheduledActionsCommand = defineCommand151({
26575
27138
  meta: {
26576
27139
  name: "scheduled-actions",
26577
27140
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -26587,7 +27150,7 @@ Examples:
26587
27150
  baker scheduled-actions trigger <id>`
26588
27151
  },
26589
27152
  subCommands: {
26590
- list: listCommand7,
27153
+ list: listCommand9,
26591
27154
  get: getCommand3,
26592
27155
  create: createCommand2,
26593
27156
  update: updateCommand2,
@@ -26597,8 +27160,8 @@ Examples:
26597
27160
  });
26598
27161
 
26599
27162
  // src/commands/schema.ts
26600
- import { defineCommand as defineCommand150 } from "citty";
26601
- var schemaCommand = defineCommand150({
27163
+ import { defineCommand as defineCommand152 } from "citty";
27164
+ var schemaCommand = defineCommand152({
26602
27165
  meta: {
26603
27166
  name: "schema",
26604
27167
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -26634,7 +27197,7 @@ var schemaCommand = defineCommand150({
26634
27197
  });
26635
27198
 
26636
27199
  // src/commands/tags/index.ts
26637
- import { defineCommand as defineCommand151 } from "citty";
27200
+ import { defineCommand as defineCommand153 } from "citty";
26638
27201
 
26639
27202
  // src/commands/tags/shared.ts
26640
27203
  function failApi3(err) {
@@ -26700,7 +27263,7 @@ async function listTags(json) {
26700
27263
  failApi3(err);
26701
27264
  }
26702
27265
  }
26703
- var listCommand8 = defineCommand151({
27266
+ var listCommand10 = defineCommand153({
26704
27267
  meta: {
26705
27268
  name: "list",
26706
27269
  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 +27282,7 @@ async function listDraft3() {
26719
27282
  failApi3(err);
26720
27283
  }
26721
27284
  }
26722
- var draftCommand3 = defineCommand151({
27285
+ var draftCommand3 = defineCommand153({
26723
27286
  meta: {
26724
27287
  name: "draft",
26725
27288
  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 +27291,7 @@ var draftCommand3 = defineCommand151({
26728
27291
  await listDraft3();
26729
27292
  }
26730
27293
  });
26731
- var tagsCommand3 = defineCommand151({
27294
+ var tagsCommand3 = defineCommand153({
26732
27295
  meta: {
26733
27296
  name: "tags",
26734
27297
  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 +27307,7 @@ Examples:
26744
27307
  baker tags draft # review the staged changes awaiting publish`
26745
27308
  },
26746
27309
  subCommands: {
26747
- list: listCommand8,
27310
+ list: listCommand10,
26748
27311
  draft: draftCommand3
26749
27312
  },
26750
27313
  run: async () => {
@@ -26753,10 +27316,10 @@ Examples:
26753
27316
  });
26754
27317
 
26755
27318
  // src/commands/testimonials/index.ts
26756
- import { defineCommand as defineCommand155 } from "citty";
27319
+ import { defineCommand as defineCommand157 } from "citty";
26757
27320
 
26758
27321
  // src/commands/testimonials/get.ts
26759
- import { defineCommand as defineCommand152 } from "citty";
27322
+ import { defineCommand as defineCommand154 } from "citty";
26760
27323
  registerSchema({
26761
27324
  command: "testimonials.get",
26762
27325
  description: "Get a single testimonial by ID",
@@ -26764,7 +27327,7 @@ registerSchema({
26764
27327
  id: { type: "string", description: "Testimonial ID", required: true }
26765
27328
  }
26766
27329
  });
26767
- var getCommand4 = defineCommand152({
27330
+ var getCommand4 = defineCommand154({
26768
27331
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
26769
27332
  args: {
26770
27333
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -26801,7 +27364,7 @@ var getCommand4 = defineCommand152({
26801
27364
  });
26802
27365
 
26803
27366
  // src/commands/testimonials/list.ts
26804
- import { defineCommand as defineCommand153 } from "citty";
27367
+ import { defineCommand as defineCommand155 } from "citty";
26805
27368
  registerSchema({
26806
27369
  command: "testimonials.list",
26807
27370
  description: "List testimonials with optional filters.",
@@ -26831,7 +27394,7 @@ registerSchema({
26831
27394
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
26832
27395
  }
26833
27396
  });
26834
- var listCommand9 = defineCommand153({
27397
+ var listCommand11 = defineCommand155({
26835
27398
  meta: {
26836
27399
  name: "list",
26837
27400
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -26880,7 +27443,7 @@ var listCommand9 = defineCommand153({
26880
27443
  });
26881
27444
 
26882
27445
  // src/commands/testimonials/search.ts
26883
- import { defineCommand as defineCommand154 } from "citty";
27446
+ import { defineCommand as defineCommand156 } from "citty";
26884
27447
  registerSchema({
26885
27448
  command: "testimonials.search",
26886
27449
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -26911,7 +27474,7 @@ registerSchema({
26911
27474
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
26912
27475
  }
26913
27476
  });
26914
- var searchCommand2 = defineCommand154({
27477
+ var searchCommand2 = defineCommand156({
26915
27478
  meta: {
26916
27479
  name: "search",
26917
27480
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -26985,7 +27548,7 @@ var searchCommand2 = defineCommand154({
26985
27548
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
26986
27549
 
26987
27550
  // src/commands/testimonials/index.ts
26988
- var testimonialsCommand = defineCommand155({
27551
+ var testimonialsCommand = defineCommand157({
26989
27552
  meta: {
26990
27553
  name: "testimonials",
26991
27554
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -27000,16 +27563,16 @@ Examples:
27000
27563
  subCommands: {
27001
27564
  get: getCommand4,
27002
27565
  search: searchCommand2,
27003
- list: listCommand9,
27566
+ list: listCommand11,
27004
27567
  tags: tagsCommand4
27005
27568
  }
27006
27569
  });
27007
27570
 
27008
27571
  // src/commands/videos/index.ts
27009
- import { defineCommand as defineCommand160 } from "citty";
27572
+ import { defineCommand as defineCommand162 } from "citty";
27010
27573
 
27011
27574
  // src/commands/videos/delete.ts
27012
- import { defineCommand as defineCommand156 } from "citty";
27575
+ import { defineCommand as defineCommand158 } from "citty";
27013
27576
  registerSchema({
27014
27577
  command: "videos.delete",
27015
27578
  description: "Delete a video by ID",
@@ -27023,7 +27586,7 @@ registerSchema({
27023
27586
  }
27024
27587
  }
27025
27588
  });
27026
- var deleteCommand3 = defineCommand156({
27589
+ var deleteCommand3 = defineCommand158({
27027
27590
  meta: {
27028
27591
  name: "delete",
27029
27592
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -27064,7 +27627,7 @@ var deleteCommand3 = defineCommand156({
27064
27627
  });
27065
27628
 
27066
27629
  // src/commands/videos/get.ts
27067
- import { defineCommand as defineCommand157 } from "citty";
27630
+ import { defineCommand as defineCommand159 } from "citty";
27068
27631
  registerSchema({
27069
27632
  command: "videos.get",
27070
27633
  description: "Get a single video by ID",
@@ -27072,7 +27635,7 @@ registerSchema({
27072
27635
  id: { type: "string", description: "Video ID", required: true }
27073
27636
  }
27074
27637
  });
27075
- var getCommand5 = defineCommand157({
27638
+ var getCommand5 = defineCommand159({
27076
27639
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
27077
27640
  args: {
27078
27641
  id: { type: "positional", description: "Video ID", required: false },
@@ -27109,7 +27672,7 @@ var getCommand5 = defineCommand157({
27109
27672
  });
27110
27673
 
27111
27674
  // src/commands/videos/search.ts
27112
- import { defineCommand as defineCommand158 } from "citty";
27675
+ import { defineCommand as defineCommand160 } from "citty";
27113
27676
  registerSchema({
27114
27677
  command: "videos.search",
27115
27678
  description: "Search videos by text query. Only returns ready videos.",
@@ -27119,7 +27682,7 @@ registerSchema({
27119
27682
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27120
27683
  }
27121
27684
  });
27122
- var searchCommand3 = defineCommand158({
27685
+ var searchCommand3 = defineCommand160({
27123
27686
  meta: {
27124
27687
  name: "search",
27125
27688
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -27171,7 +27734,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
27171
27734
  // src/commands/videos/upload.ts
27172
27735
  import { readFile as readFile20, stat as stat5 } from "fs/promises";
27173
27736
  import { extname as extname3 } from "path";
27174
- import { defineCommand as defineCommand159 } from "citty";
27737
+ import { defineCommand as defineCommand161 } from "citty";
27175
27738
  var MIME_MAP = {
27176
27739
  ".mp4": "video/mp4",
27177
27740
  ".mov": "video/quicktime",
@@ -27205,7 +27768,7 @@ function detectContentType(filePath) {
27205
27768
  }
27206
27769
  return mime;
27207
27770
  }
27208
- var uploadCommand2 = defineCommand159({
27771
+ var uploadCommand2 = defineCommand161({
27209
27772
  meta: {
27210
27773
  name: "upload",
27211
27774
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -27259,7 +27822,7 @@ var uploadCommand2 = defineCommand159({
27259
27822
  });
27260
27823
 
27261
27824
  // src/commands/videos/index.ts
27262
- var videosCommand = defineCommand160({
27825
+ var videosCommand = defineCommand162({
27263
27826
  meta: {
27264
27827
  name: "videos",
27265
27828
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -27282,10 +27845,10 @@ Examples:
27282
27845
  });
27283
27846
 
27284
27847
  // src/commands/winning-ads/index.ts
27285
- import { defineCommand as defineCommand171 } from "citty";
27848
+ import { defineCommand as defineCommand173 } from "citty";
27286
27849
 
27287
27850
  // src/commands/winning-ads/advertisers.ts
27288
- import { defineCommand as defineCommand161 } from "citty";
27851
+ import { defineCommand as defineCommand163 } from "citty";
27289
27852
 
27290
27853
  // src/commands/winning-ads/shared.ts
27291
27854
  function splitList(value) {
@@ -27338,7 +27901,7 @@ function advertiserNormalizer(record, full) {
27338
27901
  last_synced_at: record.last_synced_at ?? null
27339
27902
  };
27340
27903
  }
27341
- var advertisersCommand2 = defineCommand161({
27904
+ var advertisersCommand2 = defineCommand163({
27342
27905
  meta: {
27343
27906
  name: "advertisers",
27344
27907
  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 +27959,7 @@ var advertisersCommand2 = defineCommand161({
27396
27959
  });
27397
27960
 
27398
27961
  // src/commands/winning-ads/brief.ts
27399
- import { defineCommand as defineCommand162 } from "citty";
27962
+ import { defineCommand as defineCommand164 } from "citty";
27400
27963
  registerSchema({
27401
27964
  command: "winning-ads.brief",
27402
27965
  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 +28005,7 @@ function parseDna(raw) {
27442
28005
  }
27443
28006
  return parsed;
27444
28007
  }
27445
- var briefCommand = defineCommand162({
28008
+ var briefCommand = defineCommand164({
27446
28009
  meta: {
27447
28010
  name: "brief",
27448
28011
  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 +28041,7 @@ var briefCommand = defineCommand162({
27478
28041
  });
27479
28042
 
27480
28043
  // src/commands/winning-ads/feed.ts
27481
- import { defineCommand as defineCommand163 } from "citty";
28044
+ import { defineCommand as defineCommand165 } from "citty";
27482
28045
  function buildFeedParams(input) {
27483
28046
  const params = {};
27484
28047
  const advertiser = splitList(input.advertiser);
@@ -27530,7 +28093,7 @@ registerSchema({
27530
28093
  format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
27531
28094
  }
27532
28095
  });
27533
- var feedCommand = defineCommand163({
28096
+ var feedCommand = defineCommand165({
27534
28097
  meta: {
27535
28098
  name: "feed",
27536
28099
  description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
@@ -27615,7 +28178,7 @@ var feedCommand = defineCommand163({
27615
28178
  });
27616
28179
 
27617
28180
  // src/commands/winning-ads/follow.ts
27618
- import { defineCommand as defineCommand164 } from "citty";
28181
+ import { defineCommand as defineCommand166 } from "citty";
27619
28182
  var PLATFORMS = ["meta", "linkedin"];
27620
28183
  registerSchema({
27621
28184
  command: "winning-ads.follow",
@@ -27630,7 +28193,7 @@ registerSchema({
27630
28193
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
27631
28194
  }
27632
28195
  });
27633
- var followCommand = defineCommand164({
28196
+ var followCommand = defineCommand166({
27634
28197
  meta: {
27635
28198
  name: "follow",
27636
28199
  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 +28240,7 @@ var followCommand = defineCommand164({
27677
28240
  });
27678
28241
 
27679
28242
  // src/commands/winning-ads/following.ts
27680
- import { defineCommand as defineCommand165 } from "citty";
28243
+ import { defineCommand as defineCommand167 } from "citty";
27681
28244
  registerSchema({
27682
28245
  command: "winning-ads.following",
27683
28246
  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 +28273,7 @@ function followingNormalizer(record, full) {
27710
28273
  platforms: Array.isArray(record.platforms) ? record.platforms : []
27711
28274
  };
27712
28275
  }
27713
- var followingCommand = defineCommand165({
28276
+ var followingCommand = defineCommand167({
27714
28277
  meta: {
27715
28278
  name: "following",
27716
28279
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -27745,7 +28308,7 @@ var followingCommand = defineCommand165({
27745
28308
  });
27746
28309
 
27747
28310
  // src/commands/winning-ads/patterns.ts
27748
- import { defineCommand as defineCommand166 } from "citty";
28311
+ import { defineCommand as defineCommand168 } from "citty";
27749
28312
  registerSchema({
27750
28313
  command: "winning-ads.patterns",
27751
28314
  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 +28347,7 @@ function discriminatorRow(record) {
27784
28347
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
27785
28348
  };
27786
28349
  }
27787
- var patternsCommand = defineCommand166({
28350
+ var patternsCommand = defineCommand168({
27788
28351
  meta: {
27789
28352
  name: "patterns",
27790
28353
  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 +28403,7 @@ var patternsCommand = defineCommand166({
27840
28403
  });
27841
28404
 
27842
28405
  // src/commands/winning-ads/search.ts
27843
- import { defineCommand as defineCommand167 } from "citty";
28406
+ import { defineCommand as defineCommand169 } from "citty";
27844
28407
  registerSchema({
27845
28408
  command: "winning-ads.search",
27846
28409
  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 +28511,7 @@ function buildSearchBody(args) {
27948
28511
  }
27949
28512
  return body;
27950
28513
  }
27951
- var searchCommand4 = defineCommand167({
28514
+ var searchCommand4 = defineCommand169({
27952
28515
  meta: {
27953
28516
  name: "search",
27954
28517
  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 +28626,7 @@ var searchCommand4 = defineCommand167({
28063
28626
  });
28064
28627
 
28065
28628
  // src/commands/winning-ads/seeds.ts
28066
- import { defineCommand as defineCommand168 } from "citty";
28629
+ import { defineCommand as defineCommand170 } from "citty";
28067
28630
  function leanRow(r) {
28068
28631
  return {
28069
28632
  key: r.key,
@@ -28091,7 +28654,7 @@ function makeSeedCommand(opts) {
28091
28654
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
28092
28655
  }
28093
28656
  });
28094
- return defineCommand168({
28657
+ return defineCommand170({
28095
28658
  meta: { name: opts.name, description: opts.description },
28096
28659
  args: {
28097
28660
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -28140,7 +28703,7 @@ var formatsCommand = makeSeedCommand({
28140
28703
  });
28141
28704
 
28142
28705
  // src/commands/winning-ads/unfollow.ts
28143
- import { defineCommand as defineCommand169 } from "citty";
28706
+ import { defineCommand as defineCommand171 } from "citty";
28144
28707
  registerSchema({
28145
28708
  command: "winning-ads.unfollow",
28146
28709
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -28148,7 +28711,7 @@ registerSchema({
28148
28711
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
28149
28712
  }
28150
28713
  });
28151
- var unfollowCommand = defineCommand169({
28714
+ var unfollowCommand = defineCommand171({
28152
28715
  meta: {
28153
28716
  name: "unfollow",
28154
28717
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -28169,7 +28732,7 @@ var unfollowCommand = defineCommand169({
28169
28732
  });
28170
28733
 
28171
28734
  // src/commands/winning-ads/winners.ts
28172
- import { defineCommand as defineCommand170 } from "citty";
28735
+ import { defineCommand as defineCommand172 } from "citty";
28173
28736
  registerSchema({
28174
28737
  command: "winning-ads.winners",
28175
28738
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -28179,7 +28742,7 @@ registerSchema({
28179
28742
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
28180
28743
  }
28181
28744
  });
28182
- var winnersCommand = defineCommand170({
28745
+ var winnersCommand = defineCommand172({
28183
28746
  meta: {
28184
28747
  name: "winners",
28185
28748
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -28229,7 +28792,7 @@ var winnersCommand = defineCommand170({
28229
28792
  });
28230
28793
 
28231
28794
  // src/commands/winning-ads/index.ts
28232
- var winningAdsCommand = defineCommand171({
28795
+ var winningAdsCommand = defineCommand173({
28233
28796
  meta: {
28234
28797
  name: "winning-ads",
28235
28798
  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 +28857,11 @@ function getCliVersion() {
28294
28857
  }
28295
28858
 
28296
28859
  // src/cli.ts
28297
- var main = defineCommand172({
28860
+ var main = defineCommand174({
28298
28861
  meta: {
28299
28862
  name: "baker",
28300
28863
  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.
28864
+ 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
28865
 
28303
28866
  Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
28304
28867
  Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
@@ -28320,6 +28883,8 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28320
28883
  testimonials: testimonialsCommand,
28321
28884
  canvas: canvasCommand,
28322
28885
  tags: tagsCommand3,
28886
+ chats: chatsCommand,
28887
+ history: historyCommand,
28323
28888
  "winning-ads": winningAdsCommand,
28324
28889
  mcp: mcpCommand,
28325
28890
  schema: schemaCommand