@koda-sl/baker-cli 0.136.0 → 0.137.0-dev.529af4675

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-TXNOPO6P.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 defineCommand173, 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,224 @@ 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
+ * The caller's OWN Session id — excluded from results so an agent never sees
1973
+ * its own in-flight chat listed as a separate "other Session" to reuse.
1974
+ */
1975
+ excludeChatId: z5.string().optional()
1976
+ });
1977
+ var chatSummarySchema = z5.object({
1978
+ id: z5.string(),
1979
+ title: z5.string(),
1980
+ status: chatInspectStatusSchema,
1981
+ createdAt: z5.number(),
1982
+ updatedAt: z5.number(),
1983
+ /** Counts of produced outputs keyed by change type. */
1984
+ outputs: z5.record(z5.string(), z5.number()),
1985
+ outputTotal: z5.number(),
1986
+ changes: z5.array(chatChangeSummarySchema).optional()
1987
+ });
1988
+ var chatsListResponseSchema = z5.object({
1989
+ ok: z5.literal(true),
1990
+ data: z5.object({ chats: z5.array(chatSummarySchema) })
1991
+ });
1992
+ var chatsViewRequestSchema = z5.object({
1993
+ chatId: z5.string(),
1994
+ full: z5.boolean().optional()
1995
+ });
1996
+ var chatThreadSummarySchema = z5.object({
1997
+ id: z5.string(),
1998
+ title: z5.string().nullable(),
1999
+ status: z5.string(),
2000
+ createdAt: z5.number()
2001
+ });
2002
+ var chatCommitSummarySchema = z5.object({
2003
+ sha: z5.string(),
2004
+ message: z5.string().nullable(),
2005
+ surfaces: z5.array(z5.string()),
2006
+ createdAt: z5.number()
2007
+ });
2008
+ var effectOpSchema = z5.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
2009
+ var contentEffectSchema = z5.object({
2010
+ surface: chatChangeTypeSchema,
2011
+ slug: z5.string(),
2012
+ op: effectOpSchema,
2013
+ staged: z5.boolean()
2014
+ });
2015
+ var actionEffectSchema = z5.object({
2016
+ op: effectOpSchema,
2017
+ staged: z5.boolean(),
2018
+ name: z5.string(),
2019
+ description: z5.string().nullable(),
2020
+ priority: z5.string().nullable(),
2021
+ tags: z5.array(z5.string()),
2022
+ status: z5.string().nullable(),
2023
+ note: z5.string().nullable(),
2024
+ reason: z5.string().nullable()
2025
+ });
2026
+ var scheduledEffectSchema = z5.object({
2027
+ op: effectOpSchema,
2028
+ staged: z5.boolean(),
2029
+ name: z5.string(),
2030
+ summary: z5.string().nullable()
2031
+ });
2032
+ var tagEffectSchema = z5.object({
2033
+ op: effectOpSchema,
2034
+ staged: z5.boolean(),
2035
+ tagType: z5.string(),
2036
+ title: z5.string().nullable(),
2037
+ summary: z5.string().nullable(),
2038
+ configKeys: z5.array(z5.string()),
2039
+ hasSecrets: z5.boolean()
2040
+ });
2041
+ var adEffectSchema = z5.object({
2042
+ platform: z5.enum(["google", "meta", "linkedin"]),
2043
+ op: effectOpSchema,
2044
+ staged: z5.boolean(),
2045
+ entity: z5.string().nullable(),
2046
+ operation: z5.string().nullable(),
2047
+ summary: z5.string().nullable()
2048
+ });
2049
+ var creativeEffectSchema = z5.object({
2050
+ op: effectOpSchema,
2051
+ staged: z5.boolean(),
2052
+ slug: z5.string(),
2053
+ title: z5.string().nullable(),
2054
+ status: z5.string().nullable()
2055
+ });
2056
+ var chatEffectsSchema = z5.object({
2057
+ content: z5.array(contentEffectSchema),
2058
+ actions: z5.array(actionEffectSchema),
2059
+ scheduledActions: z5.array(scheduledEffectSchema),
2060
+ tags: z5.array(tagEffectSchema),
2061
+ ads: z5.object({
2062
+ google: z5.array(adEffectSchema),
2063
+ meta: z5.array(adEffectSchema),
2064
+ linkedin: z5.array(adEffectSchema)
2065
+ }),
2066
+ creatives: z5.array(creativeEffectSchema)
2067
+ });
2068
+ var chatDetailSchema = z5.object({
2069
+ id: z5.string(),
2070
+ title: z5.string(),
2071
+ status: chatInspectStatusSchema,
2072
+ createdAt: z5.number(),
2073
+ updatedAt: z5.number(),
2074
+ completedBySource: z5.enum(["user", "bridge"]).nullable(),
2075
+ publishedAt: z5.number().nullable(),
2076
+ /** The first user message — how this Session was originally asked. */
2077
+ kickoff: z5.string().nullable(),
2078
+ outputs: z5.record(z5.string(), z5.number()),
2079
+ outputTotal: z5.number(),
2080
+ /** The unified picture of everything this Session changed — git + DB. */
2081
+ effects: chatEffectsSchema,
2082
+ threads: z5.array(chatThreadSummarySchema),
2083
+ commits: z5.array(chatCommitSummarySchema),
2084
+ /** True when a real file-level diff is available via `baker chats diff`. */
2085
+ diffAvailable: z5.boolean()
2086
+ });
2087
+ var chatsViewResponseSchema = z5.object({
2088
+ ok: z5.literal(true),
2089
+ data: chatDetailSchema
2090
+ });
2091
+ var chatsTranscriptRequestSchema = z5.object({
2092
+ chatId: z5.string(),
2093
+ limit: z5.number().int().min(1).max(1e3).optional(),
2094
+ /** Return untruncated message text (compact truncates each entry). */
2095
+ full: z5.boolean().optional()
2096
+ });
2097
+ var transcriptEntrySchema = z5.object({
2098
+ role: z5.string(),
2099
+ text: z5.string()
2100
+ });
2101
+ var chatsTranscriptResponseSchema = z5.object({
2102
+ ok: z5.literal(true),
2103
+ data: z5.object({
2104
+ chatId: z5.string(),
2105
+ entries: z5.array(transcriptEntrySchema),
2106
+ /** True when older entries were dropped to fit `limit`. */
2107
+ truncated: z5.boolean()
2108
+ })
2109
+ });
2110
+ var chatsDiffRequestSchema = z5.object({
2111
+ chatId: z5.string(),
2112
+ surface: repoSurfaceSchema.optional(),
2113
+ /** Include the unified-diff `patch` text per file (compact omits it). */
2114
+ full: z5.boolean().optional(),
2115
+ /**
2116
+ * Opt in to reading an in-progress (unpublished) Session's changes straight
2117
+ * from its live Runtime — resumes the paused sandbox and runs a read-only git
2118
+ * diff. Slower and only works while the sandbox still exists (not discarded).
2119
+ * Ignored for published Sessions, which always read from git.
2120
+ */
2121
+ live: z5.boolean().optional()
2122
+ });
2123
+ var diffFileSchema = z5.object({
2124
+ path: z5.string(),
2125
+ surface: repoSurfaceSchema.nullable(),
2126
+ status: z5.string(),
2127
+ additions: z5.number(),
2128
+ deletions: z5.number(),
2129
+ patch: z5.string().optional()
2130
+ });
2131
+ var diffSourceSchema = z5.enum(["published", "live"]);
2132
+ var chatsDiffResponseSchema = z5.object({
2133
+ ok: z5.literal(true),
2134
+ data: z5.object({
2135
+ chatId: z5.string(),
2136
+ /** False when no published git diff exists (in-progress Session or unlinked repo). */
2137
+ available: z5.boolean(),
2138
+ reason: z5.string().optional(),
2139
+ /** Present when available — how the diff was obtained. */
2140
+ source: diffSourceSchema.optional(),
2141
+ /** True when the live diff was capped (very large in-progress change set). */
2142
+ truncated: z5.boolean().optional(),
2143
+ files: z5.array(diffFileSchema)
2144
+ })
2145
+ });
2146
+
2147
+ // ../api/src/flows.ts
2148
+ import { z as z6 } from "zod";
1933
2149
  var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1934
2150
  "email",
1935
2151
  "zapier",
@@ -1940,7 +2156,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1940
2156
  "crmble",
1941
2157
  "goHighlevelContact"
1942
2158
  ];
1943
- var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
2159
+ var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1944
2160
  var FLOW_SECRET_FIELDS = {
1945
2161
  email: [],
1946
2162
  zapier: ["zapUrl"],
@@ -1968,94 +2184,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
1968
2184
  "highlevel",
1969
2185
  "highlevelForm"
1970
2186
  ];
1971
- var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
1972
- var flowInputRequestSchema = z5.discriminatedUnion("target", [
1973
- z5.object({
2187
+ var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
2188
+ var flowInputRequestSchema = z6.discriminatedUnion("target", [
2189
+ z6.object({
1974
2190
  /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
1975
- target: z5.literal("sideEffect"),
1976
- flowSlug: z5.string(),
2191
+ target: z6.literal("sideEffect"),
2192
+ flowSlug: z6.string(),
1977
2193
  /** `id` of the FlowNode holding the side effect. */
1978
- nodeId: z5.string(),
2194
+ nodeId: z6.string(),
1979
2195
  /** `id` of the side effect within that node's `sideEffects[]`. */
1980
- sideEffectId: z5.string(),
2196
+ sideEffectId: z6.string(),
1981
2197
  sideEffectType: flowSideEffectTypeSchema,
1982
2198
  /** 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(),
2199
+ prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
1984
2200
  /** Secret credential field names the agent asks the user to provide. */
1985
- requestedSecretFields: z5.array(z5.string()).optional(),
1986
- message: z5.string().optional()
2201
+ requestedSecretFields: z6.array(z6.string()).optional(),
2202
+ message: z6.string().optional()
1987
2203
  }),
1988
- z5.object({
2204
+ z6.object({
1989
2205
  /** Configure a widget node's third-party `form.external` (+ `providerId`). */
1990
- target: z5.literal("node"),
1991
- flowSlug: z5.string(),
2206
+ target: z6.literal("node"),
2207
+ flowSlug: z6.string(),
1992
2208
  /** `id` of the widget FlowNode. */
1993
- nodeId: z5.string(),
2209
+ nodeId: z6.string(),
1994
2210
  nodeType: flowResourceNodeTypeSchema,
1995
- message: z5.string().optional()
2211
+ message: z6.string().optional()
1996
2212
  })
1997
2213
  ]);
1998
- var flowInputToolInputSchema = z5.object({
1999
- requests: z5.array(flowInputRequestSchema).min(1).max(8)
2214
+ var flowInputToolInputSchema = z6.object({
2215
+ requests: z6.array(flowInputRequestSchema).min(1).max(8)
2000
2216
  });
2001
- var flowInputResultSchema = z5.discriminatedUnion("status", [
2002
- z5.object({
2003
- status: z5.literal("submitted"),
2217
+ var flowInputResultSchema = z6.discriminatedUnion("status", [
2218
+ z6.object({
2219
+ status: z6.literal("submitted"),
2004
2220
  /** Echoes which piece this result resolves. */
2005
- nodeId: z5.string(),
2006
- sideEffectId: z5.string().optional(),
2221
+ nodeId: z6.string(),
2222
+ sideEffectId: z6.string().optional(),
2007
2223
  /** Names of secret fields the user provided. Never values. */
2008
- secretFieldsSet: z5.array(z5.string()),
2224
+ secretFieldsSet: z6.array(z6.string()),
2009
2225
  /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
2010
- note: z5.string().optional()
2226
+ note: z6.string().optional()
2011
2227
  }),
2012
- z5.object({
2013
- status: z5.literal("declined"),
2014
- nodeId: z5.string(),
2015
- sideEffectId: z5.string().optional(),
2016
- reason: z5.string().optional()
2228
+ z6.object({
2229
+ status: z6.literal("declined"),
2230
+ nodeId: z6.string(),
2231
+ sideEffectId: z6.string().optional(),
2232
+ reason: z6.string().optional()
2017
2233
  })
2018
2234
  ]);
2019
- var flowInputToolResultSchema = z5.object({
2020
- results: z5.array(flowInputResultSchema)
2235
+ var flowInputToolResultSchema = z6.object({
2236
+ results: z6.array(flowInputResultSchema)
2021
2237
  });
2022
- var flowsListRequestSchema = z5.object({ chatId: z5.string() });
2023
- var flowSummarySchema = z5.object({
2024
- slug: z5.string(),
2025
- name: z5.string(),
2238
+ var flowsListRequestSchema = z6.object({ chatId: z6.string() });
2239
+ var flowSummarySchema = z6.object({
2240
+ slug: z6.string(),
2241
+ name: z6.string(),
2026
2242
  /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
2027
- needsConfig: z5.number()
2243
+ needsConfig: z6.number()
2028
2244
  });
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()
2245
+ var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
2246
+ var flowsShowRequestSchema = z6.object({
2247
+ chatId: z6.string(),
2248
+ slug: z6.string(),
2249
+ full: z6.boolean().optional()
2034
2250
  });
2035
- var flowConfigStatusSchema = z5.object({
2036
- nodeId: z5.string(),
2037
- nodeName: z5.string().optional(),
2251
+ var flowConfigStatusSchema = z6.object({
2252
+ nodeId: z6.string(),
2253
+ nodeName: z6.string().optional(),
2038
2254
  /** "sideEffect" credential/connection, or "node" widget resource. */
2039
- target: z5.enum(["sideEffect", "node"]),
2040
- sideEffectId: z5.string().optional(),
2041
- kind: z5.string(),
2255
+ target: z6.enum(["sideEffect", "node"]),
2256
+ sideEffectId: z6.string().optional(),
2257
+ kind: z6.string(),
2042
2258
  /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
2043
- status: z5.string(),
2259
+ status: z6.string(),
2044
2260
  /** True when a `request_flow_input` call is still needed for this piece. */
2045
- needsInput: z5.boolean()
2261
+ needsInput: z6.boolean()
2046
2262
  });
2047
- var flowsShowResponseSchema = z5.object({
2048
- slug: z5.string(),
2049
- name: z5.string(),
2263
+ var flowsShowResponseSchema = z6.object({
2264
+ slug: z6.string(),
2265
+ name: z6.string(),
2050
2266
  /** Confidential fields and whether each is configured. */
2051
- config: z5.array(flowConfigStatusSchema),
2267
+ config: z6.array(flowConfigStatusSchema),
2052
2268
  /** Present only with `--full`: the whole flow tree, secret values redacted. */
2053
- tree: z5.unknown().optional()
2269
+ tree: z6.unknown().optional()
2054
2270
  });
2055
2271
 
2056
2272
  // ../api/src/history.ts
2057
- import { z as z6 } from "zod";
2058
- var historyCategorySchema = z6.enum([
2273
+ import { z as z7 } from "zod";
2274
+ var historyCategorySchema = z7.enum([
2059
2275
  "publish",
2060
2276
  "chat",
2061
2277
  "action",
@@ -2072,36 +2288,36 @@ var historyCategorySchema = z6.enum([
2072
2288
  "domain",
2073
2289
  "integration"
2074
2290
  ]);
2075
- var historyListRequestSchema = z6.object({
2076
- limit: z6.number().int().min(1).max(200).optional(),
2291
+ var historyListRequestSchema = z7.object({
2292
+ limit: z7.number().int().min(1).max(200).optional(),
2077
2293
  category: historyCategorySchema.optional(),
2078
2294
  /** Only entries from the last N days. */
2079
- days: z6.number().int().min(1).max(365).optional(),
2295
+ days: z7.number().int().min(1).max(365).optional(),
2080
2296
  /** Include raw metadata on each entry (compact by default). */
2081
- full: z6.boolean().optional()
2297
+ full: z7.boolean().optional()
2082
2298
  });
2083
- var historyEntrySchema = z6.object({
2084
- id: z6.string(),
2299
+ var historyEntrySchema = z7.object({
2300
+ id: z7.string(),
2085
2301
  /** Epoch ms. */
2086
- at: z6.number(),
2302
+ at: z7.number(),
2087
2303
  category: historyCategorySchema,
2088
2304
  /** Dotted action id, e.g. "publish.commit", "member.invite_create". */
2089
- action: z6.string(),
2090
- actorType: z6.enum(["user", "agent", "system"]),
2305
+ action: z7.string(),
2306
+ actorType: z7.enum(["user", "agent", "system"]),
2091
2307
  /** Display name of the acting user, when the actor is a user. */
2092
- actor: z6.string().nullable(),
2308
+ actor: z7.string().nullable(),
2093
2309
  /** What the change touched — commit subject, chat title, member email, tag type, … */
2094
- target: z6.string().nullable(),
2095
- metadata: z6.record(z6.string(), z6.unknown()).optional()
2310
+ target: z7.string().nullable(),
2311
+ metadata: z7.record(z7.string(), z7.unknown()).optional()
2096
2312
  });
2097
- var historyListResponseSchema = z6.object({
2098
- ok: z6.literal(true),
2099
- data: z6.object({ entries: z6.array(historyEntrySchema) })
2313
+ var historyListResponseSchema = z7.object({
2314
+ ok: z7.literal(true),
2315
+ data: z7.object({ entries: z7.array(historyEntrySchema) })
2100
2316
  });
2101
2317
 
2102
2318
  // ../api/src/images.ts
2103
- import { z as z7 } from "zod";
2104
- var imageSourceSchema = z7.enum([
2319
+ import { z as z8 } from "zod";
2320
+ var imageSourceSchema = z8.enum([
2105
2321
  "uploaded",
2106
2322
  "website",
2107
2323
  "google_testimonial",
@@ -2117,49 +2333,49 @@ var imageSourceSchema = z7.enum([
2117
2333
  "pinterest",
2118
2334
  "ai_generated"
2119
2335
  ]);
2120
- var imageStatusSchema = z7.enum(["uploading", "processing", "ready", "error"]);
2121
- var upscaleConfigSchema = z7.object({
2122
- model: z7.literal("philz1337x/crystal-upscaler"),
2123
- input: z7.object({
2124
- scale_factor: z7.number(),
2125
- creativity: z7.number(),
2126
- output_format: z7.string()
2336
+ var imageStatusSchema = z8.enum(["uploading", "processing", "ready", "error"]);
2337
+ var upscaleConfigSchema = z8.object({
2338
+ model: z8.literal("philz1337x/crystal-upscaler"),
2339
+ input: z8.object({
2340
+ scale_factor: z8.number(),
2341
+ creativity: z8.number(),
2342
+ output_format: z8.string()
2127
2343
  }),
2128
- status: z7.enum(["pending", "completed"])
2344
+ status: z8.enum(["pending", "completed"])
2129
2345
  });
2130
- var imageDocSchema = z7.object({
2131
- _id: z7.string(),
2132
- _creationTime: z7.number(),
2133
- companyId: z7.string(),
2134
- storageKey: z7.string(),
2346
+ var imageDocSchema = z8.object({
2347
+ _id: z8.string(),
2348
+ _creationTime: z8.number(),
2349
+ companyId: z8.string(),
2350
+ storageKey: z8.string(),
2135
2351
  upscaleConfig: upscaleConfigSchema.optional(),
2136
- upscaledStorageKey: z7.string().optional(),
2137
- name: z7.string(),
2138
- description: z7.string(),
2139
- tags: z7.array(z7.string()),
2140
- source: z7.string(),
2141
- externalId: z7.string().optional(),
2142
- externalUrl: z7.string().optional(),
2143
- contentHash: z7.string().optional(),
2144
- sourceId: z7.string().optional(),
2145
- descriptionContext: z7.string().optional(),
2146
- width: z7.number().optional(),
2147
- height: z7.number().optional(),
2148
- aspectRatio: z7.number().optional(),
2149
- dominantColor: z7.string().optional(),
2150
- imagePalette: z7.array(z7.string()).optional(),
2151
- thumbhashDataUri: z7.string().optional(),
2152
- isLightImage: z7.boolean().optional(),
2153
- descriptionEmbedding: z7.array(z7.number()).optional(),
2154
- imageEmbedding: z7.array(z7.number()).optional(),
2155
- searchText: z7.string().optional(),
2352
+ upscaledStorageKey: z8.string().optional(),
2353
+ name: z8.string(),
2354
+ description: z8.string(),
2355
+ tags: z8.array(z8.string()),
2356
+ source: z8.string(),
2357
+ externalId: z8.string().optional(),
2358
+ externalUrl: z8.string().optional(),
2359
+ contentHash: z8.string().optional(),
2360
+ sourceId: z8.string().optional(),
2361
+ descriptionContext: z8.string().optional(),
2362
+ width: z8.number().optional(),
2363
+ height: z8.number().optional(),
2364
+ aspectRatio: z8.number().optional(),
2365
+ dominantColor: z8.string().optional(),
2366
+ imagePalette: z8.array(z8.string()).optional(),
2367
+ thumbhashDataUri: z8.string().optional(),
2368
+ isLightImage: z8.boolean().optional(),
2369
+ descriptionEmbedding: z8.array(z8.number()).optional(),
2370
+ imageEmbedding: z8.array(z8.number()).optional(),
2371
+ searchText: z8.string().optional(),
2156
2372
  status: imageStatusSchema,
2157
- errorMessage: z7.string().optional(),
2158
- createdAt: z7.number(),
2159
- updatedAt: z7.number(),
2160
- imageUrl: z7.string()
2373
+ errorMessage: z8.string().optional(),
2374
+ createdAt: z8.number(),
2375
+ updatedAt: z8.number(),
2376
+ imageUrl: z8.string()
2161
2377
  });
2162
- var imageHitSourceSchema = z7.enum([
2378
+ var imageHitSourceSchema = z8.enum([
2163
2379
  "library",
2164
2380
  "magnific",
2165
2381
  "google_images",
@@ -2170,242 +2386,242 @@ var imageHitSourceSchema = z7.enum([
2170
2386
  "giphy",
2171
2387
  "pinterest"
2172
2388
  ]);
2173
- var imageHitSchema = z7.object({
2389
+ var imageHitSchema = z8.object({
2174
2390
  source: imageHitSourceSchema,
2175
- url: z7.string(),
2176
- thumbnailUrl: z7.string().optional(),
2177
- width: z7.number().optional(),
2178
- height: z7.number().optional(),
2179
- aspectRatio: z7.number().optional(),
2180
- dominantColor: z7.string().optional(),
2181
- externalId: z7.string().optional(),
2182
- externalUrl: z7.string().optional(),
2183
- providerMeta: z7.record(z7.string(), z7.unknown()).optional(),
2184
- descriptionContext: z7.string().optional(),
2185
- _id: z7.string().optional(),
2186
- name: z7.string().optional(),
2187
- description: z7.string().optional(),
2188
- tags: z7.array(z7.string()).optional(),
2189
- score: z7.number().optional(),
2190
- alsoInLibrary: z7.string().optional(),
2191
- prefetchedBytes: z7.string().optional(),
2192
- prefetchedContentType: z7.string().optional()
2391
+ url: z8.string(),
2392
+ thumbnailUrl: z8.string().optional(),
2393
+ width: z8.number().optional(),
2394
+ height: z8.number().optional(),
2395
+ aspectRatio: z8.number().optional(),
2396
+ dominantColor: z8.string().optional(),
2397
+ externalId: z8.string().optional(),
2398
+ externalUrl: z8.string().optional(),
2399
+ providerMeta: z8.record(z8.string(), z8.unknown()).optional(),
2400
+ descriptionContext: z8.string().optional(),
2401
+ _id: z8.string().optional(),
2402
+ name: z8.string().optional(),
2403
+ description: z8.string().optional(),
2404
+ tags: z8.array(z8.string()).optional(),
2405
+ score: z8.number().optional(),
2406
+ alsoInLibrary: z8.string().optional(),
2407
+ prefetchedBytes: z8.string().optional(),
2408
+ prefetchedContentType: z8.string().optional()
2193
2409
  });
2194
2410
  var ingestedImageHitSchema = imageHitSchema.extend({
2195
- imageId: z7.string().optional(),
2196
- imageUrl: z7.string().optional(),
2197
- deduped: z7.boolean().optional(),
2198
- sourceUrl: z7.string().optional()
2199
- });
2200
- var autoIngestItemSchema = z7.object({
2201
- imageId: z7.string(),
2202
- deduped: z7.boolean(),
2203
- imageUrl: z7.string(),
2204
- sourceUrl: z7.string(),
2205
- externalUrl: z7.string().optional()
2411
+ imageId: z8.string().optional(),
2412
+ imageUrl: z8.string().optional(),
2413
+ deduped: z8.boolean().optional(),
2414
+ sourceUrl: z8.string().optional()
2415
+ });
2416
+ var autoIngestItemSchema = z8.object({
2417
+ imageId: z8.string(),
2418
+ deduped: z8.boolean(),
2419
+ imageUrl: z8.string(),
2420
+ sourceUrl: z8.string(),
2421
+ externalUrl: z8.string().optional()
2206
2422
  });
2207
2423
  function providerHitsResponseSchema() {
2208
- return z7.object({
2209
- hits: z7.array(ingestedImageHitSchema),
2210
- ingested: z7.array(autoIngestItemSchema)
2424
+ return z8.object({
2425
+ hits: z8.array(ingestedImageHitSchema),
2426
+ ingested: z8.array(autoIngestItemSchema)
2211
2427
  });
2212
2428
  }
2213
- var imagesGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2214
- var imagesSearchRequestSchema = z7.object({
2215
- query: z7.string().min(1),
2216
- limit: z7.coerce.number().int().positive().max(100).optional(),
2217
- aspectRatio: z7.string().optional(),
2218
- tags: z7.array(z7.string()).optional(),
2219
- source: z7.string().optional(),
2220
- externalUrlHost: z7.string().optional()
2221
- });
2222
- var imageSearchResultSchema = z7.object({
2223
- _id: z7.string(),
2224
- imageUrl: z7.string(),
2225
- name: z7.string(),
2226
- description: z7.string(),
2227
- tags: z7.array(z7.string()),
2228
- width: z7.number().optional(),
2229
- height: z7.number().optional(),
2230
- aspectRatio: z7.number().optional(),
2231
- dominantColor: z7.string().optional(),
2232
- imagePalette: z7.array(z7.string()).optional(),
2233
- source: z7.string(),
2234
- externalUrl: z7.string().optional(),
2235
- score: z7.number()
2236
- });
2237
- var imagesSearchResponseSchema = z7.array(imageSearchResultSchema);
2238
- var imagesUploadRequestSchema = z7.object({
2239
- base64: z7.string().min(1),
2240
- contentType: z7.string().min(1),
2241
- source: z7.string().optional(),
2242
- descriptionContext: z7.string().optional()
2243
- });
2244
- var imagesUploadResponseSchema = z7.object({ imageId: z7.string() });
2245
- var imagesDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing image ID") });
2246
- var imagesDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
2247
- var imagesUpscaleRequestSchema = z7.object({ imageId: z7.string().min(1, "Missing image ID") });
2248
- var imagesUpscaleResponseSchema = z7.object({
2249
- imageId: z7.string(),
2250
- status: z7.literal("processing")
2429
+ var imagesGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2430
+ var imagesSearchRequestSchema = z8.object({
2431
+ query: z8.string().min(1),
2432
+ limit: z8.coerce.number().int().positive().max(100).optional(),
2433
+ aspectRatio: z8.string().optional(),
2434
+ tags: z8.array(z8.string()).optional(),
2435
+ source: z8.string().optional(),
2436
+ externalUrlHost: z8.string().optional()
2437
+ });
2438
+ var imageSearchResultSchema = z8.object({
2439
+ _id: z8.string(),
2440
+ imageUrl: z8.string(),
2441
+ name: z8.string(),
2442
+ description: z8.string(),
2443
+ tags: z8.array(z8.string()),
2444
+ width: z8.number().optional(),
2445
+ height: z8.number().optional(),
2446
+ aspectRatio: z8.number().optional(),
2447
+ dominantColor: z8.string().optional(),
2448
+ imagePalette: z8.array(z8.string()).optional(),
2449
+ source: z8.string(),
2450
+ externalUrl: z8.string().optional(),
2451
+ score: z8.number()
2452
+ });
2453
+ var imagesSearchResponseSchema = z8.array(imageSearchResultSchema);
2454
+ var imagesUploadRequestSchema = z8.object({
2455
+ base64: z8.string().min(1),
2456
+ contentType: z8.string().min(1),
2457
+ source: z8.string().optional(),
2458
+ descriptionContext: z8.string().optional()
2459
+ });
2460
+ var imagesUploadResponseSchema = z8.object({ imageId: z8.string() });
2461
+ var imagesDeleteRequestSchema = z8.object({ id: z8.string().min(1, "Missing image ID") });
2462
+ var imagesDeleteResponseSchema = z8.object({ ok: z8.literal(true) });
2463
+ var imagesUpscaleRequestSchema = z8.object({ imageId: z8.string().min(1, "Missing image ID") });
2464
+ var imagesUpscaleResponseSchema = z8.object({
2465
+ imageId: z8.string(),
2466
+ status: z8.literal("processing")
2251
2467
  });
2252
2468
  var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
2253
- var imagesFindRequestSchema = z7.object({
2254
- query: z7.string().min(1),
2255
- sources: z7.array(z7.enum(IMAGES_FIND_SOURCES)).optional(),
2256
- limit: z7.coerce.number().int().positive().max(50).optional(),
2257
- fallback: z7.boolean().optional(),
2258
- threshold: z7.number().min(0).max(1).optional(),
2259
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2260
- descriptionContext: z7.string().optional()
2261
- });
2262
- var imagesFindResponseSchema = z7.object({
2263
- groups: z7.object({
2264
- library: z7.array(imageHitSchema),
2265
- external: z7.array(ingestedImageHitSchema)
2469
+ var imagesFindRequestSchema = z8.object({
2470
+ query: z8.string().min(1),
2471
+ sources: z8.array(z8.enum(IMAGES_FIND_SOURCES)).optional(),
2472
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2473
+ fallback: z8.boolean().optional(),
2474
+ threshold: z8.number().min(0).max(1).optional(),
2475
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2476
+ descriptionContext: z8.string().optional()
2477
+ });
2478
+ var imagesFindResponseSchema = z8.object({
2479
+ groups: z8.object({
2480
+ library: z8.array(imageHitSchema),
2481
+ external: z8.array(ingestedImageHitSchema)
2266
2482
  }),
2267
- meta: z7.object({
2268
- counts: z7.record(z7.string(), z7.number()),
2269
- errors: z7.array(z7.object({ source: imageHitSourceSchema, message: z7.string() }))
2483
+ meta: z8.object({
2484
+ counts: z8.record(z8.string(), z8.number()),
2485
+ errors: z8.array(z8.object({ source: imageHitSourceSchema, message: z8.string() }))
2270
2486
  }),
2271
- ingested: z7.array(autoIngestItemSchema)
2272
- });
2273
- var imagesStockRequestSchema = z7.object({
2274
- query: z7.string().min(1),
2275
- orientation: z7.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2276
- contentType: z7.enum(["photo", "vector", "psd"]).optional(),
2277
- license: z7.enum(["freemium", "premium"]).optional(),
2278
- color: z7.string().optional(),
2279
- aiGenerated: z7.enum(["exclude", "only"]).optional(),
2280
- people: z7.enum(["include", "exclude", "only"]).optional(),
2281
- order: z7.enum(["relevance", "recent"]).optional(),
2282
- limit: z7.coerce.number().int().positive().max(50).optional(),
2283
- page: z7.coerce.number().int().positive().optional(),
2284
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2285
- descriptionContext: z7.string().optional()
2487
+ ingested: z8.array(autoIngestItemSchema)
2488
+ });
2489
+ var imagesStockRequestSchema = z8.object({
2490
+ query: z8.string().min(1),
2491
+ orientation: z8.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2492
+ contentType: z8.enum(["photo", "vector", "psd"]).optional(),
2493
+ license: z8.enum(["freemium", "premium"]).optional(),
2494
+ color: z8.string().optional(),
2495
+ aiGenerated: z8.enum(["exclude", "only"]).optional(),
2496
+ people: z8.enum(["include", "exclude", "only"]).optional(),
2497
+ order: z8.enum(["relevance", "recent"]).optional(),
2498
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2499
+ page: z8.coerce.number().int().positive().optional(),
2500
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2501
+ descriptionContext: z8.string().optional()
2286
2502
  });
2287
2503
  var imagesStockResponseSchema = providerHitsResponseSchema();
2288
- var imagesGoogleRequestSchema = z7.object({
2289
- query: z7.string().min(1),
2290
- type: z7.string().optional(),
2291
- size: z7.string().optional(),
2292
- color: z7.string().optional(),
2293
- safe: z7.enum(["off", "active"]).optional(),
2294
- limit: z7.coerce.number().int().positive().max(50).optional(),
2295
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2296
- descriptionContext: z7.string().optional()
2504
+ var imagesGoogleRequestSchema = z8.object({
2505
+ query: z8.string().min(1),
2506
+ type: z8.string().optional(),
2507
+ size: z8.string().optional(),
2508
+ color: z8.string().optional(),
2509
+ safe: z8.enum(["off", "active"]).optional(),
2510
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2511
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2512
+ descriptionContext: z8.string().optional()
2297
2513
  });
2298
2514
  var imagesGoogleResponseSchema = providerHitsResponseSchema();
2299
- var imagesPinterestRequestSchema = z7.object({
2300
- query: z7.string().min(1),
2301
- limit: z7.coerce.number().int().positive().max(20).optional(),
2302
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2303
- descriptionContext: z7.string().optional()
2515
+ var imagesPinterestRequestSchema = z8.object({
2516
+ query: z8.string().min(1),
2517
+ limit: z8.coerce.number().int().positive().max(20).optional(),
2518
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2519
+ descriptionContext: z8.string().optional()
2304
2520
  });
2305
2521
  var imagesPinterestResponseSchema = providerHitsResponseSchema();
2306
- var rgbTriple = z7.tuple([
2307
- z7.number().int().min(0).max(255),
2308
- z7.number().int().min(0).max(255),
2309
- z7.number().int().min(0).max(255)
2522
+ var rgbTriple = z8.tuple([
2523
+ z8.number().int().min(0).max(255),
2524
+ z8.number().int().min(0).max(255),
2525
+ z8.number().int().min(0).max(255)
2310
2526
  ]);
2311
- var imageGenerateModelSchema = z7.enum([
2527
+ var imageGenerateModelSchema = z8.enum([
2312
2528
  "openai/gpt-5.4-image-2",
2313
2529
  "google/gemini-3.5-flash",
2314
2530
  "google/gemini-3.1-flash-image-preview",
2315
2531
  "google/gemini-3-pro-image-preview",
2316
2532
  "recraft/recraft-v4.1-pro-vector"
2317
2533
  ]);
2318
- var imagesGenerateRequestSchema = z7.object({
2319
- prompt: z7.string().min(1),
2534
+ var imagesGenerateRequestSchema = z8.object({
2535
+ prompt: z8.string().min(1),
2320
2536
  model: imageGenerateModelSchema.optional(),
2321
2537
  // Aspect ratio + size are validated loosely as strings; the per-model enum
2322
2538
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
2323
- aspectRatio: z7.string().optional(),
2324
- imageSize: z7.string().optional(),
2539
+ aspectRatio: z8.string().optional(),
2540
+ imageSize: z8.string().optional(),
2325
2541
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
2326
- quality: z7.enum(["auto", "low", "medium", "high"]).optional(),
2542
+ quality: z8.enum(["auto", "low", "medium", "high"]).optional(),
2327
2543
  // Recraft v4.1 Pro Vector levers (ignored by other models).
2328
- strength: z7.coerce.number().min(0).max(1).optional(),
2329
- rgbColors: z7.array(rgbTriple).optional(),
2544
+ strength: z8.coerce.number().min(0).max(1).optional(),
2545
+ rgbColors: z8.array(rgbTriple).optional(),
2330
2546
  backgroundRgbColor: rgbTriple.optional(),
2331
2547
  // Public image URLs used as visual references (multi-reference, in order).
2332
- referenceUrls: z7.array(z7.string().url()).optional(),
2333
- descriptionContext: z7.string().optional()
2334
- });
2335
- var generatedImageSchema = z7.object({
2336
- imageId: z7.string(),
2337
- deduped: z7.boolean(),
2338
- imageUrl: z7.string(),
2339
- width: z7.number().optional(),
2340
- height: z7.number().optional()
2341
- });
2342
- var imagesGenerateResponseSchema = z7.object({
2343
- model: z7.string(),
2344
- costUsd: z7.number(),
2345
- images: z7.array(generatedImageSchema)
2346
- });
2347
- var imagesLogoRequestSchema = z7.object({
2348
- domain: z7.string().min(1),
2349
- variant: z7.enum(["icon", "logo", "symbol"]).optional(),
2350
- autoIngest: z7.coerce.number().int().min(0).max(5).optional(),
2351
- descriptionContext: z7.string().optional()
2548
+ referenceUrls: z8.array(z8.string().url()).optional(),
2549
+ descriptionContext: z8.string().optional()
2550
+ });
2551
+ var generatedImageSchema = z8.object({
2552
+ imageId: z8.string(),
2553
+ deduped: z8.boolean(),
2554
+ imageUrl: z8.string(),
2555
+ width: z8.number().optional(),
2556
+ height: z8.number().optional()
2557
+ });
2558
+ var imagesGenerateResponseSchema = z8.object({
2559
+ model: z8.string(),
2560
+ costUsd: z8.number(),
2561
+ images: z8.array(generatedImageSchema)
2562
+ });
2563
+ var imagesLogoRequestSchema = z8.object({
2564
+ domain: z8.string().min(1),
2565
+ variant: z8.enum(["icon", "logo", "symbol"]).optional(),
2566
+ autoIngest: z8.coerce.number().int().min(0).max(5).optional(),
2567
+ descriptionContext: z8.string().optional()
2352
2568
  });
2353
2569
  var imagesLogoResponseSchema = providerHitsResponseSchema();
2354
- var imagesIconRequestSchema = z7.object({
2355
- name: z7.string().min(1),
2356
- set: z7.string().optional(),
2357
- color: z7.string().optional(),
2358
- width: z7.coerce.number().int().positive().optional(),
2359
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2360
- descriptionContext: z7.string().optional()
2570
+ var imagesIconRequestSchema = z8.object({
2571
+ name: z8.string().min(1),
2572
+ set: z8.string().optional(),
2573
+ color: z8.string().optional(),
2574
+ width: z8.coerce.number().int().positive().optional(),
2575
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2576
+ descriptionContext: z8.string().optional()
2361
2577
  });
2362
2578
  var imagesIconResponseSchema = providerHitsResponseSchema();
2363
- var imagesExtractRequestSchema = z7.object({
2364
- url: z7.string().url(),
2365
- waitFor: z7.coerce.number().int().min(0).max(3e4).optional(),
2366
- limit: z7.coerce.number().int().positive().max(50).optional(),
2367
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2368
- descriptionContext: z7.string().optional()
2579
+ var imagesExtractRequestSchema = z8.object({
2580
+ url: z8.string().url(),
2581
+ waitFor: z8.coerce.number().int().min(0).max(3e4).optional(),
2582
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2583
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2584
+ descriptionContext: z8.string().optional()
2369
2585
  });
2370
2586
  var imagesExtractResponseSchema = providerHitsResponseSchema();
2371
- var imagesScreenshotRequestSchema = z7.object({
2372
- url: z7.string().url(),
2373
- fullPage: z7.boolean().optional(),
2374
- viewportWidth: z7.coerce.number().int().positive().max(3840).optional(),
2375
- viewportHeight: z7.coerce.number().int().positive().max(2160).optional(),
2376
- format: z7.enum(["webp", "png", "jpg"]).optional(),
2377
- descriptionContext: z7.string().optional()
2587
+ var imagesScreenshotRequestSchema = z8.object({
2588
+ url: z8.string().url(),
2589
+ fullPage: z8.boolean().optional(),
2590
+ viewportWidth: z8.coerce.number().int().positive().max(3840).optional(),
2591
+ viewportHeight: z8.coerce.number().int().positive().max(2160).optional(),
2592
+ format: z8.enum(["webp", "png", "jpg"]).optional(),
2593
+ descriptionContext: z8.string().optional()
2378
2594
  });
2379
2595
  var imagesScreenshotResponseSchema = providerHitsResponseSchema();
2380
- var imagesGiphyRequestSchema = z7.object({
2381
- query: z7.string().min(1).optional(),
2382
- trending: z7.coerce.boolean().optional(),
2383
- limit: z7.coerce.number().int().positive().max(50).optional(),
2384
- rating: z7.enum(["g", "pg", "pg-13", "r"]).optional(),
2385
- lang: z7.string().optional(),
2386
- autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2387
- descriptionContext: z7.string().optional()
2596
+ var imagesGiphyRequestSchema = z8.object({
2597
+ query: z8.string().min(1).optional(),
2598
+ trending: z8.coerce.boolean().optional(),
2599
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2600
+ rating: z8.enum(["g", "pg", "pg-13", "r"]).optional(),
2601
+ lang: z8.string().optional(),
2602
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2603
+ descriptionContext: z8.string().optional()
2388
2604
  });
2389
2605
  var imagesGifResponseSchema = providerHitsResponseSchema();
2390
2606
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2391
- var imagesIngestRequestSchema = z7.object({
2392
- url: z7.string().url(),
2607
+ var imagesIngestRequestSchema = z8.object({
2608
+ url: z8.string().url(),
2393
2609
  // Validate source at the HTTP boundary so unknown values produce the standard
2394
2610
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2395
2611
  // `assertImageSource` inside the action.
2396
2612
  source: imageSourceSchema,
2397
- externalId: z7.string().optional(),
2398
- externalUrl: z7.string().optional(),
2399
- descriptionContext: z7.string().optional()
2613
+ externalId: z8.string().optional(),
2614
+ externalUrl: z8.string().optional(),
2615
+ descriptionContext: z8.string().optional()
2400
2616
  });
2401
- var imagesIngestResponseSchema = z7.object({
2402
- imageId: z7.string(),
2403
- deduped: z7.boolean(),
2404
- contentHash: z7.string()
2617
+ var imagesIngestResponseSchema = z8.object({
2618
+ imageId: z8.string(),
2619
+ deduped: z8.boolean(),
2620
+ contentHash: z8.string()
2405
2621
  });
2406
2622
 
2407
2623
  // ../api/src/tags.ts
2408
- import { z as z8 } from "zod";
2624
+ import { z as z9 } from "zod";
2409
2625
  var TAG_TYPES = [
2410
2626
  "meta",
2411
2627
  "amplitude",
@@ -2426,7 +2642,7 @@ var TAG_TYPES = [
2426
2642
  "recaptcha",
2427
2643
  "twitterAds"
2428
2644
  ];
2429
- var tagTypeSchema = z8.enum(TAG_TYPES);
2645
+ var tagTypeSchema = z9.enum(TAG_TYPES);
2430
2646
  var TAG_IDENTIFYING_FIELD = {
2431
2647
  meta: "pixelId",
2432
2648
  googleAds: "conversionID",
@@ -2447,218 +2663,218 @@ var TAG_IDENTIFYING_FIELD = {
2447
2663
  recaptcha: "siteKey",
2448
2664
  twitterAds: "pixelId"
2449
2665
  };
2450
- var tagDraftOpKindSchema = z8.enum(["create", "update", "delete"]);
2451
- var tagDraftOpViewSchema = z8.object({
2666
+ var tagDraftOpKindSchema = z9.enum(["create", "update", "delete"]);
2667
+ var tagDraftOpViewSchema = z9.object({
2452
2668
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2453
- ref: z8.string(),
2669
+ ref: z9.string(),
2454
2670
  kind: tagDraftOpKindSchema,
2455
2671
  type: tagTypeSchema,
2456
2672
  /** Present on update/delete ops — the real tag this op targets. */
2457
- tagId: z8.string().optional(),
2673
+ tagId: z9.string().optional(),
2458
2674
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2459
- config: z8.record(z8.string(), z8.string()),
2675
+ config: z9.record(z9.string(), z9.string()),
2460
2676
  /** Update only — fields the op explicitly clears. */
2461
- clearFields: z8.array(z8.string()).optional(),
2677
+ clearFields: z9.array(z9.string()).optional(),
2462
2678
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2463
- secretsSet: z8.array(z8.string()),
2679
+ secretsSet: z9.array(z9.string()),
2464
2680
  /** Names of secret fields still awaiting user input. */
2465
- secretsPending: z8.array(z8.string()),
2466
- summary: z8.string(),
2467
- stagedAt: z8.number()
2681
+ secretsPending: z9.array(z9.string()),
2682
+ summary: z9.string(),
2683
+ stagedAt: z9.number()
2468
2684
  });
2469
- var tagsEffectiveEntrySchema = z8.object({
2685
+ var tagsEffectiveEntrySchema = z9.object({
2470
2686
  /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
2471
- ref: z8.string(),
2472
- tagId: z8.string().optional(),
2687
+ ref: z9.string(),
2688
+ tagId: z9.string().optional(),
2473
2689
  type: tagTypeSchema,
2474
2690
  /** Value of the type's identifying field, when set. */
2475
- identifier: z8.string().optional(),
2691
+ identifier: z9.string().optional(),
2476
2692
  /** Redacted config; for staged updates, production config with the patch merged. */
2477
- config: z8.record(z8.string(), z8.string()),
2693
+ config: z9.record(z9.string(), z9.string()),
2478
2694
  /** Absent = live production tag with no staged changes in this chat. */
2479
2695
  staged: tagDraftOpKindSchema.optional(),
2480
- secretsSet: z8.array(z8.string()),
2481
- secretsPending: z8.array(z8.string())
2696
+ secretsSet: z9.array(z9.string()),
2697
+ secretsPending: z9.array(z9.string())
2482
2698
  });
2483
- var tagsListRequestSchema = z8.object({ chatId: z8.string() });
2484
- var tagsListResponseSchema = z8.object({ tags: z8.array(tagsEffectiveEntrySchema) });
2485
- var tagsDraftListRequestSchema = z8.object({ chatId: z8.string() });
2486
- var tagsDraftListResponseSchema = z8.object({
2487
- status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
2488
- ops: z8.array(tagDraftOpViewSchema)
2699
+ var tagsListRequestSchema = z9.object({ chatId: z9.string() });
2700
+ var tagsListResponseSchema = z9.object({ tags: z9.array(tagsEffectiveEntrySchema) });
2701
+ var tagsDraftListRequestSchema = z9.object({ chatId: z9.string() });
2702
+ var tagsDraftListResponseSchema = z9.object({
2703
+ status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
2704
+ ops: z9.array(tagDraftOpViewSchema)
2489
2705
  });
2490
- var tagInputRequestSchema = z8.object({
2706
+ var tagInputRequestSchema = z9.object({
2491
2707
  // Every tag change is a tab in the approval form: create/edit show the full
2492
2708
  // body; delete shows a confirm. No tag change bypasses this approval.
2493
- mode: z8.enum(["create", "edit", "delete"]),
2709
+ mode: z9.enum(["create", "edit", "delete"]),
2494
2710
  tagType: tagTypeSchema,
2495
2711
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2496
- ref: z8.string().optional(),
2712
+ ref: z9.string().optional(),
2497
2713
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2498
- prefilledConfig: z8.record(z8.string(), z8.string()).optional(),
2714
+ prefilledConfig: z9.record(z9.string(), z9.string()).optional(),
2499
2715
  /** Secret field names the agent asks the user to provide. */
2500
- requestedSecretFields: z8.array(z8.string()).optional(),
2716
+ requestedSecretFields: z9.array(z9.string()).optional(),
2501
2717
  /** Short message shown above the form explaining why the input is needed. */
2502
- message: z8.string().optional()
2718
+ message: z9.string().optional()
2503
2719
  });
2504
- var tagChangeToolInputSchema = z8.object({
2505
- changes: z8.array(tagInputRequestSchema).min(1).max(8)
2720
+ var tagChangeToolInputSchema = z9.object({
2721
+ changes: z9.array(tagInputRequestSchema).min(1).max(8)
2506
2722
  });
2507
- var tagInputResultSchema = z8.discriminatedUnion("status", [
2508
- z8.object({
2509
- status: z8.literal("submitted"),
2510
- ref: z8.string(),
2723
+ var tagInputResultSchema = z9.discriminatedUnion("status", [
2724
+ z9.object({
2725
+ status: z9.literal("submitted"),
2726
+ ref: z9.string(),
2511
2727
  type: tagTypeSchema,
2512
2728
  /** Identifying field name → value (non-secret), when the type has one. */
2513
- identifier: z8.record(z8.string(), z8.string()).optional(),
2514
- secretFieldsSet: z8.array(z8.string()),
2515
- note: z8.string().optional()
2729
+ identifier: z9.record(z9.string(), z9.string()).optional(),
2730
+ secretFieldsSet: z9.array(z9.string()),
2731
+ note: z9.string().optional()
2516
2732
  }),
2517
- z8.object({
2518
- status: z8.literal("declined"),
2519
- reason: z8.string().optional()
2733
+ z9.object({
2734
+ status: z9.literal("declined"),
2735
+ reason: z9.string().optional()
2520
2736
  })
2521
2737
  ]);
2522
- var tagChangeToolResultSchema = z8.object({
2523
- results: z8.array(tagInputResultSchema)
2738
+ var tagChangeToolResultSchema = z9.object({
2739
+ results: z9.array(tagInputResultSchema)
2524
2740
  });
2525
2741
 
2526
2742
  // ../api/src/testimonials.ts
2527
- import { z as z9 } from "zod";
2528
- var testimonialSourceTypeSchema = z9.enum(["google", "trustpilot"]);
2529
- var testimonialStatusSchema = z9.enum(["pending", "processing", "ready", "error"]);
2530
- var testimonialSentimentSchema = z9.enum(["positive", "neutral", "negative"]);
2531
- var testimonialDocSchema = z9.object({
2532
- _id: z9.string(),
2533
- _creationTime: z9.number(),
2534
- companyId: z9.string(),
2535
- sourceId: z9.string(),
2743
+ import { z as z10 } from "zod";
2744
+ var testimonialSourceTypeSchema = z10.enum(["google", "trustpilot"]);
2745
+ var testimonialStatusSchema = z10.enum(["pending", "processing", "ready", "error"]);
2746
+ var testimonialSentimentSchema = z10.enum(["positive", "neutral", "negative"]);
2747
+ var testimonialDocSchema = z10.object({
2748
+ _id: z10.string(),
2749
+ _creationTime: z10.number(),
2750
+ companyId: z10.string(),
2751
+ sourceId: z10.string(),
2536
2752
  sourceType: testimonialSourceTypeSchema,
2537
- reviewText: z9.string(),
2538
- reviewTitle: z9.string().optional(),
2539
- searchText: z9.string().optional(),
2540
- reviewerName: z9.string().optional(),
2541
- reviewerImageUrl: z9.string().optional(),
2542
- reviewerImageId: z9.string().optional(),
2543
- reviewerLocation: z9.string().optional(),
2544
- rating: z9.number().optional(),
2545
- reviewDate: z9.number().optional(),
2546
- ownerAnswer: z9.string().optional(),
2547
- mediaUrls: z9.array(z9.string()).optional(),
2548
- imageIds: z9.array(z9.string()).optional(),
2549
- videoIds: z9.array(z9.string()).optional(),
2550
- sourceUrl: z9.string().optional(),
2551
- rawData: z9.unknown().optional(),
2552
- tags: z9.array(z9.string()),
2553
- highlight: z9.string().optional(),
2554
- language: z9.string().optional(),
2555
- summary: z9.string().optional(),
2753
+ reviewText: z10.string(),
2754
+ reviewTitle: z10.string().optional(),
2755
+ searchText: z10.string().optional(),
2756
+ reviewerName: z10.string().optional(),
2757
+ reviewerImageUrl: z10.string().optional(),
2758
+ reviewerImageId: z10.string().optional(),
2759
+ reviewerLocation: z10.string().optional(),
2760
+ rating: z10.number().optional(),
2761
+ reviewDate: z10.number().optional(),
2762
+ ownerAnswer: z10.string().optional(),
2763
+ mediaUrls: z10.array(z10.string()).optional(),
2764
+ imageIds: z10.array(z10.string()).optional(),
2765
+ videoIds: z10.array(z10.string()).optional(),
2766
+ sourceUrl: z10.string().optional(),
2767
+ rawData: z10.unknown().optional(),
2768
+ tags: z10.array(z10.string()),
2769
+ highlight: z10.string().optional(),
2770
+ language: z10.string().optional(),
2771
+ summary: z10.string().optional(),
2556
2772
  sentiment: testimonialSentimentSchema.optional(),
2557
- textEmbedding: z9.array(z9.number()).optional(),
2558
- externalId: z9.string().optional(),
2559
- contentHash: z9.string().optional(),
2773
+ textEmbedding: z10.array(z10.number()).optional(),
2774
+ externalId: z10.string().optional(),
2775
+ contentHash: z10.string().optional(),
2560
2776
  status: testimonialStatusSchema,
2561
- errorMessage: z9.string().optional(),
2562
- createdAt: z9.number(),
2563
- updatedAt: z9.number()
2777
+ errorMessage: z10.string().optional(),
2778
+ createdAt: z10.number(),
2779
+ updatedAt: z10.number()
2564
2780
  });
2565
- var testimonialsListRequestSchema = z9.object({
2781
+ var testimonialsListRequestSchema = z10.object({
2566
2782
  source: testimonialSourceTypeSchema.optional(),
2567
- rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2568
- rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2569
- tags: z9.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2783
+ rating_min: z10.coerce.number().int().min(1).max(5).optional(),
2784
+ rating_max: z10.coerce.number().int().min(1).max(5).optional(),
2785
+ tags: z10.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2570
2786
  status: testimonialStatusSchema.optional(),
2571
2787
  sentiment: testimonialSentimentSchema.optional(),
2572
- language: z9.string().min(2).max(5).optional(),
2573
- limit: z9.coerce.number().int().positive().max(200).optional()
2574
- });
2575
- var testimonialsListResponseSchema = z9.array(testimonialDocSchema);
2576
- var testimonialsGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2577
- var testimonialsSearchRequestSchema = z9.object({
2578
- query: z9.string().min(1),
2579
- limit: z9.coerce.number().int().positive().max(100).optional(),
2788
+ language: z10.string().min(2).max(5).optional(),
2789
+ limit: z10.coerce.number().int().positive().max(200).optional()
2790
+ });
2791
+ var testimonialsListResponseSchema = z10.array(testimonialDocSchema);
2792
+ var testimonialsGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2793
+ var testimonialsSearchRequestSchema = z10.object({
2794
+ query: z10.string().min(1),
2795
+ limit: z10.coerce.number().int().positive().max(100).optional(),
2580
2796
  source: testimonialSourceTypeSchema.optional(),
2581
- rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2582
- rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2583
- tags: z9.array(z9.string()).optional(),
2797
+ rating_min: z10.coerce.number().int().min(1).max(5).optional(),
2798
+ rating_max: z10.coerce.number().int().min(1).max(5).optional(),
2799
+ tags: z10.array(z10.string()).optional(),
2584
2800
  status: testimonialStatusSchema.optional(),
2585
2801
  sentiment: testimonialSentimentSchema.optional(),
2586
- language: z9.string().min(2).max(5).optional()
2802
+ language: z10.string().min(2).max(5).optional()
2587
2803
  }).refine(
2588
2804
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2589
2805
  { message: "rating_min must be less than or equal to rating_max" }
2590
2806
  );
2591
- var testimonialsSearchResponseSchema = z9.array(testimonialDocSchema);
2592
- var testimonialsOutscraperWebhookResponseSchema = z9.object({
2593
- ok: z9.literal(true),
2594
- note: z9.string().optional()
2807
+ var testimonialsSearchResponseSchema = z10.array(testimonialDocSchema);
2808
+ var testimonialsOutscraperWebhookResponseSchema = z10.object({
2809
+ ok: z10.literal(true),
2810
+ note: z10.string().optional()
2595
2811
  });
2596
2812
 
2597
2813
  // ../api/src/videos.ts
2598
- import { z as z10 } from "zod";
2599
- var videoStatusSchema = z10.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2600
- var videoTranscriptSegmentSchema = z10.object({
2601
- text: z10.string(),
2602
- startSecond: z10.number(),
2603
- endSecond: z10.number()
2604
- });
2605
- var videoSceneSchema = z10.object({
2606
- title: z10.string(),
2607
- description: z10.string(),
2608
- startSecond: z10.number(),
2609
- endSecond: z10.number(),
2610
- thumbnailTime: z10.number()
2611
- });
2612
- var videoDocSchema = z10.object({
2613
- _id: z10.string(),
2614
- _creationTime: z10.number(),
2615
- companyId: z10.string(),
2616
- muxAssetId: z10.string(),
2617
- muxPlaybackId: z10.string(),
2618
- muxUploadId: z10.string(),
2619
- name: z10.string(),
2620
- description: z10.string(),
2621
- tags: z10.array(z10.string()),
2622
- source: z10.string(),
2623
- externalId: z10.string().optional(),
2624
- sourceId: z10.string().optional(),
2625
- width: z10.number().optional(),
2626
- height: z10.number().optional(),
2627
- aspectRatio: z10.number().optional(),
2628
- duration: z10.number().optional(),
2629
- transcript: z10.string().optional(),
2630
- transcriptSegments: z10.array(videoTranscriptSegmentSchema).optional(),
2631
- scenes: z10.array(videoSceneSchema).optional(),
2632
- descriptionEmbedding: z10.array(z10.number()).optional(),
2633
- searchText: z10.string().optional(),
2814
+ import { z as z11 } from "zod";
2815
+ var videoStatusSchema = z11.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2816
+ var videoTranscriptSegmentSchema = z11.object({
2817
+ text: z11.string(),
2818
+ startSecond: z11.number(),
2819
+ endSecond: z11.number()
2820
+ });
2821
+ var videoSceneSchema = z11.object({
2822
+ title: z11.string(),
2823
+ description: z11.string(),
2824
+ startSecond: z11.number(),
2825
+ endSecond: z11.number(),
2826
+ thumbnailTime: z11.number()
2827
+ });
2828
+ var videoDocSchema = z11.object({
2829
+ _id: z11.string(),
2830
+ _creationTime: z11.number(),
2831
+ companyId: z11.string(),
2832
+ muxAssetId: z11.string(),
2833
+ muxPlaybackId: z11.string(),
2834
+ muxUploadId: z11.string(),
2835
+ name: z11.string(),
2836
+ description: z11.string(),
2837
+ tags: z11.array(z11.string()),
2838
+ source: z11.string(),
2839
+ externalId: z11.string().optional(),
2840
+ sourceId: z11.string().optional(),
2841
+ width: z11.number().optional(),
2842
+ height: z11.number().optional(),
2843
+ aspectRatio: z11.number().optional(),
2844
+ duration: z11.number().optional(),
2845
+ transcript: z11.string().optional(),
2846
+ transcriptSegments: z11.array(videoTranscriptSegmentSchema).optional(),
2847
+ scenes: z11.array(videoSceneSchema).optional(),
2848
+ descriptionEmbedding: z11.array(z11.number()).optional(),
2849
+ searchText: z11.string().optional(),
2634
2850
  status: videoStatusSchema,
2635
- errorMessage: z10.string().optional(),
2636
- createdAt: z10.number(),
2637
- updatedAt: z10.number(),
2638
- thumbnailUrl: z10.string()
2639
- });
2640
- var videosWebhookResponseSchema = z10.object({ ok: z10.literal(true) });
2641
- var videosGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2642
- var videosSearchRequestSchema = z10.object({
2643
- query: z10.string().min(1),
2644
- limit: z10.coerce.number().int().positive().max(100).optional(),
2645
- tags: z10.array(z10.string()).optional()
2646
- });
2647
- var videoSearchResultSchema = z10.object({
2648
- _id: z10.string(),
2649
- thumbnailUrl: z10.string(),
2650
- name: z10.string(),
2651
- description: z10.string(),
2652
- tags: z10.array(z10.string()),
2653
- status: z10.string(),
2654
- duration: z10.number().optional(),
2655
- muxPlaybackId: z10.string(),
2656
- createdAt: z10.number()
2657
- });
2658
- var videosSearchResponseSchema = z10.array(videoSearchResultSchema);
2659
- var videosUploadResponseSchema = z10.object({ uploadUrl: z10.string(), videoId: z10.string() });
2660
- var videosDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing video ID") });
2661
- var videosDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
2851
+ errorMessage: z11.string().optional(),
2852
+ createdAt: z11.number(),
2853
+ updatedAt: z11.number(),
2854
+ thumbnailUrl: z11.string()
2855
+ });
2856
+ var videosWebhookResponseSchema = z11.object({ ok: z11.literal(true) });
2857
+ var videosGetRequestSchema = z11.object({ id: z11.string().min(1, "Missing id parameter") });
2858
+ var videosSearchRequestSchema = z11.object({
2859
+ query: z11.string().min(1),
2860
+ limit: z11.coerce.number().int().positive().max(100).optional(),
2861
+ tags: z11.array(z11.string()).optional()
2862
+ });
2863
+ var videoSearchResultSchema = z11.object({
2864
+ _id: z11.string(),
2865
+ thumbnailUrl: z11.string(),
2866
+ name: z11.string(),
2867
+ description: z11.string(),
2868
+ tags: z11.array(z11.string()),
2869
+ status: z11.string(),
2870
+ duration: z11.number().optional(),
2871
+ muxPlaybackId: z11.string(),
2872
+ createdAt: z11.number()
2873
+ });
2874
+ var videosSearchResponseSchema = z11.array(videoSearchResultSchema);
2875
+ var videosUploadResponseSchema = z11.object({ uploadUrl: z11.string(), videoId: z11.string() });
2876
+ var videosDeleteRequestSchema = z11.object({ id: z11.string().min(1, "Missing video ID") });
2877
+ var videosDeleteResponseSchema = z11.object({ ok: z11.literal(true) });
2662
2878
 
2663
2879
  // src/commands/actions/complete.ts
2664
2880
  import { defineCommand as defineCommand2 } from "citty";
@@ -4471,37 +4687,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4471
4687
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4472
4688
 
4473
4689
  // ../api/src/ads-google/ops.ts
4474
- import { z as z11 } from "zod";
4475
- var tempRefSchema2 = z11.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4476
- var refSchema = z11.union([
4477
- z11.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4478
- z11.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4690
+ import { z as z12 } from "zod";
4691
+ var tempRefSchema2 = z12.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4692
+ var refSchema = z12.union([
4693
+ z12.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4694
+ z12.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4479
4695
  tempRefSchema2
4480
4696
  ]);
4481
4697
  var targetRefSchema = refSchema;
4482
- var microsSchema = z11.number().int().positive("expected a positive micros amount");
4483
- var httpsUrlSchema2 = z11.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4484
- var customerIdSchema = z11.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4485
- var stageableStatusSchema2 = z11.enum(STAGEABLE_CREATE_STATUSES2);
4486
- var matchTypeSchema = z11.enum(KEYWORD_MATCH_TYPES);
4487
- var keywordTextSchema = z11.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4488
- var budgetCreateSchema = z11.object({
4489
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4698
+ var microsSchema = z12.number().int().positive("expected a positive micros amount");
4699
+ var httpsUrlSchema2 = z12.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4700
+ var customerIdSchema = z12.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4701
+ var stageableStatusSchema2 = z12.enum(STAGEABLE_CREATE_STATUSES2);
4702
+ var matchTypeSchema = z12.enum(KEYWORD_MATCH_TYPES);
4703
+ 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");
4704
+ var budgetCreateSchema = z12.object({
4705
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4490
4706
  amountMicros: microsSchema,
4491
- deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4492
- explicitlyShared: z11.boolean().default(false)
4707
+ deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4708
+ explicitlyShared: z12.boolean().default(false)
4493
4709
  });
4494
- var budgetUpdateSchema = z11.object({
4495
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4710
+ var budgetUpdateSchema = z12.object({
4711
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4496
4712
  amountMicros: microsSchema.optional(),
4497
- deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).optional()
4713
+ deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).optional()
4498
4714
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4499
- var biddingConfigSchema = z11.object({
4500
- type: z11.enum(BIDDING_STRATEGY_TYPES),
4715
+ var biddingConfigSchema = z12.object({
4716
+ type: z12.enum(BIDDING_STRATEGY_TYPES),
4501
4717
  targetCpaMicros: microsSchema.optional(),
4502
- targetRoas: z11.number().positive().optional(),
4718
+ targetRoas: z12.number().positive().optional(),
4503
4719
  cpcBidCeilingMicros: microsSchema.optional(),
4504
- enhancedCpcEnabled: z11.boolean().optional()
4720
+ enhancedCpcEnabled: z12.boolean().optional()
4505
4721
  }).superRefine((p, ctx) => {
4506
4722
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4507
4723
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4510,17 +4726,17 @@ var biddingConfigSchema = z11.object({
4510
4726
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4511
4727
  }
4512
4728
  });
4513
- var networkSettingsSchema = z11.object({
4514
- targetGoogleSearch: z11.boolean().optional(),
4515
- targetSearchNetwork: z11.boolean().optional(),
4516
- targetContentNetwork: z11.boolean().optional(),
4517
- targetPartnerSearchNetwork: z11.boolean().optional()
4729
+ var networkSettingsSchema = z12.object({
4730
+ targetGoogleSearch: z12.boolean().optional(),
4731
+ targetSearchNetwork: z12.boolean().optional(),
4732
+ targetContentNetwork: z12.boolean().optional(),
4733
+ targetPartnerSearchNetwork: z12.boolean().optional()
4518
4734
  });
4519
- var dateSchema = z11.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4520
- var campaignCreateSchema2 = z11.object({
4521
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4522
- channelType: z11.enum(ADVERTISING_CHANNEL_TYPES),
4523
- channelSubType: z11.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4735
+ var dateSchema = z12.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4736
+ var campaignCreateSchema2 = z12.object({
4737
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4738
+ channelType: z12.enum(ADVERTISING_CHANNEL_TYPES),
4739
+ channelSubType: z12.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4524
4740
  budget: refSchema,
4525
4741
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4526
4742
  bidding: biddingConfigSchema.optional(),
@@ -4529,7 +4745,7 @@ var campaignCreateSchema2 = z11.object({
4529
4745
  startDate: dateSchema.optional(),
4530
4746
  endDate: dateSchema.optional(),
4531
4747
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4532
- objective: z11.enum(CAMPAIGN_OBJECTIVES).optional(),
4748
+ objective: z12.enum(CAMPAIGN_OBJECTIVES).optional(),
4533
4749
  status: stageableStatusSchema2.default("PAUSED")
4534
4750
  }).superRefine((p, ctx) => {
4535
4751
  if (!p.bidding && !p.biddingStrategy) {
@@ -4553,129 +4769,129 @@ var campaignCreateSchema2 = z11.object({
4553
4769
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4554
4770
  }
4555
4771
  });
4556
- var campaignUpdateSchema2 = z11.object({
4557
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4772
+ var campaignUpdateSchema2 = z12.object({
4773
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4558
4774
  budget: refSchema.optional(),
4559
4775
  bidding: biddingConfigSchema.optional(),
4560
4776
  networkSettings: networkSettingsSchema.optional(),
4561
4777
  startDate: dateSchema.optional(),
4562
4778
  endDate: dateSchema.optional(),
4563
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4779
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4564
4780
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4565
- var adGroupCreateSchema = z11.object({
4566
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4781
+ var adGroupCreateSchema = z12.object({
4782
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4567
4783
  campaign: refSchema,
4568
- type: z11.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4784
+ type: z12.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4569
4785
  cpcBidMicros: microsSchema.optional(),
4570
4786
  status: stageableStatusSchema2.default("PAUSED")
4571
4787
  });
4572
- var adGroupUpdateSchema = z11.object({
4573
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4788
+ var adGroupUpdateSchema = z12.object({
4789
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4574
4790
  cpcBidMicros: microsSchema.optional(),
4575
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4791
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4576
4792
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4577
- var keywordAddSchema = z11.object({
4793
+ var keywordAddSchema = z12.object({
4578
4794
  adGroup: refSchema,
4579
4795
  text: keywordTextSchema,
4580
4796
  matchType: matchTypeSchema,
4581
4797
  cpcBidMicros: microsSchema.optional(),
4582
- finalUrls: z11.array(httpsUrlSchema2).optional(),
4798
+ finalUrls: z12.array(httpsUrlSchema2).optional(),
4583
4799
  status: stageableStatusSchema2.default("ENABLED")
4584
4800
  });
4585
- var keywordUpdateSchema = z11.object({
4801
+ var keywordUpdateSchema = z12.object({
4586
4802
  cpcBidMicros: microsSchema.optional(),
4587
- finalUrls: z11.array(httpsUrlSchema2).optional(),
4588
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4803
+ finalUrls: z12.array(httpsUrlSchema2).optional(),
4804
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4589
4805
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4590
- var negativeKeywordAddSchema = z11.object({
4591
- level: z11.enum(["adGroup", "campaign"]),
4806
+ var negativeKeywordAddSchema = z12.object({
4807
+ level: z12.enum(["adGroup", "campaign"]),
4592
4808
  parent: refSchema,
4593
4809
  text: keywordTextSchema,
4594
4810
  matchType: matchTypeSchema
4595
4811
  });
4596
- var sharedSetCreateSchema = z11.object({
4597
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4598
- type: z11.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4812
+ var sharedSetCreateSchema = z12.object({
4813
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4814
+ type: z12.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4599
4815
  });
4600
- var sharedSetMemberAddSchema = z11.object({
4816
+ var sharedSetMemberAddSchema = z12.object({
4601
4817
  sharedSet: refSchema,
4602
4818
  text: keywordTextSchema,
4603
4819
  matchType: matchTypeSchema
4604
4820
  });
4605
- var campaignSharedSetAttachSchema = z11.object({
4821
+ var campaignSharedSetAttachSchema = z12.object({
4606
4822
  campaign: refSchema,
4607
4823
  sharedSet: refSchema
4608
4824
  });
4609
- var adTextAssetSchema = z11.object({
4610
- text: z11.string().min(1),
4611
- pinnedField: z11.enum(PINNED_FIELDS).optional()
4825
+ var adTextAssetSchema = z12.object({
4826
+ text: z12.string().min(1),
4827
+ pinnedField: z12.enum(PINNED_FIELDS).optional()
4612
4828
  });
4613
- var responsiveSearchAdSchema = z11.object({
4614
- format: z11.literal("responsiveSearch"),
4615
- headlines: z11.array(
4829
+ var responsiveSearchAdSchema = z12.object({
4830
+ format: z12.literal("responsiveSearch"),
4831
+ headlines: z12.array(
4616
4832
  adTextAssetSchema.refine(
4617
4833
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4618
4834
  "headline exceeds 30 chars"
4619
4835
  )
4620
4836
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4621
- descriptions: z11.array(
4837
+ descriptions: z12.array(
4622
4838
  adTextAssetSchema.refine(
4623
4839
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4624
4840
  "description exceeds 90 chars"
4625
4841
  )
4626
4842
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4627
- path1: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4628
- path2: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4629
- finalUrls: z11.array(httpsUrlSchema2).min(1)
4630
- });
4631
- var responsiveDisplayAdSchema = z11.object({
4632
- format: z11.literal("responsiveDisplay"),
4633
- headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4634
- longHeadline: z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4635
- descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4636
- businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4843
+ path1: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4844
+ path2: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4845
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4846
+ });
4847
+ var responsiveDisplayAdSchema = z12.object({
4848
+ format: z12.literal("responsiveDisplay"),
4849
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4850
+ longHeadline: z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4851
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4852
+ businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4637
4853
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4638
4854
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4639
4855
  // image (1:1) to serve; the logo images are optional.
4640
- marketingImageAssets: z11.array(refSchema).optional(),
4641
- squareMarketingImageAssets: z11.array(refSchema).optional(),
4642
- logoImageAssets: z11.array(refSchema).optional(),
4643
- finalUrls: z11.array(httpsUrlSchema2).min(1)
4644
- });
4645
- var callAdSchema = z11.object({
4646
- format: z11.literal("call"),
4647
- countryCode: z11.string().length(2),
4648
- phoneNumber: z11.string().min(3),
4649
- headline1: z11.string().min(1).max(30),
4650
- headline2: z11.string().min(1).max(30),
4651
- description1: z11.string().min(1).max(90),
4652
- description2: z11.string().min(1).max(90),
4653
- businessName: z11.string().min(1).max(25),
4654
- finalUrls: z11.array(httpsUrlSchema2).min(1)
4655
- });
4656
- var appAdSchema = z11.object({
4657
- format: z11.literal("app"),
4658
- headlines: z11.array(z11.object({ text: z11.string().min(1).max(30) })).min(1),
4659
- descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1)
4660
- });
4661
- var videoAdSchema = z11.object({
4662
- format: z11.literal("video"),
4856
+ marketingImageAssets: z12.array(refSchema).optional(),
4857
+ squareMarketingImageAssets: z12.array(refSchema).optional(),
4858
+ logoImageAssets: z12.array(refSchema).optional(),
4859
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4860
+ });
4861
+ var callAdSchema = z12.object({
4862
+ format: z12.literal("call"),
4863
+ countryCode: z12.string().length(2),
4864
+ phoneNumber: z12.string().min(3),
4865
+ headline1: z12.string().min(1).max(30),
4866
+ headline2: z12.string().min(1).max(30),
4867
+ description1: z12.string().min(1).max(90),
4868
+ description2: z12.string().min(1).max(90),
4869
+ businessName: z12.string().min(1).max(25),
4870
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4871
+ });
4872
+ var appAdSchema = z12.object({
4873
+ format: z12.literal("app"),
4874
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(30) })).min(1),
4875
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1)
4876
+ });
4877
+ var videoAdSchema = z12.object({
4878
+ format: z12.literal("video"),
4663
4879
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4664
4880
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4665
- videoAssets: z11.array(refSchema).min(1),
4666
- finalUrls: z11.array(httpsUrlSchema2).min(1)
4667
- });
4668
- var demandGenAdSchema = z11.object({
4669
- format: z11.literal("demandGen"),
4670
- headlines: z11.array(z11.object({ text: z11.string().min(1).max(40) })).min(1).max(5),
4671
- descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1).max(5),
4672
- businessName: z11.string().min(1).max(25),
4673
- finalUrls: z11.array(httpsUrlSchema2).min(1),
4674
- imageAssets: z11.array(refSchema).optional(),
4675
- squareImageAssets: z11.array(refSchema).optional(),
4676
- logoImageAssets: z11.array(refSchema).optional()
4677
- });
4678
- var adContentSchema = z11.discriminatedUnion("format", [
4881
+ videoAssets: z12.array(refSchema).min(1),
4882
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4883
+ });
4884
+ var demandGenAdSchema = z12.object({
4885
+ format: z12.literal("demandGen"),
4886
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(40) })).min(1).max(5),
4887
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1).max(5),
4888
+ businessName: z12.string().min(1).max(25),
4889
+ finalUrls: z12.array(httpsUrlSchema2).min(1),
4890
+ imageAssets: z12.array(refSchema).optional(),
4891
+ squareImageAssets: z12.array(refSchema).optional(),
4892
+ logoImageAssets: z12.array(refSchema).optional()
4893
+ });
4894
+ var adContentSchema = z12.discriminatedUnion("format", [
4679
4895
  responsiveSearchAdSchema,
4680
4896
  responsiveDisplayAdSchema,
4681
4897
  callAdSchema,
@@ -4683,45 +4899,45 @@ var adContentSchema = z11.discriminatedUnion("format", [
4683
4899
  videoAdSchema,
4684
4900
  demandGenAdSchema
4685
4901
  ]);
4686
- var adCreateSchema = z11.object({
4902
+ var adCreateSchema = z12.object({
4687
4903
  adGroup: refSchema,
4688
4904
  status: stageableStatusSchema2.default("PAUSED"),
4689
4905
  content: adContentSchema
4690
4906
  });
4691
- var adUpdateSchema = z11.object({
4692
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4907
+ var adUpdateSchema = z12.object({
4908
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4693
4909
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4694
- content: z11.record(z11.string(), z11.unknown()).optional()
4910
+ content: z12.record(z12.string(), z12.unknown()).optional()
4695
4911
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4696
- var textAssetSchema = z11.object({ type: z11.literal("text"), text: z11.string().min(1) });
4697
- var imageAssetSchema = z11.object({
4698
- type: z11.literal("image"),
4699
- imageId: z11.string().min(1),
4700
- name: z11.string().optional()
4701
- });
4702
- var youtubeVideoAssetSchema = z11.object({
4703
- type: z11.literal("youtubeVideo"),
4704
- youtubeVideoId: z11.string().min(1),
4705
- name: z11.string().optional()
4706
- });
4707
- var sitelinkAssetSchema = z11.object({
4708
- type: z11.literal("sitelink"),
4709
- linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4710
- description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4711
- description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4712
- finalUrls: z11.array(httpsUrlSchema2).min(1)
4713
- });
4714
- var calloutAssetSchema = z11.object({
4715
- type: z11.literal("callout"),
4716
- calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4717
- });
4718
- var structuredSnippetAssetSchema = z11.object({
4719
- type: z11.literal("structuredSnippet"),
4720
- header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4721
- values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4722
- });
4723
- var callToActionAssetSchema = z11.object({ type: z11.literal("callToAction"), callToAction: z11.string().min(1) });
4724
- var assetCreateSchema = z11.discriminatedUnion("type", [
4912
+ var textAssetSchema = z12.object({ type: z12.literal("text"), text: z12.string().min(1) });
4913
+ var imageAssetSchema = z12.object({
4914
+ type: z12.literal("image"),
4915
+ imageId: z12.string().min(1),
4916
+ name: z12.string().optional()
4917
+ });
4918
+ var youtubeVideoAssetSchema = z12.object({
4919
+ type: z12.literal("youtubeVideo"),
4920
+ youtubeVideoId: z12.string().min(1),
4921
+ name: z12.string().optional()
4922
+ });
4923
+ var sitelinkAssetSchema = z12.object({
4924
+ type: z12.literal("sitelink"),
4925
+ linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4926
+ description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4927
+ description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4928
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4929
+ });
4930
+ var calloutAssetSchema = z12.object({
4931
+ type: z12.literal("callout"),
4932
+ calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4933
+ });
4934
+ var structuredSnippetAssetSchema = z12.object({
4935
+ type: z12.literal("structuredSnippet"),
4936
+ header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4937
+ values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4938
+ });
4939
+ var callToActionAssetSchema = z12.object({ type: z12.literal("callToAction"), callToAction: z12.string().min(1) });
4940
+ var assetCreateSchema = z12.discriminatedUnion("type", [
4725
4941
  textAssetSchema,
4726
4942
  imageAssetSchema,
4727
4943
  youtubeVideoAssetSchema,
@@ -4730,136 +4946,136 @@ var assetCreateSchema = z11.discriminatedUnion("type", [
4730
4946
  structuredSnippetAssetSchema,
4731
4947
  callToActionAssetSchema
4732
4948
  ]);
4733
- var assetUpdateSchema = z11.object({
4734
- name: z11.string().min(1).optional(),
4735
- linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4736
- description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4737
- description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4738
- finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4739
- calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4740
- header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4741
- values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4742
- callToAction: z11.string().min(1).optional(),
4743
- text: z11.string().min(1).optional()
4949
+ var assetUpdateSchema = z12.object({
4950
+ name: z12.string().min(1).optional(),
4951
+ linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4952
+ description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4953
+ description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4954
+ finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
4955
+ calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4956
+ header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4957
+ values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4958
+ callToAction: z12.string().min(1).optional(),
4959
+ text: z12.string().min(1).optional()
4744
4960
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4745
- var assetLinkAttachSchema = z11.object({
4746
- level: z11.enum(["campaign", "adGroup", "customer"]),
4961
+ var assetLinkAttachSchema = z12.object({
4962
+ level: z12.enum(["campaign", "adGroup", "customer"]),
4747
4963
  parent: refSchema.optional(),
4748
4964
  asset: refSchema,
4749
- fieldType: z11.enum(ASSET_FIELD_TYPES)
4965
+ fieldType: z12.enum(ASSET_FIELD_TYPES)
4750
4966
  }).superRefine((value, ctx) => {
4751
4967
  if (value.level !== "customer" && !value.parent) {
4752
4968
  ctx.addIssue({
4753
- code: z11.ZodIssueCode.custom,
4969
+ code: z12.ZodIssueCode.custom,
4754
4970
  path: ["parent"],
4755
4971
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4756
4972
  });
4757
4973
  }
4758
4974
  });
4759
- var assetGroupCreateSchema = z11.object({
4975
+ var assetGroupCreateSchema = z12.object({
4760
4976
  campaign: refSchema,
4761
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4762
- finalUrls: z11.array(httpsUrlSchema2).min(1),
4763
- headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4764
- longHeadlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4765
- descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4766
- businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4767
- imageAssets: z11.array(refSchema).optional(),
4768
- squareImageAssets: z11.array(refSchema).optional(),
4769
- logoAssets: z11.array(refSchema).optional(),
4770
- status: z11.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4771
- });
4772
- var assetGroupUpdateSchema = z11.object({
4773
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4774
- finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4775
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4977
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4978
+ finalUrls: z12.array(httpsUrlSchema2).min(1),
4979
+ 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),
4980
+ 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),
4981
+ 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),
4982
+ businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4983
+ imageAssets: z12.array(refSchema).optional(),
4984
+ squareImageAssets: z12.array(refSchema).optional(),
4985
+ logoAssets: z12.array(refSchema).optional(),
4986
+ status: z12.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4987
+ });
4988
+ var assetGroupUpdateSchema = z12.object({
4989
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4990
+ finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
4991
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4776
4992
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4777
- var audienceCreateSchema2 = z11.object({
4778
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4779
- type: z11.enum(USER_LIST_TYPES).default("BASIC"),
4780
- description: z11.string().optional(),
4993
+ var audienceCreateSchema2 = z12.object({
4994
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4995
+ type: z12.enum(USER_LIST_TYPES).default("BASIC"),
4996
+ description: z12.string().optional(),
4781
4997
  /** Customer-match members (crm-based) — file-first for large lists. */
4782
- members: z11.array(z11.record(z11.string(), z11.string())).optional(),
4783
- sourceFileRef: z11.string().optional()
4998
+ members: z12.array(z12.record(z12.string(), z12.string())).optional(),
4999
+ sourceFileRef: z12.string().optional()
4784
5000
  });
4785
- var audienceCriterionAttachSchema = z11.object({
4786
- level: z11.enum(["campaign", "adGroup"]),
5001
+ var audienceCriterionAttachSchema = z12.object({
5002
+ level: z12.enum(["campaign", "adGroup"]),
4787
5003
  parent: refSchema,
4788
5004
  userList: refSchema,
4789
- negative: z11.boolean().default(false)
5005
+ negative: z12.boolean().default(false)
4790
5006
  });
4791
- var conversionActionCreateSchema = z11.object({
4792
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4793
- type: z11.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4794
- category: z11.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4795
- countingType: z11.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
5007
+ var conversionActionCreateSchema = z12.object({
5008
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
5009
+ type: z12.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
5010
+ category: z12.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
5011
+ countingType: z12.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4796
5012
  defaultValueMicros: microsSchema.optional(),
4797
- defaultCurrencyCode: z11.string().length(3).optional(),
4798
- clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4799
- viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4800
- status: z11.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4801
- });
4802
- var conversionActionUpdateSchema = z11.object({
4803
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4804
- category: z11.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4805
- countingType: z11.enum(CONVERSION_COUNTING_TYPES).optional(),
5013
+ defaultCurrencyCode: z12.string().length(3).optional(),
5014
+ clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
5015
+ viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
5016
+ status: z12.enum(["ENABLED", "PAUSED"]).default("ENABLED")
5017
+ });
5018
+ var conversionActionUpdateSchema = z12.object({
5019
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
5020
+ category: z12.enum(CONVERSION_ACTION_CATEGORIES).optional(),
5021
+ countingType: z12.enum(CONVERSION_COUNTING_TYPES).optional(),
4806
5022
  defaultValueMicros: microsSchema.optional(),
4807
- defaultCurrencyCode: z11.string().length(3).optional(),
4808
- clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4809
- viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4810
- status: z11.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
5023
+ defaultCurrencyCode: z12.string().length(3).optional(),
5024
+ clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
5025
+ viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
5026
+ status: z12.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4811
5027
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4812
- var biddingStrategyCreateSchema = z11.object({
4813
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
5028
+ var biddingStrategyCreateSchema = z12.object({
5029
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4814
5030
  config: biddingConfigSchema
4815
5031
  }).superRefine((p, ctx) => {
4816
5032
  if (p.config.type === "MANUAL_CPC") {
4817
5033
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4818
5034
  }
4819
5035
  });
4820
- var biddingStrategyUpdateSchema = z11.object({
4821
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
5036
+ var biddingStrategyUpdateSchema = z12.object({
5037
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4822
5038
  config: biddingConfigSchema.optional()
4823
5039
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4824
- var labelCreateSchema = z11.object({
4825
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4826
- backgroundColor: z11.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4827
- description: z11.string().optional()
5040
+ var labelCreateSchema = z12.object({
5041
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
5042
+ backgroundColor: z12.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
5043
+ description: z12.string().optional()
4828
5044
  });
4829
- var labelAttachSchema = z11.object({
4830
- level: z11.enum(["campaign", "adGroup", "ad"]),
5045
+ var labelAttachSchema = z12.object({
5046
+ level: z12.enum(["campaign", "adGroup", "ad"]),
4831
5047
  parent: refSchema,
4832
5048
  label: refSchema
4833
5049
  });
4834
- var locationCriterionSchema = z11.object({
4835
- criterionType: z11.literal("location"),
4836
- geoTargetConstant: z11.union([z11.string().regex(GEO_TARGET_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4837
- });
4838
- var languageCriterionSchema = z11.object({
4839
- criterionType: z11.literal("language"),
4840
- languageConstant: z11.union([z11.string().regex(LANGUAGE_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4841
- });
4842
- var adScheduleCriterionSchema = z11.object({
4843
- criterionType: z11.literal("adSchedule"),
4844
- dayOfWeek: z11.enum(DAYS_OF_WEEK),
4845
- startHour: z11.number().int().min(0).max(23),
4846
- startMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4847
- endHour: z11.number().int().min(0).max(24),
4848
- endMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4849
- });
4850
- var deviceCriterionSchema = z11.object({
4851
- criterionType: z11.literal("device"),
4852
- device: z11.enum(DEVICE_TYPES),
5050
+ var locationCriterionSchema = z12.object({
5051
+ criterionType: z12.literal("location"),
5052
+ geoTargetConstant: z12.union([z12.string().regex(GEO_TARGET_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
5053
+ });
5054
+ var languageCriterionSchema = z12.object({
5055
+ criterionType: z12.literal("language"),
5056
+ languageConstant: z12.union([z12.string().regex(LANGUAGE_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
5057
+ });
5058
+ var adScheduleCriterionSchema = z12.object({
5059
+ criterionType: z12.literal("adSchedule"),
5060
+ dayOfWeek: z12.enum(DAYS_OF_WEEK),
5061
+ startHour: z12.number().int().min(0).max(23),
5062
+ startMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
5063
+ endHour: z12.number().int().min(0).max(24),
5064
+ endMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
5065
+ });
5066
+ var deviceCriterionSchema = z12.object({
5067
+ criterionType: z12.literal("device"),
5068
+ device: z12.enum(DEVICE_TYPES),
4853
5069
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4854
5070
  // 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.
4855
- bidModifier: z11.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
5071
+ bidModifier: z12.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4856
5072
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4857
5073
  })
4858
5074
  });
4859
- var campaignCriterionAddSchema = z11.object({
5075
+ var campaignCriterionAddSchema = z12.object({
4860
5076
  campaign: refSchema,
4861
- negative: z11.boolean().default(false),
4862
- criterion: z11.discriminatedUnion("criterionType", [
5077
+ negative: z12.boolean().default(false),
5078
+ criterion: z12.discriminatedUnion("criterionType", [
4863
5079
  locationCriterionSchema,
4864
5080
  languageCriterionSchema,
4865
5081
  adScheduleCriterionSchema,
@@ -4869,7 +5085,7 @@ var campaignCriterionAddSchema = z11.object({
4869
5085
  const c = val.criterion;
4870
5086
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4871
5087
  ctx.addIssue({
4872
- code: z11.ZodIssueCode.custom,
5088
+ code: z12.ZodIssueCode.custom,
4873
5089
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4874
5090
  path: ["criterion", "endMinute"]
4875
5091
  });
@@ -4921,17 +5137,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4921
5137
  "google.campaignCriterion.add",
4922
5138
  "google.campaignCriterion.remove"
4923
5139
  ];
4924
- var googleDraftOpKindSchema = z11.enum(GOOGLE_DRAFT_OP_KINDS);
5140
+ var googleDraftOpKindSchema = z12.enum(GOOGLE_DRAFT_OP_KINDS);
4925
5141
  function createOp2(kind, payload) {
4926
- return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, payload });
5142
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, payload });
4927
5143
  }
4928
5144
  function updateOp2(kind, payload) {
4929
- return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
5145
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4930
5146
  }
4931
5147
  function targetOp(kind) {
4932
- return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5148
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4933
5149
  }
4934
- var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
5150
+ var googleDraftOpInputSchema = z12.discriminatedUnion("kind", [
4935
5151
  createOp2("google.budget.create", budgetCreateSchema),
4936
5152
  updateOp2("google.budget.update", budgetUpdateSchema),
4937
5153
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4979,132 +5195,132 @@ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
4979
5195
  ]);
4980
5196
 
4981
5197
  // ../api/src/ads-google/wire.ts
4982
- import { z as z12 } from "zod";
4983
- var googleWriteModeSchema = z12.enum(["live", "simulated"]);
4984
- var googleDraftOpResultSchema = z12.object({
4985
- status: z12.enum(["applied", "simulated", "failed", "skipped"]),
4986
- resourceName: z12.string().optional(),
4987
- error: z12.string().optional(),
4988
- skippedBecause: z12.string().optional(),
4989
- executedAt: z12.number().optional()
4990
- });
4991
- var googleDraftStageRequestSchema = z12.object({
4992
- chatId: z12.string(),
5198
+ import { z as z13 } from "zod";
5199
+ var googleWriteModeSchema = z13.enum(["live", "simulated"]);
5200
+ var googleDraftOpResultSchema = z13.object({
5201
+ status: z13.enum(["applied", "simulated", "failed", "skipped"]),
5202
+ resourceName: z13.string().optional(),
5203
+ error: z13.string().optional(),
5204
+ skippedBecause: z13.string().optional(),
5205
+ executedAt: z13.number().optional()
5206
+ });
5207
+ var googleDraftStageRequestSchema = z13.object({
5208
+ chatId: z13.string(),
4993
5209
  op: googleDraftOpInputSchema
4994
5210
  });
4995
- var googleDraftStageResponseSchema = z12.object({
4996
- staged: z12.literal(true),
4997
- ref: z12.string(),
5211
+ var googleDraftStageResponseSchema = z13.object({
5212
+ staged: z13.literal(true),
5213
+ ref: z13.string(),
4998
5214
  kind: googleDraftOpKindSchema,
4999
5215
  mode: googleWriteModeSchema,
5000
- dependsOn: z12.array(z12.string()),
5001
- summary: z12.string(),
5002
- warnings: z12.array(z12.string()),
5216
+ dependsOn: z13.array(z13.string()),
5217
+ summary: z13.string(),
5218
+ warnings: z13.array(z13.string()),
5003
5219
  /** True when the op amended an already-staged op in place instead of appending a new one. */
5004
- amended: z12.boolean().optional()
5220
+ amended: z13.boolean().optional()
5005
5221
  });
5006
- var googleDraftAmendRequestSchema = z12.object({
5007
- chatId: z12.string(),
5008
- ref: z12.string(),
5009
- patch: z12.record(z12.string(), z12.unknown())
5222
+ var googleDraftAmendRequestSchema = z13.object({
5223
+ chatId: z13.string(),
5224
+ ref: z13.string(),
5225
+ patch: z13.record(z13.string(), z13.unknown())
5010
5226
  });
5011
- var googleDraftShowRequestSchema = z12.object({
5012
- chatId: z12.string(),
5013
- ref: z12.string()
5227
+ var googleDraftShowRequestSchema = z13.object({
5228
+ chatId: z13.string(),
5229
+ ref: z13.string()
5014
5230
  });
5015
5231
  var GOOGLE_DRAFT_BATCH_MAX = 500;
5016
- var googleDraftStageBatchRequestSchema = z12.object({
5017
- chatId: z12.string(),
5018
- ops: z12.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
5232
+ var googleDraftStageBatchRequestSchema = z13.object({
5233
+ chatId: z13.string(),
5234
+ ops: z13.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
5019
5235
  });
5020
- var googleDraftStageBatchResponseSchema = z12.object({
5021
- staged: z12.literal(true),
5236
+ var googleDraftStageBatchResponseSchema = z13.object({
5237
+ staged: z13.literal(true),
5022
5238
  mode: googleWriteModeSchema,
5023
- count: z12.number(),
5024
- ops: z12.array(
5025
- z12.object({
5026
- ref: z12.string(),
5239
+ count: z13.number(),
5240
+ ops: z13.array(
5241
+ z13.object({
5242
+ ref: z13.string(),
5027
5243
  kind: googleDraftOpKindSchema,
5028
- dependsOn: z12.array(z12.string()),
5029
- summary: z12.string(),
5030
- warnings: z12.array(z12.string())
5244
+ dependsOn: z13.array(z13.string()),
5245
+ summary: z13.string(),
5246
+ warnings: z13.array(z13.string())
5031
5247
  })
5032
5248
  )
5033
5249
  });
5034
- var googleDraftOpViewSchema = z12.object({
5035
- ref: z12.string(),
5250
+ var googleDraftOpViewSchema = z13.object({
5251
+ ref: z13.string(),
5036
5252
  kind: googleDraftOpKindSchema,
5037
- customerId: z12.string(),
5038
- target: z12.string().optional(),
5039
- dependsOn: z12.array(z12.string()),
5040
- summary: z12.string(),
5041
- stagedAt: z12.number(),
5253
+ customerId: z13.string(),
5254
+ target: z13.string().optional(),
5255
+ dependsOn: z13.array(z13.string()),
5256
+ summary: z13.string(),
5257
+ stagedAt: z13.number(),
5042
5258
  result: googleDraftOpResultSchema.optional()
5043
5259
  });
5044
- var googleDraftShowResponseSchema = z12.object({
5260
+ var googleDraftShowResponseSchema = z13.object({
5045
5261
  op: googleDraftOpViewSchema.extend({
5046
- payload: z12.unknown().optional(),
5047
- warnings: z12.array(z12.string()).optional(),
5048
- annotations: z12.unknown().optional()
5262
+ payload: z13.unknown().optional(),
5263
+ warnings: z13.array(z13.string()).optional(),
5264
+ annotations: z13.unknown().optional()
5049
5265
  })
5050
5266
  });
5051
- var googleDraftListRequestSchema = z12.object({
5052
- chatId: z12.string()
5267
+ var googleDraftListRequestSchema = z13.object({
5268
+ chatId: z13.string()
5053
5269
  });
5054
- var googleDraftAdvisorySchema = z12.object({
5055
- scope: z12.enum(["campaign", "adGroup"]),
5056
- message: z12.string()
5270
+ var googleDraftAdvisorySchema = z13.object({
5271
+ scope: z13.enum(["campaign", "adGroup"]),
5272
+ message: z13.string()
5057
5273
  });
5058
- var googleDraftStatusCollectionSchema = z12.object({
5059
- label: z12.string(),
5060
- added: z12.number(),
5061
- removed: z12.number(),
5062
- existing: z12.number()
5274
+ var googleDraftStatusCollectionSchema = z13.object({
5275
+ label: z13.string(),
5276
+ added: z13.number(),
5277
+ removed: z13.number(),
5278
+ existing: z13.number()
5063
5279
  });
5064
- var googleDraftChangeOperationSchema = z12.enum(["create", "update", "pause", "resume", "remove"]);
5065
- var googleDraftStatusNodeSchema = z12.lazy(
5066
- () => z12.object({
5067
- entity: z12.string(),
5068
- name: z12.string(),
5280
+ var googleDraftChangeOperationSchema = z13.enum(["create", "update", "pause", "resume", "remove"]);
5281
+ var googleDraftStatusNodeSchema = z13.lazy(
5282
+ () => z13.object({
5283
+ entity: z13.string(),
5284
+ name: z13.string(),
5069
5285
  operation: googleDraftChangeOperationSchema.optional(),
5070
- existing: z12.boolean(),
5071
- collections: z12.array(googleDraftStatusCollectionSchema),
5072
- children: z12.array(googleDraftStatusNodeSchema),
5073
- warnings: z12.array(z12.string()).optional()
5286
+ existing: z13.boolean(),
5287
+ collections: z13.array(googleDraftStatusCollectionSchema),
5288
+ children: z13.array(googleDraftStatusNodeSchema),
5289
+ warnings: z13.array(z13.string()).optional()
5074
5290
  })
5075
5291
  );
5076
- var googleDraftListResponseSchema = z12.object({
5077
- status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
5292
+ var googleDraftListResponseSchema = z13.object({
5293
+ status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
5078
5294
  mode: googleWriteModeSchema,
5079
- count: z12.number(),
5080
- ops: z12.array(googleDraftOpViewSchema),
5295
+ count: z13.number(),
5296
+ ops: z13.array(googleDraftOpViewSchema),
5081
5297
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5082
- tree: z12.array(googleDraftStatusNodeSchema).optional(),
5298
+ tree: z13.array(googleDraftStatusNodeSchema).optional(),
5083
5299
  /** Non-blocking completeness advisories for the whole draft. */
5084
- advisories: z12.array(googleDraftAdvisorySchema).optional()
5300
+ advisories: z13.array(googleDraftAdvisorySchema).optional()
5085
5301
  });
5086
- var googleDraftRemoveRequestSchema = z12.object({
5087
- chatId: z12.string(),
5088
- ref: z12.string()
5302
+ var googleDraftRemoveRequestSchema = z13.object({
5303
+ chatId: z13.string(),
5304
+ ref: z13.string()
5089
5305
  });
5090
- var googleDraftRemoveResponseSchema = z12.object({
5306
+ var googleDraftRemoveResponseSchema = z13.object({
5091
5307
  /** The requested ref plus any dependents removed by cascade. */
5092
- removed: z12.array(z12.string())
5308
+ removed: z13.array(z13.string())
5093
5309
  });
5094
- var googleDraftClearRequestSchema = z12.object({
5095
- chatId: z12.string()
5310
+ var googleDraftClearRequestSchema = z13.object({
5311
+ chatId: z13.string()
5096
5312
  });
5097
- var googleDraftClearResponseSchema = z12.object({
5098
- cleared: z12.number()
5313
+ var googleDraftClearResponseSchema = z13.object({
5314
+ cleared: z13.number()
5099
5315
  });
5100
- var googleFieldErrorSchema = z12.object({
5101
- path: z12.string(),
5102
- message: z12.string()
5316
+ var googleFieldErrorSchema = z13.object({
5317
+ path: z13.string(),
5318
+ message: z13.string()
5103
5319
  });
5104
- var googleDraftErrorResponseSchema = z12.object({
5105
- code: z12.string(),
5106
- error: z12.string(),
5107
- fields: z12.array(googleFieldErrorSchema).optional()
5320
+ var googleDraftErrorResponseSchema = z13.object({
5321
+ code: z13.string(),
5322
+ error: z13.string(),
5323
+ fields: z13.array(googleFieldErrorSchema).optional()
5108
5324
  });
5109
5325
 
5110
5326
  // src/commands/ads/google/draft-status.ts
@@ -11147,17 +11363,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11147
11363
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11148
11364
 
11149
11365
  // ../api/src/ads-meta/ops.ts
11150
- import { z as z13 } from "zod";
11151
- var tempRefSchema3 = z13.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11152
- var parentRefSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11153
- var moneySchema2 = z13.object({
11154
- amount: z13.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11155
- currencyCode: z13.string().length(3).optional()
11156
- });
11157
- var httpsUrlSchema3 = z13.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11158
- var bakerMediaIdSchema2 = z13.string().min(1);
11159
- var stageableStatusSchema3 = z13.enum(STAGEABLE_CREATE_STATUSES3);
11160
- var updateStatusSchema = z13.enum(UPDATE_STATUSES);
11366
+ import { z as z14 } from "zod";
11367
+ var tempRefSchema3 = z14.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11368
+ var parentRefSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11369
+ var moneySchema2 = z14.object({
11370
+ 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"),
11371
+ currencyCode: z14.string().length(3).optional()
11372
+ });
11373
+ var httpsUrlSchema3 = z14.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11374
+ var bakerMediaIdSchema2 = z14.string().min(1);
11375
+ var stageableStatusSchema3 = z14.enum(STAGEABLE_CREATE_STATUSES3);
11376
+ var updateStatusSchema = z14.enum(UPDATE_STATUSES);
11161
11377
  function currencyMinimums2(currencyCode) {
11162
11378
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11163
11379
  }
@@ -11169,50 +11385,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
11169
11385
  }
11170
11386
  }
11171
11387
  }
11172
- var geoLocationsSchema = z13.object({
11173
- countries: z13.array(z13.string().length(2)).optional(),
11174
- regions: z13.array(z13.object({ key: z13.string() })).optional(),
11175
- cities: z13.array(z13.object({ key: z13.string(), radius: z13.number().optional(), distance_unit: z13.string().optional() })).optional(),
11176
- zips: z13.array(z13.object({ key: z13.string() })).optional(),
11177
- location_types: z13.array(z13.string()).optional()
11178
- }).catchall(z13.unknown());
11179
- var idNameSchema = z13.object({ id: z13.string(), name: z13.string().optional() });
11180
- var metaTargetingSchema = z13.object({
11388
+ var geoLocationsSchema = z14.object({
11389
+ countries: z14.array(z14.string().length(2)).optional(),
11390
+ regions: z14.array(z14.object({ key: z14.string() })).optional(),
11391
+ cities: z14.array(z14.object({ key: z14.string(), radius: z14.number().optional(), distance_unit: z14.string().optional() })).optional(),
11392
+ zips: z14.array(z14.object({ key: z14.string() })).optional(),
11393
+ location_types: z14.array(z14.string()).optional()
11394
+ }).catchall(z14.unknown());
11395
+ var idNameSchema = z14.object({ id: z14.string(), name: z14.string().optional() });
11396
+ var metaTargetingSchema = z14.object({
11181
11397
  geo_locations: geoLocationsSchema.optional(),
11182
11398
  excluded_geo_locations: geoLocationsSchema.optional(),
11183
- age_min: z13.number().int().min(13).max(65).optional(),
11184
- age_max: z13.number().int().min(13).max(65).optional(),
11185
- genders: z13.array(z13.union([z13.literal(1), z13.literal(2)])).optional(),
11186
- locales: z13.array(z13.number().int()).optional(),
11187
- interests: z13.array(idNameSchema).optional(),
11188
- behaviors: z13.array(idNameSchema).optional(),
11189
- custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11190
- excluded_custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11191
- flexible_spec: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
11192
- exclusions: z13.record(z13.string(), z13.unknown()).optional(),
11193
- publisher_platforms: z13.array(z13.string()).optional(),
11194
- facebook_positions: z13.array(z13.string()).optional(),
11195
- instagram_positions: z13.array(z13.string()).optional(),
11196
- audience_network_positions: z13.array(z13.string()).optional(),
11197
- messenger_positions: z13.array(z13.string()).optional(),
11198
- device_platforms: z13.array(z13.string()).optional(),
11199
- targeting_automation: z13.object({ advantage_audience: z13.union([z13.literal(0), z13.literal(1)]) }).partial().optional()
11200
- }).catchall(z13.unknown());
11201
- var specialAdCategoriesSchema = z13.array(z13.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11202
- var campaignCreateSchema3 = z13.object({
11203
- name: z13.string().min(1).max(META_LIMITS.campaign.nameMax),
11204
- objective: z13.enum(OBJECTIVES),
11399
+ age_min: z14.number().int().min(13).max(65).optional(),
11400
+ age_max: z14.number().int().min(13).max(65).optional(),
11401
+ genders: z14.array(z14.union([z14.literal(1), z14.literal(2)])).optional(),
11402
+ locales: z14.array(z14.number().int()).optional(),
11403
+ interests: z14.array(idNameSchema).optional(),
11404
+ behaviors: z14.array(idNameSchema).optional(),
11405
+ custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
11406
+ excluded_custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
11407
+ flexible_spec: z14.array(z14.record(z14.string(), z14.unknown())).optional(),
11408
+ exclusions: z14.record(z14.string(), z14.unknown()).optional(),
11409
+ publisher_platforms: z14.array(z14.string()).optional(),
11410
+ facebook_positions: z14.array(z14.string()).optional(),
11411
+ instagram_positions: z14.array(z14.string()).optional(),
11412
+ audience_network_positions: z14.array(z14.string()).optional(),
11413
+ messenger_positions: z14.array(z14.string()).optional(),
11414
+ device_platforms: z14.array(z14.string()).optional(),
11415
+ targeting_automation: z14.object({ advantage_audience: z14.union([z14.literal(0), z14.literal(1)]) }).partial().optional()
11416
+ }).catchall(z14.unknown());
11417
+ var specialAdCategoriesSchema = z14.array(z14.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11418
+ var campaignCreateSchema3 = z14.object({
11419
+ name: z14.string().min(1).max(META_LIMITS.campaign.nameMax),
11420
+ objective: z14.enum(OBJECTIVES),
11205
11421
  status: stageableStatusSchema3.default("PAUSED"),
11206
11422
  special_ad_categories: specialAdCategoriesSchema,
11207
- special_ad_category_country: z13.array(z13.string().length(2)).optional(),
11208
- buying_type: z13.enum(BUYING_TYPES).default("AUCTION"),
11209
- bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11423
+ special_ad_category_country: z14.array(z14.string().length(2)).optional(),
11424
+ buying_type: z14.enum(BUYING_TYPES).default("AUCTION"),
11425
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11210
11426
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11211
11427
  dailyBudget: moneySchema2.optional(),
11212
11428
  lifetimeBudget: moneySchema2.optional(),
11213
11429
  spendCap: moneySchema2.optional(),
11214
- start_time: z13.number().int().positive().optional(),
11215
- stop_time: z13.number().int().positive().optional()
11430
+ start_time: z14.number().int().positive().optional(),
11431
+ stop_time: z14.number().int().positive().optional()
11216
11432
  }).superRefine((p, ctx) => {
11217
11433
  if (p.dailyBudget && p.lifetimeBudget) {
11218
11434
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11222,15 +11438,15 @@ var campaignCreateSchema3 = z13.object({
11222
11438
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11223
11439
  }
11224
11440
  });
11225
- var campaignUpdateSchema3 = z13.object({
11226
- name: z13.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11441
+ var campaignUpdateSchema3 = z14.object({
11442
+ name: z14.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11227
11443
  status: updateStatusSchema.optional(),
11228
- bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11444
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11229
11445
  dailyBudget: moneySchema2.optional(),
11230
11446
  lifetimeBudget: moneySchema2.optional(),
11231
11447
  spendCap: moneySchema2.optional(),
11232
- start_time: z13.number().int().positive().optional(),
11233
- stop_time: z13.number().int().positive().optional()
11448
+ start_time: z14.number().int().positive().optional(),
11449
+ stop_time: z14.number().int().positive().optional()
11234
11450
  }).superRefine((p, ctx) => {
11235
11451
  if (!Object.values(p).some((val) => val !== void 0)) {
11236
11452
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11240,38 +11456,38 @@ var campaignUpdateSchema3 = z13.object({
11240
11456
  }
11241
11457
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11242
11458
  });
11243
- var promotedObjectSchema = z13.object({
11459
+ var promotedObjectSchema = z14.object({
11244
11460
  page_id: parentRefSchema2.optional(),
11245
- pixel_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11246
- custom_event_type: z13.enum(CUSTOM_EVENT_TYPES).optional(),
11247
- application_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11248
- object_store_url: z13.string().url().optional(),
11249
- product_catalog_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11250
- product_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11251
- whatsapp_phone_number: z13.string().optional(),
11252
- offline_conversion_data_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional()
11461
+ pixel_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11462
+ custom_event_type: z14.enum(CUSTOM_EVENT_TYPES).optional(),
11463
+ application_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11464
+ object_store_url: z14.string().url().optional(),
11465
+ product_catalog_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11466
+ product_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11467
+ whatsapp_phone_number: z14.string().optional(),
11468
+ offline_conversion_data_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional()
11253
11469
  }).partial();
11254
- var attributionSpecSchema = z13.array(
11255
- z13.object({
11256
- event_type: z13.enum(ATTRIBUTION_EVENT_TYPES),
11257
- window_days: z13.union([z13.literal(1), z13.literal(7), z13.literal(28)])
11470
+ var attributionSpecSchema = z14.array(
11471
+ z14.object({
11472
+ event_type: z14.enum(ATTRIBUTION_EVENT_TYPES),
11473
+ window_days: z14.union([z14.literal(1), z14.literal(7), z14.literal(28)])
11258
11474
  })
11259
11475
  );
11260
11476
  var adSetFields = {
11261
- name: z13.string().min(1).max(META_LIMITS.adSet.nameMax),
11477
+ name: z14.string().min(1).max(META_LIMITS.adSet.nameMax),
11262
11478
  campaign_id: parentRefSchema2,
11263
11479
  status: stageableStatusSchema3.default("PAUSED"),
11264
11480
  dailyBudget: moneySchema2.optional(),
11265
11481
  lifetimeBudget: moneySchema2.optional(),
11266
11482
  bidAmount: moneySchema2.optional(),
11267
- bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11268
- billing_event: z13.enum(BILLING_EVENTS),
11269
- optimization_goal: z13.enum(OPTIMIZATION_GOALS),
11270
- destination_type: z13.enum(DESTINATION_TYPES).optional(),
11483
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11484
+ billing_event: z14.enum(BILLING_EVENTS),
11485
+ optimization_goal: z14.enum(OPTIMIZATION_GOALS),
11486
+ destination_type: z14.enum(DESTINATION_TYPES).optional(),
11271
11487
  promoted_object: promotedObjectSchema.optional(),
11272
11488
  attribution_spec: attributionSpecSchema.optional(),
11273
- start_time: z13.number().int().positive().optional(),
11274
- end_time: z13.number().int().positive().optional(),
11489
+ start_time: z14.number().int().positive().optional(),
11490
+ end_time: z14.number().int().positive().optional(),
11275
11491
  targeting: metaTargetingSchema
11276
11492
  };
11277
11493
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11289,22 +11505,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11289
11505
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11290
11506
  }
11291
11507
  }
11292
- var adSetCreateSchema = z13.object(adSetFields).superRefine((p, ctx) => {
11508
+ var adSetCreateSchema = z14.object(adSetFields).superRefine((p, ctx) => {
11293
11509
  validateAdSetBudgetAndBid(p, ctx);
11294
11510
  });
11295
- var adSetUpdateSchema = z13.object({
11511
+ var adSetUpdateSchema = z14.object({
11296
11512
  name: adSetFields.name.optional(),
11297
11513
  status: updateStatusSchema.optional(),
11298
11514
  dailyBudget: moneySchema2.optional(),
11299
11515
  lifetimeBudget: moneySchema2.optional(),
11300
11516
  bidAmount: moneySchema2.optional(),
11301
- bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11302
- optimization_goal: z13.enum(OPTIMIZATION_GOALS).optional(),
11303
- destination_type: z13.enum(DESTINATION_TYPES).optional(),
11517
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11518
+ optimization_goal: z14.enum(OPTIMIZATION_GOALS).optional(),
11519
+ destination_type: z14.enum(DESTINATION_TYPES).optional(),
11304
11520
  promoted_object: promotedObjectSchema.optional(),
11305
11521
  attribution_spec: attributionSpecSchema.optional(),
11306
- start_time: z13.number().int().positive().optional(),
11307
- end_time: z13.number().int().positive().optional(),
11522
+ start_time: z14.number().int().positive().optional(),
11523
+ end_time: z14.number().int().positive().optional(),
11308
11524
  targeting: metaTargetingSchema.optional()
11309
11525
  }).superRefine((p, ctx) => {
11310
11526
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11312,38 +11528,38 @@ var adSetUpdateSchema = z13.object({
11312
11528
  }
11313
11529
  validateAdSetBudgetAndBid(p, ctx);
11314
11530
  });
11315
- var messageSchema = z13.string().min(1).max(META_LIMITS.creative.messageHardMax);
11316
- var headlineSchema2 = z13.string().min(1).max(META_LIMITS.creative.headlineMax);
11317
- var descriptionSchema = z13.string().min(1).max(META_LIMITS.creative.descriptionMax);
11318
- var callToActionSchema = z13.object({
11319
- type: z13.enum(CTA_TYPES2),
11531
+ var messageSchema = z14.string().min(1).max(META_LIMITS.creative.messageHardMax);
11532
+ var headlineSchema2 = z14.string().min(1).max(META_LIMITS.creative.headlineMax);
11533
+ var descriptionSchema = z14.string().min(1).max(META_LIMITS.creative.descriptionMax);
11534
+ var callToActionSchema = z14.object({
11535
+ type: z14.enum(CTA_TYPES2),
11320
11536
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11321
11537
  link: httpsUrlSchema3.optional()
11322
11538
  });
11323
- var creativeEnhancementsSchema = z13.object({
11324
- standardEnhancements: z13.enum(ENROLL_STATUSES).optional(),
11325
- features: z13.record(z13.string(), z13.enum(ENROLL_STATUSES)).optional()
11539
+ var creativeEnhancementsSchema = z14.object({
11540
+ standardEnhancements: z14.enum(ENROLL_STATUSES).optional(),
11541
+ features: z14.record(z14.string(), z14.enum(ENROLL_STATUSES)).optional()
11326
11542
  });
11327
11543
  var creativeSharedFields = {
11328
- name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11544
+ name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
11329
11545
  /** Facebook Page id backing the ad's identity. */
11330
11546
  page_id: parentRefSchema2,
11331
11547
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11332
- instagram_user_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11548
+ instagram_user_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11333
11549
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11334
- url_tags: z13.string().max(1e3).optional(),
11550
+ url_tags: z14.string().max(1e3).optional(),
11335
11551
  enhancements: creativeEnhancementsSchema.optional()
11336
11552
  };
11337
11553
  var imageMediaFields = {
11338
- imageHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11554
+ imageHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
11339
11555
  imageRef: tempRefSchema3.optional()
11340
11556
  };
11341
11557
  var videoMediaFields = {
11342
- videoId: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11558
+ videoId: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11343
11559
  videoRef: tempRefSchema3.optional(),
11344
11560
  /** Thumbnail for a video creative — image hash, ref, or public url. */
11345
- thumbnailHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11346
- imageUrl: z13.string().url().optional()
11561
+ thumbnailHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
11562
+ imageUrl: z14.string().url().optional()
11347
11563
  };
11348
11564
  function countImageRefs(p) {
11349
11565
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11351,8 +11567,8 @@ function countImageRefs(p) {
11351
11567
  function countVideoRefs(p) {
11352
11568
  return [p.videoId, p.videoRef].filter(Boolean).length;
11353
11569
  }
11354
- var singleCreativeSchema = z13.object({
11355
- creativeType: z13.literal("single"),
11570
+ var singleCreativeSchema = z14.object({
11571
+ creativeType: z14.literal("single"),
11356
11572
  ...creativeSharedFields,
11357
11573
  /** Primary text. */
11358
11574
  message: messageSchema,
@@ -11361,7 +11577,7 @@ var singleCreativeSchema = z13.object({
11361
11577
  headline: headlineSchema2.optional(),
11362
11578
  description: descriptionSchema.optional(),
11363
11579
  /** Display URL / caption shown under the headline. */
11364
- caption: z13.string().max(255).optional(),
11580
+ caption: z14.string().max(255).optional(),
11365
11581
  call_to_action: callToActionSchema.optional(),
11366
11582
  ...imageMediaFields,
11367
11583
  ...videoMediaFields
@@ -11385,10 +11601,10 @@ var singleCreativeSchema = z13.object({
11385
11601
  });
11386
11602
  }
11387
11603
  });
11388
- var carouselCardSchema = z13.object({
11604
+ var carouselCardSchema = z14.object({
11389
11605
  link: httpsUrlSchema3,
11390
- headline: z13.string().max(META_LIMITS.creative.headlineMax).optional(),
11391
- description: z13.string().max(META_LIMITS.creative.descriptionMax).optional(),
11606
+ headline: z14.string().max(META_LIMITS.creative.headlineMax).optional(),
11607
+ description: z14.string().max(META_LIMITS.creative.descriptionMax).optional(),
11392
11608
  call_to_action: callToActionSchema.optional(),
11393
11609
  ...imageMediaFields,
11394
11610
  ...videoMediaFields
@@ -11408,35 +11624,35 @@ var carouselCardSchema = z13.object({
11408
11624
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11409
11625
  }
11410
11626
  });
11411
- var carouselCreativeSchema2 = z13.object({
11412
- creativeType: z13.literal("carousel"),
11627
+ var carouselCreativeSchema2 = z14.object({
11628
+ creativeType: z14.literal("carousel"),
11413
11629
  ...creativeSharedFields,
11414
11630
  message: messageSchema,
11415
11631
  /** Optional "see more" card destination applied when a card has no own link. */
11416
11632
  link: httpsUrlSchema3.optional(),
11417
11633
  call_to_action: callToActionSchema.optional(),
11418
- cards: z13.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11634
+ cards: z14.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11419
11635
  });
11420
- var dynamicImageSchema = z13.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11421
- var dynamicVideoSchema = z13.object({
11636
+ var dynamicImageSchema = z14.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11637
+ var dynamicVideoSchema = z14.object({
11422
11638
  videoId: videoMediaFields.videoId,
11423
11639
  videoRef: videoMediaFields.videoRef,
11424
11640
  thumbnailHash: videoMediaFields.thumbnailHash
11425
11641
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11426
11642
  var DYN = META_LIMITS.creative;
11427
- var dynamicCreativeSchema = z13.object({
11428
- creativeType: z13.literal("dynamic"),
11643
+ var dynamicCreativeSchema = z14.object({
11644
+ creativeType: z14.literal("dynamic"),
11429
11645
  ...creativeSharedFields,
11430
- bodies: z13.array(z13.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11431
- titles: z13.array(z13.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11432
- descriptions: z13.array(z13.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11433
- images: z13.array(dynamicImageSchema).optional(),
11434
- videos: z13.array(dynamicVideoSchema).optional(),
11435
- ad_formats: z13.array(z13.enum(AD_FORMATS2)).min(1),
11436
- call_to_action_types: z13.array(z13.enum(CTA_TYPES2)).optional(),
11437
- link_urls: z13.array(z13.object({ website_url: httpsUrlSchema3, display_url: z13.string().optional() })).min(1),
11646
+ bodies: z14.array(z14.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11647
+ titles: z14.array(z14.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11648
+ descriptions: z14.array(z14.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11649
+ images: z14.array(dynamicImageSchema).optional(),
11650
+ videos: z14.array(dynamicVideoSchema).optional(),
11651
+ ad_formats: z14.array(z14.enum(AD_FORMATS2)).min(1),
11652
+ call_to_action_types: z14.array(z14.enum(CTA_TYPES2)).optional(),
11653
+ link_urls: z14.array(z14.object({ website_url: httpsUrlSchema3, display_url: z14.string().optional() })).min(1),
11438
11654
  /** Multi-language / placement customization — structural passthrough for v1. */
11439
- asset_customization_rules: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11655
+ asset_customization_rules: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11440
11656
  }).superRefine((p, ctx) => {
11441
11657
  if (!(p.images?.length || p.videos?.length)) {
11442
11658
  ctx.addIssue({
@@ -11446,57 +11662,57 @@ var dynamicCreativeSchema = z13.object({
11446
11662
  });
11447
11663
  }
11448
11664
  });
11449
- var existingPostCreativeSchema = z13.object({
11450
- creativeType: z13.literal("existing_post"),
11665
+ var existingPostCreativeSchema = z14.object({
11666
+ creativeType: z14.literal("existing_post"),
11451
11667
  name: creativeSharedFields.name,
11452
11668
  /** "<page_id>_<post_id>" object story id of the post to promote. */
11453
- object_story_id: z13.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11669
+ object_story_id: z14.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11454
11670
  instagram_user_id: creativeSharedFields.instagram_user_id,
11455
11671
  url_tags: creativeSharedFields.url_tags,
11456
11672
  enhancements: creativeSharedFields.enhancements
11457
11673
  });
11458
- var creativeContentSchema2 = z13.discriminatedUnion("creativeType", [
11674
+ var creativeContentSchema2 = z14.discriminatedUnion("creativeType", [
11459
11675
  singleCreativeSchema,
11460
11676
  carouselCreativeSchema2,
11461
11677
  dynamicCreativeSchema,
11462
11678
  existingPostCreativeSchema
11463
11679
  ]);
11464
11680
  var adCreativeCreateSchema = creativeContentSchema2;
11465
- var adCreativeUpdateSchema = z13.object({
11466
- name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11681
+ var adCreativeUpdateSchema = z14.object({
11682
+ name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
11467
11683
  status: updateStatusSchema.optional(),
11468
11684
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11469
- content: z13.record(z13.string(), z13.unknown()).optional()
11685
+ content: z14.record(z14.string(), z14.unknown()).optional()
11470
11686
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11471
- var adCreateSchema2 = z13.object({
11472
- name: z13.string().min(1).max(META_LIMITS.ad.nameMax),
11687
+ var adCreateSchema2 = z14.object({
11688
+ name: z14.string().min(1).max(META_LIMITS.ad.nameMax),
11473
11689
  adset_id: parentRefSchema2,
11474
11690
  status: stageableStatusSchema3.default("PAUSED"),
11475
- creative: z13.object({ creative_id: parentRefSchema2 }),
11691
+ creative: z14.object({ creative_id: parentRefSchema2 }),
11476
11692
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11477
- tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11693
+ tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11478
11694
  });
11479
- var adUpdateSchema2 = z13.object({
11480
- name: z13.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11695
+ var adUpdateSchema2 = z14.object({
11696
+ name: z14.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11481
11697
  status: updateStatusSchema.optional(),
11482
11698
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
11483
- creative: z13.object({ creative_id: parentRefSchema2 }).optional(),
11484
- tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11699
+ creative: z14.object({ creative_id: parentRefSchema2 }).optional(),
11700
+ tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11485
11701
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11486
- var lookalikeSpecSchema = z13.object({
11487
- origin: z13.array(z13.object({ id: parentRefSchema2 })).min(1),
11488
- ratio: z13.number().min(0.01).max(0.2).optional(),
11489
- country: z13.string().length(2).optional()
11490
- });
11491
- var customAudienceCreateSchema = z13.object({
11492
- name: z13.string().min(1).max(META_LIMITS.audience.nameMax),
11493
- subtype: z13.enum(CUSTOM_AUDIENCE_SUBTYPES),
11494
- description: z13.string().max(500).optional(),
11495
- customer_file_source: z13.string().optional(),
11496
- retention_days: z13.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11702
+ var lookalikeSpecSchema = z14.object({
11703
+ origin: z14.array(z14.object({ id: parentRefSchema2 })).min(1),
11704
+ ratio: z14.number().min(0.01).max(0.2).optional(),
11705
+ country: z14.string().length(2).optional()
11706
+ });
11707
+ var customAudienceCreateSchema = z14.object({
11708
+ name: z14.string().min(1).max(META_LIMITS.audience.nameMax),
11709
+ subtype: z14.enum(CUSTOM_AUDIENCE_SUBTYPES),
11710
+ description: z14.string().max(500).optional(),
11711
+ customer_file_source: z14.string().optional(),
11712
+ retention_days: z14.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11497
11713
  lookalike_spec: lookalikeSpecSchema.optional(),
11498
11714
  /** Website/engagement rule — structural passthrough validated by Meta. */
11499
- rule: z13.record(z13.string(), z13.unknown()).optional()
11715
+ rule: z14.record(z14.string(), z14.unknown()).optional()
11500
11716
  }).superRefine((p, ctx) => {
11501
11717
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11502
11718
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11505,16 +11721,16 @@ var customAudienceCreateSchema = z13.object({
11505
11721
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11506
11722
  }
11507
11723
  });
11508
- var customAudienceUpdateSchema = z13.object({
11509
- name: z13.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11510
- description: z13.string().max(500).optional()
11724
+ var customAudienceUpdateSchema = z14.object({
11725
+ name: z14.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11726
+ description: z14.string().max(500).optional()
11511
11727
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11512
- var mediaUploadSchema = z13.object({
11513
- kind: z13.enum(MEDIA_KINDS),
11728
+ var mediaUploadSchema = z14.object({
11729
+ kind: z14.enum(MEDIA_KINDS),
11514
11730
  bakerImageId: bakerMediaIdSchema2.optional(),
11515
11731
  bakerVideoId: bakerMediaIdSchema2.optional(),
11516
11732
  /** Optional display name / filename hint. */
11517
- name: z13.string().max(255).optional()
11733
+ name: z14.string().max(255).optional()
11518
11734
  }).superRefine((p, ctx) => {
11519
11735
  if (p.kind === "image" && !p.bakerImageId) {
11520
11736
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11536,16 +11752,16 @@ var META_DRAFT_OP_KINDS = [
11536
11752
  "customAudience.update",
11537
11753
  "media.upload"
11538
11754
  ];
11539
- var metaDraftOpKindSchema = z13.enum(META_DRAFT_OP_KINDS);
11540
- var accountIdSchema2 = z13.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11541
- var updateTargetSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11755
+ var metaDraftOpKindSchema = z14.enum(META_DRAFT_OP_KINDS);
11756
+ var accountIdSchema2 = z14.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11757
+ var updateTargetSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11542
11758
  function createOp3(kind, payload) {
11543
- return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, payload });
11759
+ return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, payload });
11544
11760
  }
11545
11761
  function updateOp3(kind, payload) {
11546
- return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11762
+ return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11547
11763
  }
11548
- var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11764
+ var metaDraftOpInputSchema = z14.discriminatedUnion("kind", [
11549
11765
  createOp3("campaign.create", campaignCreateSchema3),
11550
11766
  updateOp3("campaign.update", campaignUpdateSchema3),
11551
11767
  createOp3("adSet.create", adSetCreateSchema),
@@ -11560,89 +11776,89 @@ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11560
11776
  ]);
11561
11777
 
11562
11778
  // ../api/src/ads-meta/wire.ts
11563
- import { z as z14 } from "zod";
11564
- var metaWriteModeSchema = z14.enum(["live", "simulated"]);
11565
- var metaDraftOpResultSchema = z14.object({
11566
- status: z14.enum(["applied", "simulated", "failed", "skipped"]),
11779
+ import { z as z15 } from "zod";
11780
+ var metaWriteModeSchema = z15.enum(["live", "simulated"]);
11781
+ var metaDraftOpResultSchema = z15.object({
11782
+ status: z15.enum(["applied", "simulated", "failed", "skipped"]),
11567
11783
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11568
- id: z14.string().optional(),
11784
+ id: z15.string().optional(),
11569
11785
  /** For media.upload ops: the resulting image hash. */
11570
- hash: z14.string().optional(),
11571
- error: z14.string().optional(),
11572
- skippedBecause: z14.string().optional(),
11573
- executedAt: z14.number().optional()
11786
+ hash: z15.string().optional(),
11787
+ error: z15.string().optional(),
11788
+ skippedBecause: z15.string().optional(),
11789
+ executedAt: z15.number().optional()
11574
11790
  });
11575
- var metaDraftStageRequestSchema = z14.object({
11576
- chatId: z14.string(),
11791
+ var metaDraftStageRequestSchema = z15.object({
11792
+ chatId: z15.string(),
11577
11793
  op: metaDraftOpInputSchema
11578
11794
  });
11579
- var metaDraftStageResponseSchema = z14.object({
11580
- staged: z14.literal(true),
11581
- ref: z14.string(),
11795
+ var metaDraftStageResponseSchema = z15.object({
11796
+ staged: z15.literal(true),
11797
+ ref: z15.string(),
11582
11798
  kind: metaDraftOpKindSchema,
11583
11799
  mode: metaWriteModeSchema,
11584
- dependsOn: z14.array(z14.string()),
11585
- summary: z14.string(),
11586
- warnings: z14.array(z14.string()),
11800
+ dependsOn: z15.array(z15.string()),
11801
+ summary: z15.string(),
11802
+ warnings: z15.array(z15.string()),
11587
11803
  /** True when the op amended an already-staged op in place instead of appending a new one. */
11588
- amended: z14.boolean().optional()
11589
- });
11590
- var metaDraftDuplicateRequestSchema = z14.object({
11591
- chatId: z14.string(),
11592
- accountId: z14.string(),
11593
- entity: z14.enum(["campaign", "adSet", "ad"]),
11594
- sourceId: z14.string(),
11595
- overrides: z14.record(z14.string(), z14.unknown()).optional(),
11804
+ amended: z15.boolean().optional()
11805
+ });
11806
+ var metaDraftDuplicateRequestSchema = z15.object({
11807
+ chatId: z15.string(),
11808
+ accountId: z15.string(),
11809
+ entity: z15.enum(["campaign", "adSet", "ad"]),
11810
+ sourceId: z15.string(),
11811
+ overrides: z15.record(z15.string(), z15.unknown()).optional(),
11596
11812
  /** Pause the original after the copy publishes. */
11597
- replace: z14.boolean().optional()
11813
+ replace: z15.boolean().optional()
11598
11814
  });
11599
- var metaDraftOpViewSchema = z14.object({
11600
- ref: z14.string(),
11815
+ var metaDraftOpViewSchema = z15.object({
11816
+ ref: z15.string(),
11601
11817
  kind: metaDraftOpKindSchema,
11602
- accountId: z14.string(),
11603
- target: z14.string().optional(),
11604
- dependsOn: z14.array(z14.string()),
11605
- summary: z14.string(),
11606
- stagedAt: z14.number(),
11818
+ accountId: z15.string(),
11819
+ target: z15.string().optional(),
11820
+ dependsOn: z15.array(z15.string()),
11821
+ summary: z15.string(),
11822
+ stagedAt: z15.number(),
11607
11823
  result: metaDraftOpResultSchema.optional()
11608
11824
  });
11609
- var metaDraftListRequestSchema = z14.object({
11610
- chatId: z14.string()
11825
+ var metaDraftListRequestSchema = z15.object({
11826
+ chatId: z15.string()
11611
11827
  });
11612
- var metaDraftAdvisorySchema = z14.object({
11613
- ref: z14.string(),
11614
- message: z14.string()
11828
+ var metaDraftAdvisorySchema = z15.object({
11829
+ ref: z15.string(),
11830
+ message: z15.string()
11615
11831
  });
11616
- var metaDraftListResponseSchema = z14.object({
11617
- status: z14.enum(["active", "publishing", "applied", "discarded", "none"]),
11832
+ var metaDraftListResponseSchema = z15.object({
11833
+ status: z15.enum(["active", "publishing", "applied", "discarded", "none"]),
11618
11834
  mode: metaWriteModeSchema,
11619
- count: z14.number(),
11620
- ops: z14.array(metaDraftOpViewSchema),
11835
+ count: z15.number(),
11836
+ ops: z15.array(metaDraftOpViewSchema),
11621
11837
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11622
- advisories: z14.array(metaDraftAdvisorySchema)
11838
+ advisories: z15.array(metaDraftAdvisorySchema)
11623
11839
  });
11624
- var metaDraftRemoveRequestSchema = z14.object({
11625
- chatId: z14.string(),
11626
- ref: z14.string()
11840
+ var metaDraftRemoveRequestSchema = z15.object({
11841
+ chatId: z15.string(),
11842
+ ref: z15.string()
11627
11843
  });
11628
- var metaDraftRemoveResponseSchema = z14.object({
11844
+ var metaDraftRemoveResponseSchema = z15.object({
11629
11845
  /** The requested ref plus any dependents removed by cascade. */
11630
- removed: z14.array(z14.string())
11846
+ removed: z15.array(z15.string())
11631
11847
  });
11632
- var metaDraftClearRequestSchema = z14.object({
11633
- chatId: z14.string()
11848
+ var metaDraftClearRequestSchema = z15.object({
11849
+ chatId: z15.string()
11634
11850
  });
11635
- var metaDraftClearResponseSchema = z14.object({
11636
- cleared: z14.number()
11851
+ var metaDraftClearResponseSchema = z15.object({
11852
+ cleared: z15.number()
11637
11853
  });
11638
- var metaFieldErrorSchema = z14.object({
11639
- path: z14.string(),
11640
- message: z14.string()
11854
+ var metaFieldErrorSchema = z15.object({
11855
+ path: z15.string(),
11856
+ message: z15.string()
11641
11857
  });
11642
- var metaDraftErrorResponseSchema = z14.object({
11643
- code: z14.string(),
11644
- error: z14.string(),
11645
- fields: z14.array(metaFieldErrorSchema).optional()
11858
+ var metaDraftErrorResponseSchema = z15.object({
11859
+ code: z15.string(),
11860
+ error: z15.string(),
11861
+ fields: z15.array(metaFieldErrorSchema).optional()
11646
11862
  });
11647
11863
 
11648
11864
  // src/commands/ads/meta/write-shared.ts
@@ -15055,7 +15271,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
15055
15271
  import { toCardinal as nwNl } from "n2words/nl-NL";
15056
15272
  import { toCardinal as nwPl } from "n2words/pl-PL";
15057
15273
  import { toCardinal as nwPt } from "n2words/pt-PT";
15058
- import { z as z15 } from "zod";
15274
+ import { z as z16 } from "zod";
15059
15275
 
15060
15276
  // src/engine/scaffold/lib/shoot-modes.ts
15061
15277
  var SHOOT_MODES = [
@@ -15391,71 +15607,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15391
15607
  "{{out.video}}"
15392
15608
  ];
15393
15609
  }
15394
- var FrameAsset = z15.object({ url: z15.string().optional() }).loose().optional();
15395
- var DialogueLine = z15.object({
15396
- speaker: z15.string().optional(),
15397
- line: z15.string().optional(),
15610
+ var FrameAsset = z16.object({ url: z16.string().optional() }).loose().optional();
15611
+ var DialogueLine = z16.object({
15612
+ speaker: z16.string().optional(),
15613
+ line: z16.string().optional(),
15398
15614
  // Absolute seconds on the source timeline (the deconstruct emits both).
15399
- start_s: z15.number().optional(),
15400
- end_s: z15.number().optional(),
15401
- delivery: z15.string().optional(),
15402
- voice_description: z15.string().optional(),
15615
+ start_s: z16.number().optional(),
15616
+ end_s: z16.number().optional(),
15617
+ delivery: z16.string().optional(),
15618
+ voice_description: z16.string().optional(),
15403
15619
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15404
15620
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15405
15621
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15406
15622
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15407
15623
  // the VO path; absent keeps the presence-based decision (old blueprints).
15408
- on_camera: z15.boolean().optional()
15624
+ on_camera: z16.boolean().optional()
15409
15625
  }).loose();
15410
- var Sfx = z15.object({
15411
- at_s: z15.number().optional(),
15412
- duration_s: z15.number().optional(),
15413
- sound_effect_prompt: z15.string().optional(),
15414
- description: z15.string().optional()
15626
+ var Sfx = z16.object({
15627
+ at_s: z16.number().optional(),
15628
+ duration_s: z16.number().optional(),
15629
+ sound_effect_prompt: z16.string().optional(),
15630
+ description: z16.string().optional()
15415
15631
  }).loose();
15416
- var CompositionRegion = z15.object({
15632
+ var CompositionRegion = z16.object({
15417
15633
  // full | top | bottom | left | right | inset
15418
- panel: z15.string().optional(),
15634
+ panel: z16.string().optional(),
15419
15635
  // 9-grid anchor for an `inset` presenter box.
15420
- position: z15.string().optional(),
15421
- is_presenter: z15.boolean().optional(),
15636
+ position: z16.string().optional(),
15637
+ is_presenter: z16.boolean().optional(),
15422
15638
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15423
- cast_ref: z15.string().optional(),
15639
+ cast_ref: z16.string().optional(),
15424
15640
  // What the region's content IS: camera | screen_capture | static_graphic |
15425
15641
  // generated. Authoritative for routing when present (regex-over-prose fallback
15426
15642
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15427
15643
  // overlay layer, never AI-generated.
15428
- kind: z15.string().optional(),
15644
+ kind: z16.string().optional(),
15429
15645
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15430
15646
  // screen_capture region shows. Two scenes share it only when they show the SAME
15431
15647
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15432
15648
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15433
15649
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15434
15650
  // instead of asking the operator for one screenshot that can't cover both.
15435
- surface_id: z15.string().optional(),
15651
+ surface_id: z16.string().optional(),
15436
15652
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15437
15653
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15438
15654
  // must re-composite, not paint into the surface.
15439
- nested: z15.array(z15.object({}).loose()).optional(),
15440
- summary: z15.string().optional(),
15441
- frame_prompt: z15.string().optional(),
15442
- motion_prompt: z15.string().optional()
15655
+ nested: z16.array(z16.object({}).loose()).optional(),
15656
+ summary: z16.string().optional(),
15657
+ frame_prompt: z16.string().optional(),
15658
+ motion_prompt: z16.string().optional()
15443
15659
  }).loose();
15444
- var SceneComposition = z15.object({
15660
+ var SceneComposition = z16.object({
15445
15661
  // full_frame (default) | split_screen | pip | keyed_overlay
15446
- layout: z15.string().optional(),
15662
+ layout: z16.string().optional(),
15447
15663
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15448
- split_axis: z15.string().optional(),
15449
- regions: z15.array(CompositionRegion).optional()
15664
+ split_axis: z16.string().optional(),
15665
+ regions: z16.array(CompositionRegion).optional()
15450
15666
  }).loose();
15451
- var CameraMotion = z15.object({ movement: z15.string().optional(), detail: z15.string().optional() }).loose();
15452
- var TranscriptWord = z15.object({ text: z15.string().optional() }).loose();
15453
- var Scene = z15.object({
15454
- start_s: z15.number().optional(),
15455
- end_s: z15.number().optional(),
15456
- duration_s: z15.number().optional(),
15457
- summary: z15.string().optional(),
15458
- action_detail: z15.string().optional(),
15667
+ var CameraMotion = z16.object({ movement: z16.string().optional(), detail: z16.string().optional() }).loose();
15668
+ var TranscriptWord = z16.object({ text: z16.string().optional() }).loose();
15669
+ var Scene = z16.object({
15670
+ start_s: z16.number().optional(),
15671
+ end_s: z16.number().optional(),
15672
+ duration_s: z16.number().optional(),
15673
+ summary: z16.string().optional(),
15674
+ action_detail: z16.string().optional(),
15459
15675
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15460
15676
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15461
15677
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15463,82 +15679,82 @@ var Scene = z15.object({
15463
15679
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15464
15680
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15465
15681
  // UGC/product mode; a human can override per scene by setting this.
15466
- shoot_mode: z15.string().optional(),
15682
+ shoot_mode: z16.string().optional(),
15467
15683
  // Diegetic ambient the clip's native audio should carry (no music). When
15468
15684
  // absent the scene falls back to its shoot mode's default ambience.
15469
- ambient: z15.string().optional(),
15685
+ ambient: z16.string().optional(),
15470
15686
  camera_motion: CameraMotion.optional(),
15471
- start_frame_prompt: z15.string().optional(),
15472
- end_frame_prompt: z15.string().optional(),
15473
- motion_prompt: z15.string().optional(),
15687
+ start_frame_prompt: z16.string().optional(),
15688
+ end_frame_prompt: z16.string().optional(),
15689
+ motion_prompt: z16.string().optional(),
15474
15690
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15475
15691
  // script re-craft checklist. Inferred from position when absent.
15476
- narrative_role: z15.string().optional(),
15692
+ narrative_role: z16.string().optional(),
15477
15693
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15478
15694
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15479
15695
  // into the hook's start-frame description so the generator renders that state,
15480
15696
  // not a calm influencer (CCA-11).
15481
- hook_mechanic: z15.object({ mechanic: z15.string().optional(), why_it_stops_scroll: z15.string().optional() }).loose().optional(),
15697
+ hook_mechanic: z16.object({ mechanic: z16.string().optional(), why_it_stops_scroll: z16.string().optional() }).loose().optional(),
15482
15698
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15483
- scene_setting: z15.string().optional(),
15699
+ scene_setting: z16.string().optional(),
15484
15700
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15485
15701
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15486
15702
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15487
15703
  // ignored (nothing follows it).
15488
- transition_out: z15.object({ type: z15.string().optional(), description: z15.string().optional() }).loose().optional(),
15489
- dialogue: z15.array(DialogueLine).optional(),
15490
- sfx: z15.array(Sfx).optional(),
15491
- overlays: z15.array(z15.unknown()).optional(),
15492
- floating_elements: z15.array(z15.unknown()).optional(),
15704
+ transition_out: z16.object({ type: z16.string().optional(), description: z16.string().optional() }).loose().optional(),
15705
+ dialogue: z16.array(DialogueLine).optional(),
15706
+ sfx: z16.array(Sfx).optional(),
15707
+ overlays: z16.array(z16.unknown()).optional(),
15708
+ floating_elements: z16.array(z16.unknown()).optional(),
15493
15709
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15494
15710
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15495
15711
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15496
15712
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
15497
- motion_level: z15.enum(["static", "subtle", "dynamic"]).optional(),
15498
- transcript_slice: z15.array(TranscriptWord).optional(),
15713
+ motion_level: z16.enum(["static", "subtle", "dynamic"]).optional(),
15714
+ transcript_slice: z16.array(TranscriptWord).optional(),
15499
15715
  start_frame_asset: FrameAsset,
15500
15716
  end_frame_asset: FrameAsset,
15501
15717
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15502
15718
  // previous one (the SAME physical shot, broken up only because it exceeded the
15503
15719
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15504
15720
  // start frame IS the previous scene's end frame — so the join is seamless.
15505
- continues_previous: z15.boolean().optional()
15721
+ continues_previous: z16.boolean().optional()
15506
15722
  }).loose();
15507
- var VideoBlueprint = z15.object({
15508
- source: z15.object({ aspect_ratio: z15.string().optional(), duration_s: z15.number().optional() }).loose().optional(),
15509
- global: z15.object({
15510
- music: z15.object({
15511
- present: z15.boolean().optional(),
15512
- music_prompt: z15.string().optional(),
15723
+ var VideoBlueprint = z16.object({
15724
+ source: z16.object({ aspect_ratio: z16.string().optional(), duration_s: z16.number().optional() }).loose().optional(),
15725
+ global: z16.object({
15726
+ music: z16.object({
15727
+ present: z16.boolean().optional(),
15728
+ music_prompt: z16.string().optional(),
15513
15729
  // Absolute second the music enters in the reference (the bed often
15514
15730
  // kicks in mid-ad, after the hook). We start the regenerated track here
15515
15731
  // instead of at 0 so the timing matches.
15516
- starts_at_s: z15.number().optional(),
15732
+ starts_at_s: z16.number().optional(),
15517
15733
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15518
15734
  // reference track. We never reuse it — only style the regenerated bed.
15519
- identified_track: z15.object({ title: z15.string().optional(), artist: z15.string().optional() }).loose().nullish()
15735
+ identified_track: z16.object({ title: z16.string().optional(), artist: z16.string().optional() }).loose().nullish()
15520
15736
  }).loose().optional(),
15521
- cast: z15.array(
15522
- z15.object({
15523
- id: z15.string().optional(),
15524
- description: z15.string().optional(),
15737
+ cast: z16.array(
15738
+ z16.object({
15739
+ id: z16.string().optional(),
15740
+ description: z16.string().optional(),
15525
15741
  // The deconstruct's note on the target-market localization (e.g. "native
15526
15742
  // French speaker") — read to derive the spoken-track language code.
15527
- market_localization_note: z15.string().optional()
15743
+ market_localization_note: z16.string().optional()
15528
15744
  }).loose()
15529
15745
  ).optional(),
15530
- voiceover: z15.object({
15746
+ voiceover: z16.object({
15531
15747
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15532
15748
  // voiceover | none → narration over the picture (no lip-sync).
15533
- mode: z15.string().optional(),
15534
- voice_description: z15.string().optional(),
15535
- persona: z15.string().optional()
15749
+ mode: z16.string().optional(),
15750
+ voice_description: z16.string().optional(),
15751
+ persona: z16.string().optional()
15536
15752
  }).loose().optional(),
15537
15753
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15538
15754
  // first hex is the dominant brand colour); never to drive frame generation.
15539
- style: z15.object({ palette: z15.array(z15.object({ hex: z15.string().optional() }).loose()).optional() }).loose().optional()
15755
+ style: z16.object({ palette: z16.array(z16.object({ hex: z16.string().optional() }).loose()).optional() }).loose().optional()
15540
15756
  }).loose().optional(),
15541
- scenes: z15.array(Scene).min(1)
15757
+ scenes: z16.array(Scene).min(1)
15542
15758
  }).loose();
15543
15759
  function injectHookPhysicality(blueprint) {
15544
15760
  for (const scene of blueprint.scenes) {
@@ -15555,26 +15771,26 @@ function clipIntentOf(scene, sceneIndex) {
15555
15771
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
15556
15772
  return "body";
15557
15773
  }
15558
- var AppearsItem = z15.union([z15.number(), z15.object({ scene: z15.number(), edge: z15.string().optional() }).loose()]);
15559
- var RecurringElement = z15.object({
15774
+ var AppearsItem = z16.union([z16.number(), z16.object({ scene: z16.number(), edge: z16.string().optional() }).loose()]);
15775
+ var RecurringElement = z16.object({
15560
15776
  // person | animal | product | logo | badge | other
15561
- type: z15.string(),
15562
- label: z15.string().optional(),
15563
- description: z15.string().optional(),
15564
- expression: z15.string().nullable().optional(),
15777
+ type: z16.string(),
15778
+ label: z16.string().optional(),
15779
+ description: z16.string().optional(),
15780
+ expression: z16.string().nullable().optional(),
15565
15781
  // When the element maps to a global cast entry, its stable id (for annotation).
15566
- cast_id: z15.string().nullable().optional(),
15782
+ cast_id: z16.string().nullable().optional(),
15567
15783
  // The label of another element that is the SAME individual as this one, shown
15568
15784
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15569
15785
  // pink shirt and believer in a white shirt). Each look gets its own reference
15570
15786
  // slot, but the face/identity must stay identical across them.
15571
- same_as: z15.string().nullable().optional(),
15787
+ same_as: z16.string().nullable().optional(),
15572
15788
  // Scenes the element appears in. Either a bare list of scene indices (both
15573
15789
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
15574
- scenes: z15.array(z15.number()).optional(),
15575
- appears_in: z15.array(AppearsItem).optional()
15790
+ scenes: z16.array(z16.number()).optional(),
15791
+ appears_in: z16.array(AppearsItem).optional()
15576
15792
  }).loose();
15577
- var RecurringElements = z15.array(RecurringElement);
15793
+ var RecurringElements = z16.array(RecurringElement);
15578
15794
  function sanitizeId(raw, fallback) {
15579
15795
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15580
15796
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -16047,7 +16263,7 @@ function scrubFloatSentences(text, floatDescs) {
16047
16263
  return kept;
16048
16264
  }
16049
16265
  function sceneFloatDescs(scene) {
16050
- const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16266
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16051
16267
  if (!floats.success) return [];
16052
16268
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
16053
16269
  }
@@ -17471,25 +17687,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
17471
17687
  }
17472
17688
  return tracks;
17473
17689
  }
17474
- var OverlayStyle = z15.object({ color_hex: z15.string().optional(), background: z15.string().optional(), size: z15.string().optional() }).loose();
17475
- var Overlay = z15.object({
17476
- text: z15.string().optional(),
17477
- appears_at_s: z15.number().optional(),
17478
- duration_s: z15.number().optional(),
17479
- position: z15.string().optional(),
17480
- role: z15.string().optional(),
17481
- animation: z15.string().optional(),
17482
- animation_detail: z15.string().optional(),
17690
+ var OverlayStyle = z16.object({ color_hex: z16.string().optional(), background: z16.string().optional(), size: z16.string().optional() }).loose();
17691
+ var Overlay = z16.object({
17692
+ text: z16.string().optional(),
17693
+ appears_at_s: z16.number().optional(),
17694
+ duration_s: z16.number().optional(),
17695
+ position: z16.string().optional(),
17696
+ role: z16.string().optional(),
17697
+ animation: z16.string().optional(),
17698
+ animation_detail: z16.string().optional(),
17483
17699
  style: OverlayStyle.optional()
17484
17700
  }).loose();
17485
- var FloatingElement = z15.object({
17486
- kind: z15.string().optional(),
17487
- description: z15.string().optional(),
17488
- brand_name: z15.string().nullish(),
17489
- what_it_represents: z15.string().optional(),
17490
- appears_at_s: z15.number().optional(),
17491
- duration_s: z15.number().optional(),
17492
- position: z15.string().optional()
17701
+ var FloatingElement = z16.object({
17702
+ kind: z16.string().optional(),
17703
+ description: z16.string().optional(),
17704
+ brand_name: z16.string().nullish(),
17705
+ what_it_represents: z16.string().optional(),
17706
+ appears_at_s: z16.number().optional(),
17707
+ duration_s: z16.number().optional(),
17708
+ position: z16.string().optional()
17493
17709
  }).loose();
17494
17710
  function escapeHtml(s) {
17495
17711
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17521,7 +17737,7 @@ function positionClass(position) {
17521
17737
  function collectCaptions(blueprint, clock) {
17522
17738
  return blueprint.scenes.flatMap((scene, i) => {
17523
17739
  const sceneStart = scene.start_s ?? 0;
17524
- const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
17740
+ const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
17525
17741
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17526
17742
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
17527
17743
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17601,7 +17817,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
17601
17817
  const windows = /* @__PURE__ */ new Map();
17602
17818
  blueprint.scenes.forEach((scene, i) => {
17603
17819
  const sceneStart = scene.start_s ?? 0;
17604
- const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17820
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17605
17821
  if (!floats.success) return;
17606
17822
  for (const fe of floats.data) {
17607
17823
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -18049,8 +18265,8 @@ function buildMotionBoard(blueprint) {
18049
18265
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
18050
18266
  cursor = end_s;
18051
18267
  const spoken = sceneSpokenText(scene);
18052
- const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
18053
- const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18268
+ const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
18269
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18054
18270
  const graphics = [
18055
18271
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
18056
18272
  kind: "text",
@@ -18558,6 +18774,9 @@ function buildFailedRunRecord(runId, errorMessage, meta) {
18558
18774
  }
18559
18775
 
18560
18776
  // src/commands/canvas/run-progress.ts
18777
+ function clampNodeError(error) {
18778
+ return { ...error, message: error.message.slice(0, 2e3) };
18779
+ }
18561
18780
  var RunProgressTracker = class {
18562
18781
  runId;
18563
18782
  meta;
@@ -18606,7 +18825,7 @@ var RunProgressTracker = class {
18606
18825
  });
18607
18826
  return;
18608
18827
  }
18609
- this.patchNode(event.node_id, { status: "failed" });
18828
+ this.patchNode(event.node_id, { status: "failed", error: clampNodeError(event.error) });
18610
18829
  }
18611
18830
  /** True once the plan event landed — before that there is nothing worth posting. */
18612
18831
  hasPlan() {
@@ -19482,7 +19701,7 @@ import path17 from "path";
19482
19701
  import { defineCommand as defineCommand91 } from "citty";
19483
19702
 
19484
19703
  // src/engine/scaffold/staticAd.ts
19485
- import { z as z16 } from "zod";
19704
+ import { z as z17 } from "zod";
19486
19705
  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"]);
19487
19706
  var DEFAULT_ASPECT_RATIO = "9:16";
19488
19707
  var SHEET_SUBJECT_TYPE2 = {
@@ -19494,24 +19713,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
19494
19713
  var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
19495
19714
  var ADAPT_IMAGE_SIZE = "2K";
19496
19715
  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.";
19497
- var Blueprint = z16.object({
19498
- meta: z16.object({ estimated_aspect_ratio: z16.string().optional() }).loose().optional(),
19499
- text_content: z16.array(z16.object({ text: z16.string().optional() }).loose()).optional()
19716
+ var Blueprint = z17.object({
19717
+ meta: z17.object({ estimated_aspect_ratio: z17.string().optional() }).loose().optional(),
19718
+ text_content: z17.array(z17.object({ text: z17.string().optional() }).loose()).optional()
19500
19719
  }).loose();
19501
- var ElementLocator = z16.object({
19502
- collection: z16.enum(["subjects", "people", "brands_logos"]),
19503
- index: z16.number().int().nonnegative()
19720
+ var ElementLocator = z17.object({
19721
+ collection: z17.enum(["subjects", "people", "brands_logos"]),
19722
+ index: z17.number().int().nonnegative()
19504
19723
  }).loose();
19505
- var MainElement = z16.object({
19724
+ var MainElement = z17.object({
19506
19725
  // logo | product | person | animal | badge | other
19507
- type: z16.string(),
19508
- label: z16.string().optional(),
19509
- description: z16.string().optional(),
19510
- expression: z16.string().nullable().optional(),
19511
- reason: z16.string().optional(),
19726
+ type: z17.string(),
19727
+ label: z17.string().optional(),
19728
+ description: z17.string().optional(),
19729
+ expression: z17.string().nullable().optional(),
19730
+ reason: z17.string().optional(),
19512
19731
  locator: ElementLocator.optional()
19513
19732
  }).loose();
19514
- var MainElements = z16.array(MainElement);
19733
+ var MainElements = z17.array(MainElement);
19515
19734
  function sanitizeId2(raw, fallback) {
19516
19735
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
19517
19736
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -21296,11 +21515,242 @@ Subcommands:
21296
21515
  }
21297
21516
  });
21298
21517
 
21518
+ // src/commands/chats/index.ts
21519
+ import { defineCommand as defineCommand96 } from "citty";
21520
+ var STATUS_GROUPS = ["active", "archived", "all"];
21521
+ var REPO_SURFACES = ["knowledge", "company", "brand", "landings", "flows", "creatives"];
21522
+ function parseBoundedInt(raw, name, min, max) {
21523
+ if (raw === void 0) {
21524
+ return void 0;
21525
+ }
21526
+ const value = Number.parseInt(raw, 10);
21527
+ if (Number.isNaN(value) || value < min || value > max) {
21528
+ throw new Error(`--${name} must be an integer between ${min} and ${max}`);
21529
+ }
21530
+ return value;
21531
+ }
21532
+ registerSchema({
21533
+ command: "chats.list",
21534
+ 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.",
21535
+ args: {
21536
+ status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
21537
+ limit: { type: "string", description: "Max Sessions to return, 1-100 (default: 20)", required: false },
21538
+ full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
21539
+ }
21540
+ });
21541
+ var listCommand5 = defineCommand96({
21542
+ meta: { name: "list", description: "List other Sessions on this account, newest first." },
21543
+ args: {
21544
+ status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
21545
+ limit: { type: "string", description: "Max Sessions (1-100, default 20)", required: false },
21546
+ full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
21547
+ },
21548
+ run: async ({ args }) => {
21549
+ try {
21550
+ const body = {};
21551
+ if (args.status) {
21552
+ if (!STATUS_GROUPS.includes(args.status)) {
21553
+ throw new Error(`--status must be one of: ${STATUS_GROUPS.join("|")}`);
21554
+ }
21555
+ body.status = args.status;
21556
+ }
21557
+ const limit = parseBoundedInt(args.limit, "limit", 1, 100);
21558
+ if (limit !== void 0) {
21559
+ body.limit = limit;
21560
+ }
21561
+ if (args.full) {
21562
+ body.full = true;
21563
+ }
21564
+ const selfChatId = getEnv().BAKER_CHAT_ID;
21565
+ if (selfChatId) {
21566
+ body.excludeChatId = selfChatId;
21567
+ }
21568
+ const response = await apiPost("/api/chats/list", body);
21569
+ writeJson({
21570
+ ...response,
21571
+ meta: { count: response.data.chats.length },
21572
+ ...response.data.chats.length === 0 ? { hints: ["No Sessions matched. Widen with --status all or a larger --limit."] } : {
21573
+ hints: [
21574
+ "Drill in: `baker chats view <id>` for outputs, `chats transcript <id>` for the conversation, `chats diff <id>` for the real file changes."
21575
+ ]
21576
+ }
21577
+ });
21578
+ } catch (err) {
21579
+ failApi(err);
21580
+ }
21581
+ }
21582
+ });
21583
+ registerSchema({
21584
+ command: "chats.view",
21585
+ 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.",
21586
+ args: {
21587
+ id: { type: "positional", description: "The Session id (from `baker chats list`)", required: true },
21588
+ full: {
21589
+ type: "boolean",
21590
+ description: "No-op today; view already returns full effect detail",
21591
+ required: false,
21592
+ default: false
21593
+ }
21594
+ }
21595
+ });
21596
+ var viewCommand = defineCommand96({
21597
+ meta: {
21598
+ name: "view",
21599
+ description: "Inspect one Session's full effects \u2014 git content + actions/tags/ads, kickoff, commits."
21600
+ },
21601
+ args: {
21602
+ id: { type: "positional", description: "The Session id", required: true },
21603
+ full: { type: "boolean", description: "Include full detail", required: false, default: false }
21604
+ },
21605
+ run: async ({ args }) => {
21606
+ try {
21607
+ const response = await apiPost("/api/chats/view", {
21608
+ chatId: args.id,
21609
+ ...args.full ? { full: true } : {}
21610
+ });
21611
+ const hints = [];
21612
+ if (response.data.diffAvailable) {
21613
+ hints.push("See the real file-level diff of the git content with `baker chats diff <id> --full`.");
21614
+ } else if (response.data.status === "in_progress" || response.data.status === "publishing") {
21615
+ hints.push(
21616
+ "This Session is still in progress \u2014 read its current file changes with `baker chats diff <id> --live`."
21617
+ );
21618
+ }
21619
+ hints.push("Read the conversation with `baker chats transcript <id>`.");
21620
+ writeJson({ ...response, hints });
21621
+ } catch (err) {
21622
+ failApi(err);
21623
+ }
21624
+ }
21625
+ });
21626
+ registerSchema({
21627
+ command: "chats.transcript",
21628
+ 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.",
21629
+ args: {
21630
+ id: { type: "positional", description: "The Session id", required: true },
21631
+ limit: { type: "string", description: "Max messages to return, 1-1000 (default: 100)", required: false },
21632
+ full: {
21633
+ type: "boolean",
21634
+ description: "Return verbatim (untruncated) message text",
21635
+ required: false,
21636
+ default: false
21637
+ }
21638
+ }
21639
+ });
21640
+ var transcriptCommand = defineCommand96({
21641
+ meta: { name: "transcript", description: "Read another Session's conversation." },
21642
+ args: {
21643
+ id: { type: "positional", description: "The Session id", required: true },
21644
+ limit: { type: "string", description: "Max messages (1-1000, default 100)", required: false },
21645
+ full: { type: "boolean", description: "Verbatim message text", required: false, default: false }
21646
+ },
21647
+ run: async ({ args }) => {
21648
+ try {
21649
+ const body = { chatId: args.id };
21650
+ const limit = parseBoundedInt(args.limit, "limit", 1, 1e3);
21651
+ if (limit !== void 0) {
21652
+ body.limit = limit;
21653
+ }
21654
+ if (args.full) {
21655
+ body.full = true;
21656
+ }
21657
+ const response = await apiPost("/api/chats/transcript", body);
21658
+ writeJson({
21659
+ ...response,
21660
+ meta: { count: response.data.entries.length },
21661
+ ...response.data.truncated ? { hints: ["Older messages were dropped to fit --limit. Raise --limit to see more."] } : {}
21662
+ });
21663
+ } catch (err) {
21664
+ failApi(err);
21665
+ }
21666
+ }
21667
+ });
21668
+ registerSchema({
21669
+ command: "chats.diff",
21670
+ description: "See the real file-level changes a Session made (landings, creatives, brand, flows, knowledge). Published Sessions read from git; for an in-progress (unpublished) Session pass --live to read its changes straight from its running workspace. Without --live, an unpublished Session returns available:false \u2014 use `baker chats view` for the staged summary. Compact lists changed files with +/- counts; add --full for the actual diff text. Read-only.",
21671
+ args: {
21672
+ id: { type: "positional", description: "The Session id", required: true },
21673
+ surface: {
21674
+ type: "string",
21675
+ description: "Filter to one surface: knowledge|company|brand|landings|flows|creatives",
21676
+ required: false
21677
+ },
21678
+ full: {
21679
+ type: "boolean",
21680
+ description: "Include the unified-diff patch text per file",
21681
+ required: false,
21682
+ default: false
21683
+ },
21684
+ live: {
21685
+ type: "boolean",
21686
+ description: "For an in-progress Session, read its changes from the live workspace (slower; resumes the paused Runtime). Ignored for published Sessions.",
21687
+ required: false,
21688
+ default: false
21689
+ }
21690
+ }
21691
+ });
21692
+ var diffCommand = defineCommand96({
21693
+ meta: { name: "diff", description: "See a published Session's real file-level changes." },
21694
+ args: {
21695
+ id: { type: "positional", description: "The Session id", required: true },
21696
+ surface: {
21697
+ type: "string",
21698
+ description: "Filter: knowledge|company|brand|landings|flows|creatives",
21699
+ required: false
21700
+ },
21701
+ full: { type: "boolean", description: "Include the diff patch text per file", required: false, default: false },
21702
+ live: {
21703
+ type: "boolean",
21704
+ description: "Read an in-progress Session's changes from its live workspace (slower)",
21705
+ required: false,
21706
+ default: false
21707
+ }
21708
+ },
21709
+ run: async ({ args }) => {
21710
+ try {
21711
+ const body = { chatId: args.id };
21712
+ if (args.surface) {
21713
+ if (!REPO_SURFACES.includes(args.surface)) {
21714
+ throw new Error(`--surface must be one of: ${REPO_SURFACES.join("|")}`);
21715
+ }
21716
+ body.surface = args.surface;
21717
+ }
21718
+ if (args.full) {
21719
+ body.full = true;
21720
+ }
21721
+ if (args.live) {
21722
+ body.live = true;
21723
+ }
21724
+ const response = await apiPost("/api/chats/diff", body);
21725
+ writeJson({
21726
+ ...response,
21727
+ meta: { count: response.data.files.length },
21728
+ ...!response.data.available && response.data.reason ? { hints: [response.data.reason] } : {},
21729
+ ...response.data.available && !args.full && response.data.files.length > 0 ? { hints: ["Add --full to read the actual diff text for each file."] } : {}
21730
+ });
21731
+ } catch (err) {
21732
+ failApi(err);
21733
+ }
21734
+ }
21735
+ });
21736
+ var chatsCommand = defineCommand96({
21737
+ meta: {
21738
+ name: "chats",
21739
+ 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."
21740
+ },
21741
+ subCommands: {
21742
+ list: listCommand5,
21743
+ view: viewCommand,
21744
+ transcript: transcriptCommand,
21745
+ diff: diffCommand
21746
+ }
21747
+ });
21748
+
21299
21749
  // src/commands/creatives/index.ts
21300
- import { defineCommand as defineCommand97 } from "citty";
21750
+ import { defineCommand as defineCommand98 } from "citty";
21301
21751
 
21302
21752
  // src/commands/creatives/publish.ts
21303
- import { defineCommand as defineCommand96 } from "citty";
21753
+ import { defineCommand as defineCommand97 } from "citty";
21304
21754
 
21305
21755
  // src/commands/images/api.ts
21306
21756
  import { readFile as readFile17 } from "fs/promises";
@@ -21444,7 +21894,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
21444
21894
  chatId: chatIdFromEnv()
21445
21895
  });
21446
21896
  }
21447
- var publishCommand = defineCommand96({
21897
+ var publishCommand = defineCommand97({
21448
21898
  meta: {
21449
21899
  name: "publish",
21450
21900
  description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
@@ -21502,7 +21952,7 @@ var publishCommand = defineCommand96({
21502
21952
  });
21503
21953
 
21504
21954
  // src/commands/creatives/index.ts
21505
- var creativesCommand3 = defineCommand97({
21955
+ var creativesCommand3 = defineCommand98({
21506
21956
  meta: {
21507
21957
  name: "creatives",
21508
21958
  description: `Publish static ad creatives as first-class Baker outputs.
@@ -21518,7 +21968,7 @@ Publishing uploads the image to the Company image library, applies the official
21518
21968
  });
21519
21969
 
21520
21970
  // src/commands/flows/index.ts
21521
- import { defineCommand as defineCommand98 } from "citty";
21971
+ import { defineCommand as defineCommand99 } from "citty";
21522
21972
 
21523
21973
  // src/commands/flows/shared.ts
21524
21974
  import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
@@ -21673,7 +22123,7 @@ function displayName(slug) {
21673
22123
  const name = tree.displayName;
21674
22124
  return typeof name === "string" && name.trim() ? name.trim() : slug;
21675
22125
  }
21676
- var listCommand5 = defineCommand98({
22126
+ var listCommand6 = defineCommand99({
21677
22127
  meta: {
21678
22128
  name: "list",
21679
22129
  description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
@@ -21687,7 +22137,7 @@ var listCommand5 = defineCommand98({
21687
22137
  writeJson({ ok: true, data: { flows } });
21688
22138
  }
21689
22139
  });
21690
- var showCommand2 = defineCommand98({
22140
+ var showCommand2 = defineCommand99({
21691
22141
  meta: {
21692
22142
  name: "show",
21693
22143
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -21708,7 +22158,7 @@ var showCommand2 = defineCommand98({
21708
22158
  writeJson({ ok: true, data: response });
21709
22159
  }
21710
22160
  });
21711
- var flowsCommand = defineCommand98({
22161
+ var flowsCommand = defineCommand99({
21712
22162
  meta: {
21713
22163
  name: "flows",
21714
22164
  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).
@@ -21721,7 +22171,7 @@ Examples:
21721
22171
  baker flows show contact --full`
21722
22172
  },
21723
22173
  subCommands: {
21724
- list: listCommand5,
22174
+ list: listCommand6,
21725
22175
  show: showCommand2
21726
22176
  },
21727
22177
  run: () => {
@@ -21735,10 +22185,10 @@ Examples:
21735
22185
  });
21736
22186
 
21737
22187
  // src/commands/ga4/index.ts
21738
- import { defineCommand as defineCommand102 } from "citty";
22188
+ import { defineCommand as defineCommand103 } from "citty";
21739
22189
 
21740
22190
  // src/commands/ga4/audit.ts
21741
- import { defineCommand as defineCommand99 } from "citty";
22191
+ import { defineCommand as defineCommand100 } from "citty";
21742
22192
 
21743
22193
  // src/commands/ga4/resolve.ts
21744
22194
  async function fetchProperties(useCache = true) {
@@ -21801,7 +22251,7 @@ registerSchema({
21801
22251
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21802
22252
  }
21803
22253
  });
21804
- var auditCommand2 = defineCommand99({
22254
+ var auditCommand2 = defineCommand100({
21805
22255
  meta: {
21806
22256
  name: "audit",
21807
22257
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -21853,7 +22303,7 @@ Examples:
21853
22303
  });
21854
22304
 
21855
22305
  // src/commands/ga4/properties.ts
21856
- import { defineCommand as defineCommand100 } from "citty";
22306
+ import { defineCommand as defineCommand101 } from "citty";
21857
22307
  registerSchema({
21858
22308
  command: "ga4.properties",
21859
22309
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -21861,7 +22311,7 @@ registerSchema({
21861
22311
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21862
22312
  }
21863
22313
  });
21864
- var propertiesCommand = defineCommand100({
22314
+ var propertiesCommand = defineCommand101({
21865
22315
  meta: {
21866
22316
  name: "properties",
21867
22317
  description: `List accessible GA4 properties.
@@ -21911,7 +22361,7 @@ Examples:
21911
22361
  // src/commands/ga4/query.ts
21912
22362
  import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
21913
22363
  import { resolve as resolve2 } from "path";
21914
- import { defineCommand as defineCommand101 } from "citty";
22364
+ import { defineCommand as defineCommand102 } from "citty";
21915
22365
 
21916
22366
  // src/commands/ga4/presets.ts
21917
22367
  var GA4_PRESETS = [
@@ -22043,7 +22493,7 @@ function handleError(err) {
22043
22493
  });
22044
22494
  process.exit(1);
22045
22495
  }
22046
- var queryCommand2 = defineCommand101({
22496
+ var queryCommand2 = defineCommand102({
22047
22497
  meta: {
22048
22498
  name: "query",
22049
22499
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -22114,7 +22564,7 @@ Free-form (escape hatch):
22114
22564
  });
22115
22565
 
22116
22566
  // src/commands/ga4/index.ts
22117
- var ga4Command = defineCommand102({
22567
+ var ga4Command = defineCommand103({
22118
22568
  meta: {
22119
22569
  name: "ga4",
22120
22570
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -22137,12 +22587,12 @@ Examples:
22137
22587
  });
22138
22588
 
22139
22589
  // src/commands/gsc/index.ts
22140
- import { defineCommand as defineCommand106 } from "citty";
22590
+ import { defineCommand as defineCommand107 } from "citty";
22141
22591
 
22142
22592
  // src/commands/gsc/query.ts
22143
22593
  import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
22144
22594
  import { resolve as resolve3 } from "path";
22145
- import { defineCommand as defineCommand103 } from "citty";
22595
+ import { defineCommand as defineCommand104 } from "citty";
22146
22596
 
22147
22597
  // src/commands/gsc/presets.ts
22148
22598
  var GSC_PRESETS = [
@@ -22330,7 +22780,7 @@ function handleError2(err) {
22330
22780
  });
22331
22781
  process.exit(1);
22332
22782
  }
22333
- var queryCommand3 = defineCommand103({
22783
+ var queryCommand3 = defineCommand104({
22334
22784
  meta: {
22335
22785
  name: "query",
22336
22786
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -22408,7 +22858,7 @@ Free-form (escape hatch):
22408
22858
  });
22409
22859
 
22410
22860
  // src/commands/gsc/sitemaps.ts
22411
- import { defineCommand as defineCommand104 } from "citty";
22861
+ import { defineCommand as defineCommand105 } from "citty";
22412
22862
  registerSchema({
22413
22863
  command: "gsc.sitemaps",
22414
22864
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -22417,7 +22867,7 @@ registerSchema({
22417
22867
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22418
22868
  }
22419
22869
  });
22420
- var sitemapsCommand = defineCommand104({
22870
+ var sitemapsCommand = defineCommand105({
22421
22871
  meta: {
22422
22872
  name: "sitemaps",
22423
22873
  description: `List sitemaps for a site. Check health and errors.
@@ -22467,7 +22917,7 @@ Examples:
22467
22917
  });
22468
22918
 
22469
22919
  // src/commands/gsc/sites.ts
22470
- import { defineCommand as defineCommand105 } from "citty";
22920
+ import { defineCommand as defineCommand106 } from "citty";
22471
22921
  registerSchema({
22472
22922
  command: "gsc.sites",
22473
22923
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -22475,7 +22925,7 @@ registerSchema({
22475
22925
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22476
22926
  }
22477
22927
  });
22478
- var sitesCommand = defineCommand105({
22928
+ var sitesCommand = defineCommand106({
22479
22929
  meta: {
22480
22930
  name: "sites",
22481
22931
  description: `List verified Search Console sites.
@@ -22523,7 +22973,7 @@ Examples:
22523
22973
  });
22524
22974
 
22525
22975
  // src/commands/gsc/index.ts
22526
- var gscCommand = defineCommand106({
22976
+ var gscCommand = defineCommand107({
22527
22977
  meta: {
22528
22978
  name: "gsc",
22529
22979
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -22546,7 +22996,7 @@ Examples:
22546
22996
  });
22547
22997
 
22548
22998
  // src/commands/history/index.ts
22549
- import { defineCommand as defineCommand107 } from "citty";
22999
+ import { defineCommand as defineCommand108 } from "citty";
22550
23000
  registerSchema({
22551
23001
  command: "history.list",
22552
23002
  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.",
@@ -22591,7 +23041,7 @@ var CATEGORIES = [
22591
23041
  "domain",
22592
23042
  "integration"
22593
23043
  ];
22594
- function parseBoundedInt(raw, name, min, max) {
23044
+ function parseBoundedInt2(raw, name, min, max) {
22595
23045
  if (raw === void 0) {
22596
23046
  return void 0;
22597
23047
  }
@@ -22601,7 +23051,7 @@ function parseBoundedInt(raw, name, min, max) {
22601
23051
  }
22602
23052
  return value;
22603
23053
  }
22604
- var listCommand6 = defineCommand107({
23054
+ var listCommand7 = defineCommand108({
22605
23055
  meta: {
22606
23056
  name: "list",
22607
23057
  description: "List recent account changes (unified audit log), newest first."
@@ -22619,11 +23069,11 @@ var listCommand6 = defineCommand107({
22619
23069
  run: async ({ args }) => {
22620
23070
  try {
22621
23071
  const body = {};
22622
- const limit = parseBoundedInt(args.limit, "limit", 1, 200);
23072
+ const limit = parseBoundedInt2(args.limit, "limit", 1, 200);
22623
23073
  if (limit !== void 0) {
22624
23074
  body.limit = limit;
22625
23075
  }
22626
- const days = parseBoundedInt(args.days, "days", 1, 365);
23076
+ const days = parseBoundedInt2(args.days, "days", 1, 365);
22627
23077
  if (days !== void 0) {
22628
23078
  body.days = days;
22629
23079
  }
@@ -22647,19 +23097,19 @@ var listCommand6 = defineCommand107({
22647
23097
  }
22648
23098
  }
22649
23099
  });
22650
- var historyCommand = defineCommand107({
23100
+ var historyCommand = defineCommand108({
22651
23101
  meta: {
22652
23102
  name: "history",
22653
23103
  description: "Unified account history (audit log): what changed, who did it, and when."
22654
23104
  },
22655
- subCommands: { list: listCommand6 }
23105
+ subCommands: { list: listCommand7 }
22656
23106
  });
22657
23107
 
22658
23108
  // src/commands/images/index.ts
22659
- import { defineCommand as defineCommand131 } from "citty";
23109
+ import { defineCommand as defineCommand132 } from "citty";
22660
23110
 
22661
23111
  // src/commands/images/crop.ts
22662
- import { defineCommand as defineCommand108 } from "citty";
23112
+ import { defineCommand as defineCommand109 } from "citty";
22663
23113
 
22664
23114
  // src/lib/image/crop-sprite.ts
22665
23115
  import sharp from "sharp";
@@ -22784,7 +23234,7 @@ function emitError2(err) {
22784
23234
  }
22785
23235
  process.exit(1);
22786
23236
  }
22787
- var cropCommand = defineCommand108({
23237
+ var cropCommand = defineCommand109({
22788
23238
  meta: {
22789
23239
  name: "crop",
22790
23240
  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"
@@ -22820,7 +23270,7 @@ var cropCommand = defineCommand108({
22820
23270
  });
22821
23271
 
22822
23272
  // src/commands/images/delete.ts
22823
- import { defineCommand as defineCommand109 } from "citty";
23273
+ import { defineCommand as defineCommand110 } from "citty";
22824
23274
  registerSchema({
22825
23275
  command: "images.delete",
22826
23276
  description: "Delete an image by ID",
@@ -22834,7 +23284,7 @@ registerSchema({
22834
23284
  }
22835
23285
  }
22836
23286
  });
22837
- var deleteCommand = defineCommand109({
23287
+ var deleteCommand = defineCommand110({
22838
23288
  meta: {
22839
23289
  name: "delete",
22840
23290
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -22875,7 +23325,7 @@ var deleteCommand = defineCommand109({
22875
23325
  });
22876
23326
 
22877
23327
  // src/commands/images/dimensions.ts
22878
- import { defineCommand as defineCommand110 } from "citty";
23328
+ import { defineCommand as defineCommand111 } from "citty";
22879
23329
 
22880
23330
  // src/lib/image/dimensions.ts
22881
23331
  import { imageSize } from "image-size";
@@ -22898,7 +23348,7 @@ registerSchema({
22898
23348
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
22899
23349
  }
22900
23350
  });
22901
- var dimensionsCommand = defineCommand110({
23351
+ var dimensionsCommand = defineCommand111({
22902
23352
  meta: {
22903
23353
  name: "dimensions",
22904
23354
  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"
@@ -22942,7 +23392,7 @@ var dimensionsCommand = defineCommand110({
22942
23392
  });
22943
23393
 
22944
23394
  // src/commands/images/extract.ts
22945
- import { defineCommand as defineCommand111 } from "citty";
23395
+ import { defineCommand as defineCommand112 } from "citty";
22946
23396
  registerSchema({
22947
23397
  command: "images.extract",
22948
23398
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -22958,7 +23408,7 @@ registerSchema({
22958
23408
  }
22959
23409
  }
22960
23410
  });
22961
- var extractCommand = defineCommand111({
23411
+ var extractCommand = defineCommand112({
22962
23412
  meta: {
22963
23413
  name: "extract",
22964
23414
  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"
@@ -22996,7 +23446,7 @@ var extractCommand = defineCommand111({
22996
23446
  });
22997
23447
 
22998
23448
  // src/commands/images/find.ts
22999
- import { defineCommand as defineCommand112 } from "citty";
23449
+ import { defineCommand as defineCommand113 } from "citty";
23000
23450
  registerSchema({
23001
23451
  command: "images.find",
23002
23452
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -23028,7 +23478,7 @@ registerSchema({
23028
23478
  }
23029
23479
  }
23030
23480
  });
23031
- var findCommand = defineCommand112({
23481
+ var findCommand = defineCommand113({
23032
23482
  meta: {
23033
23483
  name: "find",
23034
23484
  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"
@@ -23077,7 +23527,7 @@ var findCommand = defineCommand112({
23077
23527
 
23078
23528
  // src/commands/images/generate.ts
23079
23529
  import { readFile as readFile19 } from "fs/promises";
23080
- import { defineCommand as defineCommand113 } from "citty";
23530
+ import { defineCommand as defineCommand114 } from "citty";
23081
23531
  import sharp2 from "sharp";
23082
23532
  var GENERATE_TIMEOUT_MS = 18e4;
23083
23533
  var REFERENCE_MAX_EDGE = 1536;
@@ -23180,7 +23630,7 @@ async function resolveReferences(spec) {
23180
23630
  }
23181
23631
  return out;
23182
23632
  }
23183
- var generateCommand = defineCommand113({
23633
+ var generateCommand = defineCommand114({
23184
23634
  meta: {
23185
23635
  name: "generate",
23186
23636
  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]]'"
@@ -23232,7 +23682,7 @@ var generateCommand = defineCommand113({
23232
23682
  });
23233
23683
 
23234
23684
  // src/commands/images/get.ts
23235
- import { defineCommand as defineCommand114 } from "citty";
23685
+ import { defineCommand as defineCommand115 } from "citty";
23236
23686
  registerSchema({
23237
23687
  command: "images.get",
23238
23688
  description: "Get a single image by ID",
@@ -23240,7 +23690,7 @@ registerSchema({
23240
23690
  id: { type: "string", description: "Image ID", required: true }
23241
23691
  }
23242
23692
  });
23243
- var getCommand2 = defineCommand114({
23693
+ var getCommand2 = defineCommand115({
23244
23694
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
23245
23695
  args: {
23246
23696
  id: { type: "positional", description: "Image ID", required: false },
@@ -23276,7 +23726,7 @@ var getCommand2 = defineCommand114({
23276
23726
  });
23277
23727
 
23278
23728
  // src/commands/images/gif.ts
23279
- import { defineCommand as defineCommand115 } from "citty";
23729
+ import { defineCommand as defineCommand116 } from "citty";
23280
23730
  registerSchema({
23281
23731
  command: "images.gif",
23282
23732
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -23308,7 +23758,7 @@ registerSchema({
23308
23758
  }
23309
23759
  }
23310
23760
  });
23311
- var gifCommand = defineCommand115({
23761
+ var gifCommand = defineCommand116({
23312
23762
  meta: {
23313
23763
  name: "gif",
23314
23764
  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"
@@ -23355,7 +23805,7 @@ var gifCommand = defineCommand115({
23355
23805
  });
23356
23806
 
23357
23807
  // src/commands/images/google.ts
23358
- import { defineCommand as defineCommand116 } from "citty";
23808
+ import { defineCommand as defineCommand117 } from "citty";
23359
23809
  registerSchema({
23360
23810
  command: "images.google",
23361
23811
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -23391,7 +23841,7 @@ registerSchema({
23391
23841
  }
23392
23842
  }
23393
23843
  });
23394
- var googleCommand2 = defineCommand116({
23844
+ var googleCommand2 = defineCommand117({
23395
23845
  meta: {
23396
23846
  name: "google",
23397
23847
  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"
@@ -23439,7 +23889,7 @@ var googleCommand2 = defineCommand116({
23439
23889
  });
23440
23890
 
23441
23891
  // src/commands/images/icon.ts
23442
- import { defineCommand as defineCommand117 } from "citty";
23892
+ import { defineCommand as defineCommand118 } from "citty";
23443
23893
  registerSchema({
23444
23894
  command: "images.icon",
23445
23895
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -23465,7 +23915,7 @@ registerSchema({
23465
23915
  }
23466
23916
  }
23467
23917
  });
23468
- var iconCommand = defineCommand117({
23918
+ var iconCommand = defineCommand118({
23469
23919
  meta: {
23470
23920
  name: "icon",
23471
23921
  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'"
@@ -23505,7 +23955,7 @@ var iconCommand = defineCommand117({
23505
23955
  });
23506
23956
 
23507
23957
  // src/commands/images/ingest.ts
23508
- import { defineCommand as defineCommand118 } from "citty";
23958
+ import { defineCommand as defineCommand119 } from "citty";
23509
23959
  registerSchema({
23510
23960
  command: "images.ingest",
23511
23961
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -23517,7 +23967,7 @@ registerSchema({
23517
23967
  context: { type: "string", description: "Description context hint", required: false }
23518
23968
  }
23519
23969
  });
23520
- var ingestCommand = defineCommand118({
23970
+ var ingestCommand = defineCommand119({
23521
23971
  meta: {
23522
23972
  name: "ingest",
23523
23973
  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"
@@ -23559,7 +24009,7 @@ var ingestCommand = defineCommand118({
23559
24009
  });
23560
24010
 
23561
24011
  // src/commands/images/library.ts
23562
- import { defineCommand as defineCommand119 } from "citty";
24012
+ import { defineCommand as defineCommand120 } from "citty";
23563
24013
  registerSchema({
23564
24014
  command: "images.library",
23565
24015
  description: "Search the company image library. Returns only ready images.",
@@ -23585,7 +24035,7 @@ registerSchema({
23585
24035
  }
23586
24036
  }
23587
24037
  });
23588
- var libraryCommand = defineCommand119({
24038
+ var libraryCommand = defineCommand120({
23589
24039
  meta: {
23590
24040
  name: "library",
23591
24041
  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"
@@ -23642,7 +24092,7 @@ var libraryCommand = defineCommand119({
23642
24092
  });
23643
24093
 
23644
24094
  // src/commands/images/logo.ts
23645
- import { defineCommand as defineCommand120 } from "citty";
24095
+ import { defineCommand as defineCommand121 } from "citty";
23646
24096
  registerSchema({
23647
24097
  command: "images.logo",
23648
24098
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -23667,7 +24117,7 @@ registerSchema({
23667
24117
  }
23668
24118
  }
23669
24119
  });
23670
- var logoCommand = defineCommand120({
24120
+ var logoCommand = defineCommand121({
23671
24121
  meta: {
23672
24122
  name: "logo",
23673
24123
  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"
@@ -23705,7 +24155,7 @@ var logoCommand = defineCommand120({
23705
24155
  });
23706
24156
 
23707
24157
  // src/commands/images/normalize.ts
23708
- import { defineCommand as defineCommand121 } from "citty";
24158
+ import { defineCommand as defineCommand122 } from "citty";
23709
24159
 
23710
24160
  // src/lib/image/color-changer.ts
23711
24161
  import quantize from "quantize";
@@ -24437,7 +24887,7 @@ function coerceRawArgs(args) {
24437
24887
  "dry-run": bool(args["dry-run"])
24438
24888
  };
24439
24889
  }
24440
- var normalizeCommand = defineCommand121({
24890
+ var normalizeCommand = defineCommand122({
24441
24891
  meta: {
24442
24892
  name: "normalize",
24443
24893
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -24492,7 +24942,7 @@ Examples:
24492
24942
  });
24493
24943
 
24494
24944
  // src/commands/images/pinterest.ts
24495
- import { defineCommand as defineCommand122 } from "citty";
24945
+ import { defineCommand as defineCommand123 } from "citty";
24496
24946
  registerSchema({
24497
24947
  command: "images.pinterest",
24498
24948
  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.",
@@ -24512,7 +24962,7 @@ registerSchema({
24512
24962
  }
24513
24963
  }
24514
24964
  });
24515
- var pinterestCommand = defineCommand122({
24965
+ var pinterestCommand = defineCommand123({
24516
24966
  meta: {
24517
24967
  name: "pinterest",
24518
24968
  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'"
@@ -24552,7 +25002,7 @@ var pinterestCommand = defineCommand122({
24552
25002
  });
24553
25003
 
24554
25004
  // src/commands/images/screenshot.ts
24555
- import { defineCommand as defineCommand123 } from "citty";
25005
+ import { defineCommand as defineCommand124 } from "citty";
24556
25006
  registerSchema({
24557
25007
  command: "images.screenshot",
24558
25008
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -24568,7 +25018,7 @@ registerSchema({
24568
25018
  }
24569
25019
  }
24570
25020
  });
24571
- var screenshotCommand = defineCommand123({
25021
+ var screenshotCommand = defineCommand124({
24572
25022
  meta: {
24573
25023
  name: "screenshot",
24574
25024
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -24631,7 +25081,7 @@ var screenshotCommand = defineCommand123({
24631
25081
  });
24632
25082
 
24633
25083
  // src/commands/images/search.ts
24634
- import { defineCommand as defineCommand124 } from "citty";
25084
+ import { defineCommand as defineCommand125 } from "citty";
24635
25085
  registerSchema({
24636
25086
  command: "images.search",
24637
25087
  description: "Search images by text query. Only returns ready images.",
@@ -24647,7 +25097,7 @@ registerSchema({
24647
25097
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24648
25098
  }
24649
25099
  });
24650
- var searchCommand = defineCommand124({
25100
+ var searchCommand = defineCommand125({
24651
25101
  meta: {
24652
25102
  name: "search",
24653
25103
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -24707,7 +25157,7 @@ var searchCommand = defineCommand124({
24707
25157
  });
24708
25158
 
24709
25159
  // src/commands/images/sticker.ts
24710
- import { defineCommand as defineCommand125 } from "citty";
25160
+ import { defineCommand as defineCommand126 } from "citty";
24711
25161
  registerSchema({
24712
25162
  command: "images.sticker",
24713
25163
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -24739,7 +25189,7 @@ registerSchema({
24739
25189
  }
24740
25190
  }
24741
25191
  });
24742
- var stickerCommand = defineCommand125({
25192
+ var stickerCommand = defineCommand126({
24743
25193
  meta: {
24744
25194
  name: "sticker",
24745
25195
  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"
@@ -24786,7 +25236,7 @@ var stickerCommand = defineCommand125({
24786
25236
  });
24787
25237
 
24788
25238
  // src/commands/images/stock.ts
24789
- import { defineCommand as defineCommand126 } from "citty";
25239
+ import { defineCommand as defineCommand127 } from "citty";
24790
25240
  registerSchema({
24791
25241
  command: "images.stock",
24792
25242
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -24844,7 +25294,7 @@ registerSchema({
24844
25294
  }
24845
25295
  }
24846
25296
  });
24847
- var stockCommand = defineCommand126({
25297
+ var stockCommand = defineCommand127({
24848
25298
  meta: {
24849
25299
  name: "stock",
24850
25300
  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"
@@ -24900,7 +25350,7 @@ var stockCommand = defineCommand126({
24900
25350
  });
24901
25351
 
24902
25352
  // src/lib/tags-command.ts
24903
- import { defineCommand as defineCommand127 } from "citty";
25353
+ import { defineCommand as defineCommand128 } from "citty";
24904
25354
  function makeTagsCommand(command, label, endpoint) {
24905
25355
  registerSchema({
24906
25356
  command: `${command}.tags`,
@@ -24909,7 +25359,7 @@ function makeTagsCommand(command, label, endpoint) {
24909
25359
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
24910
25360
  }
24911
25361
  });
24912
- return defineCommand127({
25362
+ return defineCommand128({
24913
25363
  meta: {
24914
25364
  name: "tags",
24915
25365
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -24945,7 +25395,7 @@ function makeTagsCommand(command, label, endpoint) {
24945
25395
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
24946
25396
 
24947
25397
  // src/commands/images/upload.ts
24948
- import { defineCommand as defineCommand128 } from "citty";
25398
+ import { defineCommand as defineCommand129 } from "citty";
24949
25399
  registerSchema({
24950
25400
  command: "images.upload",
24951
25401
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -24983,7 +25433,7 @@ registerSchema({
24983
25433
  function isRemoteUrl2(value) {
24984
25434
  return /^https?:\/\//i.test(value);
24985
25435
  }
24986
- var uploadCommand = defineCommand128({
25436
+ var uploadCommand = defineCommand129({
24987
25437
  meta: {
24988
25438
  name: "upload",
24989
25439
  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'"
@@ -25076,7 +25526,7 @@ async function uploadLocal(target, args) {
25076
25526
  }
25077
25527
 
25078
25528
  // src/commands/images/upscale.ts
25079
- import { defineCommand as defineCommand129 } from "citty";
25529
+ import { defineCommand as defineCommand130 } from "citty";
25080
25530
  registerSchema({
25081
25531
  command: "images.upscale",
25082
25532
  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).",
@@ -25091,7 +25541,7 @@ registerSchema({
25091
25541
  }
25092
25542
  });
25093
25543
  var POLL_INTERVAL_MS3 = 1500;
25094
- var upscaleCommand = defineCommand129({
25544
+ var upscaleCommand = defineCommand130({
25095
25545
  meta: {
25096
25546
  name: "upscale",
25097
25547
  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"
@@ -25146,7 +25596,7 @@ var upscaleCommand = defineCommand129({
25146
25596
  });
25147
25597
 
25148
25598
  // src/commands/images/use.ts
25149
- import { defineCommand as defineCommand130 } from "citty";
25599
+ import { defineCommand as defineCommand131 } from "citty";
25150
25600
  registerSchema({
25151
25601
  command: "images.use",
25152
25602
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -25162,7 +25612,7 @@ registerSchema({
25162
25612
  }
25163
25613
  });
25164
25614
  var POLL_INTERVAL_MS4 = 1500;
25165
- var useCommand = defineCommand130({
25615
+ var useCommand = defineCommand131({
25166
25616
  meta: {
25167
25617
  name: "use",
25168
25618
  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"
@@ -25208,7 +25658,7 @@ var useCommand = defineCommand130({
25208
25658
  });
25209
25659
 
25210
25660
  // src/commands/images/index.ts
25211
- var imagesCommand = defineCommand131({
25661
+ var imagesCommand = defineCommand132({
25212
25662
  meta: {
25213
25663
  name: "images",
25214
25664
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -25278,7 +25728,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
25278
25728
  });
25279
25729
 
25280
25730
  // src/commands/mcp/index.ts
25281
- import { defineCommand as defineCommand132 } from "citty";
25731
+ import { defineCommand as defineCommand133 } from "citty";
25282
25732
  var SCOPES = ["user", "user_org", "company", "org"];
25283
25733
  function parseScope(raw) {
25284
25734
  const scope = raw === void 0 ? "company" : String(raw);
@@ -25317,7 +25767,7 @@ registerSchema({
25317
25767
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
25318
25768
  args: {}
25319
25769
  });
25320
- var listCommand7 = defineCommand132({
25770
+ var listCommand8 = defineCommand133({
25321
25771
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
25322
25772
  run: async () => {
25323
25773
  try {
@@ -25342,7 +25792,7 @@ registerSchema({
25342
25792
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
25343
25793
  }
25344
25794
  });
25345
- var addCommand = defineCommand132({
25795
+ var addCommand = defineCommand133({
25346
25796
  meta: {
25347
25797
  name: "add",
25348
25798
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -25383,7 +25833,7 @@ registerSchema({
25383
25833
  description: "Remove a company custom MCP server by name.",
25384
25834
  args: { name: { type: "string", description: "Server name to remove", required: true } }
25385
25835
  });
25386
- var removeCommand4 = defineCommand132({
25836
+ var removeCommand4 = defineCommand133({
25387
25837
  meta: {
25388
25838
  name: "remove",
25389
25839
  description: `Remove a company custom MCP server by name.
@@ -25405,7 +25855,7 @@ Example:
25405
25855
  }
25406
25856
  }
25407
25857
  });
25408
- var mcpCommand = defineCommand132({
25858
+ var mcpCommand = defineCommand133({
25409
25859
  meta: {
25410
25860
  name: "mcp",
25411
25861
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -25422,17 +25872,17 @@ Examples:
25422
25872
  baker mcp remove --name weather`
25423
25873
  },
25424
25874
  subCommands: {
25425
- list: listCommand7,
25875
+ list: listCommand8,
25426
25876
  add: addCommand,
25427
25877
  remove: removeCommand4
25428
25878
  }
25429
25879
  });
25430
25880
 
25431
25881
  // src/commands/research/index.ts
25432
- import { defineCommand as defineCommand143 } from "citty";
25882
+ import { defineCommand as defineCommand144 } from "citty";
25433
25883
 
25434
25884
  // src/commands/research/advertisers.ts
25435
- import { defineCommand as defineCommand133 } from "citty";
25885
+ import { defineCommand as defineCommand134 } from "citty";
25436
25886
 
25437
25887
  // src/commands/research/output.ts
25438
25888
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -25545,7 +25995,7 @@ var FIELDS3 = {
25545
25995
  etv: "Estimated traffic value (USD)",
25546
25996
  visibility: "SERP visibility score (0-1)"
25547
25997
  };
25548
- var advertisersCommand = defineCommand133({
25998
+ var advertisersCommand = defineCommand134({
25549
25999
  meta: {
25550
26000
  name: "advertisers",
25551
26001
  description: `Find domains competing for a keyword in Google SERPs.
@@ -25592,7 +26042,7 @@ Examples:
25592
26042
  });
25593
26043
 
25594
26044
  // src/commands/research/autocomplete.ts
25595
- import { defineCommand as defineCommand134 } from "citty";
26045
+ import { defineCommand as defineCommand135 } from "citty";
25596
26046
  registerSchema({
25597
26047
  command: "research.autocomplete",
25598
26048
  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).",
@@ -25615,7 +26065,7 @@ registerSchema({
25615
26065
  var FIELDS4 = {
25616
26066
  suggestion: "Autocomplete suggestion from Google"
25617
26067
  };
25618
- var autocompleteCommand = defineCommand134({
26068
+ var autocompleteCommand = defineCommand135({
25619
26069
  meta: {
25620
26070
  name: "autocomplete",
25621
26071
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -25661,7 +26111,7 @@ Examples:
25661
26111
  });
25662
26112
 
25663
26113
  // src/commands/research/countries.ts
25664
- import { defineCommand as defineCommand135 } from "citty";
26114
+ import { defineCommand as defineCommand136 } from "citty";
25665
26115
  registerSchema({
25666
26116
  command: "research.countries",
25667
26117
  description: "List all supported country codes for --location flag in research commands.",
@@ -25718,7 +26168,7 @@ var FIELDS5 = {
25718
26168
  code: "Country code to pass as --location",
25719
26169
  name: "Country name"
25720
26170
  };
25721
- var countriesCommand = defineCommand135({
26171
+ var countriesCommand = defineCommand136({
25722
26172
  meta: {
25723
26173
  name: "countries",
25724
26174
  description: "List all supported country codes for --location flag."
@@ -25729,7 +26179,7 @@ var countriesCommand = defineCommand135({
25729
26179
  });
25730
26180
 
25731
26181
  // src/commands/research/intent.ts
25732
- import { defineCommand as defineCommand136 } from "citty";
26182
+ import { defineCommand as defineCommand137 } from "citty";
25733
26183
  registerSchema({
25734
26184
  command: "research.intent",
25735
26185
  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.",
@@ -25752,7 +26202,7 @@ var FIELDS6 = {
25752
26202
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
25753
26203
  probability: "Confidence score 0.0-1.0"
25754
26204
  };
25755
- var intentCommand = defineCommand136({
26205
+ var intentCommand = defineCommand137({
25756
26206
  meta: {
25757
26207
  name: "intent",
25758
26208
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -25800,7 +26250,7 @@ Examples:
25800
26250
  });
25801
26251
 
25802
26252
  // src/commands/research/keyword-gap.ts
25803
- import { defineCommand as defineCommand137 } from "citty";
26253
+ import { defineCommand as defineCommand138 } from "citty";
25804
26254
  registerSchema({
25805
26255
  command: "research.keyword-gap",
25806
26256
  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.",
@@ -25829,7 +26279,7 @@ var FIELDS7 = {
25829
26279
  cpc: "Cost per click USD",
25830
26280
  their_position: "Competitor's ranking position"
25831
26281
  };
25832
- var keywordGapCommand = defineCommand137({
26282
+ var keywordGapCommand = defineCommand138({
25833
26283
  meta: {
25834
26284
  name: "keyword-gap",
25835
26285
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -25903,7 +26353,7 @@ Examples:
25903
26353
  });
25904
26354
 
25905
26355
  // src/commands/research/keywords-for-site.ts
25906
- import { defineCommand as defineCommand138 } from "citty";
26356
+ import { defineCommand as defineCommand139 } from "citty";
25907
26357
  registerSchema({
25908
26358
  command: "research.keywords-for-site",
25909
26359
  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.",
@@ -25936,7 +26386,7 @@ var FIELDS8 = {
25936
26386
  competition: "LOW, MEDIUM, or HIGH",
25937
26387
  competition_index: "Competition score 0-100"
25938
26388
  };
25939
- var keywordsForSiteCommand = defineCommand138({
26389
+ var keywordsForSiteCommand = defineCommand139({
25940
26390
  meta: {
25941
26391
  name: "keywords-for-site",
25942
26392
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -25989,7 +26439,7 @@ Examples:
25989
26439
  });
25990
26440
 
25991
26441
  // src/commands/research/languages.ts
25992
- import { defineCommand as defineCommand139 } from "citty";
26442
+ import { defineCommand as defineCommand140 } from "citty";
25993
26443
  registerSchema({
25994
26444
  command: "research.languages",
25995
26445
  description: "List all supported language codes for --language flag in research commands.",
@@ -26019,7 +26469,7 @@ var FIELDS9 = {
26019
26469
  code: "Language code to pass as --language",
26020
26470
  name: "Language name (also accepted by --language)"
26021
26471
  };
26022
- var languagesCommand2 = defineCommand139({
26472
+ var languagesCommand2 = defineCommand140({
26023
26473
  meta: {
26024
26474
  name: "languages",
26025
26475
  description: "List all supported language codes for --language flag."
@@ -26030,7 +26480,7 @@ var languagesCommand2 = defineCommand139({
26030
26480
  });
26031
26481
 
26032
26482
  // src/commands/research/lighthouse.ts
26033
- import { defineCommand as defineCommand140 } from "citty";
26483
+ import { defineCommand as defineCommand141 } from "citty";
26034
26484
  registerSchema({
26035
26485
  command: "research.lighthouse",
26036
26486
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -26049,7 +26499,7 @@ var FIELDS10 = {
26049
26499
  speed_index_ms: "Speed Index in ms (good: < 3400)",
26050
26500
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
26051
26501
  };
26052
- var lighthouseCommand = defineCommand140({
26502
+ var lighthouseCommand = defineCommand141({
26053
26503
  meta: {
26054
26504
  name: "lighthouse",
26055
26505
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -26087,7 +26537,7 @@ Examples:
26087
26537
  });
26088
26538
 
26089
26539
  // src/commands/research/relevant-pages.ts
26090
- import { defineCommand as defineCommand141 } from "citty";
26540
+ import { defineCommand as defineCommand142 } from "citty";
26091
26541
  registerSchema({
26092
26542
  command: "research.relevant-pages",
26093
26543
  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).",
@@ -26113,7 +26563,7 @@ var FIELDS11 = {
26113
26563
  keywords: "Total organic keywords the page ranks for",
26114
26564
  top_10: "Keywords in positions 1-10"
26115
26565
  };
26116
- var relevantPagesCommand = defineCommand141({
26566
+ var relevantPagesCommand = defineCommand142({
26117
26567
  meta: {
26118
26568
  name: "relevant-pages",
26119
26569
  description: `Get the top pages of a competitor domain with traffic data.
@@ -26159,7 +26609,7 @@ Examples:
26159
26609
  });
26160
26610
 
26161
26611
  // src/commands/research/web.ts
26162
- import { defineCommand as defineCommand142 } from "citty";
26612
+ import { defineCommand as defineCommand143 } from "citty";
26163
26613
  registerSchema({
26164
26614
  command: "research.web",
26165
26615
  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).",
@@ -26210,7 +26660,7 @@ async function runDeepResearch(question) {
26210
26660
  }
26211
26661
  throw new Error("Deep research timed out");
26212
26662
  }
26213
- var webCommand = defineCommand142({
26663
+ var webCommand = defineCommand143({
26214
26664
  meta: {
26215
26665
  name: "web",
26216
26666
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -26270,7 +26720,7 @@ Examples:
26270
26720
  });
26271
26721
 
26272
26722
  // src/commands/research/index.ts
26273
- var researchCommand = defineCommand143({
26723
+ var researchCommand = defineCommand144({
26274
26724
  meta: {
26275
26725
  name: "research",
26276
26726
  description: `Competitive intelligence and AI-powered research commands.
@@ -26310,10 +26760,10 @@ Examples:
26310
26760
  });
26311
26761
 
26312
26762
  // src/commands/scheduled-actions/index.ts
26313
- import { defineCommand as defineCommand150 } from "citty";
26763
+ import { defineCommand as defineCommand151 } from "citty";
26314
26764
 
26315
26765
  // src/commands/scheduled-actions/create.ts
26316
- import { defineCommand as defineCommand144 } from "citty";
26766
+ import { defineCommand as defineCommand145 } from "citty";
26317
26767
 
26318
26768
  // src/commands/scheduled-actions/shared.ts
26319
26769
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -26428,7 +26878,7 @@ registerSchema({
26428
26878
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
26429
26879
  }
26430
26880
  });
26431
- var createCommand2 = defineCommand144({
26881
+ var createCommand2 = defineCommand145({
26432
26882
  meta: {
26433
26883
  name: "create",
26434
26884
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -26477,7 +26927,7 @@ var createCommand2 = defineCommand144({
26477
26927
  });
26478
26928
 
26479
26929
  // src/commands/scheduled-actions/delete.ts
26480
- import { defineCommand as defineCommand145 } from "citty";
26930
+ import { defineCommand as defineCommand146 } from "citty";
26481
26931
  registerSchema({
26482
26932
  command: "scheduled-actions.delete",
26483
26933
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -26485,7 +26935,7 @@ registerSchema({
26485
26935
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26486
26936
  }
26487
26937
  });
26488
- var deleteCommand2 = defineCommand145({
26938
+ var deleteCommand2 = defineCommand146({
26489
26939
  meta: {
26490
26940
  name: "delete",
26491
26941
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -26514,7 +26964,7 @@ var deleteCommand2 = defineCommand145({
26514
26964
  });
26515
26965
 
26516
26966
  // src/commands/scheduled-actions/get.ts
26517
- import { defineCommand as defineCommand146 } from "citty";
26967
+ import { defineCommand as defineCommand147 } from "citty";
26518
26968
  registerSchema({
26519
26969
  command: "scheduled-actions.get",
26520
26970
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -26522,7 +26972,7 @@ registerSchema({
26522
26972
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26523
26973
  }
26524
26974
  });
26525
- var getCommand3 = defineCommand146({
26975
+ var getCommand3 = defineCommand147({
26526
26976
  meta: {
26527
26977
  name: "get",
26528
26978
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -26559,13 +27009,13 @@ var getCommand3 = defineCommand146({
26559
27009
  });
26560
27010
 
26561
27011
  // src/commands/scheduled-actions/list.ts
26562
- import { defineCommand as defineCommand147 } from "citty";
27012
+ import { defineCommand as defineCommand148 } from "citty";
26563
27013
  registerSchema({
26564
27014
  command: "scheduled-actions.list",
26565
27015
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
26566
27016
  args: {}
26567
27017
  });
26568
- var listCommand8 = defineCommand147({
27018
+ var listCommand9 = defineCommand148({
26569
27019
  meta: {
26570
27020
  name: "list",
26571
27021
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -26586,7 +27036,7 @@ var listCommand8 = defineCommand147({
26586
27036
  });
26587
27037
 
26588
27038
  // src/commands/scheduled-actions/trigger.ts
26589
- import { defineCommand as defineCommand148 } from "citty";
27039
+ import { defineCommand as defineCommand149 } from "citty";
26590
27040
  registerSchema({
26591
27041
  command: "scheduled-actions.trigger",
26592
27042
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -26594,7 +27044,7 @@ registerSchema({
26594
27044
  id: { type: "string", description: "Published scheduled action ID", required: true }
26595
27045
  }
26596
27046
  });
26597
- var triggerCommand = defineCommand148({
27047
+ var triggerCommand = defineCommand149({
26598
27048
  meta: {
26599
27049
  name: "trigger",
26600
27050
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -26631,7 +27081,7 @@ var triggerCommand = defineCommand148({
26631
27081
  });
26632
27082
 
26633
27083
  // src/commands/scheduled-actions/update.ts
26634
- import { defineCommand as defineCommand149 } from "citty";
27084
+ import { defineCommand as defineCommand150 } from "citty";
26635
27085
  registerSchema({
26636
27086
  command: "scheduled-actions.update",
26637
27087
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -26656,7 +27106,7 @@ registerSchema({
26656
27106
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
26657
27107
  }
26658
27108
  });
26659
- var updateCommand2 = defineCommand149({
27109
+ var updateCommand2 = defineCommand150({
26660
27110
  meta: {
26661
27111
  name: "update",
26662
27112
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -26727,7 +27177,7 @@ var updateCommand2 = defineCommand149({
26727
27177
  });
26728
27178
 
26729
27179
  // src/commands/scheduled-actions/index.ts
26730
- var scheduledActionsCommand = defineCommand150({
27180
+ var scheduledActionsCommand = defineCommand151({
26731
27181
  meta: {
26732
27182
  name: "scheduled-actions",
26733
27183
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -26743,7 +27193,7 @@ Examples:
26743
27193
  baker scheduled-actions trigger <id>`
26744
27194
  },
26745
27195
  subCommands: {
26746
- list: listCommand8,
27196
+ list: listCommand9,
26747
27197
  get: getCommand3,
26748
27198
  create: createCommand2,
26749
27199
  update: updateCommand2,
@@ -26753,8 +27203,8 @@ Examples:
26753
27203
  });
26754
27204
 
26755
27205
  // src/commands/schema.ts
26756
- import { defineCommand as defineCommand151 } from "citty";
26757
- var schemaCommand = defineCommand151({
27206
+ import { defineCommand as defineCommand152 } from "citty";
27207
+ var schemaCommand = defineCommand152({
26758
27208
  meta: {
26759
27209
  name: "schema",
26760
27210
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -26790,7 +27240,7 @@ var schemaCommand = defineCommand151({
26790
27240
  });
26791
27241
 
26792
27242
  // src/commands/tags/index.ts
26793
- import { defineCommand as defineCommand152 } from "citty";
27243
+ import { defineCommand as defineCommand153 } from "citty";
26794
27244
 
26795
27245
  // src/commands/tags/shared.ts
26796
27246
  function failApi3(err) {
@@ -26856,7 +27306,7 @@ async function listTags(json) {
26856
27306
  failApi3(err);
26857
27307
  }
26858
27308
  }
26859
- var listCommand9 = defineCommand152({
27309
+ var listCommand10 = defineCommand153({
26860
27310
  meta: {
26861
27311
  name: "list",
26862
27312
  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"
@@ -26875,7 +27325,7 @@ async function listDraft3() {
26875
27325
  failApi3(err);
26876
27326
  }
26877
27327
  }
26878
- var draftCommand3 = defineCommand152({
27328
+ var draftCommand3 = defineCommand153({
26879
27329
  meta: {
26880
27330
  name: "draft",
26881
27331
  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)."
@@ -26884,7 +27334,7 @@ var draftCommand3 = defineCommand152({
26884
27334
  await listDraft3();
26885
27335
  }
26886
27336
  });
26887
- var tagsCommand3 = defineCommand152({
27337
+ var tagsCommand3 = defineCommand153({
26888
27338
  meta: {
26889
27339
  name: "tags",
26890
27340
  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.
@@ -26900,7 +27350,7 @@ Examples:
26900
27350
  baker tags draft # review the staged changes awaiting publish`
26901
27351
  },
26902
27352
  subCommands: {
26903
- list: listCommand9,
27353
+ list: listCommand10,
26904
27354
  draft: draftCommand3
26905
27355
  },
26906
27356
  run: async () => {
@@ -26909,10 +27359,10 @@ Examples:
26909
27359
  });
26910
27360
 
26911
27361
  // src/commands/testimonials/index.ts
26912
- import { defineCommand as defineCommand156 } from "citty";
27362
+ import { defineCommand as defineCommand157 } from "citty";
26913
27363
 
26914
27364
  // src/commands/testimonials/get.ts
26915
- import { defineCommand as defineCommand153 } from "citty";
27365
+ import { defineCommand as defineCommand154 } from "citty";
26916
27366
  registerSchema({
26917
27367
  command: "testimonials.get",
26918
27368
  description: "Get a single testimonial by ID",
@@ -26920,7 +27370,7 @@ registerSchema({
26920
27370
  id: { type: "string", description: "Testimonial ID", required: true }
26921
27371
  }
26922
27372
  });
26923
- var getCommand4 = defineCommand153({
27373
+ var getCommand4 = defineCommand154({
26924
27374
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
26925
27375
  args: {
26926
27376
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -26957,7 +27407,7 @@ var getCommand4 = defineCommand153({
26957
27407
  });
26958
27408
 
26959
27409
  // src/commands/testimonials/list.ts
26960
- import { defineCommand as defineCommand154 } from "citty";
27410
+ import { defineCommand as defineCommand155 } from "citty";
26961
27411
  registerSchema({
26962
27412
  command: "testimonials.list",
26963
27413
  description: "List testimonials with optional filters.",
@@ -26987,7 +27437,7 @@ registerSchema({
26987
27437
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
26988
27438
  }
26989
27439
  });
26990
- var listCommand10 = defineCommand154({
27440
+ var listCommand11 = defineCommand155({
26991
27441
  meta: {
26992
27442
  name: "list",
26993
27443
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -27036,7 +27486,7 @@ var listCommand10 = defineCommand154({
27036
27486
  });
27037
27487
 
27038
27488
  // src/commands/testimonials/search.ts
27039
- import { defineCommand as defineCommand155 } from "citty";
27489
+ import { defineCommand as defineCommand156 } from "citty";
27040
27490
  function languageBiasHint(results, requestedLanguage) {
27041
27491
  if (requestedLanguage) {
27042
27492
  return null;
@@ -27114,7 +27564,7 @@ function buildSearchRequest(query, args) {
27114
27564
  }
27115
27565
  return body;
27116
27566
  }
27117
- var searchCommand2 = defineCommand155({
27567
+ var searchCommand2 = defineCommand156({
27118
27568
  meta: {
27119
27569
  name: "search",
27120
27570
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -27170,7 +27620,7 @@ var searchCommand2 = defineCommand155({
27170
27620
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
27171
27621
 
27172
27622
  // src/commands/testimonials/index.ts
27173
- var testimonialsCommand = defineCommand156({
27623
+ var testimonialsCommand = defineCommand157({
27174
27624
  meta: {
27175
27625
  name: "testimonials",
27176
27626
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -27185,16 +27635,16 @@ Examples:
27185
27635
  subCommands: {
27186
27636
  get: getCommand4,
27187
27637
  search: searchCommand2,
27188
- list: listCommand10,
27638
+ list: listCommand11,
27189
27639
  tags: tagsCommand4
27190
27640
  }
27191
27641
  });
27192
27642
 
27193
27643
  // src/commands/videos/index.ts
27194
- import { defineCommand as defineCommand161 } from "citty";
27644
+ import { defineCommand as defineCommand162 } from "citty";
27195
27645
 
27196
27646
  // src/commands/videos/delete.ts
27197
- import { defineCommand as defineCommand157 } from "citty";
27647
+ import { defineCommand as defineCommand158 } from "citty";
27198
27648
  registerSchema({
27199
27649
  command: "videos.delete",
27200
27650
  description: "Delete a video by ID",
@@ -27208,7 +27658,7 @@ registerSchema({
27208
27658
  }
27209
27659
  }
27210
27660
  });
27211
- var deleteCommand3 = defineCommand157({
27661
+ var deleteCommand3 = defineCommand158({
27212
27662
  meta: {
27213
27663
  name: "delete",
27214
27664
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -27249,7 +27699,7 @@ var deleteCommand3 = defineCommand157({
27249
27699
  });
27250
27700
 
27251
27701
  // src/commands/videos/get.ts
27252
- import { defineCommand as defineCommand158 } from "citty";
27702
+ import { defineCommand as defineCommand159 } from "citty";
27253
27703
  registerSchema({
27254
27704
  command: "videos.get",
27255
27705
  description: "Get a single video by ID",
@@ -27257,7 +27707,7 @@ registerSchema({
27257
27707
  id: { type: "string", description: "Video ID", required: true }
27258
27708
  }
27259
27709
  });
27260
- var getCommand5 = defineCommand158({
27710
+ var getCommand5 = defineCommand159({
27261
27711
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
27262
27712
  args: {
27263
27713
  id: { type: "positional", description: "Video ID", required: false },
@@ -27294,7 +27744,7 @@ var getCommand5 = defineCommand158({
27294
27744
  });
27295
27745
 
27296
27746
  // src/commands/videos/search.ts
27297
- import { defineCommand as defineCommand159 } from "citty";
27747
+ import { defineCommand as defineCommand160 } from "citty";
27298
27748
  registerSchema({
27299
27749
  command: "videos.search",
27300
27750
  description: "Search videos by text query. Only returns ready videos.",
@@ -27304,7 +27754,7 @@ registerSchema({
27304
27754
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27305
27755
  }
27306
27756
  });
27307
- var searchCommand3 = defineCommand159({
27757
+ var searchCommand3 = defineCommand160({
27308
27758
  meta: {
27309
27759
  name: "search",
27310
27760
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -27356,7 +27806,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
27356
27806
  // src/commands/videos/upload.ts
27357
27807
  import { readFile as readFile20, stat as stat5 } from "fs/promises";
27358
27808
  import { extname as extname3 } from "path";
27359
- import { defineCommand as defineCommand160 } from "citty";
27809
+ import { defineCommand as defineCommand161 } from "citty";
27360
27810
  var MIME_MAP = {
27361
27811
  ".mp4": "video/mp4",
27362
27812
  ".mov": "video/quicktime",
@@ -27390,7 +27840,7 @@ function detectContentType(filePath) {
27390
27840
  }
27391
27841
  return mime;
27392
27842
  }
27393
- var uploadCommand2 = defineCommand160({
27843
+ var uploadCommand2 = defineCommand161({
27394
27844
  meta: {
27395
27845
  name: "upload",
27396
27846
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -27444,7 +27894,7 @@ var uploadCommand2 = defineCommand160({
27444
27894
  });
27445
27895
 
27446
27896
  // src/commands/videos/index.ts
27447
- var videosCommand = defineCommand161({
27897
+ var videosCommand = defineCommand162({
27448
27898
  meta: {
27449
27899
  name: "videos",
27450
27900
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -27467,10 +27917,10 @@ Examples:
27467
27917
  });
27468
27918
 
27469
27919
  // src/commands/winning-ads/index.ts
27470
- import { defineCommand as defineCommand172 } from "citty";
27920
+ import { defineCommand as defineCommand173 } from "citty";
27471
27921
 
27472
27922
  // src/commands/winning-ads/advertisers.ts
27473
- import { defineCommand as defineCommand162 } from "citty";
27923
+ import { defineCommand as defineCommand163 } from "citty";
27474
27924
 
27475
27925
  // src/commands/winning-ads/shared.ts
27476
27926
  function splitList(value) {
@@ -27523,7 +27973,7 @@ function advertiserNormalizer(record, full) {
27523
27973
  last_synced_at: record.last_synced_at ?? null
27524
27974
  };
27525
27975
  }
27526
- var advertisersCommand2 = defineCommand162({
27976
+ var advertisersCommand2 = defineCommand163({
27527
27977
  meta: {
27528
27978
  name: "advertisers",
27529
27979
  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'
@@ -27581,7 +28031,7 @@ var advertisersCommand2 = defineCommand162({
27581
28031
  });
27582
28032
 
27583
28033
  // src/commands/winning-ads/brief.ts
27584
- import { defineCommand as defineCommand163 } from "citty";
28034
+ import { defineCommand as defineCommand164 } from "citty";
27585
28035
  registerSchema({
27586
28036
  command: "winning-ads.brief",
27587
28037
  description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
@@ -27627,7 +28077,7 @@ function parseDna(raw) {
27627
28077
  }
27628
28078
  return parsed;
27629
28079
  }
27630
- var briefCommand = defineCommand163({
28080
+ var briefCommand = defineCommand164({
27631
28081
  meta: {
27632
28082
  name: "brief",
27633
28083
  description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
@@ -27663,7 +28113,7 @@ var briefCommand = defineCommand163({
27663
28113
  });
27664
28114
 
27665
28115
  // src/commands/winning-ads/feed.ts
27666
- import { defineCommand as defineCommand164 } from "citty";
28116
+ import { defineCommand as defineCommand165 } from "citty";
27667
28117
  function buildFeedParams(input) {
27668
28118
  const params = {};
27669
28119
  const advertiser = splitList(input.advertiser);
@@ -27715,7 +28165,7 @@ registerSchema({
27715
28165
  format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
27716
28166
  }
27717
28167
  });
27718
- var feedCommand = defineCommand164({
28168
+ var feedCommand = defineCommand165({
27719
28169
  meta: {
27720
28170
  name: "feed",
27721
28171
  description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
@@ -27800,7 +28250,7 @@ var feedCommand = defineCommand164({
27800
28250
  });
27801
28251
 
27802
28252
  // src/commands/winning-ads/follow.ts
27803
- import { defineCommand as defineCommand165 } from "citty";
28253
+ import { defineCommand as defineCommand166 } from "citty";
27804
28254
  var PLATFORMS = ["meta", "linkedin"];
27805
28255
  registerSchema({
27806
28256
  command: "winning-ads.follow",
@@ -27815,7 +28265,7 @@ registerSchema({
27815
28265
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
27816
28266
  }
27817
28267
  });
27818
- var followCommand = defineCommand165({
28268
+ var followCommand = defineCommand166({
27819
28269
  meta: {
27820
28270
  name: "follow",
27821
28271
  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'
@@ -27862,7 +28312,7 @@ var followCommand = defineCommand165({
27862
28312
  });
27863
28313
 
27864
28314
  // src/commands/winning-ads/following.ts
27865
- import { defineCommand as defineCommand166 } from "citty";
28315
+ import { defineCommand as defineCommand167 } from "citty";
27866
28316
  registerSchema({
27867
28317
  command: "winning-ads.following",
27868
28318
  description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
@@ -27895,7 +28345,7 @@ function followingNormalizer(record, full) {
27895
28345
  platforms: Array.isArray(record.platforms) ? record.platforms : []
27896
28346
  };
27897
28347
  }
27898
- var followingCommand = defineCommand166({
28348
+ var followingCommand = defineCommand167({
27899
28349
  meta: {
27900
28350
  name: "following",
27901
28351
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -27930,7 +28380,7 @@ var followingCommand = defineCommand166({
27930
28380
  });
27931
28381
 
27932
28382
  // src/commands/winning-ads/patterns.ts
27933
- import { defineCommand as defineCommand167 } from "citty";
28383
+ import { defineCommand as defineCommand168 } from "citty";
27934
28384
  registerSchema({
27935
28385
  command: "winning-ads.patterns",
27936
28386
  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.",
@@ -27969,7 +28419,7 @@ function discriminatorRow(record) {
27969
28419
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
27970
28420
  };
27971
28421
  }
27972
- var patternsCommand = defineCommand167({
28422
+ var patternsCommand = defineCommand168({
27973
28423
  meta: {
27974
28424
  name: "patterns",
27975
28425
  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"
@@ -28025,7 +28475,7 @@ var patternsCommand = defineCommand167({
28025
28475
  });
28026
28476
 
28027
28477
  // src/commands/winning-ads/search.ts
28028
- import { defineCommand as defineCommand168 } from "citty";
28478
+ import { defineCommand as defineCommand169 } from "citty";
28029
28479
  registerSchema({
28030
28480
  command: "winning-ads.search",
28031
28481
  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.",
@@ -28133,7 +28583,7 @@ function buildSearchBody(args) {
28133
28583
  }
28134
28584
  return body;
28135
28585
  }
28136
- var searchCommand4 = defineCommand168({
28586
+ var searchCommand4 = defineCommand169({
28137
28587
  meta: {
28138
28588
  name: "search",
28139
28589
  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"
@@ -28248,7 +28698,7 @@ var searchCommand4 = defineCommand168({
28248
28698
  });
28249
28699
 
28250
28700
  // src/commands/winning-ads/seeds.ts
28251
- import { defineCommand as defineCommand169 } from "citty";
28701
+ import { defineCommand as defineCommand170 } from "citty";
28252
28702
  function leanRow(r) {
28253
28703
  return {
28254
28704
  key: r.key,
@@ -28276,7 +28726,7 @@ function makeSeedCommand(opts) {
28276
28726
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
28277
28727
  }
28278
28728
  });
28279
- return defineCommand169({
28729
+ return defineCommand170({
28280
28730
  meta: { name: opts.name, description: opts.description },
28281
28731
  args: {
28282
28732
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -28325,7 +28775,7 @@ var formatsCommand = makeSeedCommand({
28325
28775
  });
28326
28776
 
28327
28777
  // src/commands/winning-ads/unfollow.ts
28328
- import { defineCommand as defineCommand170 } from "citty";
28778
+ import { defineCommand as defineCommand171 } from "citty";
28329
28779
  registerSchema({
28330
28780
  command: "winning-ads.unfollow",
28331
28781
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -28333,7 +28783,7 @@ registerSchema({
28333
28783
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
28334
28784
  }
28335
28785
  });
28336
- var unfollowCommand = defineCommand170({
28786
+ var unfollowCommand = defineCommand171({
28337
28787
  meta: {
28338
28788
  name: "unfollow",
28339
28789
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -28354,7 +28804,7 @@ var unfollowCommand = defineCommand170({
28354
28804
  });
28355
28805
 
28356
28806
  // src/commands/winning-ads/winners.ts
28357
- import { defineCommand as defineCommand171 } from "citty";
28807
+ import { defineCommand as defineCommand172 } from "citty";
28358
28808
  registerSchema({
28359
28809
  command: "winning-ads.winners",
28360
28810
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -28364,7 +28814,7 @@ registerSchema({
28364
28814
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
28365
28815
  }
28366
28816
  });
28367
- var winnersCommand = defineCommand171({
28817
+ var winnersCommand = defineCommand172({
28368
28818
  meta: {
28369
28819
  name: "winners",
28370
28820
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -28414,7 +28864,7 @@ var winnersCommand = defineCommand171({
28414
28864
  });
28415
28865
 
28416
28866
  // src/commands/winning-ads/index.ts
28417
- var winningAdsCommand = defineCommand172({
28867
+ var winningAdsCommand = defineCommand173({
28418
28868
  meta: {
28419
28869
  name: "winning-ads",
28420
28870
  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.
@@ -28479,7 +28929,7 @@ function getCliVersion() {
28479
28929
  }
28480
28930
 
28481
28931
  // src/cli.ts
28482
- var main = defineCommand173({
28932
+ var main = defineCommand174({
28483
28933
  meta: {
28484
28934
  name: "baker",
28485
28935
  version: getCliVersion(),
@@ -28505,6 +28955,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28505
28955
  testimonials: testimonialsCommand,
28506
28956
  canvas: canvasCommand,
28507
28957
  tags: tagsCommand3,
28958
+ chats: chatsCommand,
28508
28959
  history: historyCommand,
28509
28960
  "winning-ads": winningAdsCommand,
28510
28961
  mcp: mcpCommand,