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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  toModelSafeImage,
35
35
  ulid,
36
36
  validateCanvasDeep
37
- } from "./chunk-CIF62V7L.js";
37
+ } from "./chunk-GKL4CUCC.js";
38
38
  import {
39
39
  csvOrJson,
40
40
  daysAgoIso,
@@ -73,7 +73,7 @@ import {
73
73
  } from "./chunk-RK67WL4O.js";
74
74
 
75
75
  // src/cli.ts
76
- import { defineCommand as 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,207 @@ var linkedinDraftErrorResponseSchema = z4.object({
1928
1928
  fields: z4.array(linkedinFieldErrorSchema).optional()
1929
1929
  });
1930
1930
 
1931
- // ../api/src/flows.ts
1931
+ // ../api/src/chats.ts
1932
1932
  import { z as z5 } from "zod";
1933
+ var chatInspectStatusSchema = z5.enum([
1934
+ "draft",
1935
+ "in_progress",
1936
+ "publishing",
1937
+ "publish_failed",
1938
+ "completed",
1939
+ "discarded"
1940
+ ]);
1941
+ var chatStatusGroupSchema = z5.enum(["active", "archived", "all"]);
1942
+ var chatChangeTypeSchema = z5.enum([
1943
+ "landing",
1944
+ "document",
1945
+ "knowledge",
1946
+ "brand",
1947
+ "company",
1948
+ "flow",
1949
+ "action",
1950
+ "creative",
1951
+ "tags",
1952
+ "report",
1953
+ "linkedin-ads",
1954
+ "google-ads",
1955
+ "meta-ads",
1956
+ "briefs"
1957
+ ]);
1958
+ var chatChangeActionSchema = z5.enum(["created", "updated", "deleted"]);
1959
+ var chatChangeSummarySchema = z5.object({
1960
+ type: chatChangeTypeSchema,
1961
+ slug: z5.string(),
1962
+ action: chatChangeActionSchema,
1963
+ title: z5.string().optional()
1964
+ });
1965
+ var repoSurfaceSchema = z5.enum(["knowledge", "company", "brand", "landings", "flows", "creatives"]);
1966
+ var chatsListRequestSchema = z5.object({
1967
+ status: chatStatusGroupSchema.optional(),
1968
+ limit: z5.number().int().min(1).max(100).optional(),
1969
+ /** Include each Session's full `changes[]` list (compact returns counts only). */
1970
+ full: z5.boolean().optional()
1971
+ });
1972
+ var chatSummarySchema = z5.object({
1973
+ id: z5.string(),
1974
+ title: z5.string(),
1975
+ status: chatInspectStatusSchema,
1976
+ createdAt: z5.number(),
1977
+ updatedAt: z5.number(),
1978
+ /** Counts of produced outputs keyed by change type. */
1979
+ outputs: z5.record(z5.string(), z5.number()),
1980
+ outputTotal: z5.number(),
1981
+ changes: z5.array(chatChangeSummarySchema).optional()
1982
+ });
1983
+ var chatsListResponseSchema = z5.object({
1984
+ ok: z5.literal(true),
1985
+ data: z5.object({ chats: z5.array(chatSummarySchema) })
1986
+ });
1987
+ var chatsViewRequestSchema = z5.object({
1988
+ chatId: z5.string(),
1989
+ full: z5.boolean().optional()
1990
+ });
1991
+ var chatThreadSummarySchema = z5.object({
1992
+ id: z5.string(),
1993
+ title: z5.string().nullable(),
1994
+ status: z5.string(),
1995
+ createdAt: z5.number()
1996
+ });
1997
+ var chatCommitSummarySchema = z5.object({
1998
+ sha: z5.string(),
1999
+ message: z5.string().nullable(),
2000
+ surfaces: z5.array(z5.string()),
2001
+ createdAt: z5.number()
2002
+ });
2003
+ var effectOpSchema = z5.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
2004
+ var contentEffectSchema = z5.object({
2005
+ surface: chatChangeTypeSchema,
2006
+ slug: z5.string(),
2007
+ op: effectOpSchema,
2008
+ staged: z5.boolean()
2009
+ });
2010
+ var actionEffectSchema = z5.object({
2011
+ op: effectOpSchema,
2012
+ staged: z5.boolean(),
2013
+ name: z5.string(),
2014
+ description: z5.string().nullable(),
2015
+ priority: z5.string().nullable(),
2016
+ tags: z5.array(z5.string()),
2017
+ status: z5.string().nullable(),
2018
+ note: z5.string().nullable(),
2019
+ reason: z5.string().nullable()
2020
+ });
2021
+ var scheduledEffectSchema = z5.object({
2022
+ op: effectOpSchema,
2023
+ staged: z5.boolean(),
2024
+ name: z5.string(),
2025
+ summary: z5.string().nullable()
2026
+ });
2027
+ var tagEffectSchema = z5.object({
2028
+ op: effectOpSchema,
2029
+ staged: z5.boolean(),
2030
+ tagType: z5.string(),
2031
+ title: z5.string().nullable(),
2032
+ summary: z5.string().nullable(),
2033
+ configKeys: z5.array(z5.string()),
2034
+ hasSecrets: z5.boolean()
2035
+ });
2036
+ var adEffectSchema = z5.object({
2037
+ platform: z5.enum(["google", "meta", "linkedin"]),
2038
+ op: effectOpSchema,
2039
+ staged: z5.boolean(),
2040
+ entity: z5.string().nullable(),
2041
+ operation: z5.string().nullable(),
2042
+ summary: z5.string().nullable()
2043
+ });
2044
+ var creativeEffectSchema = z5.object({
2045
+ op: effectOpSchema,
2046
+ staged: z5.boolean(),
2047
+ slug: z5.string(),
2048
+ title: z5.string().nullable(),
2049
+ status: z5.string().nullable()
2050
+ });
2051
+ var chatEffectsSchema = z5.object({
2052
+ content: z5.array(contentEffectSchema),
2053
+ actions: z5.array(actionEffectSchema),
2054
+ scheduledActions: z5.array(scheduledEffectSchema),
2055
+ tags: z5.array(tagEffectSchema),
2056
+ ads: z5.object({
2057
+ google: z5.array(adEffectSchema),
2058
+ meta: z5.array(adEffectSchema),
2059
+ linkedin: z5.array(adEffectSchema)
2060
+ }),
2061
+ creatives: z5.array(creativeEffectSchema)
2062
+ });
2063
+ var chatDetailSchema = z5.object({
2064
+ id: z5.string(),
2065
+ title: z5.string(),
2066
+ status: chatInspectStatusSchema,
2067
+ createdAt: z5.number(),
2068
+ updatedAt: z5.number(),
2069
+ completedBySource: z5.enum(["user", "bridge"]).nullable(),
2070
+ publishedAt: z5.number().nullable(),
2071
+ /** The first user message — how this Session was originally asked. */
2072
+ kickoff: z5.string().nullable(),
2073
+ outputs: z5.record(z5.string(), z5.number()),
2074
+ outputTotal: z5.number(),
2075
+ /** The unified picture of everything this Session changed — git + DB. */
2076
+ effects: chatEffectsSchema,
2077
+ threads: z5.array(chatThreadSummarySchema),
2078
+ commits: z5.array(chatCommitSummarySchema),
2079
+ /** True when a real file-level diff is available via `baker chats diff`. */
2080
+ diffAvailable: z5.boolean()
2081
+ });
2082
+ var chatsViewResponseSchema = z5.object({
2083
+ ok: z5.literal(true),
2084
+ data: chatDetailSchema
2085
+ });
2086
+ var chatsTranscriptRequestSchema = z5.object({
2087
+ chatId: z5.string(),
2088
+ limit: z5.number().int().min(1).max(1e3).optional(),
2089
+ /** Return untruncated message text (compact truncates each entry). */
2090
+ full: z5.boolean().optional()
2091
+ });
2092
+ var transcriptEntrySchema = z5.object({
2093
+ role: z5.string(),
2094
+ text: z5.string()
2095
+ });
2096
+ var chatsTranscriptResponseSchema = z5.object({
2097
+ ok: z5.literal(true),
2098
+ data: z5.object({
2099
+ chatId: z5.string(),
2100
+ entries: z5.array(transcriptEntrySchema),
2101
+ /** True when older entries were dropped to fit `limit`. */
2102
+ truncated: z5.boolean()
2103
+ })
2104
+ });
2105
+ var chatsDiffRequestSchema = z5.object({
2106
+ chatId: z5.string(),
2107
+ surface: repoSurfaceSchema.optional(),
2108
+ /** Include the unified-diff `patch` text per file (compact omits it). */
2109
+ full: z5.boolean().optional()
2110
+ });
2111
+ var diffFileSchema = z5.object({
2112
+ path: z5.string(),
2113
+ surface: repoSurfaceSchema.nullable(),
2114
+ status: z5.string(),
2115
+ additions: z5.number(),
2116
+ deletions: z5.number(),
2117
+ patch: z5.string().optional()
2118
+ });
2119
+ var chatsDiffResponseSchema = z5.object({
2120
+ ok: z5.literal(true),
2121
+ data: z5.object({
2122
+ chatId: z5.string(),
2123
+ /** False when no published git diff exists (in-progress Session or unlinked repo). */
2124
+ available: z5.boolean(),
2125
+ reason: z5.string().optional(),
2126
+ files: z5.array(diffFileSchema)
2127
+ })
2128
+ });
2129
+
2130
+ // ../api/src/flows.ts
2131
+ import { z as z6 } from "zod";
1933
2132
  var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1934
2133
  "email",
1935
2134
  "zapier",
@@ -1940,7 +2139,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1940
2139
  "crmble",
1941
2140
  "goHighlevelContact"
1942
2141
  ];
1943
- var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
2142
+ var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1944
2143
  var FLOW_SECRET_FIELDS = {
1945
2144
  email: [],
1946
2145
  zapier: ["zapUrl"],
@@ -1968,94 +2167,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
1968
2167
  "highlevel",
1969
2168
  "highlevelForm"
1970
2169
  ];
1971
- var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
1972
- var flowInputRequestSchema = z5.discriminatedUnion("target", [
1973
- z5.object({
2170
+ var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
2171
+ var flowInputRequestSchema = z6.discriminatedUnion("target", [
2172
+ z6.object({
1974
2173
  /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
1975
- target: z5.literal("sideEffect"),
1976
- flowSlug: z5.string(),
2174
+ target: z6.literal("sideEffect"),
2175
+ flowSlug: z6.string(),
1977
2176
  /** `id` of the FlowNode holding the side effect. */
1978
- nodeId: z5.string(),
2177
+ nodeId: z6.string(),
1979
2178
  /** `id` of the side effect within that node's `sideEffects[]`. */
1980
- sideEffectId: z5.string(),
2179
+ sideEffectId: z6.string(),
1981
2180
  sideEffectType: flowSideEffectTypeSchema,
1982
2181
  /** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
1983
- prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
2182
+ prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
1984
2183
  /** Secret credential field names the agent asks the user to provide. */
1985
- requestedSecretFields: z5.array(z5.string()).optional(),
1986
- message: z5.string().optional()
2184
+ requestedSecretFields: z6.array(z6.string()).optional(),
2185
+ message: z6.string().optional()
1987
2186
  }),
1988
- z5.object({
2187
+ z6.object({
1989
2188
  /** Configure a widget node's third-party `form.external` (+ `providerId`). */
1990
- target: z5.literal("node"),
1991
- flowSlug: z5.string(),
2189
+ target: z6.literal("node"),
2190
+ flowSlug: z6.string(),
1992
2191
  /** `id` of the widget FlowNode. */
1993
- nodeId: z5.string(),
2192
+ nodeId: z6.string(),
1994
2193
  nodeType: flowResourceNodeTypeSchema,
1995
- message: z5.string().optional()
2194
+ message: z6.string().optional()
1996
2195
  })
1997
2196
  ]);
1998
- var flowInputToolInputSchema = z5.object({
1999
- requests: z5.array(flowInputRequestSchema).min(1).max(8)
2197
+ var flowInputToolInputSchema = z6.object({
2198
+ requests: z6.array(flowInputRequestSchema).min(1).max(8)
2000
2199
  });
2001
- var flowInputResultSchema = z5.discriminatedUnion("status", [
2002
- z5.object({
2003
- status: z5.literal("submitted"),
2200
+ var flowInputResultSchema = z6.discriminatedUnion("status", [
2201
+ z6.object({
2202
+ status: z6.literal("submitted"),
2004
2203
  /** Echoes which piece this result resolves. */
2005
- nodeId: z5.string(),
2006
- sideEffectId: z5.string().optional(),
2204
+ nodeId: z6.string(),
2205
+ sideEffectId: z6.string().optional(),
2007
2206
  /** Names of secret fields the user provided. Never values. */
2008
- secretFieldsSet: z5.array(z5.string()),
2207
+ secretFieldsSet: z6.array(z6.string()),
2009
2208
  /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
2010
- note: z5.string().optional()
2209
+ note: z6.string().optional()
2011
2210
  }),
2012
- z5.object({
2013
- status: z5.literal("declined"),
2014
- nodeId: z5.string(),
2015
- sideEffectId: z5.string().optional(),
2016
- reason: z5.string().optional()
2211
+ z6.object({
2212
+ status: z6.literal("declined"),
2213
+ nodeId: z6.string(),
2214
+ sideEffectId: z6.string().optional(),
2215
+ reason: z6.string().optional()
2017
2216
  })
2018
2217
  ]);
2019
- var flowInputToolResultSchema = z5.object({
2020
- results: z5.array(flowInputResultSchema)
2218
+ var flowInputToolResultSchema = z6.object({
2219
+ results: z6.array(flowInputResultSchema)
2021
2220
  });
2022
- var flowsListRequestSchema = z5.object({ chatId: z5.string() });
2023
- var flowSummarySchema = z5.object({
2024
- slug: z5.string(),
2025
- name: z5.string(),
2221
+ var flowsListRequestSchema = z6.object({ chatId: z6.string() });
2222
+ var flowSummarySchema = z6.object({
2223
+ slug: z6.string(),
2224
+ name: z6.string(),
2026
2225
  /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
2027
- needsConfig: z5.number()
2226
+ needsConfig: z6.number()
2028
2227
  });
2029
- var flowsListResponseSchema = z5.object({ flows: z5.array(flowSummarySchema) });
2030
- var flowsShowRequestSchema = z5.object({
2031
- chatId: z5.string(),
2032
- slug: z5.string(),
2033
- full: z5.boolean().optional()
2228
+ var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
2229
+ var flowsShowRequestSchema = z6.object({
2230
+ chatId: z6.string(),
2231
+ slug: z6.string(),
2232
+ full: z6.boolean().optional()
2034
2233
  });
2035
- var flowConfigStatusSchema = z5.object({
2036
- nodeId: z5.string(),
2037
- nodeName: z5.string().optional(),
2234
+ var flowConfigStatusSchema = z6.object({
2235
+ nodeId: z6.string(),
2236
+ nodeName: z6.string().optional(),
2038
2237
  /** "sideEffect" credential/connection, or "node" widget resource. */
2039
- target: z5.enum(["sideEffect", "node"]),
2040
- sideEffectId: z5.string().optional(),
2041
- kind: z5.string(),
2238
+ target: z6.enum(["sideEffect", "node"]),
2239
+ sideEffectId: z6.string().optional(),
2240
+ kind: z6.string(),
2042
2241
  /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
2043
- status: z5.string(),
2242
+ status: z6.string(),
2044
2243
  /** True when a `request_flow_input` call is still needed for this piece. */
2045
- needsInput: z5.boolean()
2244
+ needsInput: z6.boolean()
2046
2245
  });
2047
- var flowsShowResponseSchema = z5.object({
2048
- slug: z5.string(),
2049
- name: z5.string(),
2246
+ var flowsShowResponseSchema = z6.object({
2247
+ slug: z6.string(),
2248
+ name: z6.string(),
2050
2249
  /** Confidential fields and whether each is configured. */
2051
- config: z5.array(flowConfigStatusSchema),
2250
+ config: z6.array(flowConfigStatusSchema),
2052
2251
  /** Present only with `--full`: the whole flow tree, secret values redacted. */
2053
- tree: z5.unknown().optional()
2252
+ tree: z6.unknown().optional()
2054
2253
  });
2055
2254
 
2056
2255
  // ../api/src/history.ts
2057
- import { z as z6 } from "zod";
2058
- var historyCategorySchema = z6.enum([
2256
+ import { z as z7 } from "zod";
2257
+ var historyCategorySchema = z7.enum([
2059
2258
  "publish",
2060
2259
  "chat",
2061
2260
  "action",
@@ -2072,36 +2271,36 @@ var historyCategorySchema = z6.enum([
2072
2271
  "domain",
2073
2272
  "integration"
2074
2273
  ]);
2075
- var historyListRequestSchema = z6.object({
2076
- limit: z6.number().int().min(1).max(200).optional(),
2274
+ var historyListRequestSchema = z7.object({
2275
+ limit: z7.number().int().min(1).max(200).optional(),
2077
2276
  category: historyCategorySchema.optional(),
2078
2277
  /** Only entries from the last N days. */
2079
- days: z6.number().int().min(1).max(365).optional(),
2278
+ days: z7.number().int().min(1).max(365).optional(),
2080
2279
  /** Include raw metadata on each entry (compact by default). */
2081
- full: z6.boolean().optional()
2280
+ full: z7.boolean().optional()
2082
2281
  });
2083
- var historyEntrySchema = z6.object({
2084
- id: z6.string(),
2282
+ var historyEntrySchema = z7.object({
2283
+ id: z7.string(),
2085
2284
  /** Epoch ms. */
2086
- at: z6.number(),
2285
+ at: z7.number(),
2087
2286
  category: historyCategorySchema,
2088
2287
  /** Dotted action id, e.g. "publish.commit", "member.invite_create". */
2089
- action: z6.string(),
2090
- actorType: z6.enum(["user", "agent", "system"]),
2288
+ action: z7.string(),
2289
+ actorType: z7.enum(["user", "agent", "system"]),
2091
2290
  /** Display name of the acting user, when the actor is a user. */
2092
- actor: z6.string().nullable(),
2291
+ actor: z7.string().nullable(),
2093
2292
  /** 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()
2293
+ target: z7.string().nullable(),
2294
+ metadata: z7.record(z7.string(), z7.unknown()).optional()
2096
2295
  });
2097
- var historyListResponseSchema = z6.object({
2098
- ok: z6.literal(true),
2099
- data: z6.object({ entries: z6.array(historyEntrySchema) })
2296
+ var historyListResponseSchema = z7.object({
2297
+ ok: z7.literal(true),
2298
+ data: z7.object({ entries: z7.array(historyEntrySchema) })
2100
2299
  });
2101
2300
 
2102
2301
  // ../api/src/images.ts
2103
- import { z as z7 } from "zod";
2104
- var imageSourceSchema = z7.enum([
2302
+ import { z as z8 } from "zod";
2303
+ var imageSourceSchema = z8.enum([
2105
2304
  "uploaded",
2106
2305
  "website",
2107
2306
  "google_testimonial",
@@ -2117,49 +2316,49 @@ var imageSourceSchema = z7.enum([
2117
2316
  "pinterest",
2118
2317
  "ai_generated"
2119
2318
  ]);
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()
2319
+ var imageStatusSchema = z8.enum(["uploading", "processing", "ready", "error"]);
2320
+ var upscaleConfigSchema = z8.object({
2321
+ model: z8.literal("philz1337x/crystal-upscaler"),
2322
+ input: z8.object({
2323
+ scale_factor: z8.number(),
2324
+ creativity: z8.number(),
2325
+ output_format: z8.string()
2127
2326
  }),
2128
- status: z7.enum(["pending", "completed"])
2327
+ status: z8.enum(["pending", "completed"])
2129
2328
  });
2130
- var imageDocSchema = z7.object({
2131
- _id: z7.string(),
2132
- _creationTime: z7.number(),
2133
- companyId: z7.string(),
2134
- storageKey: z7.string(),
2329
+ var imageDocSchema = z8.object({
2330
+ _id: z8.string(),
2331
+ _creationTime: z8.number(),
2332
+ companyId: z8.string(),
2333
+ storageKey: z8.string(),
2135
2334
  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(),
2335
+ upscaledStorageKey: z8.string().optional(),
2336
+ name: z8.string(),
2337
+ description: z8.string(),
2338
+ tags: z8.array(z8.string()),
2339
+ source: z8.string(),
2340
+ externalId: z8.string().optional(),
2341
+ externalUrl: z8.string().optional(),
2342
+ contentHash: z8.string().optional(),
2343
+ sourceId: z8.string().optional(),
2344
+ descriptionContext: z8.string().optional(),
2345
+ width: z8.number().optional(),
2346
+ height: z8.number().optional(),
2347
+ aspectRatio: z8.number().optional(),
2348
+ dominantColor: z8.string().optional(),
2349
+ imagePalette: z8.array(z8.string()).optional(),
2350
+ thumbhashDataUri: z8.string().optional(),
2351
+ isLightImage: z8.boolean().optional(),
2352
+ descriptionEmbedding: z8.array(z8.number()).optional(),
2353
+ imageEmbedding: z8.array(z8.number()).optional(),
2354
+ searchText: z8.string().optional(),
2156
2355
  status: imageStatusSchema,
2157
- errorMessage: z7.string().optional(),
2158
- createdAt: z7.number(),
2159
- updatedAt: z7.number(),
2160
- imageUrl: z7.string()
2356
+ errorMessage: z8.string().optional(),
2357
+ createdAt: z8.number(),
2358
+ updatedAt: z8.number(),
2359
+ imageUrl: z8.string()
2161
2360
  });
2162
- var imageHitSourceSchema = z7.enum([
2361
+ var imageHitSourceSchema = z8.enum([
2163
2362
  "library",
2164
2363
  "magnific",
2165
2364
  "google_images",
@@ -2170,242 +2369,242 @@ var imageHitSourceSchema = z7.enum([
2170
2369
  "giphy",
2171
2370
  "pinterest"
2172
2371
  ]);
2173
- var imageHitSchema = z7.object({
2372
+ var imageHitSchema = z8.object({
2174
2373
  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()
2374
+ url: z8.string(),
2375
+ thumbnailUrl: z8.string().optional(),
2376
+ width: z8.number().optional(),
2377
+ height: z8.number().optional(),
2378
+ aspectRatio: z8.number().optional(),
2379
+ dominantColor: z8.string().optional(),
2380
+ externalId: z8.string().optional(),
2381
+ externalUrl: z8.string().optional(),
2382
+ providerMeta: z8.record(z8.string(), z8.unknown()).optional(),
2383
+ descriptionContext: z8.string().optional(),
2384
+ _id: z8.string().optional(),
2385
+ name: z8.string().optional(),
2386
+ description: z8.string().optional(),
2387
+ tags: z8.array(z8.string()).optional(),
2388
+ score: z8.number().optional(),
2389
+ alsoInLibrary: z8.string().optional(),
2390
+ prefetchedBytes: z8.string().optional(),
2391
+ prefetchedContentType: z8.string().optional()
2193
2392
  });
2194
2393
  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()
2394
+ imageId: z8.string().optional(),
2395
+ imageUrl: z8.string().optional(),
2396
+ deduped: z8.boolean().optional(),
2397
+ sourceUrl: z8.string().optional()
2398
+ });
2399
+ var autoIngestItemSchema = z8.object({
2400
+ imageId: z8.string(),
2401
+ deduped: z8.boolean(),
2402
+ imageUrl: z8.string(),
2403
+ sourceUrl: z8.string(),
2404
+ externalUrl: z8.string().optional()
2206
2405
  });
2207
2406
  function providerHitsResponseSchema() {
2208
- return z7.object({
2209
- hits: z7.array(ingestedImageHitSchema),
2210
- ingested: z7.array(autoIngestItemSchema)
2407
+ return z8.object({
2408
+ hits: z8.array(ingestedImageHitSchema),
2409
+ ingested: z8.array(autoIngestItemSchema)
2211
2410
  });
2212
2411
  }
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")
2412
+ var imagesGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2413
+ var imagesSearchRequestSchema = z8.object({
2414
+ query: z8.string().min(1),
2415
+ limit: z8.coerce.number().int().positive().max(100).optional(),
2416
+ aspectRatio: z8.string().optional(),
2417
+ tags: z8.array(z8.string()).optional(),
2418
+ source: z8.string().optional(),
2419
+ externalUrlHost: z8.string().optional()
2420
+ });
2421
+ var imageSearchResultSchema = z8.object({
2422
+ _id: z8.string(),
2423
+ imageUrl: z8.string(),
2424
+ name: z8.string(),
2425
+ description: z8.string(),
2426
+ tags: z8.array(z8.string()),
2427
+ width: z8.number().optional(),
2428
+ height: z8.number().optional(),
2429
+ aspectRatio: z8.number().optional(),
2430
+ dominantColor: z8.string().optional(),
2431
+ imagePalette: z8.array(z8.string()).optional(),
2432
+ source: z8.string(),
2433
+ externalUrl: z8.string().optional(),
2434
+ score: z8.number()
2435
+ });
2436
+ var imagesSearchResponseSchema = z8.array(imageSearchResultSchema);
2437
+ var imagesUploadRequestSchema = z8.object({
2438
+ base64: z8.string().min(1),
2439
+ contentType: z8.string().min(1),
2440
+ source: z8.string().optional(),
2441
+ descriptionContext: z8.string().optional()
2442
+ });
2443
+ var imagesUploadResponseSchema = z8.object({ imageId: z8.string() });
2444
+ var imagesDeleteRequestSchema = z8.object({ id: z8.string().min(1, "Missing image ID") });
2445
+ var imagesDeleteResponseSchema = z8.object({ ok: z8.literal(true) });
2446
+ var imagesUpscaleRequestSchema = z8.object({ imageId: z8.string().min(1, "Missing image ID") });
2447
+ var imagesUpscaleResponseSchema = z8.object({
2448
+ imageId: z8.string(),
2449
+ status: z8.literal("processing")
2251
2450
  });
2252
2451
  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)
2452
+ var imagesFindRequestSchema = z8.object({
2453
+ query: z8.string().min(1),
2454
+ sources: z8.array(z8.enum(IMAGES_FIND_SOURCES)).optional(),
2455
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2456
+ fallback: z8.boolean().optional(),
2457
+ threshold: z8.number().min(0).max(1).optional(),
2458
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2459
+ descriptionContext: z8.string().optional()
2460
+ });
2461
+ var imagesFindResponseSchema = z8.object({
2462
+ groups: z8.object({
2463
+ library: z8.array(imageHitSchema),
2464
+ external: z8.array(ingestedImageHitSchema)
2266
2465
  }),
2267
- meta: z7.object({
2268
- counts: z7.record(z7.string(), z7.number()),
2269
- errors: z7.array(z7.object({ source: imageHitSourceSchema, message: z7.string() }))
2466
+ meta: z8.object({
2467
+ counts: z8.record(z8.string(), z8.number()),
2468
+ errors: z8.array(z8.object({ source: imageHitSourceSchema, message: z8.string() }))
2270
2469
  }),
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()
2470
+ ingested: z8.array(autoIngestItemSchema)
2471
+ });
2472
+ var imagesStockRequestSchema = z8.object({
2473
+ query: z8.string().min(1),
2474
+ orientation: z8.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2475
+ contentType: z8.enum(["photo", "vector", "psd"]).optional(),
2476
+ license: z8.enum(["freemium", "premium"]).optional(),
2477
+ color: z8.string().optional(),
2478
+ aiGenerated: z8.enum(["exclude", "only"]).optional(),
2479
+ people: z8.enum(["include", "exclude", "only"]).optional(),
2480
+ order: z8.enum(["relevance", "recent"]).optional(),
2481
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2482
+ page: z8.coerce.number().int().positive().optional(),
2483
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2484
+ descriptionContext: z8.string().optional()
2286
2485
  });
2287
2486
  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()
2487
+ var imagesGoogleRequestSchema = z8.object({
2488
+ query: z8.string().min(1),
2489
+ type: z8.string().optional(),
2490
+ size: z8.string().optional(),
2491
+ color: z8.string().optional(),
2492
+ safe: z8.enum(["off", "active"]).optional(),
2493
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2494
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2495
+ descriptionContext: z8.string().optional()
2297
2496
  });
2298
2497
  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()
2498
+ var imagesPinterestRequestSchema = z8.object({
2499
+ query: z8.string().min(1),
2500
+ limit: z8.coerce.number().int().positive().max(20).optional(),
2501
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2502
+ descriptionContext: z8.string().optional()
2304
2503
  });
2305
2504
  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)
2505
+ var rgbTriple = z8.tuple([
2506
+ z8.number().int().min(0).max(255),
2507
+ z8.number().int().min(0).max(255),
2508
+ z8.number().int().min(0).max(255)
2310
2509
  ]);
2311
- var imageGenerateModelSchema = z7.enum([
2510
+ var imageGenerateModelSchema = z8.enum([
2312
2511
  "openai/gpt-5.4-image-2",
2313
2512
  "google/gemini-3.5-flash",
2314
2513
  "google/gemini-3.1-flash-image-preview",
2315
2514
  "google/gemini-3-pro-image-preview",
2316
2515
  "recraft/recraft-v4.1-pro-vector"
2317
2516
  ]);
2318
- var imagesGenerateRequestSchema = z7.object({
2319
- prompt: z7.string().min(1),
2517
+ var imagesGenerateRequestSchema = z8.object({
2518
+ prompt: z8.string().min(1),
2320
2519
  model: imageGenerateModelSchema.optional(),
2321
2520
  // Aspect ratio + size are validated loosely as strings; the per-model enum
2322
2521
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
2323
- aspectRatio: z7.string().optional(),
2324
- imageSize: z7.string().optional(),
2522
+ aspectRatio: z8.string().optional(),
2523
+ imageSize: z8.string().optional(),
2325
2524
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
2326
- quality: z7.enum(["auto", "low", "medium", "high"]).optional(),
2525
+ quality: z8.enum(["auto", "low", "medium", "high"]).optional(),
2327
2526
  // 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(),
2527
+ strength: z8.coerce.number().min(0).max(1).optional(),
2528
+ rgbColors: z8.array(rgbTriple).optional(),
2330
2529
  backgroundRgbColor: rgbTriple.optional(),
2331
2530
  // 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()
2531
+ referenceUrls: z8.array(z8.string().url()).optional(),
2532
+ descriptionContext: z8.string().optional()
2533
+ });
2534
+ var generatedImageSchema = z8.object({
2535
+ imageId: z8.string(),
2536
+ deduped: z8.boolean(),
2537
+ imageUrl: z8.string(),
2538
+ width: z8.number().optional(),
2539
+ height: z8.number().optional()
2540
+ });
2541
+ var imagesGenerateResponseSchema = z8.object({
2542
+ model: z8.string(),
2543
+ costUsd: z8.number(),
2544
+ images: z8.array(generatedImageSchema)
2545
+ });
2546
+ var imagesLogoRequestSchema = z8.object({
2547
+ domain: z8.string().min(1),
2548
+ variant: z8.enum(["icon", "logo", "symbol"]).optional(),
2549
+ autoIngest: z8.coerce.number().int().min(0).max(5).optional(),
2550
+ descriptionContext: z8.string().optional()
2352
2551
  });
2353
2552
  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()
2553
+ var imagesIconRequestSchema = z8.object({
2554
+ name: z8.string().min(1),
2555
+ set: z8.string().optional(),
2556
+ color: z8.string().optional(),
2557
+ width: z8.coerce.number().int().positive().optional(),
2558
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2559
+ descriptionContext: z8.string().optional()
2361
2560
  });
2362
2561
  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()
2562
+ var imagesExtractRequestSchema = z8.object({
2563
+ url: z8.string().url(),
2564
+ waitFor: z8.coerce.number().int().min(0).max(3e4).optional(),
2565
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2566
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2567
+ descriptionContext: z8.string().optional()
2369
2568
  });
2370
2569
  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()
2570
+ var imagesScreenshotRequestSchema = z8.object({
2571
+ url: z8.string().url(),
2572
+ fullPage: z8.boolean().optional(),
2573
+ viewportWidth: z8.coerce.number().int().positive().max(3840).optional(),
2574
+ viewportHeight: z8.coerce.number().int().positive().max(2160).optional(),
2575
+ format: z8.enum(["webp", "png", "jpg"]).optional(),
2576
+ descriptionContext: z8.string().optional()
2378
2577
  });
2379
2578
  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()
2579
+ var imagesGiphyRequestSchema = z8.object({
2580
+ query: z8.string().min(1).optional(),
2581
+ trending: z8.coerce.boolean().optional(),
2582
+ limit: z8.coerce.number().int().positive().max(50).optional(),
2583
+ rating: z8.enum(["g", "pg", "pg-13", "r"]).optional(),
2584
+ lang: z8.string().optional(),
2585
+ autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
2586
+ descriptionContext: z8.string().optional()
2388
2587
  });
2389
2588
  var imagesGifResponseSchema = providerHitsResponseSchema();
2390
2589
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2391
- var imagesIngestRequestSchema = z7.object({
2392
- url: z7.string().url(),
2590
+ var imagesIngestRequestSchema = z8.object({
2591
+ url: z8.string().url(),
2393
2592
  // Validate source at the HTTP boundary so unknown values produce the standard
2394
2593
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2395
2594
  // `assertImageSource` inside the action.
2396
2595
  source: imageSourceSchema,
2397
- externalId: z7.string().optional(),
2398
- externalUrl: z7.string().optional(),
2399
- descriptionContext: z7.string().optional()
2596
+ externalId: z8.string().optional(),
2597
+ externalUrl: z8.string().optional(),
2598
+ descriptionContext: z8.string().optional()
2400
2599
  });
2401
- var imagesIngestResponseSchema = z7.object({
2402
- imageId: z7.string(),
2403
- deduped: z7.boolean(),
2404
- contentHash: z7.string()
2600
+ var imagesIngestResponseSchema = z8.object({
2601
+ imageId: z8.string(),
2602
+ deduped: z8.boolean(),
2603
+ contentHash: z8.string()
2405
2604
  });
2406
2605
 
2407
2606
  // ../api/src/tags.ts
2408
- import { z as z8 } from "zod";
2607
+ import { z as z9 } from "zod";
2409
2608
  var TAG_TYPES = [
2410
2609
  "meta",
2411
2610
  "amplitude",
@@ -2426,7 +2625,7 @@ var TAG_TYPES = [
2426
2625
  "recaptcha",
2427
2626
  "twitterAds"
2428
2627
  ];
2429
- var tagTypeSchema = z8.enum(TAG_TYPES);
2628
+ var tagTypeSchema = z9.enum(TAG_TYPES);
2430
2629
  var TAG_IDENTIFYING_FIELD = {
2431
2630
  meta: "pixelId",
2432
2631
  googleAds: "conversionID",
@@ -2447,218 +2646,218 @@ var TAG_IDENTIFYING_FIELD = {
2447
2646
  recaptcha: "siteKey",
2448
2647
  twitterAds: "pixelId"
2449
2648
  };
2450
- var tagDraftOpKindSchema = z8.enum(["create", "update", "delete"]);
2451
- var tagDraftOpViewSchema = z8.object({
2649
+ var tagDraftOpKindSchema = z9.enum(["create", "update", "delete"]);
2650
+ var tagDraftOpViewSchema = z9.object({
2452
2651
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2453
- ref: z8.string(),
2652
+ ref: z9.string(),
2454
2653
  kind: tagDraftOpKindSchema,
2455
2654
  type: tagTypeSchema,
2456
2655
  /** Present on update/delete ops — the real tag this op targets. */
2457
- tagId: z8.string().optional(),
2656
+ tagId: z9.string().optional(),
2458
2657
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2459
- config: z8.record(z8.string(), z8.string()),
2658
+ config: z9.record(z9.string(), z9.string()),
2460
2659
  /** Update only — fields the op explicitly clears. */
2461
- clearFields: z8.array(z8.string()).optional(),
2660
+ clearFields: z9.array(z9.string()).optional(),
2462
2661
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2463
- secretsSet: z8.array(z8.string()),
2662
+ secretsSet: z9.array(z9.string()),
2464
2663
  /** Names of secret fields still awaiting user input. */
2465
- secretsPending: z8.array(z8.string()),
2466
- summary: z8.string(),
2467
- stagedAt: z8.number()
2664
+ secretsPending: z9.array(z9.string()),
2665
+ summary: z9.string(),
2666
+ stagedAt: z9.number()
2468
2667
  });
2469
- var tagsEffectiveEntrySchema = z8.object({
2668
+ var tagsEffectiveEntrySchema = z9.object({
2470
2669
  /** 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(),
2670
+ ref: z9.string(),
2671
+ tagId: z9.string().optional(),
2473
2672
  type: tagTypeSchema,
2474
2673
  /** Value of the type's identifying field, when set. */
2475
- identifier: z8.string().optional(),
2674
+ identifier: z9.string().optional(),
2476
2675
  /** Redacted config; for staged updates, production config with the patch merged. */
2477
- config: z8.record(z8.string(), z8.string()),
2676
+ config: z9.record(z9.string(), z9.string()),
2478
2677
  /** Absent = live production tag with no staged changes in this chat. */
2479
2678
  staged: tagDraftOpKindSchema.optional(),
2480
- secretsSet: z8.array(z8.string()),
2481
- secretsPending: z8.array(z8.string())
2679
+ secretsSet: z9.array(z9.string()),
2680
+ secretsPending: z9.array(z9.string())
2482
2681
  });
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)
2682
+ var tagsListRequestSchema = z9.object({ chatId: z9.string() });
2683
+ var tagsListResponseSchema = z9.object({ tags: z9.array(tagsEffectiveEntrySchema) });
2684
+ var tagsDraftListRequestSchema = z9.object({ chatId: z9.string() });
2685
+ var tagsDraftListResponseSchema = z9.object({
2686
+ status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
2687
+ ops: z9.array(tagDraftOpViewSchema)
2489
2688
  });
2490
- var tagInputRequestSchema = z8.object({
2689
+ var tagInputRequestSchema = z9.object({
2491
2690
  // Every tag change is a tab in the approval form: create/edit show the full
2492
2691
  // body; delete shows a confirm. No tag change bypasses this approval.
2493
- mode: z8.enum(["create", "edit", "delete"]),
2692
+ mode: z9.enum(["create", "edit", "delete"]),
2494
2693
  tagType: tagTypeSchema,
2495
2694
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2496
- ref: z8.string().optional(),
2695
+ ref: z9.string().optional(),
2497
2696
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2498
- prefilledConfig: z8.record(z8.string(), z8.string()).optional(),
2697
+ prefilledConfig: z9.record(z9.string(), z9.string()).optional(),
2499
2698
  /** Secret field names the agent asks the user to provide. */
2500
- requestedSecretFields: z8.array(z8.string()).optional(),
2699
+ requestedSecretFields: z9.array(z9.string()).optional(),
2501
2700
  /** Short message shown above the form explaining why the input is needed. */
2502
- message: z8.string().optional()
2701
+ message: z9.string().optional()
2503
2702
  });
2504
- var tagChangeToolInputSchema = z8.object({
2505
- changes: z8.array(tagInputRequestSchema).min(1).max(8)
2703
+ var tagChangeToolInputSchema = z9.object({
2704
+ changes: z9.array(tagInputRequestSchema).min(1).max(8)
2506
2705
  });
2507
- var tagInputResultSchema = z8.discriminatedUnion("status", [
2508
- z8.object({
2509
- status: z8.literal("submitted"),
2510
- ref: z8.string(),
2706
+ var tagInputResultSchema = z9.discriminatedUnion("status", [
2707
+ z9.object({
2708
+ status: z9.literal("submitted"),
2709
+ ref: z9.string(),
2511
2710
  type: tagTypeSchema,
2512
2711
  /** 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()
2712
+ identifier: z9.record(z9.string(), z9.string()).optional(),
2713
+ secretFieldsSet: z9.array(z9.string()),
2714
+ note: z9.string().optional()
2516
2715
  }),
2517
- z8.object({
2518
- status: z8.literal("declined"),
2519
- reason: z8.string().optional()
2716
+ z9.object({
2717
+ status: z9.literal("declined"),
2718
+ reason: z9.string().optional()
2520
2719
  })
2521
2720
  ]);
2522
- var tagChangeToolResultSchema = z8.object({
2523
- results: z8.array(tagInputResultSchema)
2721
+ var tagChangeToolResultSchema = z9.object({
2722
+ results: z9.array(tagInputResultSchema)
2524
2723
  });
2525
2724
 
2526
2725
  // ../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(),
2726
+ import { z as z10 } from "zod";
2727
+ var testimonialSourceTypeSchema = z10.enum(["google", "trustpilot"]);
2728
+ var testimonialStatusSchema = z10.enum(["pending", "processing", "ready", "error"]);
2729
+ var testimonialSentimentSchema = z10.enum(["positive", "neutral", "negative"]);
2730
+ var testimonialDocSchema = z10.object({
2731
+ _id: z10.string(),
2732
+ _creationTime: z10.number(),
2733
+ companyId: z10.string(),
2734
+ sourceId: z10.string(),
2536
2735
  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(),
2736
+ reviewText: z10.string(),
2737
+ reviewTitle: z10.string().optional(),
2738
+ searchText: z10.string().optional(),
2739
+ reviewerName: z10.string().optional(),
2740
+ reviewerImageUrl: z10.string().optional(),
2741
+ reviewerImageId: z10.string().optional(),
2742
+ reviewerLocation: z10.string().optional(),
2743
+ rating: z10.number().optional(),
2744
+ reviewDate: z10.number().optional(),
2745
+ ownerAnswer: z10.string().optional(),
2746
+ mediaUrls: z10.array(z10.string()).optional(),
2747
+ imageIds: z10.array(z10.string()).optional(),
2748
+ videoIds: z10.array(z10.string()).optional(),
2749
+ sourceUrl: z10.string().optional(),
2750
+ rawData: z10.unknown().optional(),
2751
+ tags: z10.array(z10.string()),
2752
+ highlight: z10.string().optional(),
2753
+ language: z10.string().optional(),
2754
+ summary: z10.string().optional(),
2556
2755
  sentiment: testimonialSentimentSchema.optional(),
2557
- textEmbedding: z9.array(z9.number()).optional(),
2558
- externalId: z9.string().optional(),
2559
- contentHash: z9.string().optional(),
2756
+ textEmbedding: z10.array(z10.number()).optional(),
2757
+ externalId: z10.string().optional(),
2758
+ contentHash: z10.string().optional(),
2560
2759
  status: testimonialStatusSchema,
2561
- errorMessage: z9.string().optional(),
2562
- createdAt: z9.number(),
2563
- updatedAt: z9.number()
2760
+ errorMessage: z10.string().optional(),
2761
+ createdAt: z10.number(),
2762
+ updatedAt: z10.number()
2564
2763
  });
2565
- var testimonialsListRequestSchema = z9.object({
2764
+ var testimonialsListRequestSchema = z10.object({
2566
2765
  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(),
2766
+ rating_min: z10.coerce.number().int().min(1).max(5).optional(),
2767
+ rating_max: z10.coerce.number().int().min(1).max(5).optional(),
2768
+ tags: z10.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2570
2769
  status: testimonialStatusSchema.optional(),
2571
2770
  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(),
2771
+ language: z10.string().min(2).max(5).optional(),
2772
+ limit: z10.coerce.number().int().positive().max(200).optional()
2773
+ });
2774
+ var testimonialsListResponseSchema = z10.array(testimonialDocSchema);
2775
+ var testimonialsGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2776
+ var testimonialsSearchRequestSchema = z10.object({
2777
+ query: z10.string().min(1),
2778
+ limit: z10.coerce.number().int().positive().max(100).optional(),
2580
2779
  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(),
2780
+ rating_min: z10.coerce.number().int().min(1).max(5).optional(),
2781
+ rating_max: z10.coerce.number().int().min(1).max(5).optional(),
2782
+ tags: z10.array(z10.string()).optional(),
2584
2783
  status: testimonialStatusSchema.optional(),
2585
2784
  sentiment: testimonialSentimentSchema.optional(),
2586
- language: z9.string().min(2).max(5).optional()
2785
+ language: z10.string().min(2).max(5).optional()
2587
2786
  }).refine(
2588
2787
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2589
2788
  { message: "rating_min must be less than or equal to rating_max" }
2590
2789
  );
2591
- var testimonialsSearchResponseSchema = z9.array(testimonialDocSchema);
2592
- var testimonialsOutscraperWebhookResponseSchema = z9.object({
2593
- ok: z9.literal(true),
2594
- note: z9.string().optional()
2790
+ var testimonialsSearchResponseSchema = z10.array(testimonialDocSchema);
2791
+ var testimonialsOutscraperWebhookResponseSchema = z10.object({
2792
+ ok: z10.literal(true),
2793
+ note: z10.string().optional()
2595
2794
  });
2596
2795
 
2597
2796
  // ../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(),
2797
+ import { z as z11 } from "zod";
2798
+ var videoStatusSchema = z11.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2799
+ var videoTranscriptSegmentSchema = z11.object({
2800
+ text: z11.string(),
2801
+ startSecond: z11.number(),
2802
+ endSecond: z11.number()
2803
+ });
2804
+ var videoSceneSchema = z11.object({
2805
+ title: z11.string(),
2806
+ description: z11.string(),
2807
+ startSecond: z11.number(),
2808
+ endSecond: z11.number(),
2809
+ thumbnailTime: z11.number()
2810
+ });
2811
+ var videoDocSchema = z11.object({
2812
+ _id: z11.string(),
2813
+ _creationTime: z11.number(),
2814
+ companyId: z11.string(),
2815
+ muxAssetId: z11.string(),
2816
+ muxPlaybackId: z11.string(),
2817
+ muxUploadId: z11.string(),
2818
+ name: z11.string(),
2819
+ description: z11.string(),
2820
+ tags: z11.array(z11.string()),
2821
+ source: z11.string(),
2822
+ externalId: z11.string().optional(),
2823
+ sourceId: z11.string().optional(),
2824
+ width: z11.number().optional(),
2825
+ height: z11.number().optional(),
2826
+ aspectRatio: z11.number().optional(),
2827
+ duration: z11.number().optional(),
2828
+ transcript: z11.string().optional(),
2829
+ transcriptSegments: z11.array(videoTranscriptSegmentSchema).optional(),
2830
+ scenes: z11.array(videoSceneSchema).optional(),
2831
+ descriptionEmbedding: z11.array(z11.number()).optional(),
2832
+ searchText: z11.string().optional(),
2634
2833
  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) });
2834
+ errorMessage: z11.string().optional(),
2835
+ createdAt: z11.number(),
2836
+ updatedAt: z11.number(),
2837
+ thumbnailUrl: z11.string()
2838
+ });
2839
+ var videosWebhookResponseSchema = z11.object({ ok: z11.literal(true) });
2840
+ var videosGetRequestSchema = z11.object({ id: z11.string().min(1, "Missing id parameter") });
2841
+ var videosSearchRequestSchema = z11.object({
2842
+ query: z11.string().min(1),
2843
+ limit: z11.coerce.number().int().positive().max(100).optional(),
2844
+ tags: z11.array(z11.string()).optional()
2845
+ });
2846
+ var videoSearchResultSchema = z11.object({
2847
+ _id: z11.string(),
2848
+ thumbnailUrl: z11.string(),
2849
+ name: z11.string(),
2850
+ description: z11.string(),
2851
+ tags: z11.array(z11.string()),
2852
+ status: z11.string(),
2853
+ duration: z11.number().optional(),
2854
+ muxPlaybackId: z11.string(),
2855
+ createdAt: z11.number()
2856
+ });
2857
+ var videosSearchResponseSchema = z11.array(videoSearchResultSchema);
2858
+ var videosUploadResponseSchema = z11.object({ uploadUrl: z11.string(), videoId: z11.string() });
2859
+ var videosDeleteRequestSchema = z11.object({ id: z11.string().min(1, "Missing video ID") });
2860
+ var videosDeleteResponseSchema = z11.object({ ok: z11.literal(true) });
2662
2861
 
2663
2862
  // src/commands/actions/complete.ts
2664
2863
  import { defineCommand as defineCommand2 } from "citty";
@@ -4471,37 +4670,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4471
4670
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4472
4671
 
4473
4672
  // ../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"),
4673
+ import { z as z12 } from "zod";
4674
+ var tempRefSchema2 = z12.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4675
+ var refSchema = z12.union([
4676
+ z12.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4677
+ z12.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4479
4678
  tempRefSchema2
4480
4679
  ]);
4481
4680
  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),
4681
+ var microsSchema = z12.number().int().positive("expected a positive micros amount");
4682
+ var httpsUrlSchema2 = z12.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4683
+ var customerIdSchema = z12.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4684
+ var stageableStatusSchema2 = z12.enum(STAGEABLE_CREATE_STATUSES2);
4685
+ var matchTypeSchema = z12.enum(KEYWORD_MATCH_TYPES);
4686
+ var keywordTextSchema = z12.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4687
+ var budgetCreateSchema = z12.object({
4688
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4490
4689
  amountMicros: microsSchema,
4491
- deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4492
- explicitlyShared: z11.boolean().default(false)
4690
+ deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4691
+ explicitlyShared: z12.boolean().default(false)
4493
4692
  });
4494
- var budgetUpdateSchema = z11.object({
4495
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4693
+ var budgetUpdateSchema = z12.object({
4694
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4496
4695
  amountMicros: microsSchema.optional(),
4497
- deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).optional()
4696
+ deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).optional()
4498
4697
  }).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),
4698
+ var biddingConfigSchema = z12.object({
4699
+ type: z12.enum(BIDDING_STRATEGY_TYPES),
4501
4700
  targetCpaMicros: microsSchema.optional(),
4502
- targetRoas: z11.number().positive().optional(),
4701
+ targetRoas: z12.number().positive().optional(),
4503
4702
  cpcBidCeilingMicros: microsSchema.optional(),
4504
- enhancedCpcEnabled: z11.boolean().optional()
4703
+ enhancedCpcEnabled: z12.boolean().optional()
4505
4704
  }).superRefine((p, ctx) => {
4506
4705
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4507
4706
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4510,17 +4709,17 @@ var biddingConfigSchema = z11.object({
4510
4709
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4511
4710
  }
4512
4711
  });
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()
4712
+ var networkSettingsSchema = z12.object({
4713
+ targetGoogleSearch: z12.boolean().optional(),
4714
+ targetSearchNetwork: z12.boolean().optional(),
4715
+ targetContentNetwork: z12.boolean().optional(),
4716
+ targetPartnerSearchNetwork: z12.boolean().optional()
4518
4717
  });
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(),
4718
+ var dateSchema = z12.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4719
+ var campaignCreateSchema2 = z12.object({
4720
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4721
+ channelType: z12.enum(ADVERTISING_CHANNEL_TYPES),
4722
+ channelSubType: z12.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4524
4723
  budget: refSchema,
4525
4724
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4526
4725
  bidding: biddingConfigSchema.optional(),
@@ -4529,7 +4728,7 @@ var campaignCreateSchema2 = z11.object({
4529
4728
  startDate: dateSchema.optional(),
4530
4729
  endDate: dateSchema.optional(),
4531
4730
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4532
- objective: z11.enum(CAMPAIGN_OBJECTIVES).optional(),
4731
+ objective: z12.enum(CAMPAIGN_OBJECTIVES).optional(),
4533
4732
  status: stageableStatusSchema2.default("PAUSED")
4534
4733
  }).superRefine((p, ctx) => {
4535
4734
  if (!p.bidding && !p.biddingStrategy) {
@@ -4553,129 +4752,129 @@ var campaignCreateSchema2 = z11.object({
4553
4752
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4554
4753
  }
4555
4754
  });
4556
- var campaignUpdateSchema2 = z11.object({
4557
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4755
+ var campaignUpdateSchema2 = z12.object({
4756
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4558
4757
  budget: refSchema.optional(),
4559
4758
  bidding: biddingConfigSchema.optional(),
4560
4759
  networkSettings: networkSettingsSchema.optional(),
4561
4760
  startDate: dateSchema.optional(),
4562
4761
  endDate: dateSchema.optional(),
4563
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4762
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4564
4763
  }).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),
4764
+ var adGroupCreateSchema = z12.object({
4765
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4567
4766
  campaign: refSchema,
4568
- type: z11.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4767
+ type: z12.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4569
4768
  cpcBidMicros: microsSchema.optional(),
4570
4769
  status: stageableStatusSchema2.default("PAUSED")
4571
4770
  });
4572
- var adGroupUpdateSchema = z11.object({
4573
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4771
+ var adGroupUpdateSchema = z12.object({
4772
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4574
4773
  cpcBidMicros: microsSchema.optional(),
4575
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4774
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4576
4775
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4577
- var keywordAddSchema = z11.object({
4776
+ var keywordAddSchema = z12.object({
4578
4777
  adGroup: refSchema,
4579
4778
  text: keywordTextSchema,
4580
4779
  matchType: matchTypeSchema,
4581
4780
  cpcBidMicros: microsSchema.optional(),
4582
- finalUrls: z11.array(httpsUrlSchema2).optional(),
4781
+ finalUrls: z12.array(httpsUrlSchema2).optional(),
4583
4782
  status: stageableStatusSchema2.default("ENABLED")
4584
4783
  });
4585
- var keywordUpdateSchema = z11.object({
4784
+ var keywordUpdateSchema = z12.object({
4586
4785
  cpcBidMicros: microsSchema.optional(),
4587
- finalUrls: z11.array(httpsUrlSchema2).optional(),
4588
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4786
+ finalUrls: z12.array(httpsUrlSchema2).optional(),
4787
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4589
4788
  }).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"]),
4789
+ var negativeKeywordAddSchema = z12.object({
4790
+ level: z12.enum(["adGroup", "campaign"]),
4592
4791
  parent: refSchema,
4593
4792
  text: keywordTextSchema,
4594
4793
  matchType: matchTypeSchema
4595
4794
  });
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")
4795
+ var sharedSetCreateSchema = z12.object({
4796
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4797
+ type: z12.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4599
4798
  });
4600
- var sharedSetMemberAddSchema = z11.object({
4799
+ var sharedSetMemberAddSchema = z12.object({
4601
4800
  sharedSet: refSchema,
4602
4801
  text: keywordTextSchema,
4603
4802
  matchType: matchTypeSchema
4604
4803
  });
4605
- var campaignSharedSetAttachSchema = z11.object({
4804
+ var campaignSharedSetAttachSchema = z12.object({
4606
4805
  campaign: refSchema,
4607
4806
  sharedSet: refSchema
4608
4807
  });
4609
- var adTextAssetSchema = z11.object({
4610
- text: z11.string().min(1),
4611
- pinnedField: z11.enum(PINNED_FIELDS).optional()
4808
+ var adTextAssetSchema = z12.object({
4809
+ text: z12.string().min(1),
4810
+ pinnedField: z12.enum(PINNED_FIELDS).optional()
4612
4811
  });
4613
- var responsiveSearchAdSchema = z11.object({
4614
- format: z11.literal("responsiveSearch"),
4615
- headlines: z11.array(
4812
+ var responsiveSearchAdSchema = z12.object({
4813
+ format: z12.literal("responsiveSearch"),
4814
+ headlines: z12.array(
4616
4815
  adTextAssetSchema.refine(
4617
4816
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4618
4817
  "headline exceeds 30 chars"
4619
4818
  )
4620
4819
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4621
- descriptions: z11.array(
4820
+ descriptions: z12.array(
4622
4821
  adTextAssetSchema.refine(
4623
4822
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4624
4823
  "description exceeds 90 chars"
4625
4824
  )
4626
4825
  ).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),
4826
+ path1: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4827
+ path2: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4828
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4829
+ });
4830
+ var responsiveDisplayAdSchema = z12.object({
4831
+ format: z12.literal("responsiveDisplay"),
4832
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4833
+ longHeadline: z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4834
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4835
+ businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4637
4836
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4638
4837
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4639
4838
  // 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"),
4839
+ marketingImageAssets: z12.array(refSchema).optional(),
4840
+ squareMarketingImageAssets: z12.array(refSchema).optional(),
4841
+ logoImageAssets: z12.array(refSchema).optional(),
4842
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4843
+ });
4844
+ var callAdSchema = z12.object({
4845
+ format: z12.literal("call"),
4846
+ countryCode: z12.string().length(2),
4847
+ phoneNumber: z12.string().min(3),
4848
+ headline1: z12.string().min(1).max(30),
4849
+ headline2: z12.string().min(1).max(30),
4850
+ description1: z12.string().min(1).max(90),
4851
+ description2: z12.string().min(1).max(90),
4852
+ businessName: z12.string().min(1).max(25),
4853
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4854
+ });
4855
+ var appAdSchema = z12.object({
4856
+ format: z12.literal("app"),
4857
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(30) })).min(1),
4858
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1)
4859
+ });
4860
+ var videoAdSchema = z12.object({
4861
+ format: z12.literal("video"),
4663
4862
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4664
4863
  // 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", [
4864
+ videoAssets: z12.array(refSchema).min(1),
4865
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4866
+ });
4867
+ var demandGenAdSchema = z12.object({
4868
+ format: z12.literal("demandGen"),
4869
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(40) })).min(1).max(5),
4870
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1).max(5),
4871
+ businessName: z12.string().min(1).max(25),
4872
+ finalUrls: z12.array(httpsUrlSchema2).min(1),
4873
+ imageAssets: z12.array(refSchema).optional(),
4874
+ squareImageAssets: z12.array(refSchema).optional(),
4875
+ logoImageAssets: z12.array(refSchema).optional()
4876
+ });
4877
+ var adContentSchema = z12.discriminatedUnion("format", [
4679
4878
  responsiveSearchAdSchema,
4680
4879
  responsiveDisplayAdSchema,
4681
4880
  callAdSchema,
@@ -4683,45 +4882,45 @@ var adContentSchema = z11.discriminatedUnion("format", [
4683
4882
  videoAdSchema,
4684
4883
  demandGenAdSchema
4685
4884
  ]);
4686
- var adCreateSchema = z11.object({
4885
+ var adCreateSchema = z12.object({
4687
4886
  adGroup: refSchema,
4688
4887
  status: stageableStatusSchema2.default("PAUSED"),
4689
4888
  content: adContentSchema
4690
4889
  });
4691
- var adUpdateSchema = z11.object({
4692
- status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4890
+ var adUpdateSchema = z12.object({
4891
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4693
4892
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4694
- content: z11.record(z11.string(), z11.unknown()).optional()
4893
+ content: z12.record(z12.string(), z12.unknown()).optional()
4695
4894
  }).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", [
4895
+ var textAssetSchema = z12.object({ type: z12.literal("text"), text: z12.string().min(1) });
4896
+ var imageAssetSchema = z12.object({
4897
+ type: z12.literal("image"),
4898
+ imageId: z12.string().min(1),
4899
+ name: z12.string().optional()
4900
+ });
4901
+ var youtubeVideoAssetSchema = z12.object({
4902
+ type: z12.literal("youtubeVideo"),
4903
+ youtubeVideoId: z12.string().min(1),
4904
+ name: z12.string().optional()
4905
+ });
4906
+ var sitelinkAssetSchema = z12.object({
4907
+ type: z12.literal("sitelink"),
4908
+ linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4909
+ description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4910
+ description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4911
+ finalUrls: z12.array(httpsUrlSchema2).min(1)
4912
+ });
4913
+ var calloutAssetSchema = z12.object({
4914
+ type: z12.literal("callout"),
4915
+ calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4916
+ });
4917
+ var structuredSnippetAssetSchema = z12.object({
4918
+ type: z12.literal("structuredSnippet"),
4919
+ header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4920
+ values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4921
+ });
4922
+ var callToActionAssetSchema = z12.object({ type: z12.literal("callToAction"), callToAction: z12.string().min(1) });
4923
+ var assetCreateSchema = z12.discriminatedUnion("type", [
4725
4924
  textAssetSchema,
4726
4925
  imageAssetSchema,
4727
4926
  youtubeVideoAssetSchema,
@@ -4730,136 +4929,136 @@ var assetCreateSchema = z11.discriminatedUnion("type", [
4730
4929
  structuredSnippetAssetSchema,
4731
4930
  callToActionAssetSchema
4732
4931
  ]);
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()
4932
+ var assetUpdateSchema = z12.object({
4933
+ name: z12.string().min(1).optional(),
4934
+ linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4935
+ description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4936
+ description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4937
+ finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
4938
+ calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4939
+ header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4940
+ values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4941
+ callToAction: z12.string().min(1).optional(),
4942
+ text: z12.string().min(1).optional()
4744
4943
  }).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"]),
4944
+ var assetLinkAttachSchema = z12.object({
4945
+ level: z12.enum(["campaign", "adGroup", "customer"]),
4747
4946
  parent: refSchema.optional(),
4748
4947
  asset: refSchema,
4749
- fieldType: z11.enum(ASSET_FIELD_TYPES)
4948
+ fieldType: z12.enum(ASSET_FIELD_TYPES)
4750
4949
  }).superRefine((value, ctx) => {
4751
4950
  if (value.level !== "customer" && !value.parent) {
4752
4951
  ctx.addIssue({
4753
- code: z11.ZodIssueCode.custom,
4952
+ code: z12.ZodIssueCode.custom,
4754
4953
  path: ["parent"],
4755
4954
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4756
4955
  });
4757
4956
  }
4758
4957
  });
4759
- var assetGroupCreateSchema = z11.object({
4958
+ var assetGroupCreateSchema = z12.object({
4760
4959
  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()
4960
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4961
+ finalUrls: z12.array(httpsUrlSchema2).min(1),
4962
+ headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4963
+ longHeadlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4964
+ descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4965
+ businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4966
+ imageAssets: z12.array(refSchema).optional(),
4967
+ squareImageAssets: z12.array(refSchema).optional(),
4968
+ logoAssets: z12.array(refSchema).optional(),
4969
+ status: z12.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4970
+ });
4971
+ var assetGroupUpdateSchema = z12.object({
4972
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4973
+ finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
4974
+ status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4776
4975
  }).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(),
4976
+ var audienceCreateSchema2 = z12.object({
4977
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4978
+ type: z12.enum(USER_LIST_TYPES).default("BASIC"),
4979
+ description: z12.string().optional(),
4781
4980
  /** 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()
4981
+ members: z12.array(z12.record(z12.string(), z12.string())).optional(),
4982
+ sourceFileRef: z12.string().optional()
4784
4983
  });
4785
- var audienceCriterionAttachSchema = z11.object({
4786
- level: z11.enum(["campaign", "adGroup"]),
4984
+ var audienceCriterionAttachSchema = z12.object({
4985
+ level: z12.enum(["campaign", "adGroup"]),
4787
4986
  parent: refSchema,
4788
4987
  userList: refSchema,
4789
- negative: z11.boolean().default(false)
4988
+ negative: z12.boolean().default(false)
4790
4989
  });
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"),
4990
+ var conversionActionCreateSchema = z12.object({
4991
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4992
+ type: z12.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4993
+ category: z12.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4994
+ countingType: z12.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4796
4995
  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(),
4996
+ defaultCurrencyCode: z12.string().length(3).optional(),
4997
+ clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
4998
+ viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
4999
+ status: z12.enum(["ENABLED", "PAUSED"]).default("ENABLED")
5000
+ });
5001
+ var conversionActionUpdateSchema = z12.object({
5002
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
5003
+ category: z12.enum(CONVERSION_ACTION_CATEGORIES).optional(),
5004
+ countingType: z12.enum(CONVERSION_COUNTING_TYPES).optional(),
4806
5005
  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()
5006
+ defaultCurrencyCode: z12.string().length(3).optional(),
5007
+ clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
5008
+ viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
5009
+ status: z12.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4811
5010
  }).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),
5011
+ var biddingStrategyCreateSchema = z12.object({
5012
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4814
5013
  config: biddingConfigSchema
4815
5014
  }).superRefine((p, ctx) => {
4816
5015
  if (p.config.type === "MANUAL_CPC") {
4817
5016
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4818
5017
  }
4819
5018
  });
4820
- var biddingStrategyUpdateSchema = z11.object({
4821
- name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
5019
+ var biddingStrategyUpdateSchema = z12.object({
5020
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4822
5021
  config: biddingConfigSchema.optional()
4823
5022
  }).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()
5023
+ var labelCreateSchema = z12.object({
5024
+ name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
5025
+ backgroundColor: z12.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
5026
+ description: z12.string().optional()
4828
5027
  });
4829
- var labelAttachSchema = z11.object({
4830
- level: z11.enum(["campaign", "adGroup", "ad"]),
5028
+ var labelAttachSchema = z12.object({
5029
+ level: z12.enum(["campaign", "adGroup", "ad"]),
4831
5030
  parent: refSchema,
4832
5031
  label: refSchema
4833
5032
  });
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),
5033
+ var locationCriterionSchema = z12.object({
5034
+ criterionType: z12.literal("location"),
5035
+ geoTargetConstant: z12.union([z12.string().regex(GEO_TARGET_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
5036
+ });
5037
+ var languageCriterionSchema = z12.object({
5038
+ criterionType: z12.literal("language"),
5039
+ languageConstant: z12.union([z12.string().regex(LANGUAGE_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
5040
+ });
5041
+ var adScheduleCriterionSchema = z12.object({
5042
+ criterionType: z12.literal("adSchedule"),
5043
+ dayOfWeek: z12.enum(DAYS_OF_WEEK),
5044
+ startHour: z12.number().int().min(0).max(23),
5045
+ startMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
5046
+ endHour: z12.number().int().min(0).max(24),
5047
+ endMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
5048
+ });
5049
+ var deviceCriterionSchema = z12.object({
5050
+ criterionType: z12.literal("device"),
5051
+ device: z12.enum(DEVICE_TYPES),
4853
5052
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4854
5053
  // to opt out of a Device type." So 0 (exclude the device) and 0.1–10.0 are valid; the (0, 0.1) gap is not.
4855
- bidModifier: z11.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
5054
+ bidModifier: z12.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4856
5055
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4857
5056
  })
4858
5057
  });
4859
- var campaignCriterionAddSchema = z11.object({
5058
+ var campaignCriterionAddSchema = z12.object({
4860
5059
  campaign: refSchema,
4861
- negative: z11.boolean().default(false),
4862
- criterion: z11.discriminatedUnion("criterionType", [
5060
+ negative: z12.boolean().default(false),
5061
+ criterion: z12.discriminatedUnion("criterionType", [
4863
5062
  locationCriterionSchema,
4864
5063
  languageCriterionSchema,
4865
5064
  adScheduleCriterionSchema,
@@ -4869,7 +5068,7 @@ var campaignCriterionAddSchema = z11.object({
4869
5068
  const c = val.criterion;
4870
5069
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4871
5070
  ctx.addIssue({
4872
- code: z11.ZodIssueCode.custom,
5071
+ code: z12.ZodIssueCode.custom,
4873
5072
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4874
5073
  path: ["criterion", "endMinute"]
4875
5074
  });
@@ -4921,17 +5120,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4921
5120
  "google.campaignCriterion.add",
4922
5121
  "google.campaignCriterion.remove"
4923
5122
  ];
4924
- var googleDraftOpKindSchema = z11.enum(GOOGLE_DRAFT_OP_KINDS);
5123
+ var googleDraftOpKindSchema = z12.enum(GOOGLE_DRAFT_OP_KINDS);
4925
5124
  function createOp2(kind, payload) {
4926
- return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, payload });
5125
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, payload });
4927
5126
  }
4928
5127
  function updateOp2(kind, payload) {
4929
- return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
5128
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4930
5129
  }
4931
5130
  function targetOp(kind) {
4932
- return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5131
+ return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4933
5132
  }
4934
- var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
5133
+ var googleDraftOpInputSchema = z12.discriminatedUnion("kind", [
4935
5134
  createOp2("google.budget.create", budgetCreateSchema),
4936
5135
  updateOp2("google.budget.update", budgetUpdateSchema),
4937
5136
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4979,132 +5178,132 @@ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
4979
5178
  ]);
4980
5179
 
4981
5180
  // ../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(),
5181
+ import { z as z13 } from "zod";
5182
+ var googleWriteModeSchema = z13.enum(["live", "simulated"]);
5183
+ var googleDraftOpResultSchema = z13.object({
5184
+ status: z13.enum(["applied", "simulated", "failed", "skipped"]),
5185
+ resourceName: z13.string().optional(),
5186
+ error: z13.string().optional(),
5187
+ skippedBecause: z13.string().optional(),
5188
+ executedAt: z13.number().optional()
5189
+ });
5190
+ var googleDraftStageRequestSchema = z13.object({
5191
+ chatId: z13.string(),
4993
5192
  op: googleDraftOpInputSchema
4994
5193
  });
4995
- var googleDraftStageResponseSchema = z12.object({
4996
- staged: z12.literal(true),
4997
- ref: z12.string(),
5194
+ var googleDraftStageResponseSchema = z13.object({
5195
+ staged: z13.literal(true),
5196
+ ref: z13.string(),
4998
5197
  kind: googleDraftOpKindSchema,
4999
5198
  mode: googleWriteModeSchema,
5000
- dependsOn: z12.array(z12.string()),
5001
- summary: z12.string(),
5002
- warnings: z12.array(z12.string()),
5199
+ dependsOn: z13.array(z13.string()),
5200
+ summary: z13.string(),
5201
+ warnings: z13.array(z13.string()),
5003
5202
  /** True when the op amended an already-staged op in place instead of appending a new one. */
5004
- amended: z12.boolean().optional()
5203
+ amended: z13.boolean().optional()
5005
5204
  });
5006
- var googleDraftAmendRequestSchema = z12.object({
5007
- chatId: z12.string(),
5008
- ref: z12.string(),
5009
- patch: z12.record(z12.string(), z12.unknown())
5205
+ var googleDraftAmendRequestSchema = z13.object({
5206
+ chatId: z13.string(),
5207
+ ref: z13.string(),
5208
+ patch: z13.record(z13.string(), z13.unknown())
5010
5209
  });
5011
- var googleDraftShowRequestSchema = z12.object({
5012
- chatId: z12.string(),
5013
- ref: z12.string()
5210
+ var googleDraftShowRequestSchema = z13.object({
5211
+ chatId: z13.string(),
5212
+ ref: z13.string()
5014
5213
  });
5015
5214
  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)
5215
+ var googleDraftStageBatchRequestSchema = z13.object({
5216
+ chatId: z13.string(),
5217
+ ops: z13.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
5019
5218
  });
5020
- var googleDraftStageBatchResponseSchema = z12.object({
5021
- staged: z12.literal(true),
5219
+ var googleDraftStageBatchResponseSchema = z13.object({
5220
+ staged: z13.literal(true),
5022
5221
  mode: googleWriteModeSchema,
5023
- count: z12.number(),
5024
- ops: z12.array(
5025
- z12.object({
5026
- ref: z12.string(),
5222
+ count: z13.number(),
5223
+ ops: z13.array(
5224
+ z13.object({
5225
+ ref: z13.string(),
5027
5226
  kind: googleDraftOpKindSchema,
5028
- dependsOn: z12.array(z12.string()),
5029
- summary: z12.string(),
5030
- warnings: z12.array(z12.string())
5227
+ dependsOn: z13.array(z13.string()),
5228
+ summary: z13.string(),
5229
+ warnings: z13.array(z13.string())
5031
5230
  })
5032
5231
  )
5033
5232
  });
5034
- var googleDraftOpViewSchema = z12.object({
5035
- ref: z12.string(),
5233
+ var googleDraftOpViewSchema = z13.object({
5234
+ ref: z13.string(),
5036
5235
  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(),
5236
+ customerId: z13.string(),
5237
+ target: z13.string().optional(),
5238
+ dependsOn: z13.array(z13.string()),
5239
+ summary: z13.string(),
5240
+ stagedAt: z13.number(),
5042
5241
  result: googleDraftOpResultSchema.optional()
5043
5242
  });
5044
- var googleDraftShowResponseSchema = z12.object({
5243
+ var googleDraftShowResponseSchema = z13.object({
5045
5244
  op: googleDraftOpViewSchema.extend({
5046
- payload: z12.unknown().optional(),
5047
- warnings: z12.array(z12.string()).optional(),
5048
- annotations: z12.unknown().optional()
5245
+ payload: z13.unknown().optional(),
5246
+ warnings: z13.array(z13.string()).optional(),
5247
+ annotations: z13.unknown().optional()
5049
5248
  })
5050
5249
  });
5051
- var googleDraftListRequestSchema = z12.object({
5052
- chatId: z12.string()
5250
+ var googleDraftListRequestSchema = z13.object({
5251
+ chatId: z13.string()
5053
5252
  });
5054
- var googleDraftAdvisorySchema = z12.object({
5055
- scope: z12.enum(["campaign", "adGroup"]),
5056
- message: z12.string()
5253
+ var googleDraftAdvisorySchema = z13.object({
5254
+ scope: z13.enum(["campaign", "adGroup"]),
5255
+ message: z13.string()
5057
5256
  });
5058
- var googleDraftStatusCollectionSchema = z12.object({
5059
- label: z12.string(),
5060
- added: z12.number(),
5061
- removed: z12.number(),
5062
- existing: z12.number()
5257
+ var googleDraftStatusCollectionSchema = z13.object({
5258
+ label: z13.string(),
5259
+ added: z13.number(),
5260
+ removed: z13.number(),
5261
+ existing: z13.number()
5063
5262
  });
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(),
5263
+ var googleDraftChangeOperationSchema = z13.enum(["create", "update", "pause", "resume", "remove"]);
5264
+ var googleDraftStatusNodeSchema = z13.lazy(
5265
+ () => z13.object({
5266
+ entity: z13.string(),
5267
+ name: z13.string(),
5069
5268
  operation: googleDraftChangeOperationSchema.optional(),
5070
- existing: z12.boolean(),
5071
- collections: z12.array(googleDraftStatusCollectionSchema),
5072
- children: z12.array(googleDraftStatusNodeSchema),
5073
- warnings: z12.array(z12.string()).optional()
5269
+ existing: z13.boolean(),
5270
+ collections: z13.array(googleDraftStatusCollectionSchema),
5271
+ children: z13.array(googleDraftStatusNodeSchema),
5272
+ warnings: z13.array(z13.string()).optional()
5074
5273
  })
5075
5274
  );
5076
- var googleDraftListResponseSchema = z12.object({
5077
- status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
5275
+ var googleDraftListResponseSchema = z13.object({
5276
+ status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
5078
5277
  mode: googleWriteModeSchema,
5079
- count: z12.number(),
5080
- ops: z12.array(googleDraftOpViewSchema),
5278
+ count: z13.number(),
5279
+ ops: z13.array(googleDraftOpViewSchema),
5081
5280
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5082
- tree: z12.array(googleDraftStatusNodeSchema).optional(),
5281
+ tree: z13.array(googleDraftStatusNodeSchema).optional(),
5083
5282
  /** Non-blocking completeness advisories for the whole draft. */
5084
- advisories: z12.array(googleDraftAdvisorySchema).optional()
5283
+ advisories: z13.array(googleDraftAdvisorySchema).optional()
5085
5284
  });
5086
- var googleDraftRemoveRequestSchema = z12.object({
5087
- chatId: z12.string(),
5088
- ref: z12.string()
5285
+ var googleDraftRemoveRequestSchema = z13.object({
5286
+ chatId: z13.string(),
5287
+ ref: z13.string()
5089
5288
  });
5090
- var googleDraftRemoveResponseSchema = z12.object({
5289
+ var googleDraftRemoveResponseSchema = z13.object({
5091
5290
  /** The requested ref plus any dependents removed by cascade. */
5092
- removed: z12.array(z12.string())
5291
+ removed: z13.array(z13.string())
5093
5292
  });
5094
- var googleDraftClearRequestSchema = z12.object({
5095
- chatId: z12.string()
5293
+ var googleDraftClearRequestSchema = z13.object({
5294
+ chatId: z13.string()
5096
5295
  });
5097
- var googleDraftClearResponseSchema = z12.object({
5098
- cleared: z12.number()
5296
+ var googleDraftClearResponseSchema = z13.object({
5297
+ cleared: z13.number()
5099
5298
  });
5100
- var googleFieldErrorSchema = z12.object({
5101
- path: z12.string(),
5102
- message: z12.string()
5299
+ var googleFieldErrorSchema = z13.object({
5300
+ path: z13.string(),
5301
+ message: z13.string()
5103
5302
  });
5104
- var googleDraftErrorResponseSchema = z12.object({
5105
- code: z12.string(),
5106
- error: z12.string(),
5107
- fields: z12.array(googleFieldErrorSchema).optional()
5303
+ var googleDraftErrorResponseSchema = z13.object({
5304
+ code: z13.string(),
5305
+ error: z13.string(),
5306
+ fields: z13.array(googleFieldErrorSchema).optional()
5108
5307
  });
5109
5308
 
5110
5309
  // src/commands/ads/google/draft-status.ts
@@ -11147,17 +11346,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11147
11346
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11148
11347
 
11149
11348
  // ../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);
11349
+ import { z as z14 } from "zod";
11350
+ var tempRefSchema3 = z14.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11351
+ var parentRefSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11352
+ var moneySchema2 = z14.object({
11353
+ amount: z14.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11354
+ currencyCode: z14.string().length(3).optional()
11355
+ });
11356
+ var httpsUrlSchema3 = z14.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11357
+ var bakerMediaIdSchema2 = z14.string().min(1);
11358
+ var stageableStatusSchema3 = z14.enum(STAGEABLE_CREATE_STATUSES3);
11359
+ var updateStatusSchema = z14.enum(UPDATE_STATUSES);
11161
11360
  function currencyMinimums2(currencyCode) {
11162
11361
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11163
11362
  }
@@ -11169,50 +11368,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
11169
11368
  }
11170
11369
  }
11171
11370
  }
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({
11371
+ var geoLocationsSchema = z14.object({
11372
+ countries: z14.array(z14.string().length(2)).optional(),
11373
+ regions: z14.array(z14.object({ key: z14.string() })).optional(),
11374
+ cities: z14.array(z14.object({ key: z14.string(), radius: z14.number().optional(), distance_unit: z14.string().optional() })).optional(),
11375
+ zips: z14.array(z14.object({ key: z14.string() })).optional(),
11376
+ location_types: z14.array(z14.string()).optional()
11377
+ }).catchall(z14.unknown());
11378
+ var idNameSchema = z14.object({ id: z14.string(), name: z14.string().optional() });
11379
+ var metaTargetingSchema = z14.object({
11181
11380
  geo_locations: geoLocationsSchema.optional(),
11182
11381
  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),
11382
+ age_min: z14.number().int().min(13).max(65).optional(),
11383
+ age_max: z14.number().int().min(13).max(65).optional(),
11384
+ genders: z14.array(z14.union([z14.literal(1), z14.literal(2)])).optional(),
11385
+ locales: z14.array(z14.number().int()).optional(),
11386
+ interests: z14.array(idNameSchema).optional(),
11387
+ behaviors: z14.array(idNameSchema).optional(),
11388
+ custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
11389
+ excluded_custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
11390
+ flexible_spec: z14.array(z14.record(z14.string(), z14.unknown())).optional(),
11391
+ exclusions: z14.record(z14.string(), z14.unknown()).optional(),
11392
+ publisher_platforms: z14.array(z14.string()).optional(),
11393
+ facebook_positions: z14.array(z14.string()).optional(),
11394
+ instagram_positions: z14.array(z14.string()).optional(),
11395
+ audience_network_positions: z14.array(z14.string()).optional(),
11396
+ messenger_positions: z14.array(z14.string()).optional(),
11397
+ device_platforms: z14.array(z14.string()).optional(),
11398
+ targeting_automation: z14.object({ advantage_audience: z14.union([z14.literal(0), z14.literal(1)]) }).partial().optional()
11399
+ }).catchall(z14.unknown());
11400
+ var specialAdCategoriesSchema = z14.array(z14.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11401
+ var campaignCreateSchema3 = z14.object({
11402
+ name: z14.string().min(1).max(META_LIMITS.campaign.nameMax),
11403
+ objective: z14.enum(OBJECTIVES),
11205
11404
  status: stageableStatusSchema3.default("PAUSED"),
11206
11405
  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(),
11406
+ special_ad_category_country: z14.array(z14.string().length(2)).optional(),
11407
+ buying_type: z14.enum(BUYING_TYPES).default("AUCTION"),
11408
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11210
11409
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11211
11410
  dailyBudget: moneySchema2.optional(),
11212
11411
  lifetimeBudget: moneySchema2.optional(),
11213
11412
  spendCap: moneySchema2.optional(),
11214
- start_time: z13.number().int().positive().optional(),
11215
- stop_time: z13.number().int().positive().optional()
11413
+ start_time: z14.number().int().positive().optional(),
11414
+ stop_time: z14.number().int().positive().optional()
11216
11415
  }).superRefine((p, ctx) => {
11217
11416
  if (p.dailyBudget && p.lifetimeBudget) {
11218
11417
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11222,15 +11421,15 @@ var campaignCreateSchema3 = z13.object({
11222
11421
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11223
11422
  }
11224
11423
  });
11225
- var campaignUpdateSchema3 = z13.object({
11226
- name: z13.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11424
+ var campaignUpdateSchema3 = z14.object({
11425
+ name: z14.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11227
11426
  status: updateStatusSchema.optional(),
11228
- bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11427
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11229
11428
  dailyBudget: moneySchema2.optional(),
11230
11429
  lifetimeBudget: moneySchema2.optional(),
11231
11430
  spendCap: moneySchema2.optional(),
11232
- start_time: z13.number().int().positive().optional(),
11233
- stop_time: z13.number().int().positive().optional()
11431
+ start_time: z14.number().int().positive().optional(),
11432
+ stop_time: z14.number().int().positive().optional()
11234
11433
  }).superRefine((p, ctx) => {
11235
11434
  if (!Object.values(p).some((val) => val !== void 0)) {
11236
11435
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11240,38 +11439,38 @@ var campaignUpdateSchema3 = z13.object({
11240
11439
  }
11241
11440
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11242
11441
  });
11243
- var promotedObjectSchema = z13.object({
11442
+ var promotedObjectSchema = z14.object({
11244
11443
  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()
11444
+ pixel_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11445
+ custom_event_type: z14.enum(CUSTOM_EVENT_TYPES).optional(),
11446
+ application_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11447
+ object_store_url: z14.string().url().optional(),
11448
+ product_catalog_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11449
+ product_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11450
+ whatsapp_phone_number: z14.string().optional(),
11451
+ offline_conversion_data_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional()
11253
11452
  }).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)])
11453
+ var attributionSpecSchema = z14.array(
11454
+ z14.object({
11455
+ event_type: z14.enum(ATTRIBUTION_EVENT_TYPES),
11456
+ window_days: z14.union([z14.literal(1), z14.literal(7), z14.literal(28)])
11258
11457
  })
11259
11458
  );
11260
11459
  var adSetFields = {
11261
- name: z13.string().min(1).max(META_LIMITS.adSet.nameMax),
11460
+ name: z14.string().min(1).max(META_LIMITS.adSet.nameMax),
11262
11461
  campaign_id: parentRefSchema2,
11263
11462
  status: stageableStatusSchema3.default("PAUSED"),
11264
11463
  dailyBudget: moneySchema2.optional(),
11265
11464
  lifetimeBudget: moneySchema2.optional(),
11266
11465
  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(),
11466
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11467
+ billing_event: z14.enum(BILLING_EVENTS),
11468
+ optimization_goal: z14.enum(OPTIMIZATION_GOALS),
11469
+ destination_type: z14.enum(DESTINATION_TYPES).optional(),
11271
11470
  promoted_object: promotedObjectSchema.optional(),
11272
11471
  attribution_spec: attributionSpecSchema.optional(),
11273
- start_time: z13.number().int().positive().optional(),
11274
- end_time: z13.number().int().positive().optional(),
11472
+ start_time: z14.number().int().positive().optional(),
11473
+ end_time: z14.number().int().positive().optional(),
11275
11474
  targeting: metaTargetingSchema
11276
11475
  };
11277
11476
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11289,22 +11488,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11289
11488
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11290
11489
  }
11291
11490
  }
11292
- var adSetCreateSchema = z13.object(adSetFields).superRefine((p, ctx) => {
11491
+ var adSetCreateSchema = z14.object(adSetFields).superRefine((p, ctx) => {
11293
11492
  validateAdSetBudgetAndBid(p, ctx);
11294
11493
  });
11295
- var adSetUpdateSchema = z13.object({
11494
+ var adSetUpdateSchema = z14.object({
11296
11495
  name: adSetFields.name.optional(),
11297
11496
  status: updateStatusSchema.optional(),
11298
11497
  dailyBudget: moneySchema2.optional(),
11299
11498
  lifetimeBudget: moneySchema2.optional(),
11300
11499
  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(),
11500
+ bid_strategy: z14.enum(BID_STRATEGIES).optional(),
11501
+ optimization_goal: z14.enum(OPTIMIZATION_GOALS).optional(),
11502
+ destination_type: z14.enum(DESTINATION_TYPES).optional(),
11304
11503
  promoted_object: promotedObjectSchema.optional(),
11305
11504
  attribution_spec: attributionSpecSchema.optional(),
11306
- start_time: z13.number().int().positive().optional(),
11307
- end_time: z13.number().int().positive().optional(),
11505
+ start_time: z14.number().int().positive().optional(),
11506
+ end_time: z14.number().int().positive().optional(),
11308
11507
  targeting: metaTargetingSchema.optional()
11309
11508
  }).superRefine((p, ctx) => {
11310
11509
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11312,38 +11511,38 @@ var adSetUpdateSchema = z13.object({
11312
11511
  }
11313
11512
  validateAdSetBudgetAndBid(p, ctx);
11314
11513
  });
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),
11514
+ var messageSchema = z14.string().min(1).max(META_LIMITS.creative.messageHardMax);
11515
+ var headlineSchema2 = z14.string().min(1).max(META_LIMITS.creative.headlineMax);
11516
+ var descriptionSchema = z14.string().min(1).max(META_LIMITS.creative.descriptionMax);
11517
+ var callToActionSchema = z14.object({
11518
+ type: z14.enum(CTA_TYPES2),
11320
11519
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11321
11520
  link: httpsUrlSchema3.optional()
11322
11521
  });
11323
- var creativeEnhancementsSchema = z13.object({
11324
- standardEnhancements: z13.enum(ENROLL_STATUSES).optional(),
11325
- features: z13.record(z13.string(), z13.enum(ENROLL_STATUSES)).optional()
11522
+ var creativeEnhancementsSchema = z14.object({
11523
+ standardEnhancements: z14.enum(ENROLL_STATUSES).optional(),
11524
+ features: z14.record(z14.string(), z14.enum(ENROLL_STATUSES)).optional()
11326
11525
  });
11327
11526
  var creativeSharedFields = {
11328
- name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11527
+ name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
11329
11528
  /** Facebook Page id backing the ad's identity. */
11330
11529
  page_id: parentRefSchema2,
11331
11530
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11332
- instagram_user_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11531
+ instagram_user_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11333
11532
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11334
- url_tags: z13.string().max(1e3).optional(),
11533
+ url_tags: z14.string().max(1e3).optional(),
11335
11534
  enhancements: creativeEnhancementsSchema.optional()
11336
11535
  };
11337
11536
  var imageMediaFields = {
11338
- imageHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11537
+ imageHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
11339
11538
  imageRef: tempRefSchema3.optional()
11340
11539
  };
11341
11540
  var videoMediaFields = {
11342
- videoId: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11541
+ videoId: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
11343
11542
  videoRef: tempRefSchema3.optional(),
11344
11543
  /** 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()
11544
+ thumbnailHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
11545
+ imageUrl: z14.string().url().optional()
11347
11546
  };
11348
11547
  function countImageRefs(p) {
11349
11548
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11351,8 +11550,8 @@ function countImageRefs(p) {
11351
11550
  function countVideoRefs(p) {
11352
11551
  return [p.videoId, p.videoRef].filter(Boolean).length;
11353
11552
  }
11354
- var singleCreativeSchema = z13.object({
11355
- creativeType: z13.literal("single"),
11553
+ var singleCreativeSchema = z14.object({
11554
+ creativeType: z14.literal("single"),
11356
11555
  ...creativeSharedFields,
11357
11556
  /** Primary text. */
11358
11557
  message: messageSchema,
@@ -11361,7 +11560,7 @@ var singleCreativeSchema = z13.object({
11361
11560
  headline: headlineSchema2.optional(),
11362
11561
  description: descriptionSchema.optional(),
11363
11562
  /** Display URL / caption shown under the headline. */
11364
- caption: z13.string().max(255).optional(),
11563
+ caption: z14.string().max(255).optional(),
11365
11564
  call_to_action: callToActionSchema.optional(),
11366
11565
  ...imageMediaFields,
11367
11566
  ...videoMediaFields
@@ -11385,10 +11584,10 @@ var singleCreativeSchema = z13.object({
11385
11584
  });
11386
11585
  }
11387
11586
  });
11388
- var carouselCardSchema = z13.object({
11587
+ var carouselCardSchema = z14.object({
11389
11588
  link: httpsUrlSchema3,
11390
- headline: z13.string().max(META_LIMITS.creative.headlineMax).optional(),
11391
- description: z13.string().max(META_LIMITS.creative.descriptionMax).optional(),
11589
+ headline: z14.string().max(META_LIMITS.creative.headlineMax).optional(),
11590
+ description: z14.string().max(META_LIMITS.creative.descriptionMax).optional(),
11392
11591
  call_to_action: callToActionSchema.optional(),
11393
11592
  ...imageMediaFields,
11394
11593
  ...videoMediaFields
@@ -11408,35 +11607,35 @@ var carouselCardSchema = z13.object({
11408
11607
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11409
11608
  }
11410
11609
  });
11411
- var carouselCreativeSchema2 = z13.object({
11412
- creativeType: z13.literal("carousel"),
11610
+ var carouselCreativeSchema2 = z14.object({
11611
+ creativeType: z14.literal("carousel"),
11413
11612
  ...creativeSharedFields,
11414
11613
  message: messageSchema,
11415
11614
  /** Optional "see more" card destination applied when a card has no own link. */
11416
11615
  link: httpsUrlSchema3.optional(),
11417
11616
  call_to_action: callToActionSchema.optional(),
11418
- cards: z13.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11617
+ cards: z14.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11419
11618
  });
11420
- var dynamicImageSchema = z13.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11421
- var dynamicVideoSchema = z13.object({
11619
+ var dynamicImageSchema = z14.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11620
+ var dynamicVideoSchema = z14.object({
11422
11621
  videoId: videoMediaFields.videoId,
11423
11622
  videoRef: videoMediaFields.videoRef,
11424
11623
  thumbnailHash: videoMediaFields.thumbnailHash
11425
11624
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11426
11625
  var DYN = META_LIMITS.creative;
11427
- var dynamicCreativeSchema = z13.object({
11428
- creativeType: z13.literal("dynamic"),
11626
+ var dynamicCreativeSchema = z14.object({
11627
+ creativeType: z14.literal("dynamic"),
11429
11628
  ...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),
11629
+ bodies: z14.array(z14.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11630
+ titles: z14.array(z14.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11631
+ descriptions: z14.array(z14.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11632
+ images: z14.array(dynamicImageSchema).optional(),
11633
+ videos: z14.array(dynamicVideoSchema).optional(),
11634
+ ad_formats: z14.array(z14.enum(AD_FORMATS2)).min(1),
11635
+ call_to_action_types: z14.array(z14.enum(CTA_TYPES2)).optional(),
11636
+ link_urls: z14.array(z14.object({ website_url: httpsUrlSchema3, display_url: z14.string().optional() })).min(1),
11438
11637
  /** Multi-language / placement customization — structural passthrough for v1. */
11439
- asset_customization_rules: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11638
+ asset_customization_rules: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11440
11639
  }).superRefine((p, ctx) => {
11441
11640
  if (!(p.images?.length || p.videos?.length)) {
11442
11641
  ctx.addIssue({
@@ -11446,57 +11645,57 @@ var dynamicCreativeSchema = z13.object({
11446
11645
  });
11447
11646
  }
11448
11647
  });
11449
- var existingPostCreativeSchema = z13.object({
11450
- creativeType: z13.literal("existing_post"),
11648
+ var existingPostCreativeSchema = z14.object({
11649
+ creativeType: z14.literal("existing_post"),
11451
11650
  name: creativeSharedFields.name,
11452
11651
  /** "<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>"'),
11652
+ object_story_id: z14.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11454
11653
  instagram_user_id: creativeSharedFields.instagram_user_id,
11455
11654
  url_tags: creativeSharedFields.url_tags,
11456
11655
  enhancements: creativeSharedFields.enhancements
11457
11656
  });
11458
- var creativeContentSchema2 = z13.discriminatedUnion("creativeType", [
11657
+ var creativeContentSchema2 = z14.discriminatedUnion("creativeType", [
11459
11658
  singleCreativeSchema,
11460
11659
  carouselCreativeSchema2,
11461
11660
  dynamicCreativeSchema,
11462
11661
  existingPostCreativeSchema
11463
11662
  ]);
11464
11663
  var adCreativeCreateSchema = creativeContentSchema2;
11465
- var adCreativeUpdateSchema = z13.object({
11466
- name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11664
+ var adCreativeUpdateSchema = z14.object({
11665
+ name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
11467
11666
  status: updateStatusSchema.optional(),
11468
11667
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11469
- content: z13.record(z13.string(), z13.unknown()).optional()
11668
+ content: z14.record(z14.string(), z14.unknown()).optional()
11470
11669
  }).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),
11670
+ var adCreateSchema2 = z14.object({
11671
+ name: z14.string().min(1).max(META_LIMITS.ad.nameMax),
11473
11672
  adset_id: parentRefSchema2,
11474
11673
  status: stageableStatusSchema3.default("PAUSED"),
11475
- creative: z13.object({ creative_id: parentRefSchema2 }),
11674
+ creative: z14.object({ creative_id: parentRefSchema2 }),
11476
11675
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11477
- tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11676
+ tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11478
11677
  });
11479
- var adUpdateSchema2 = z13.object({
11480
- name: z13.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11678
+ var adUpdateSchema2 = z14.object({
11679
+ name: z14.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11481
11680
  status: updateStatusSchema.optional(),
11482
11681
  /** 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()
11682
+ creative: z14.object({ creative_id: parentRefSchema2 }).optional(),
11683
+ tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
11485
11684
  }).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(),
11685
+ var lookalikeSpecSchema = z14.object({
11686
+ origin: z14.array(z14.object({ id: parentRefSchema2 })).min(1),
11687
+ ratio: z14.number().min(0.01).max(0.2).optional(),
11688
+ country: z14.string().length(2).optional()
11689
+ });
11690
+ var customAudienceCreateSchema = z14.object({
11691
+ name: z14.string().min(1).max(META_LIMITS.audience.nameMax),
11692
+ subtype: z14.enum(CUSTOM_AUDIENCE_SUBTYPES),
11693
+ description: z14.string().max(500).optional(),
11694
+ customer_file_source: z14.string().optional(),
11695
+ retention_days: z14.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11497
11696
  lookalike_spec: lookalikeSpecSchema.optional(),
11498
11697
  /** Website/engagement rule — structural passthrough validated by Meta. */
11499
- rule: z13.record(z13.string(), z13.unknown()).optional()
11698
+ rule: z14.record(z14.string(), z14.unknown()).optional()
11500
11699
  }).superRefine((p, ctx) => {
11501
11700
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11502
11701
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11505,16 +11704,16 @@ var customAudienceCreateSchema = z13.object({
11505
11704
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11506
11705
  }
11507
11706
  });
11508
- var customAudienceUpdateSchema = z13.object({
11509
- name: z13.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11510
- description: z13.string().max(500).optional()
11707
+ var customAudienceUpdateSchema = z14.object({
11708
+ name: z14.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11709
+ description: z14.string().max(500).optional()
11511
11710
  }).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),
11711
+ var mediaUploadSchema = z14.object({
11712
+ kind: z14.enum(MEDIA_KINDS),
11514
11713
  bakerImageId: bakerMediaIdSchema2.optional(),
11515
11714
  bakerVideoId: bakerMediaIdSchema2.optional(),
11516
11715
  /** Optional display name / filename hint. */
11517
- name: z13.string().max(255).optional()
11716
+ name: z14.string().max(255).optional()
11518
11717
  }).superRefine((p, ctx) => {
11519
11718
  if (p.kind === "image" && !p.bakerImageId) {
11520
11719
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11536,16 +11735,16 @@ var META_DRAFT_OP_KINDS = [
11536
11735
  "customAudience.update",
11537
11736
  "media.upload"
11538
11737
  ];
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]);
11738
+ var metaDraftOpKindSchema = z14.enum(META_DRAFT_OP_KINDS);
11739
+ var accountIdSchema2 = z14.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11740
+ var updateTargetSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11542
11741
  function createOp3(kind, payload) {
11543
- return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, payload });
11742
+ return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, payload });
11544
11743
  }
11545
11744
  function updateOp3(kind, payload) {
11546
- return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11745
+ return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11547
11746
  }
11548
- var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11747
+ var metaDraftOpInputSchema = z14.discriminatedUnion("kind", [
11549
11748
  createOp3("campaign.create", campaignCreateSchema3),
11550
11749
  updateOp3("campaign.update", campaignUpdateSchema3),
11551
11750
  createOp3("adSet.create", adSetCreateSchema),
@@ -11560,89 +11759,89 @@ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11560
11759
  ]);
11561
11760
 
11562
11761
  // ../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"]),
11762
+ import { z as z15 } from "zod";
11763
+ var metaWriteModeSchema = z15.enum(["live", "simulated"]);
11764
+ var metaDraftOpResultSchema = z15.object({
11765
+ status: z15.enum(["applied", "simulated", "failed", "skipped"]),
11567
11766
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11568
- id: z14.string().optional(),
11767
+ id: z15.string().optional(),
11569
11768
  /** 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()
11769
+ hash: z15.string().optional(),
11770
+ error: z15.string().optional(),
11771
+ skippedBecause: z15.string().optional(),
11772
+ executedAt: z15.number().optional()
11574
11773
  });
11575
- var metaDraftStageRequestSchema = z14.object({
11576
- chatId: z14.string(),
11774
+ var metaDraftStageRequestSchema = z15.object({
11775
+ chatId: z15.string(),
11577
11776
  op: metaDraftOpInputSchema
11578
11777
  });
11579
- var metaDraftStageResponseSchema = z14.object({
11580
- staged: z14.literal(true),
11581
- ref: z14.string(),
11778
+ var metaDraftStageResponseSchema = z15.object({
11779
+ staged: z15.literal(true),
11780
+ ref: z15.string(),
11582
11781
  kind: metaDraftOpKindSchema,
11583
11782
  mode: metaWriteModeSchema,
11584
- dependsOn: z14.array(z14.string()),
11585
- summary: z14.string(),
11586
- warnings: z14.array(z14.string()),
11783
+ dependsOn: z15.array(z15.string()),
11784
+ summary: z15.string(),
11785
+ warnings: z15.array(z15.string()),
11587
11786
  /** 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(),
11787
+ amended: z15.boolean().optional()
11788
+ });
11789
+ var metaDraftDuplicateRequestSchema = z15.object({
11790
+ chatId: z15.string(),
11791
+ accountId: z15.string(),
11792
+ entity: z15.enum(["campaign", "adSet", "ad"]),
11793
+ sourceId: z15.string(),
11794
+ overrides: z15.record(z15.string(), z15.unknown()).optional(),
11596
11795
  /** Pause the original after the copy publishes. */
11597
- replace: z14.boolean().optional()
11796
+ replace: z15.boolean().optional()
11598
11797
  });
11599
- var metaDraftOpViewSchema = z14.object({
11600
- ref: z14.string(),
11798
+ var metaDraftOpViewSchema = z15.object({
11799
+ ref: z15.string(),
11601
11800
  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(),
11801
+ accountId: z15.string(),
11802
+ target: z15.string().optional(),
11803
+ dependsOn: z15.array(z15.string()),
11804
+ summary: z15.string(),
11805
+ stagedAt: z15.number(),
11607
11806
  result: metaDraftOpResultSchema.optional()
11608
11807
  });
11609
- var metaDraftListRequestSchema = z14.object({
11610
- chatId: z14.string()
11808
+ var metaDraftListRequestSchema = z15.object({
11809
+ chatId: z15.string()
11611
11810
  });
11612
- var metaDraftAdvisorySchema = z14.object({
11613
- ref: z14.string(),
11614
- message: z14.string()
11811
+ var metaDraftAdvisorySchema = z15.object({
11812
+ ref: z15.string(),
11813
+ message: z15.string()
11615
11814
  });
11616
- var metaDraftListResponseSchema = z14.object({
11617
- status: z14.enum(["active", "publishing", "applied", "discarded", "none"]),
11815
+ var metaDraftListResponseSchema = z15.object({
11816
+ status: z15.enum(["active", "publishing", "applied", "discarded", "none"]),
11618
11817
  mode: metaWriteModeSchema,
11619
- count: z14.number(),
11620
- ops: z14.array(metaDraftOpViewSchema),
11818
+ count: z15.number(),
11819
+ ops: z15.array(metaDraftOpViewSchema),
11621
11820
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11622
- advisories: z14.array(metaDraftAdvisorySchema)
11821
+ advisories: z15.array(metaDraftAdvisorySchema)
11623
11822
  });
11624
- var metaDraftRemoveRequestSchema = z14.object({
11625
- chatId: z14.string(),
11626
- ref: z14.string()
11823
+ var metaDraftRemoveRequestSchema = z15.object({
11824
+ chatId: z15.string(),
11825
+ ref: z15.string()
11627
11826
  });
11628
- var metaDraftRemoveResponseSchema = z14.object({
11827
+ var metaDraftRemoveResponseSchema = z15.object({
11629
11828
  /** The requested ref plus any dependents removed by cascade. */
11630
- removed: z14.array(z14.string())
11829
+ removed: z15.array(z15.string())
11631
11830
  });
11632
- var metaDraftClearRequestSchema = z14.object({
11633
- chatId: z14.string()
11831
+ var metaDraftClearRequestSchema = z15.object({
11832
+ chatId: z15.string()
11634
11833
  });
11635
- var metaDraftClearResponseSchema = z14.object({
11636
- cleared: z14.number()
11834
+ var metaDraftClearResponseSchema = z15.object({
11835
+ cleared: z15.number()
11637
11836
  });
11638
- var metaFieldErrorSchema = z14.object({
11639
- path: z14.string(),
11640
- message: z14.string()
11837
+ var metaFieldErrorSchema = z15.object({
11838
+ path: z15.string(),
11839
+ message: z15.string()
11641
11840
  });
11642
- var metaDraftErrorResponseSchema = z14.object({
11643
- code: z14.string(),
11644
- error: z14.string(),
11645
- fields: z14.array(metaFieldErrorSchema).optional()
11841
+ var metaDraftErrorResponseSchema = z15.object({
11842
+ code: z15.string(),
11843
+ error: z15.string(),
11844
+ fields: z15.array(metaFieldErrorSchema).optional()
11646
11845
  });
11647
11846
 
11648
11847
  // src/commands/ads/meta/write-shared.ts
@@ -15055,7 +15254,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
15055
15254
  import { toCardinal as nwNl } from "n2words/nl-NL";
15056
15255
  import { toCardinal as nwPl } from "n2words/pl-PL";
15057
15256
  import { toCardinal as nwPt } from "n2words/pt-PT";
15058
- import { z as z15 } from "zod";
15257
+ import { z as z16 } from "zod";
15059
15258
 
15060
15259
  // src/engine/scaffold/lib/shoot-modes.ts
15061
15260
  var SHOOT_MODES = [
@@ -15391,71 +15590,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15391
15590
  "{{out.video}}"
15392
15591
  ];
15393
15592
  }
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(),
15593
+ var FrameAsset = z16.object({ url: z16.string().optional() }).loose().optional();
15594
+ var DialogueLine = z16.object({
15595
+ speaker: z16.string().optional(),
15596
+ line: z16.string().optional(),
15398
15597
  // 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(),
15598
+ start_s: z16.number().optional(),
15599
+ end_s: z16.number().optional(),
15600
+ delivery: z16.string().optional(),
15601
+ voice_description: z16.string().optional(),
15403
15602
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15404
15603
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15405
15604
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15406
15605
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15407
15606
  // the VO path; absent keeps the presence-based decision (old blueprints).
15408
- on_camera: z15.boolean().optional()
15607
+ on_camera: z16.boolean().optional()
15409
15608
  }).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()
15609
+ var Sfx = z16.object({
15610
+ at_s: z16.number().optional(),
15611
+ duration_s: z16.number().optional(),
15612
+ sound_effect_prompt: z16.string().optional(),
15613
+ description: z16.string().optional()
15415
15614
  }).loose();
15416
- var CompositionRegion = z15.object({
15615
+ var CompositionRegion = z16.object({
15417
15616
  // full | top | bottom | left | right | inset
15418
- panel: z15.string().optional(),
15617
+ panel: z16.string().optional(),
15419
15618
  // 9-grid anchor for an `inset` presenter box.
15420
- position: z15.string().optional(),
15421
- is_presenter: z15.boolean().optional(),
15619
+ position: z16.string().optional(),
15620
+ is_presenter: z16.boolean().optional(),
15422
15621
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15423
- cast_ref: z15.string().optional(),
15622
+ cast_ref: z16.string().optional(),
15424
15623
  // What the region's content IS: camera | screen_capture | static_graphic |
15425
15624
  // generated. Authoritative for routing when present (regex-over-prose fallback
15426
15625
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15427
15626
  // overlay layer, never AI-generated.
15428
- kind: z15.string().optional(),
15627
+ kind: z16.string().optional(),
15429
15628
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15430
15629
  // screen_capture region shows. Two scenes share it only when they show the SAME
15431
15630
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15432
15631
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15433
15632
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15434
15633
  // instead of asking the operator for one screenshot that can't cover both.
15435
- surface_id: z15.string().optional(),
15634
+ surface_id: z16.string().optional(),
15436
15635
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15437
15636
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15438
15637
  // 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()
15638
+ nested: z16.array(z16.object({}).loose()).optional(),
15639
+ summary: z16.string().optional(),
15640
+ frame_prompt: z16.string().optional(),
15641
+ motion_prompt: z16.string().optional()
15443
15642
  }).loose();
15444
- var SceneComposition = z15.object({
15643
+ var SceneComposition = z16.object({
15445
15644
  // full_frame (default) | split_screen | pip | keyed_overlay
15446
- layout: z15.string().optional(),
15645
+ layout: z16.string().optional(),
15447
15646
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15448
- split_axis: z15.string().optional(),
15449
- regions: z15.array(CompositionRegion).optional()
15647
+ split_axis: z16.string().optional(),
15648
+ regions: z16.array(CompositionRegion).optional()
15450
15649
  }).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(),
15650
+ var CameraMotion = z16.object({ movement: z16.string().optional(), detail: z16.string().optional() }).loose();
15651
+ var TranscriptWord = z16.object({ text: z16.string().optional() }).loose();
15652
+ var Scene = z16.object({
15653
+ start_s: z16.number().optional(),
15654
+ end_s: z16.number().optional(),
15655
+ duration_s: z16.number().optional(),
15656
+ summary: z16.string().optional(),
15657
+ action_detail: z16.string().optional(),
15459
15658
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15460
15659
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15461
15660
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15463,82 +15662,82 @@ var Scene = z15.object({
15463
15662
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15464
15663
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15465
15664
  // UGC/product mode; a human can override per scene by setting this.
15466
- shoot_mode: z15.string().optional(),
15665
+ shoot_mode: z16.string().optional(),
15467
15666
  // Diegetic ambient the clip's native audio should carry (no music). When
15468
15667
  // absent the scene falls back to its shoot mode's default ambience.
15469
- ambient: z15.string().optional(),
15668
+ ambient: z16.string().optional(),
15470
15669
  camera_motion: CameraMotion.optional(),
15471
- start_frame_prompt: z15.string().optional(),
15472
- end_frame_prompt: z15.string().optional(),
15473
- motion_prompt: z15.string().optional(),
15670
+ start_frame_prompt: z16.string().optional(),
15671
+ end_frame_prompt: z16.string().optional(),
15672
+ motion_prompt: z16.string().optional(),
15474
15673
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15475
15674
  // script re-craft checklist. Inferred from position when absent.
15476
- narrative_role: z15.string().optional(),
15675
+ narrative_role: z16.string().optional(),
15477
15676
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15478
15677
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15479
15678
  // into the hook's start-frame description so the generator renders that state,
15480
15679
  // not a calm influencer (CCA-11).
15481
- hook_mechanic: z15.object({ mechanic: z15.string().optional(), why_it_stops_scroll: z15.string().optional() }).loose().optional(),
15680
+ hook_mechanic: z16.object({ mechanic: z16.string().optional(), why_it_stops_scroll: z16.string().optional() }).loose().optional(),
15482
15681
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15483
- scene_setting: z15.string().optional(),
15682
+ scene_setting: z16.string().optional(),
15484
15683
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15485
15684
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15486
15685
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15487
15686
  // 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(),
15687
+ transition_out: z16.object({ type: z16.string().optional(), description: z16.string().optional() }).loose().optional(),
15688
+ dialogue: z16.array(DialogueLine).optional(),
15689
+ sfx: z16.array(Sfx).optional(),
15690
+ overlays: z16.array(z16.unknown()).optional(),
15691
+ floating_elements: z16.array(z16.unknown()).optional(),
15493
15692
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15494
15693
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15495
15694
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15496
15695
  // 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(),
15696
+ motion_level: z16.enum(["static", "subtle", "dynamic"]).optional(),
15697
+ transcript_slice: z16.array(TranscriptWord).optional(),
15499
15698
  start_frame_asset: FrameAsset,
15500
15699
  end_frame_asset: FrameAsset,
15501
15700
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15502
15701
  // previous one (the SAME physical shot, broken up only because it exceeded the
15503
15702
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15504
15703
  // start frame IS the previous scene's end frame — so the join is seamless.
15505
- continues_previous: z15.boolean().optional()
15704
+ continues_previous: z16.boolean().optional()
15506
15705
  }).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(),
15706
+ var VideoBlueprint = z16.object({
15707
+ source: z16.object({ aspect_ratio: z16.string().optional(), duration_s: z16.number().optional() }).loose().optional(),
15708
+ global: z16.object({
15709
+ music: z16.object({
15710
+ present: z16.boolean().optional(),
15711
+ music_prompt: z16.string().optional(),
15513
15712
  // Absolute second the music enters in the reference (the bed often
15514
15713
  // kicks in mid-ad, after the hook). We start the regenerated track here
15515
15714
  // instead of at 0 so the timing matches.
15516
- starts_at_s: z15.number().optional(),
15715
+ starts_at_s: z16.number().optional(),
15517
15716
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15518
15717
  // 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()
15718
+ identified_track: z16.object({ title: z16.string().optional(), artist: z16.string().optional() }).loose().nullish()
15520
15719
  }).loose().optional(),
15521
- cast: z15.array(
15522
- z15.object({
15523
- id: z15.string().optional(),
15524
- description: z15.string().optional(),
15720
+ cast: z16.array(
15721
+ z16.object({
15722
+ id: z16.string().optional(),
15723
+ description: z16.string().optional(),
15525
15724
  // The deconstruct's note on the target-market localization (e.g. "native
15526
15725
  // French speaker") — read to derive the spoken-track language code.
15527
- market_localization_note: z15.string().optional()
15726
+ market_localization_note: z16.string().optional()
15528
15727
  }).loose()
15529
15728
  ).optional(),
15530
- voiceover: z15.object({
15729
+ voiceover: z16.object({
15531
15730
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15532
15731
  // 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()
15732
+ mode: z16.string().optional(),
15733
+ voice_description: z16.string().optional(),
15734
+ persona: z16.string().optional()
15536
15735
  }).loose().optional(),
15537
15736
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15538
15737
  // 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()
15738
+ style: z16.object({ palette: z16.array(z16.object({ hex: z16.string().optional() }).loose()).optional() }).loose().optional()
15540
15739
  }).loose().optional(),
15541
- scenes: z15.array(Scene).min(1)
15740
+ scenes: z16.array(Scene).min(1)
15542
15741
  }).loose();
15543
15742
  function injectHookPhysicality(blueprint) {
15544
15743
  for (const scene of blueprint.scenes) {
@@ -15555,26 +15754,26 @@ function clipIntentOf(scene, sceneIndex) {
15555
15754
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
15556
15755
  return "body";
15557
15756
  }
15558
- var AppearsItem = z15.union([z15.number(), z15.object({ scene: z15.number(), edge: z15.string().optional() }).loose()]);
15559
- var RecurringElement = z15.object({
15757
+ var AppearsItem = z16.union([z16.number(), z16.object({ scene: z16.number(), edge: z16.string().optional() }).loose()]);
15758
+ var RecurringElement = z16.object({
15560
15759
  // 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(),
15760
+ type: z16.string(),
15761
+ label: z16.string().optional(),
15762
+ description: z16.string().optional(),
15763
+ expression: z16.string().nullable().optional(),
15565
15764
  // When the element maps to a global cast entry, its stable id (for annotation).
15566
- cast_id: z15.string().nullable().optional(),
15765
+ cast_id: z16.string().nullable().optional(),
15567
15766
  // The label of another element that is the SAME individual as this one, shown
15568
15767
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15569
15768
  // pink shirt and believer in a white shirt). Each look gets its own reference
15570
15769
  // slot, but the face/identity must stay identical across them.
15571
- same_as: z15.string().nullable().optional(),
15770
+ same_as: z16.string().nullable().optional(),
15572
15771
  // Scenes the element appears in. Either a bare list of scene indices (both
15573
15772
  // 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()
15773
+ scenes: z16.array(z16.number()).optional(),
15774
+ appears_in: z16.array(AppearsItem).optional()
15576
15775
  }).loose();
15577
- var RecurringElements = z15.array(RecurringElement);
15776
+ var RecurringElements = z16.array(RecurringElement);
15578
15777
  function sanitizeId(raw, fallback) {
15579
15778
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15580
15779
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -16047,7 +16246,7 @@ function scrubFloatSentences(text, floatDescs) {
16047
16246
  return kept;
16048
16247
  }
16049
16248
  function sceneFloatDescs(scene) {
16050
- const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16249
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16051
16250
  if (!floats.success) return [];
16052
16251
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
16053
16252
  }
@@ -17471,25 +17670,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
17471
17670
  }
17472
17671
  return tracks;
17473
17672
  }
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(),
17673
+ var OverlayStyle = z16.object({ color_hex: z16.string().optional(), background: z16.string().optional(), size: z16.string().optional() }).loose();
17674
+ var Overlay = z16.object({
17675
+ text: z16.string().optional(),
17676
+ appears_at_s: z16.number().optional(),
17677
+ duration_s: z16.number().optional(),
17678
+ position: z16.string().optional(),
17679
+ role: z16.string().optional(),
17680
+ animation: z16.string().optional(),
17681
+ animation_detail: z16.string().optional(),
17483
17682
  style: OverlayStyle.optional()
17484
17683
  }).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()
17684
+ var FloatingElement = z16.object({
17685
+ kind: z16.string().optional(),
17686
+ description: z16.string().optional(),
17687
+ brand_name: z16.string().nullish(),
17688
+ what_it_represents: z16.string().optional(),
17689
+ appears_at_s: z16.number().optional(),
17690
+ duration_s: z16.number().optional(),
17691
+ position: z16.string().optional()
17493
17692
  }).loose();
17494
17693
  function escapeHtml(s) {
17495
17694
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17521,7 +17720,7 @@ function positionClass(position) {
17521
17720
  function collectCaptions(blueprint, clock) {
17522
17721
  return blueprint.scenes.flatMap((scene, i) => {
17523
17722
  const sceneStart = scene.start_s ?? 0;
17524
- const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
17723
+ const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
17525
17724
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17526
17725
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
17527
17726
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17601,7 +17800,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
17601
17800
  const windows = /* @__PURE__ */ new Map();
17602
17801
  blueprint.scenes.forEach((scene, i) => {
17603
17802
  const sceneStart = scene.start_s ?? 0;
17604
- const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17803
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17605
17804
  if (!floats.success) return;
17606
17805
  for (const fe of floats.data) {
17607
17806
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -18049,8 +18248,8 @@ function buildMotionBoard(blueprint) {
18049
18248
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
18050
18249
  cursor = end_s;
18051
18250
  const spoken = sceneSpokenText(scene);
18052
- const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
18053
- const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18251
+ const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
18252
+ const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18054
18253
  const graphics = [
18055
18254
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
18056
18255
  kind: "text",
@@ -19482,7 +19681,7 @@ import path17 from "path";
19482
19681
  import { defineCommand as defineCommand91 } from "citty";
19483
19682
 
19484
19683
  // src/engine/scaffold/staticAd.ts
19485
- import { z as z16 } from "zod";
19684
+ import { z as z17 } from "zod";
19486
19685
  var GEN_ASPECT_RATIOS = /* @__PURE__ */ new Set(["1:1", "4:5", "9:16", "16:9", "4:3", "3:4", "2:3", "3:2", "21:9"]);
19487
19686
  var DEFAULT_ASPECT_RATIO = "9:16";
19488
19687
  var SHEET_SUBJECT_TYPE2 = {
@@ -19494,24 +19693,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
19494
19693
  var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
19495
19694
  var ADAPT_IMAGE_SIZE = "2K";
19496
19695
  var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
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()
19696
+ var Blueprint = z17.object({
19697
+ meta: z17.object({ estimated_aspect_ratio: z17.string().optional() }).loose().optional(),
19698
+ text_content: z17.array(z17.object({ text: z17.string().optional() }).loose()).optional()
19500
19699
  }).loose();
19501
- var ElementLocator = z16.object({
19502
- collection: z16.enum(["subjects", "people", "brands_logos"]),
19503
- index: z16.number().int().nonnegative()
19700
+ var ElementLocator = z17.object({
19701
+ collection: z17.enum(["subjects", "people", "brands_logos"]),
19702
+ index: z17.number().int().nonnegative()
19504
19703
  }).loose();
19505
- var MainElement = z16.object({
19704
+ var MainElement = z17.object({
19506
19705
  // 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(),
19706
+ type: z17.string(),
19707
+ label: z17.string().optional(),
19708
+ description: z17.string().optional(),
19709
+ expression: z17.string().nullable().optional(),
19710
+ reason: z17.string().optional(),
19512
19711
  locator: ElementLocator.optional()
19513
19712
  }).loose();
19514
- var MainElements = z16.array(MainElement);
19713
+ var MainElements = z17.array(MainElement);
19515
19714
  function sanitizeId2(raw, fallback) {
19516
19715
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
19517
19716
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -21296,11 +21495,219 @@ Subcommands:
21296
21495
  }
21297
21496
  });
21298
21497
 
21498
+ // src/commands/chats/index.ts
21499
+ import { defineCommand as defineCommand96 } from "citty";
21500
+ var STATUS_GROUPS = ["active", "archived", "all"];
21501
+ var REPO_SURFACES = ["knowledge", "company", "brand", "landings", "flows", "creatives"];
21502
+ function parseBoundedInt(raw, name, min, max) {
21503
+ if (raw === void 0) {
21504
+ return void 0;
21505
+ }
21506
+ const value = Number.parseInt(raw, 10);
21507
+ if (Number.isNaN(value) || value < min || value > max) {
21508
+ throw new Error(`--${name} must be an integer between ${min} and ${max}`);
21509
+ }
21510
+ return value;
21511
+ }
21512
+ registerSchema({
21513
+ command: "chats.list",
21514
+ description: "Start here: list other Sessions on this account (newest first) so you can reuse what was done before. Each row shows the Session id, title, status, and a count of what it produced (creatives, landings, actions, flows, reports\u2026). Then drill in with `baker chats view <id>`, `baker chats transcript <id>`, or `baker chats diff <id>`. Read-only.",
21515
+ args: {
21516
+ status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
21517
+ limit: { type: "string", description: "Max Sessions to return, 1-100 (default: 20)", required: false },
21518
+ full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
21519
+ }
21520
+ });
21521
+ var listCommand5 = defineCommand96({
21522
+ meta: { name: "list", description: "List other Sessions on this account, newest first." },
21523
+ args: {
21524
+ status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
21525
+ limit: { type: "string", description: "Max Sessions (1-100, default 20)", required: false },
21526
+ full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
21527
+ },
21528
+ run: async ({ args }) => {
21529
+ try {
21530
+ const body = {};
21531
+ if (args.status) {
21532
+ if (!STATUS_GROUPS.includes(args.status)) {
21533
+ throw new Error(`--status must be one of: ${STATUS_GROUPS.join("|")}`);
21534
+ }
21535
+ body.status = args.status;
21536
+ }
21537
+ const limit = parseBoundedInt(args.limit, "limit", 1, 100);
21538
+ if (limit !== void 0) {
21539
+ body.limit = limit;
21540
+ }
21541
+ if (args.full) {
21542
+ body.full = true;
21543
+ }
21544
+ const response = await apiPost("/api/chats/list", body);
21545
+ writeJson({
21546
+ ...response,
21547
+ meta: { count: response.data.chats.length },
21548
+ ...response.data.chats.length === 0 ? { hints: ["No Sessions matched. Widen with --status all or a larger --limit."] } : {
21549
+ hints: [
21550
+ "Drill in: `baker chats view <id>` for outputs, `chats transcript <id>` for the conversation, `chats diff <id>` for the real file changes."
21551
+ ]
21552
+ }
21553
+ });
21554
+ } catch (err) {
21555
+ failApi(err);
21556
+ }
21557
+ }
21558
+ });
21559
+ registerSchema({
21560
+ command: "chats.view",
21561
+ description: "Inspect one Session's FULL picture of what it changed \u2014 the unified `effects`: git content (landings, creatives, flows, knowledge, brand), plus DB-only effects that never touch the repo \u2014 Actions, Scheduled Actions, Tags, and ad-platform writes \u2014 each resolved to real detail (names, descriptions, priorities, tag types, ad operations). Also the kickoff (how it was asked), threads, and commits. Effects are `staged` (in-progress draft) or applied. Use after `baker chats list` to decide whether to reuse it. Read-only.",
21562
+ args: {
21563
+ id: { type: "positional", description: "The Session id (from `baker chats list`)", required: true },
21564
+ full: {
21565
+ type: "boolean",
21566
+ description: "No-op today; view already returns full effect detail",
21567
+ required: false,
21568
+ default: false
21569
+ }
21570
+ }
21571
+ });
21572
+ var viewCommand = defineCommand96({
21573
+ meta: {
21574
+ name: "view",
21575
+ description: "Inspect one Session's full effects \u2014 git content + actions/tags/ads, kickoff, commits."
21576
+ },
21577
+ args: {
21578
+ id: { type: "positional", description: "The Session id", required: true },
21579
+ full: { type: "boolean", description: "Include full detail", required: false, default: false }
21580
+ },
21581
+ run: async ({ args }) => {
21582
+ try {
21583
+ const response = await apiPost("/api/chats/view", {
21584
+ chatId: args.id,
21585
+ ...args.full ? { full: true } : {}
21586
+ });
21587
+ const hints = [];
21588
+ if (response.data.diffAvailable) {
21589
+ hints.push("See the real file-level diff of the git content with `baker chats diff <id> --full`.");
21590
+ }
21591
+ hints.push("Read the conversation with `baker chats transcript <id>`.");
21592
+ writeJson({ ...response, hints });
21593
+ } catch (err) {
21594
+ failApi(err);
21595
+ }
21596
+ }
21597
+ });
21598
+ registerSchema({
21599
+ command: "chats.transcript",
21600
+ description: "Read another Session's conversation (user + agent turns), most-recent first-capped. Use to see exactly how a past request was phrased and iterated before replaying it for a new goal. Compact truncates long messages; add --full for verbatim text. Read-only.",
21601
+ args: {
21602
+ id: { type: "positional", description: "The Session id", required: true },
21603
+ limit: { type: "string", description: "Max messages to return, 1-1000 (default: 100)", required: false },
21604
+ full: {
21605
+ type: "boolean",
21606
+ description: "Return verbatim (untruncated) message text",
21607
+ required: false,
21608
+ default: false
21609
+ }
21610
+ }
21611
+ });
21612
+ var transcriptCommand = defineCommand96({
21613
+ meta: { name: "transcript", description: "Read another Session's conversation." },
21614
+ args: {
21615
+ id: { type: "positional", description: "The Session id", required: true },
21616
+ limit: { type: "string", description: "Max messages (1-1000, default 100)", required: false },
21617
+ full: { type: "boolean", description: "Verbatim message text", required: false, default: false }
21618
+ },
21619
+ run: async ({ args }) => {
21620
+ try {
21621
+ const body = { chatId: args.id };
21622
+ const limit = parseBoundedInt(args.limit, "limit", 1, 1e3);
21623
+ if (limit !== void 0) {
21624
+ body.limit = limit;
21625
+ }
21626
+ if (args.full) {
21627
+ body.full = true;
21628
+ }
21629
+ const response = await apiPost("/api/chats/transcript", body);
21630
+ writeJson({
21631
+ ...response,
21632
+ meta: { count: response.data.entries.length },
21633
+ ...response.data.truncated ? { hints: ["Older messages were dropped to fit --limit. Raise --limit to see more."] } : {}
21634
+ });
21635
+ } catch (err) {
21636
+ failApi(err);
21637
+ }
21638
+ }
21639
+ });
21640
+ registerSchema({
21641
+ command: "chats.diff",
21642
+ description: "See the real file-level changes a Session made (landings, creatives, brand, flows, knowledge). Only available for published Sessions; in-progress ones return available:false \u2014 use `baker chats view` for their staged summary. Compact lists changed files with +/- counts; add --full for the actual diff text. Read-only.",
21643
+ args: {
21644
+ id: { type: "positional", description: "The Session id", required: true },
21645
+ surface: {
21646
+ type: "string",
21647
+ description: "Filter to one surface: knowledge|company|brand|landings|flows|creatives",
21648
+ required: false
21649
+ },
21650
+ full: {
21651
+ type: "boolean",
21652
+ description: "Include the unified-diff patch text per file",
21653
+ required: false,
21654
+ default: false
21655
+ }
21656
+ }
21657
+ });
21658
+ var diffCommand = defineCommand96({
21659
+ meta: { name: "diff", description: "See a published Session's real file-level changes." },
21660
+ args: {
21661
+ id: { type: "positional", description: "The Session id", required: true },
21662
+ surface: {
21663
+ type: "string",
21664
+ description: "Filter: knowledge|company|brand|landings|flows|creatives",
21665
+ required: false
21666
+ },
21667
+ full: { type: "boolean", description: "Include the diff patch text per file", required: false, default: false }
21668
+ },
21669
+ run: async ({ args }) => {
21670
+ try {
21671
+ const body = { chatId: args.id };
21672
+ if (args.surface) {
21673
+ if (!REPO_SURFACES.includes(args.surface)) {
21674
+ throw new Error(`--surface must be one of: ${REPO_SURFACES.join("|")}`);
21675
+ }
21676
+ body.surface = args.surface;
21677
+ }
21678
+ if (args.full) {
21679
+ body.full = true;
21680
+ }
21681
+ const response = await apiPost("/api/chats/diff", body);
21682
+ writeJson({
21683
+ ...response,
21684
+ meta: { count: response.data.files.length },
21685
+ ...!response.data.available && response.data.reason ? { hints: [response.data.reason] } : {},
21686
+ ...response.data.available && !args.full && response.data.files.length > 0 ? { hints: ["Add --full to read the actual diff text for each file."] } : {}
21687
+ });
21688
+ } catch (err) {
21689
+ failApi(err);
21690
+ }
21691
+ }
21692
+ });
21693
+ var chatsCommand = defineCommand96({
21694
+ meta: {
21695
+ name: "chats",
21696
+ description: "Inspect other Sessions on this account (read-only): list them, view what they produced, read their conversation, and see their real file changes \u2014 so you can reuse past work for a new goal."
21697
+ },
21698
+ subCommands: {
21699
+ list: listCommand5,
21700
+ view: viewCommand,
21701
+ transcript: transcriptCommand,
21702
+ diff: diffCommand
21703
+ }
21704
+ });
21705
+
21299
21706
  // src/commands/creatives/index.ts
21300
- import { defineCommand as defineCommand97 } from "citty";
21707
+ import { defineCommand as defineCommand98 } from "citty";
21301
21708
 
21302
21709
  // src/commands/creatives/publish.ts
21303
- import { defineCommand as defineCommand96 } from "citty";
21710
+ import { defineCommand as defineCommand97 } from "citty";
21304
21711
 
21305
21712
  // src/commands/images/api.ts
21306
21713
  import { readFile as readFile17 } from "fs/promises";
@@ -21444,7 +21851,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
21444
21851
  chatId: chatIdFromEnv()
21445
21852
  });
21446
21853
  }
21447
- var publishCommand = defineCommand96({
21854
+ var publishCommand = defineCommand97({
21448
21855
  meta: {
21449
21856
  name: "publish",
21450
21857
  description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
@@ -21502,7 +21909,7 @@ var publishCommand = defineCommand96({
21502
21909
  });
21503
21910
 
21504
21911
  // src/commands/creatives/index.ts
21505
- var creativesCommand3 = defineCommand97({
21912
+ var creativesCommand3 = defineCommand98({
21506
21913
  meta: {
21507
21914
  name: "creatives",
21508
21915
  description: `Publish static ad creatives as first-class Baker outputs.
@@ -21518,7 +21925,7 @@ Publishing uploads the image to the Company image library, applies the official
21518
21925
  });
21519
21926
 
21520
21927
  // src/commands/flows/index.ts
21521
- import { defineCommand as defineCommand98 } from "citty";
21928
+ import { defineCommand as defineCommand99 } from "citty";
21522
21929
 
21523
21930
  // src/commands/flows/shared.ts
21524
21931
  import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
@@ -21673,7 +22080,7 @@ function displayName(slug) {
21673
22080
  const name = tree.displayName;
21674
22081
  return typeof name === "string" && name.trim() ? name.trim() : slug;
21675
22082
  }
21676
- var listCommand5 = defineCommand98({
22083
+ var listCommand6 = defineCommand99({
21677
22084
  meta: {
21678
22085
  name: "list",
21679
22086
  description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
@@ -21687,7 +22094,7 @@ var listCommand5 = defineCommand98({
21687
22094
  writeJson({ ok: true, data: { flows } });
21688
22095
  }
21689
22096
  });
21690
- var showCommand2 = defineCommand98({
22097
+ var showCommand2 = defineCommand99({
21691
22098
  meta: {
21692
22099
  name: "show",
21693
22100
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -21708,7 +22115,7 @@ var showCommand2 = defineCommand98({
21708
22115
  writeJson({ ok: true, data: response });
21709
22116
  }
21710
22117
  });
21711
- var flowsCommand = defineCommand98({
22118
+ var flowsCommand = defineCommand99({
21712
22119
  meta: {
21713
22120
  name: "flows",
21714
22121
  description: `Read this workspace's Forms (flows) and the configuration status of their confidential fields \u2014 connection secrets, OAuth connections, and third-party field definitions (HubSpot, Calendly, HighLevel, SavvyCal).
@@ -21721,7 +22128,7 @@ Examples:
21721
22128
  baker flows show contact --full`
21722
22129
  },
21723
22130
  subCommands: {
21724
- list: listCommand5,
22131
+ list: listCommand6,
21725
22132
  show: showCommand2
21726
22133
  },
21727
22134
  run: () => {
@@ -21735,10 +22142,10 @@ Examples:
21735
22142
  });
21736
22143
 
21737
22144
  // src/commands/ga4/index.ts
21738
- import { defineCommand as defineCommand102 } from "citty";
22145
+ import { defineCommand as defineCommand103 } from "citty";
21739
22146
 
21740
22147
  // src/commands/ga4/audit.ts
21741
- import { defineCommand as defineCommand99 } from "citty";
22148
+ import { defineCommand as defineCommand100 } from "citty";
21742
22149
 
21743
22150
  // src/commands/ga4/resolve.ts
21744
22151
  async function fetchProperties(useCache = true) {
@@ -21801,7 +22208,7 @@ registerSchema({
21801
22208
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21802
22209
  }
21803
22210
  });
21804
- var auditCommand2 = defineCommand99({
22211
+ var auditCommand2 = defineCommand100({
21805
22212
  meta: {
21806
22213
  name: "audit",
21807
22214
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -21853,7 +22260,7 @@ Examples:
21853
22260
  });
21854
22261
 
21855
22262
  // src/commands/ga4/properties.ts
21856
- import { defineCommand as defineCommand100 } from "citty";
22263
+ import { defineCommand as defineCommand101 } from "citty";
21857
22264
  registerSchema({
21858
22265
  command: "ga4.properties",
21859
22266
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -21861,7 +22268,7 @@ registerSchema({
21861
22268
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21862
22269
  }
21863
22270
  });
21864
- var propertiesCommand = defineCommand100({
22271
+ var propertiesCommand = defineCommand101({
21865
22272
  meta: {
21866
22273
  name: "properties",
21867
22274
  description: `List accessible GA4 properties.
@@ -21911,7 +22318,7 @@ Examples:
21911
22318
  // src/commands/ga4/query.ts
21912
22319
  import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
21913
22320
  import { resolve as resolve2 } from "path";
21914
- import { defineCommand as defineCommand101 } from "citty";
22321
+ import { defineCommand as defineCommand102 } from "citty";
21915
22322
 
21916
22323
  // src/commands/ga4/presets.ts
21917
22324
  var GA4_PRESETS = [
@@ -22043,7 +22450,7 @@ function handleError(err) {
22043
22450
  });
22044
22451
  process.exit(1);
22045
22452
  }
22046
- var queryCommand2 = defineCommand101({
22453
+ var queryCommand2 = defineCommand102({
22047
22454
  meta: {
22048
22455
  name: "query",
22049
22456
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -22114,7 +22521,7 @@ Free-form (escape hatch):
22114
22521
  });
22115
22522
 
22116
22523
  // src/commands/ga4/index.ts
22117
- var ga4Command = defineCommand102({
22524
+ var ga4Command = defineCommand103({
22118
22525
  meta: {
22119
22526
  name: "ga4",
22120
22527
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -22137,12 +22544,12 @@ Examples:
22137
22544
  });
22138
22545
 
22139
22546
  // src/commands/gsc/index.ts
22140
- import { defineCommand as defineCommand106 } from "citty";
22547
+ import { defineCommand as defineCommand107 } from "citty";
22141
22548
 
22142
22549
  // src/commands/gsc/query.ts
22143
22550
  import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
22144
22551
  import { resolve as resolve3 } from "path";
22145
- import { defineCommand as defineCommand103 } from "citty";
22552
+ import { defineCommand as defineCommand104 } from "citty";
22146
22553
 
22147
22554
  // src/commands/gsc/presets.ts
22148
22555
  var GSC_PRESETS = [
@@ -22330,7 +22737,7 @@ function handleError2(err) {
22330
22737
  });
22331
22738
  process.exit(1);
22332
22739
  }
22333
- var queryCommand3 = defineCommand103({
22740
+ var queryCommand3 = defineCommand104({
22334
22741
  meta: {
22335
22742
  name: "query",
22336
22743
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -22408,7 +22815,7 @@ Free-form (escape hatch):
22408
22815
  });
22409
22816
 
22410
22817
  // src/commands/gsc/sitemaps.ts
22411
- import { defineCommand as defineCommand104 } from "citty";
22818
+ import { defineCommand as defineCommand105 } from "citty";
22412
22819
  registerSchema({
22413
22820
  command: "gsc.sitemaps",
22414
22821
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -22417,7 +22824,7 @@ registerSchema({
22417
22824
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22418
22825
  }
22419
22826
  });
22420
- var sitemapsCommand = defineCommand104({
22827
+ var sitemapsCommand = defineCommand105({
22421
22828
  meta: {
22422
22829
  name: "sitemaps",
22423
22830
  description: `List sitemaps for a site. Check health and errors.
@@ -22467,7 +22874,7 @@ Examples:
22467
22874
  });
22468
22875
 
22469
22876
  // src/commands/gsc/sites.ts
22470
- import { defineCommand as defineCommand105 } from "citty";
22877
+ import { defineCommand as defineCommand106 } from "citty";
22471
22878
  registerSchema({
22472
22879
  command: "gsc.sites",
22473
22880
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -22475,7 +22882,7 @@ registerSchema({
22475
22882
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22476
22883
  }
22477
22884
  });
22478
- var sitesCommand = defineCommand105({
22885
+ var sitesCommand = defineCommand106({
22479
22886
  meta: {
22480
22887
  name: "sites",
22481
22888
  description: `List verified Search Console sites.
@@ -22523,7 +22930,7 @@ Examples:
22523
22930
  });
22524
22931
 
22525
22932
  // src/commands/gsc/index.ts
22526
- var gscCommand = defineCommand106({
22933
+ var gscCommand = defineCommand107({
22527
22934
  meta: {
22528
22935
  name: "gsc",
22529
22936
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -22546,7 +22953,7 @@ Examples:
22546
22953
  });
22547
22954
 
22548
22955
  // src/commands/history/index.ts
22549
- import { defineCommand as defineCommand107 } from "citty";
22956
+ import { defineCommand as defineCommand108 } from "citty";
22550
22957
  registerSchema({
22551
22958
  command: "history.list",
22552
22959
  description: "Start here: unified account history (audit log) \u2014 everything that changed on this account, newest first: publishes, chat lifecycle, backlog actions, team changes, setup links, tags, schedules, ad-platform writes, followed advertisers, media, creatives, reports, domains, and integrations. Use it to see what happened recently before planning work. Compact by default; add --full for raw metadata per entry.",
@@ -22591,7 +22998,7 @@ var CATEGORIES = [
22591
22998
  "domain",
22592
22999
  "integration"
22593
23000
  ];
22594
- function parseBoundedInt(raw, name, min, max) {
23001
+ function parseBoundedInt2(raw, name, min, max) {
22595
23002
  if (raw === void 0) {
22596
23003
  return void 0;
22597
23004
  }
@@ -22601,7 +23008,7 @@ function parseBoundedInt(raw, name, min, max) {
22601
23008
  }
22602
23009
  return value;
22603
23010
  }
22604
- var listCommand6 = defineCommand107({
23011
+ var listCommand7 = defineCommand108({
22605
23012
  meta: {
22606
23013
  name: "list",
22607
23014
  description: "List recent account changes (unified audit log), newest first."
@@ -22619,11 +23026,11 @@ var listCommand6 = defineCommand107({
22619
23026
  run: async ({ args }) => {
22620
23027
  try {
22621
23028
  const body = {};
22622
- const limit = parseBoundedInt(args.limit, "limit", 1, 200);
23029
+ const limit = parseBoundedInt2(args.limit, "limit", 1, 200);
22623
23030
  if (limit !== void 0) {
22624
23031
  body.limit = limit;
22625
23032
  }
22626
- const days = parseBoundedInt(args.days, "days", 1, 365);
23033
+ const days = parseBoundedInt2(args.days, "days", 1, 365);
22627
23034
  if (days !== void 0) {
22628
23035
  body.days = days;
22629
23036
  }
@@ -22647,19 +23054,19 @@ var listCommand6 = defineCommand107({
22647
23054
  }
22648
23055
  }
22649
23056
  });
22650
- var historyCommand = defineCommand107({
23057
+ var historyCommand = defineCommand108({
22651
23058
  meta: {
22652
23059
  name: "history",
22653
23060
  description: "Unified account history (audit log): what changed, who did it, and when."
22654
23061
  },
22655
- subCommands: { list: listCommand6 }
23062
+ subCommands: { list: listCommand7 }
22656
23063
  });
22657
23064
 
22658
23065
  // src/commands/images/index.ts
22659
- import { defineCommand as defineCommand131 } from "citty";
23066
+ import { defineCommand as defineCommand132 } from "citty";
22660
23067
 
22661
23068
  // src/commands/images/crop.ts
22662
- import { defineCommand as defineCommand108 } from "citty";
23069
+ import { defineCommand as defineCommand109 } from "citty";
22663
23070
 
22664
23071
  // src/lib/image/crop-sprite.ts
22665
23072
  import sharp from "sharp";
@@ -22784,7 +23191,7 @@ function emitError2(err) {
22784
23191
  }
22785
23192
  process.exit(1);
22786
23193
  }
22787
- var cropCommand = defineCommand108({
23194
+ var cropCommand = defineCommand109({
22788
23195
  meta: {
22789
23196
  name: "crop",
22790
23197
  description: "Crop a rectangular region from an image.\n\nExample: baker images crop sprite.png --x 0 --y 0 --width 64 --height 64 --output icon.png"
@@ -22820,7 +23227,7 @@ var cropCommand = defineCommand108({
22820
23227
  });
22821
23228
 
22822
23229
  // src/commands/images/delete.ts
22823
- import { defineCommand as defineCommand109 } from "citty";
23230
+ import { defineCommand as defineCommand110 } from "citty";
22824
23231
  registerSchema({
22825
23232
  command: "images.delete",
22826
23233
  description: "Delete an image by ID",
@@ -22834,7 +23241,7 @@ registerSchema({
22834
23241
  }
22835
23242
  }
22836
23243
  });
22837
- var deleteCommand = defineCommand109({
23244
+ var deleteCommand = defineCommand110({
22838
23245
  meta: {
22839
23246
  name: "delete",
22840
23247
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -22875,7 +23282,7 @@ var deleteCommand = defineCommand109({
22875
23282
  });
22876
23283
 
22877
23284
  // src/commands/images/dimensions.ts
22878
- import { defineCommand as defineCommand110 } from "citty";
23285
+ import { defineCommand as defineCommand111 } from "citty";
22879
23286
 
22880
23287
  // src/lib/image/dimensions.ts
22881
23288
  import { imageSize } from "image-size";
@@ -22898,7 +23305,7 @@ registerSchema({
22898
23305
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
22899
23306
  }
22900
23307
  });
22901
- var dimensionsCommand = defineCommand110({
23308
+ var dimensionsCommand = defineCommand111({
22902
23309
  meta: {
22903
23310
  name: "dimensions",
22904
23311
  description: "Read image dimensions without decoding the full file.\n\nExample: baker images dimensions ./logo.png\nExample: baker images dimensions https://acme.com/hero.png"
@@ -22942,7 +23349,7 @@ var dimensionsCommand = defineCommand110({
22942
23349
  });
22943
23350
 
22944
23351
  // src/commands/images/extract.ts
22945
- import { defineCommand as defineCommand111 } from "citty";
23352
+ import { defineCommand as defineCommand112 } from "citty";
22946
23353
  registerSchema({
22947
23354
  command: "images.extract",
22948
23355
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -22958,7 +23365,7 @@ registerSchema({
22958
23365
  }
22959
23366
  }
22960
23367
  });
22961
- var extractCommand = defineCommand111({
23368
+ var extractCommand = defineCommand112({
22962
23369
  meta: {
22963
23370
  name: "extract",
22964
23371
  description: "Pull every image from a single URL via Firecrawl. ~$0.001/scrape. Cap auto-ingest at 20.\n\nExample: baker images extract https://stripe.com --auto-ingest 5"
@@ -22996,7 +23403,7 @@ var extractCommand = defineCommand111({
22996
23403
  });
22997
23404
 
22998
23405
  // src/commands/images/find.ts
22999
- import { defineCommand as defineCommand112 } from "citty";
23406
+ import { defineCommand as defineCommand113 } from "citty";
23000
23407
  registerSchema({
23001
23408
  command: "images.find",
23002
23409
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -23028,7 +23435,7 @@ registerSchema({
23028
23435
  }
23029
23436
  }
23030
23437
  });
23031
- var findCommand = defineCommand112({
23438
+ var findCommand = defineCommand113({
23032
23439
  meta: {
23033
23440
  name: "find",
23034
23441
  description: "Library-first fanout image search. Opt in to providers with --sources. `--fallback` short-circuits to externals only when library is thin. With --auto-ingest, ingested external hits return Baker-owned URLs.\n\nExample: baker images find 'office' --sources library,magnific --limit 20"
@@ -23077,7 +23484,7 @@ var findCommand = defineCommand112({
23077
23484
 
23078
23485
  // src/commands/images/generate.ts
23079
23486
  import { readFile as readFile19 } from "fs/promises";
23080
- import { defineCommand as defineCommand113 } from "citty";
23487
+ import { defineCommand as defineCommand114 } from "citty";
23081
23488
  import sharp2 from "sharp";
23082
23489
  var GENERATE_TIMEOUT_MS = 18e4;
23083
23490
  var REFERENCE_MAX_EDGE = 1536;
@@ -23180,7 +23587,7 @@ async function resolveReferences(spec) {
23180
23587
  }
23181
23588
  return out;
23182
23589
  }
23183
- var generateCommand = defineCommand113({
23590
+ var generateCommand = defineCommand114({
23184
23591
  meta: {
23185
23592
  name: "generate",
23186
23593
  description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: google/gemini-3.1-flash-image-preview (Nano Banana flash \u2014 default, fast, extreme aspect ratios) & google/gemini-3.5-flash (fast), google/gemini-3-pro-image-preview (Nano Banana Pro \u2014 highest fidelity), openai/gpt-5.4-image-2 (photoreal, cleanest in-image text, best for ad/landing reproduction), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model openai/gpt-5.4-image-2 --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
@@ -23232,7 +23639,7 @@ var generateCommand = defineCommand113({
23232
23639
  });
23233
23640
 
23234
23641
  // src/commands/images/get.ts
23235
- import { defineCommand as defineCommand114 } from "citty";
23642
+ import { defineCommand as defineCommand115 } from "citty";
23236
23643
  registerSchema({
23237
23644
  command: "images.get",
23238
23645
  description: "Get a single image by ID",
@@ -23240,7 +23647,7 @@ registerSchema({
23240
23647
  id: { type: "string", description: "Image ID", required: true }
23241
23648
  }
23242
23649
  });
23243
- var getCommand2 = defineCommand114({
23650
+ var getCommand2 = defineCommand115({
23244
23651
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
23245
23652
  args: {
23246
23653
  id: { type: "positional", description: "Image ID", required: false },
@@ -23276,7 +23683,7 @@ var getCommand2 = defineCommand114({
23276
23683
  });
23277
23684
 
23278
23685
  // src/commands/images/gif.ts
23279
- import { defineCommand as defineCommand115 } from "citty";
23686
+ import { defineCommand as defineCommand116 } from "citty";
23280
23687
  registerSchema({
23281
23688
  command: "images.gif",
23282
23689
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -23308,7 +23715,7 @@ registerSchema({
23308
23715
  }
23309
23716
  }
23310
23717
  });
23311
- var gifCommand = defineCommand115({
23718
+ var gifCommand = defineCommand116({
23312
23719
  meta: {
23313
23720
  name: "gif",
23314
23721
  description: "Search Giphy for GIFs / reaction memes \u2014 built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25"
@@ -23355,7 +23762,7 @@ var gifCommand = defineCommand115({
23355
23762
  });
23356
23763
 
23357
23764
  // src/commands/images/google.ts
23358
- import { defineCommand as defineCommand116 } from "citty";
23765
+ import { defineCommand as defineCommand117 } from "citty";
23359
23766
  registerSchema({
23360
23767
  command: "images.google",
23361
23768
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -23391,7 +23798,7 @@ registerSchema({
23391
23798
  }
23392
23799
  }
23393
23800
  });
23394
- var googleCommand2 = defineCommand116({
23801
+ var googleCommand2 = defineCommand117({
23395
23802
  meta: {
23396
23803
  name: "google",
23397
23804
  description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). \u26A0 Source unverified \u2014 watermarks, low-res, mislabeled results are common. Use as last resort. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20"
@@ -23439,7 +23846,7 @@ var googleCommand2 = defineCommand116({
23439
23846
  });
23440
23847
 
23441
23848
  // src/commands/images/icon.ts
23442
- import { defineCommand as defineCommand117 } from "citty";
23849
+ import { defineCommand as defineCommand118 } from "citty";
23443
23850
  registerSchema({
23444
23851
  command: "images.icon",
23445
23852
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -23465,7 +23872,7 @@ registerSchema({
23465
23872
  }
23466
23873
  }
23467
23874
  });
23468
- var iconCommand = defineCommand117({
23875
+ var iconCommand = defineCommand118({
23469
23876
  meta: {
23470
23877
  name: "icon",
23471
23878
  description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, \u2026). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'"
@@ -23505,7 +23912,7 @@ var iconCommand = defineCommand117({
23505
23912
  });
23506
23913
 
23507
23914
  // src/commands/images/ingest.ts
23508
- import { defineCommand as defineCommand118 } from "citty";
23915
+ import { defineCommand as defineCommand119 } from "citty";
23509
23916
  registerSchema({
23510
23917
  command: "images.ingest",
23511
23918
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -23517,7 +23924,7 @@ registerSchema({
23517
23924
  context: { type: "string", description: "Description context hint", required: false }
23518
23925
  }
23519
23926
  });
23520
- var ingestCommand = defineCommand118({
23927
+ var ingestCommand = defineCommand119({
23521
23928
  meta: {
23522
23929
  name: "ingest",
23523
23930
  description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345"
@@ -23559,7 +23966,7 @@ var ingestCommand = defineCommand118({
23559
23966
  });
23560
23967
 
23561
23968
  // src/commands/images/library.ts
23562
- import { defineCommand as defineCommand119 } from "citty";
23969
+ import { defineCommand as defineCommand120 } from "citty";
23563
23970
  registerSchema({
23564
23971
  command: "images.library",
23565
23972
  description: "Search the company image library. Returns only ready images.",
@@ -23585,7 +23992,7 @@ registerSchema({
23585
23992
  }
23586
23993
  }
23587
23994
  });
23588
- var libraryCommand = defineCommand119({
23995
+ var libraryCommand = defineCommand120({
23589
23996
  meta: {
23590
23997
  name: "library",
23591
23998
  description: "Search the company image library (hybrid BM25 + vector + Cohere rerank). Use this BEFORE any external provider.\n\nExample: baker images library 'hero banner' --aspect-ratio 16:9 --source magnific"
@@ -23642,7 +24049,7 @@ var libraryCommand = defineCommand119({
23642
24049
  });
23643
24050
 
23644
24051
  // src/commands/images/logo.ts
23645
- import { defineCommand as defineCommand120 } from "citty";
24052
+ import { defineCommand as defineCommand121 } from "citty";
23646
24053
  registerSchema({
23647
24054
  command: "images.logo",
23648
24055
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -23667,7 +24074,7 @@ registerSchema({
23667
24074
  }
23668
24075
  }
23669
24076
  });
23670
- var logoCommand = defineCommand120({
24077
+ var logoCommand = defineCommand121({
23671
24078
  meta: {
23672
24079
  name: "logo",
23673
24080
  description: "Brand logo via Brandfetch CDN. Returns up to 5 variants (icon, light/dark logo, light/dark symbol). Auto-ingests the first variant.\n\nExample: baker images logo stripe.com --variant logo"
@@ -23705,7 +24112,7 @@ var logoCommand = defineCommand120({
23705
24112
  });
23706
24113
 
23707
24114
  // src/commands/images/normalize.ts
23708
- import { defineCommand as defineCommand121 } from "citty";
24115
+ import { defineCommand as defineCommand122 } from "citty";
23709
24116
 
23710
24117
  // src/lib/image/color-changer.ts
23711
24118
  import quantize from "quantize";
@@ -24437,7 +24844,7 @@ function coerceRawArgs(args) {
24437
24844
  "dry-run": bool(args["dry-run"])
24438
24845
  };
24439
24846
  }
24440
- var normalizeCommand = defineCommand121({
24847
+ var normalizeCommand = defineCommand122({
24441
24848
  meta: {
24442
24849
  name: "normalize",
24443
24850
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -24492,7 +24899,7 @@ Examples:
24492
24899
  });
24493
24900
 
24494
24901
  // src/commands/images/pinterest.ts
24495
- import { defineCommand as defineCommand122 } from "citty";
24902
+ import { defineCommand as defineCommand123 } from "citty";
24496
24903
  registerSchema({
24497
24904
  command: "images.pinterest",
24498
24905
  description: "Pinterest image search via ScrapeCreators. Reference-grade real-world photography, product styling, interiors, fashion, food, and aesthetic mood boards. Inspect before placing \u2014 Pinterest is unverified, trademark-bearing web content.",
@@ -24512,7 +24919,7 @@ registerSchema({
24512
24919
  }
24513
24920
  }
24514
24921
  });
24515
- var pinterestCommand = defineCommand122({
24922
+ var pinterestCommand = defineCommand123({
24516
24923
  meta: {
24517
24924
  name: "pinterest",
24518
24925
  description: "Pinterest image search via ScrapeCreators ($0.00188/request). Best for photo-realistic reference imagery \u2014 lifestyle, interiors, fashion, food, product styling, and mood boards to brief AI generation against. \u26A0 Unverified, trademark-bearing web content \u2014 inspect and respect rights before placing on a customer page. Browse first; auto-ingest only the pins you commit to.\n\nExamples:\n baker images pinterest 'scandinavian living room'\n baker images pinterest 'minimalist skincare product photography' --limit 20\n baker images pinterest 'cozy coffee shop interior' --auto-ingest 2 --context 'Mood reference for hero photography'"
@@ -24552,7 +24959,7 @@ var pinterestCommand = defineCommand122({
24552
24959
  });
24553
24960
 
24554
24961
  // src/commands/images/screenshot.ts
24555
- import { defineCommand as defineCommand123 } from "citty";
24962
+ import { defineCommand as defineCommand124 } from "citty";
24556
24963
  registerSchema({
24557
24964
  command: "images.screenshot",
24558
24965
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -24568,7 +24975,7 @@ registerSchema({
24568
24975
  }
24569
24976
  }
24570
24977
  });
24571
- var screenshotCommand = defineCommand123({
24978
+ var screenshotCommand = defineCommand124({
24572
24979
  meta: {
24573
24980
  name: "screenshot",
24574
24981
  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 +25038,7 @@ var screenshotCommand = defineCommand123({
24631
25038
  });
24632
25039
 
24633
25040
  // src/commands/images/search.ts
24634
- import { defineCommand as defineCommand124 } from "citty";
25041
+ import { defineCommand as defineCommand125 } from "citty";
24635
25042
  registerSchema({
24636
25043
  command: "images.search",
24637
25044
  description: "Search images by text query. Only returns ready images.",
@@ -24647,7 +25054,7 @@ registerSchema({
24647
25054
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24648
25055
  }
24649
25056
  });
24650
- var searchCommand = defineCommand124({
25057
+ var searchCommand = defineCommand125({
24651
25058
  meta: {
24652
25059
  name: "search",
24653
25060
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -24707,7 +25114,7 @@ var searchCommand = defineCommand124({
24707
25114
  });
24708
25115
 
24709
25116
  // src/commands/images/sticker.ts
24710
- import { defineCommand as defineCommand125 } from "citty";
25117
+ import { defineCommand as defineCommand126 } from "citty";
24711
25118
  registerSchema({
24712
25119
  command: "images.sticker",
24713
25120
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -24739,7 +25146,7 @@ registerSchema({
24739
25146
  }
24740
25147
  }
24741
25148
  });
24742
- var stickerCommand = defineCommand125({
25149
+ var stickerCommand = defineCommand126({
24743
25150
  meta: {
24744
25151
  name: "sticker",
24745
25152
  description: "Search Giphy's sticker corpus \u2014 transparent-background WebPs / GIFs ideal for overlaying on ad creative (Meta, TikTok, Stories). Same Giphy free API as `baker images gif`; results carry WebP + GIF + MP4 URLs in providerMeta.\n\nExample: baker images sticker 'thumbs up' --limit 10\nExample: baker images sticker celebration --rating g --auto-ingest 3\nExample: baker images sticker --trending --limit 25"
@@ -24786,7 +25193,7 @@ var stickerCommand = defineCommand125({
24786
25193
  });
24787
25194
 
24788
25195
  // src/commands/images/stock.ts
24789
- import { defineCommand as defineCommand126 } from "citty";
25196
+ import { defineCommand as defineCommand127 } from "citty";
24790
25197
  registerSchema({
24791
25198
  command: "images.stock",
24792
25199
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -24844,7 +25251,7 @@ registerSchema({
24844
25251
  }
24845
25252
  }
24846
25253
  });
24847
- var stockCommand = defineCommand126({
25254
+ var stockCommand = defineCommand127({
24848
25255
  meta: {
24849
25256
  name: "stock",
24850
25257
  description: "Stock search via Magnific \u2014 Freepik's developer API (~250M assets: photos, vectors, illustrations, icons, PSDs). $0.002/req. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExamples:\n baker images stock 'minimalist office'\n baker images stock 'flat office workers' --type vector\n baker images stock 'hero photo of a kitchen' --type photo --orientation landscape --ai exclude\n baker images stock 'brand pattern' --color '#0a0a0a' --license freemium --auto-ingest 2"
@@ -24900,7 +25307,7 @@ var stockCommand = defineCommand126({
24900
25307
  });
24901
25308
 
24902
25309
  // src/lib/tags-command.ts
24903
- import { defineCommand as defineCommand127 } from "citty";
25310
+ import { defineCommand as defineCommand128 } from "citty";
24904
25311
  function makeTagsCommand(command, label, endpoint) {
24905
25312
  registerSchema({
24906
25313
  command: `${command}.tags`,
@@ -24909,7 +25316,7 @@ function makeTagsCommand(command, label, endpoint) {
24909
25316
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
24910
25317
  }
24911
25318
  });
24912
- return defineCommand127({
25319
+ return defineCommand128({
24913
25320
  meta: {
24914
25321
  name: "tags",
24915
25322
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -24945,7 +25352,7 @@ function makeTagsCommand(command, label, endpoint) {
24945
25352
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
24946
25353
 
24947
25354
  // src/commands/images/upload.ts
24948
- import { defineCommand as defineCommand128 } from "citty";
25355
+ import { defineCommand as defineCommand129 } from "citty";
24949
25356
  registerSchema({
24950
25357
  command: "images.upload",
24951
25358
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -24983,7 +25390,7 @@ registerSchema({
24983
25390
  function isRemoteUrl2(value) {
24984
25391
  return /^https?:\/\//i.test(value);
24985
25392
  }
24986
- var uploadCommand = defineCommand128({
25393
+ var uploadCommand = defineCommand129({
24987
25394
  meta: {
24988
25395
  name: "upload",
24989
25396
  description: "Upload an image to the library \u2014 accepts a local file path OR a remote http(s) URL.\n\nLocal: reads bytes, sends to /api/images/upload, content-type auto-detected from extension.\nRemote: dispatches to /api/images/ingest with hash-dedup on bytes + externalId.\n\nExamples:\n baker images upload ./logo.png --source uploaded\n baker images upload ./cert.png --context 'ISO 27001 badge \u2014 enterprise tier'\n baker images upload https://acme.com/hero.png --source firecrawl --context 'Acme competitor pricing hero'"
@@ -25076,7 +25483,7 @@ async function uploadLocal(target, args) {
25076
25483
  }
25077
25484
 
25078
25485
  // src/commands/images/upscale.ts
25079
- import { defineCommand as defineCommand129 } from "citty";
25486
+ import { defineCommand as defineCommand130 } from "citty";
25080
25487
  registerSchema({
25081
25488
  command: "images.upscale",
25082
25489
  description: "Upscale a library image via the backend (Replicate, cost-tracked). Waits for completion by default. The image must be status 'ready' and raster (not SVG/AVIF).",
@@ -25091,7 +25498,7 @@ registerSchema({
25091
25498
  }
25092
25499
  });
25093
25500
  var POLL_INTERVAL_MS3 = 1500;
25094
- var upscaleCommand = defineCommand129({
25501
+ var upscaleCommand = defineCommand130({
25095
25502
  meta: {
25096
25503
  name: "upscale",
25097
25504
  description: "Upscale a library image via the Convex backend (Replicate, cost-tracked at $0.05/image). Waits for completion by default.\n\nExample: baker images upscale j571abc123def\nExample: baker images upscale j571abc123def --max-wait 0 # fire-and-forget"
@@ -25146,7 +25553,7 @@ var upscaleCommand = defineCommand129({
25146
25553
  });
25147
25554
 
25148
25555
  // src/commands/images/use.ts
25149
- import { defineCommand as defineCommand130 } from "citty";
25556
+ import { defineCommand as defineCommand131 } from "citty";
25150
25557
  registerSchema({
25151
25558
  command: "images.use",
25152
25559
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -25162,7 +25569,7 @@ registerSchema({
25162
25569
  }
25163
25570
  });
25164
25571
  var POLL_INTERVAL_MS4 = 1500;
25165
- var useCommand = defineCommand130({
25572
+ var useCommand = defineCommand131({
25166
25573
  meta: {
25167
25574
  name: "use",
25168
25575
  description: "Sugar over `ingest`: download \u2192 store \u2192 wait until describe + embed complete \u2192 return ready library record.\n\nExample: baker images use https://cdn.example.com/hero.png --source uploaded"
@@ -25208,7 +25615,7 @@ var useCommand = defineCommand130({
25208
25615
  });
25209
25616
 
25210
25617
  // src/commands/images/index.ts
25211
- var imagesCommand = defineCommand131({
25618
+ var imagesCommand = defineCommand132({
25212
25619
  meta: {
25213
25620
  name: "images",
25214
25621
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -25278,7 +25685,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
25278
25685
  });
25279
25686
 
25280
25687
  // src/commands/mcp/index.ts
25281
- import { defineCommand as defineCommand132 } from "citty";
25688
+ import { defineCommand as defineCommand133 } from "citty";
25282
25689
  var SCOPES = ["user", "user_org", "company", "org"];
25283
25690
  function parseScope(raw) {
25284
25691
  const scope = raw === void 0 ? "company" : String(raw);
@@ -25317,7 +25724,7 @@ registerSchema({
25317
25724
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
25318
25725
  args: {}
25319
25726
  });
25320
- var listCommand7 = defineCommand132({
25727
+ var listCommand8 = defineCommand133({
25321
25728
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
25322
25729
  run: async () => {
25323
25730
  try {
@@ -25342,7 +25749,7 @@ registerSchema({
25342
25749
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
25343
25750
  }
25344
25751
  });
25345
- var addCommand = defineCommand132({
25752
+ var addCommand = defineCommand133({
25346
25753
  meta: {
25347
25754
  name: "add",
25348
25755
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -25383,7 +25790,7 @@ registerSchema({
25383
25790
  description: "Remove a company custom MCP server by name.",
25384
25791
  args: { name: { type: "string", description: "Server name to remove", required: true } }
25385
25792
  });
25386
- var removeCommand4 = defineCommand132({
25793
+ var removeCommand4 = defineCommand133({
25387
25794
  meta: {
25388
25795
  name: "remove",
25389
25796
  description: `Remove a company custom MCP server by name.
@@ -25405,7 +25812,7 @@ Example:
25405
25812
  }
25406
25813
  }
25407
25814
  });
25408
- var mcpCommand = defineCommand132({
25815
+ var mcpCommand = defineCommand133({
25409
25816
  meta: {
25410
25817
  name: "mcp",
25411
25818
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -25422,17 +25829,17 @@ Examples:
25422
25829
  baker mcp remove --name weather`
25423
25830
  },
25424
25831
  subCommands: {
25425
- list: listCommand7,
25832
+ list: listCommand8,
25426
25833
  add: addCommand,
25427
25834
  remove: removeCommand4
25428
25835
  }
25429
25836
  });
25430
25837
 
25431
25838
  // src/commands/research/index.ts
25432
- import { defineCommand as defineCommand143 } from "citty";
25839
+ import { defineCommand as defineCommand144 } from "citty";
25433
25840
 
25434
25841
  // src/commands/research/advertisers.ts
25435
- import { defineCommand as defineCommand133 } from "citty";
25842
+ import { defineCommand as defineCommand134 } from "citty";
25436
25843
 
25437
25844
  // src/commands/research/output.ts
25438
25845
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -25545,7 +25952,7 @@ var FIELDS3 = {
25545
25952
  etv: "Estimated traffic value (USD)",
25546
25953
  visibility: "SERP visibility score (0-1)"
25547
25954
  };
25548
- var advertisersCommand = defineCommand133({
25955
+ var advertisersCommand = defineCommand134({
25549
25956
  meta: {
25550
25957
  name: "advertisers",
25551
25958
  description: `Find domains competing for a keyword in Google SERPs.
@@ -25592,7 +25999,7 @@ Examples:
25592
25999
  });
25593
26000
 
25594
26001
  // src/commands/research/autocomplete.ts
25595
- import { defineCommand as defineCommand134 } from "citty";
26002
+ import { defineCommand as defineCommand135 } from "citty";
25596
26003
  registerSchema({
25597
26004
  command: "research.autocomplete",
25598
26005
  description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -25615,7 +26022,7 @@ registerSchema({
25615
26022
  var FIELDS4 = {
25616
26023
  suggestion: "Autocomplete suggestion from Google"
25617
26024
  };
25618
- var autocompleteCommand = defineCommand134({
26025
+ var autocompleteCommand = defineCommand135({
25619
26026
  meta: {
25620
26027
  name: "autocomplete",
25621
26028
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -25661,7 +26068,7 @@ Examples:
25661
26068
  });
25662
26069
 
25663
26070
  // src/commands/research/countries.ts
25664
- import { defineCommand as defineCommand135 } from "citty";
26071
+ import { defineCommand as defineCommand136 } from "citty";
25665
26072
  registerSchema({
25666
26073
  command: "research.countries",
25667
26074
  description: "List all supported country codes for --location flag in research commands.",
@@ -25718,7 +26125,7 @@ var FIELDS5 = {
25718
26125
  code: "Country code to pass as --location",
25719
26126
  name: "Country name"
25720
26127
  };
25721
- var countriesCommand = defineCommand135({
26128
+ var countriesCommand = defineCommand136({
25722
26129
  meta: {
25723
26130
  name: "countries",
25724
26131
  description: "List all supported country codes for --location flag."
@@ -25729,7 +26136,7 @@ var countriesCommand = defineCommand135({
25729
26136
  });
25730
26137
 
25731
26138
  // src/commands/research/intent.ts
25732
- import { defineCommand as defineCommand136 } from "citty";
26139
+ import { defineCommand as defineCommand137 } from "citty";
25733
26140
  registerSchema({
25734
26141
  command: "research.intent",
25735
26142
  description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
@@ -25752,7 +26159,7 @@ var FIELDS6 = {
25752
26159
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
25753
26160
  probability: "Confidence score 0.0-1.0"
25754
26161
  };
25755
- var intentCommand = defineCommand136({
26162
+ var intentCommand = defineCommand137({
25756
26163
  meta: {
25757
26164
  name: "intent",
25758
26165
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -25800,7 +26207,7 @@ Examples:
25800
26207
  });
25801
26208
 
25802
26209
  // src/commands/research/keyword-gap.ts
25803
- import { defineCommand as defineCommand137 } from "citty";
26210
+ import { defineCommand as defineCommand138 } from "citty";
25804
26211
  registerSchema({
25805
26212
  command: "research.keyword-gap",
25806
26213
  description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -25829,7 +26236,7 @@ var FIELDS7 = {
25829
26236
  cpc: "Cost per click USD",
25830
26237
  their_position: "Competitor's ranking position"
25831
26238
  };
25832
- var keywordGapCommand = defineCommand137({
26239
+ var keywordGapCommand = defineCommand138({
25833
26240
  meta: {
25834
26241
  name: "keyword-gap",
25835
26242
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -25903,7 +26310,7 @@ Examples:
25903
26310
  });
25904
26311
 
25905
26312
  // src/commands/research/keywords-for-site.ts
25906
- import { defineCommand as defineCommand138 } from "citty";
26313
+ import { defineCommand as defineCommand139 } from "citty";
25907
26314
  registerSchema({
25908
26315
  command: "research.keywords-for-site",
25909
26316
  description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -25936,7 +26343,7 @@ var FIELDS8 = {
25936
26343
  competition: "LOW, MEDIUM, or HIGH",
25937
26344
  competition_index: "Competition score 0-100"
25938
26345
  };
25939
- var keywordsForSiteCommand = defineCommand138({
26346
+ var keywordsForSiteCommand = defineCommand139({
25940
26347
  meta: {
25941
26348
  name: "keywords-for-site",
25942
26349
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -25989,7 +26396,7 @@ Examples:
25989
26396
  });
25990
26397
 
25991
26398
  // src/commands/research/languages.ts
25992
- import { defineCommand as defineCommand139 } from "citty";
26399
+ import { defineCommand as defineCommand140 } from "citty";
25993
26400
  registerSchema({
25994
26401
  command: "research.languages",
25995
26402
  description: "List all supported language codes for --language flag in research commands.",
@@ -26019,7 +26426,7 @@ var FIELDS9 = {
26019
26426
  code: "Language code to pass as --language",
26020
26427
  name: "Language name (also accepted by --language)"
26021
26428
  };
26022
- var languagesCommand2 = defineCommand139({
26429
+ var languagesCommand2 = defineCommand140({
26023
26430
  meta: {
26024
26431
  name: "languages",
26025
26432
  description: "List all supported language codes for --language flag."
@@ -26030,7 +26437,7 @@ var languagesCommand2 = defineCommand139({
26030
26437
  });
26031
26438
 
26032
26439
  // src/commands/research/lighthouse.ts
26033
- import { defineCommand as defineCommand140 } from "citty";
26440
+ import { defineCommand as defineCommand141 } from "citty";
26034
26441
  registerSchema({
26035
26442
  command: "research.lighthouse",
26036
26443
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -26049,7 +26456,7 @@ var FIELDS10 = {
26049
26456
  speed_index_ms: "Speed Index in ms (good: < 3400)",
26050
26457
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
26051
26458
  };
26052
- var lighthouseCommand = defineCommand140({
26459
+ var lighthouseCommand = defineCommand141({
26053
26460
  meta: {
26054
26461
  name: "lighthouse",
26055
26462
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -26087,7 +26494,7 @@ Examples:
26087
26494
  });
26088
26495
 
26089
26496
  // src/commands/research/relevant-pages.ts
26090
- import { defineCommand as defineCommand141 } from "citty";
26497
+ import { defineCommand as defineCommand142 } from "citty";
26091
26498
  registerSchema({
26092
26499
  command: "research.relevant-pages",
26093
26500
  description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -26113,7 +26520,7 @@ var FIELDS11 = {
26113
26520
  keywords: "Total organic keywords the page ranks for",
26114
26521
  top_10: "Keywords in positions 1-10"
26115
26522
  };
26116
- var relevantPagesCommand = defineCommand141({
26523
+ var relevantPagesCommand = defineCommand142({
26117
26524
  meta: {
26118
26525
  name: "relevant-pages",
26119
26526
  description: `Get the top pages of a competitor domain with traffic data.
@@ -26159,7 +26566,7 @@ Examples:
26159
26566
  });
26160
26567
 
26161
26568
  // src/commands/research/web.ts
26162
- import { defineCommand as defineCommand142 } from "citty";
26569
+ import { defineCommand as defineCommand143 } from "citty";
26163
26570
  registerSchema({
26164
26571
  command: "research.web",
26165
26572
  description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
@@ -26210,7 +26617,7 @@ async function runDeepResearch(question) {
26210
26617
  }
26211
26618
  throw new Error("Deep research timed out");
26212
26619
  }
26213
- var webCommand = defineCommand142({
26620
+ var webCommand = defineCommand143({
26214
26621
  meta: {
26215
26622
  name: "web",
26216
26623
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -26270,7 +26677,7 @@ Examples:
26270
26677
  });
26271
26678
 
26272
26679
  // src/commands/research/index.ts
26273
- var researchCommand = defineCommand143({
26680
+ var researchCommand = defineCommand144({
26274
26681
  meta: {
26275
26682
  name: "research",
26276
26683
  description: `Competitive intelligence and AI-powered research commands.
@@ -26310,10 +26717,10 @@ Examples:
26310
26717
  });
26311
26718
 
26312
26719
  // src/commands/scheduled-actions/index.ts
26313
- import { defineCommand as defineCommand150 } from "citty";
26720
+ import { defineCommand as defineCommand151 } from "citty";
26314
26721
 
26315
26722
  // src/commands/scheduled-actions/create.ts
26316
- import { defineCommand as defineCommand144 } from "citty";
26723
+ import { defineCommand as defineCommand145 } from "citty";
26317
26724
 
26318
26725
  // src/commands/scheduled-actions/shared.ts
26319
26726
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -26428,7 +26835,7 @@ registerSchema({
26428
26835
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
26429
26836
  }
26430
26837
  });
26431
- var createCommand2 = defineCommand144({
26838
+ var createCommand2 = defineCommand145({
26432
26839
  meta: {
26433
26840
  name: "create",
26434
26841
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -26477,7 +26884,7 @@ var createCommand2 = defineCommand144({
26477
26884
  });
26478
26885
 
26479
26886
  // src/commands/scheduled-actions/delete.ts
26480
- import { defineCommand as defineCommand145 } from "citty";
26887
+ import { defineCommand as defineCommand146 } from "citty";
26481
26888
  registerSchema({
26482
26889
  command: "scheduled-actions.delete",
26483
26890
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -26485,7 +26892,7 @@ registerSchema({
26485
26892
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26486
26893
  }
26487
26894
  });
26488
- var deleteCommand2 = defineCommand145({
26895
+ var deleteCommand2 = defineCommand146({
26489
26896
  meta: {
26490
26897
  name: "delete",
26491
26898
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -26514,7 +26921,7 @@ var deleteCommand2 = defineCommand145({
26514
26921
  });
26515
26922
 
26516
26923
  // src/commands/scheduled-actions/get.ts
26517
- import { defineCommand as defineCommand146 } from "citty";
26924
+ import { defineCommand as defineCommand147 } from "citty";
26518
26925
  registerSchema({
26519
26926
  command: "scheduled-actions.get",
26520
26927
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -26522,7 +26929,7 @@ registerSchema({
26522
26929
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26523
26930
  }
26524
26931
  });
26525
- var getCommand3 = defineCommand146({
26932
+ var getCommand3 = defineCommand147({
26526
26933
  meta: {
26527
26934
  name: "get",
26528
26935
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -26559,13 +26966,13 @@ var getCommand3 = defineCommand146({
26559
26966
  });
26560
26967
 
26561
26968
  // src/commands/scheduled-actions/list.ts
26562
- import { defineCommand as defineCommand147 } from "citty";
26969
+ import { defineCommand as defineCommand148 } from "citty";
26563
26970
  registerSchema({
26564
26971
  command: "scheduled-actions.list",
26565
26972
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
26566
26973
  args: {}
26567
26974
  });
26568
- var listCommand8 = defineCommand147({
26975
+ var listCommand9 = defineCommand148({
26569
26976
  meta: {
26570
26977
  name: "list",
26571
26978
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -26586,7 +26993,7 @@ var listCommand8 = defineCommand147({
26586
26993
  });
26587
26994
 
26588
26995
  // src/commands/scheduled-actions/trigger.ts
26589
- import { defineCommand as defineCommand148 } from "citty";
26996
+ import { defineCommand as defineCommand149 } from "citty";
26590
26997
  registerSchema({
26591
26998
  command: "scheduled-actions.trigger",
26592
26999
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -26594,7 +27001,7 @@ registerSchema({
26594
27001
  id: { type: "string", description: "Published scheduled action ID", required: true }
26595
27002
  }
26596
27003
  });
26597
- var triggerCommand = defineCommand148({
27004
+ var triggerCommand = defineCommand149({
26598
27005
  meta: {
26599
27006
  name: "trigger",
26600
27007
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -26631,7 +27038,7 @@ var triggerCommand = defineCommand148({
26631
27038
  });
26632
27039
 
26633
27040
  // src/commands/scheduled-actions/update.ts
26634
- import { defineCommand as defineCommand149 } from "citty";
27041
+ import { defineCommand as defineCommand150 } from "citty";
26635
27042
  registerSchema({
26636
27043
  command: "scheduled-actions.update",
26637
27044
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -26656,7 +27063,7 @@ registerSchema({
26656
27063
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
26657
27064
  }
26658
27065
  });
26659
- var updateCommand2 = defineCommand149({
27066
+ var updateCommand2 = defineCommand150({
26660
27067
  meta: {
26661
27068
  name: "update",
26662
27069
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -26727,7 +27134,7 @@ var updateCommand2 = defineCommand149({
26727
27134
  });
26728
27135
 
26729
27136
  // src/commands/scheduled-actions/index.ts
26730
- var scheduledActionsCommand = defineCommand150({
27137
+ var scheduledActionsCommand = defineCommand151({
26731
27138
  meta: {
26732
27139
  name: "scheduled-actions",
26733
27140
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -26743,7 +27150,7 @@ Examples:
26743
27150
  baker scheduled-actions trigger <id>`
26744
27151
  },
26745
27152
  subCommands: {
26746
- list: listCommand8,
27153
+ list: listCommand9,
26747
27154
  get: getCommand3,
26748
27155
  create: createCommand2,
26749
27156
  update: updateCommand2,
@@ -26753,8 +27160,8 @@ Examples:
26753
27160
  });
26754
27161
 
26755
27162
  // src/commands/schema.ts
26756
- import { defineCommand as defineCommand151 } from "citty";
26757
- var schemaCommand = defineCommand151({
27163
+ import { defineCommand as defineCommand152 } from "citty";
27164
+ var schemaCommand = defineCommand152({
26758
27165
  meta: {
26759
27166
  name: "schema",
26760
27167
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -26790,7 +27197,7 @@ var schemaCommand = defineCommand151({
26790
27197
  });
26791
27198
 
26792
27199
  // src/commands/tags/index.ts
26793
- import { defineCommand as defineCommand152 } from "citty";
27200
+ import { defineCommand as defineCommand153 } from "citty";
26794
27201
 
26795
27202
  // src/commands/tags/shared.ts
26796
27203
  function failApi3(err) {
@@ -26856,7 +27263,7 @@ async function listTags(json) {
26856
27263
  failApi3(err);
26857
27264
  }
26858
27265
  }
26859
- var listCommand9 = defineCommand152({
27266
+ var listCommand10 = defineCommand153({
26860
27267
  meta: {
26861
27268
  name: "list",
26862
27269
  description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
@@ -26875,7 +27282,7 @@ async function listDraft3() {
26875
27282
  failApi3(err);
26876
27283
  }
26877
27284
  }
26878
- var draftCommand3 = defineCommand152({
27285
+ var draftCommand3 = defineCommand153({
26879
27286
  meta: {
26880
27287
  name: "draft",
26881
27288
  description: "Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published; to amend or drop one, propose a follow-up change through the same tool (a delete on a tag_temp_* ref drops the staged create)."
@@ -26884,7 +27291,7 @@ var draftCommand3 = defineCommand152({
26884
27291
  await listDraft3();
26885
27292
  }
26886
27293
  });
26887
- var tagsCommand3 = defineCommand152({
27294
+ var tagsCommand3 = defineCommand153({
26888
27295
  meta: {
26889
27296
  name: "tags",
26890
27297
  description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, \u2026) \u2014 production tags plus the changes staged in this chat.
@@ -26900,7 +27307,7 @@ Examples:
26900
27307
  baker tags draft # review the staged changes awaiting publish`
26901
27308
  },
26902
27309
  subCommands: {
26903
- list: listCommand9,
27310
+ list: listCommand10,
26904
27311
  draft: draftCommand3
26905
27312
  },
26906
27313
  run: async () => {
@@ -26909,10 +27316,10 @@ Examples:
26909
27316
  });
26910
27317
 
26911
27318
  // src/commands/testimonials/index.ts
26912
- import { defineCommand as defineCommand156 } from "citty";
27319
+ import { defineCommand as defineCommand157 } from "citty";
26913
27320
 
26914
27321
  // src/commands/testimonials/get.ts
26915
- import { defineCommand as defineCommand153 } from "citty";
27322
+ import { defineCommand as defineCommand154 } from "citty";
26916
27323
  registerSchema({
26917
27324
  command: "testimonials.get",
26918
27325
  description: "Get a single testimonial by ID",
@@ -26920,7 +27327,7 @@ registerSchema({
26920
27327
  id: { type: "string", description: "Testimonial ID", required: true }
26921
27328
  }
26922
27329
  });
26923
- var getCommand4 = defineCommand153({
27330
+ var getCommand4 = defineCommand154({
26924
27331
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
26925
27332
  args: {
26926
27333
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -26957,7 +27364,7 @@ var getCommand4 = defineCommand153({
26957
27364
  });
26958
27365
 
26959
27366
  // src/commands/testimonials/list.ts
26960
- import { defineCommand as defineCommand154 } from "citty";
27367
+ import { defineCommand as defineCommand155 } from "citty";
26961
27368
  registerSchema({
26962
27369
  command: "testimonials.list",
26963
27370
  description: "List testimonials with optional filters.",
@@ -26987,7 +27394,7 @@ registerSchema({
26987
27394
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
26988
27395
  }
26989
27396
  });
26990
- var listCommand10 = defineCommand154({
27397
+ var listCommand11 = defineCommand155({
26991
27398
  meta: {
26992
27399
  name: "list",
26993
27400
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -27036,7 +27443,7 @@ var listCommand10 = defineCommand154({
27036
27443
  });
27037
27444
 
27038
27445
  // src/commands/testimonials/search.ts
27039
- import { defineCommand as defineCommand155 } from "citty";
27446
+ import { defineCommand as defineCommand156 } from "citty";
27040
27447
  registerSchema({
27041
27448
  command: "testimonials.search",
27042
27449
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -27067,7 +27474,7 @@ registerSchema({
27067
27474
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27068
27475
  }
27069
27476
  });
27070
- var searchCommand2 = defineCommand155({
27477
+ var searchCommand2 = defineCommand156({
27071
27478
  meta: {
27072
27479
  name: "search",
27073
27480
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -27141,7 +27548,7 @@ var searchCommand2 = defineCommand155({
27141
27548
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
27142
27549
 
27143
27550
  // src/commands/testimonials/index.ts
27144
- var testimonialsCommand = defineCommand156({
27551
+ var testimonialsCommand = defineCommand157({
27145
27552
  meta: {
27146
27553
  name: "testimonials",
27147
27554
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -27156,16 +27563,16 @@ Examples:
27156
27563
  subCommands: {
27157
27564
  get: getCommand4,
27158
27565
  search: searchCommand2,
27159
- list: listCommand10,
27566
+ list: listCommand11,
27160
27567
  tags: tagsCommand4
27161
27568
  }
27162
27569
  });
27163
27570
 
27164
27571
  // src/commands/videos/index.ts
27165
- import { defineCommand as defineCommand161 } from "citty";
27572
+ import { defineCommand as defineCommand162 } from "citty";
27166
27573
 
27167
27574
  // src/commands/videos/delete.ts
27168
- import { defineCommand as defineCommand157 } from "citty";
27575
+ import { defineCommand as defineCommand158 } from "citty";
27169
27576
  registerSchema({
27170
27577
  command: "videos.delete",
27171
27578
  description: "Delete a video by ID",
@@ -27179,7 +27586,7 @@ registerSchema({
27179
27586
  }
27180
27587
  }
27181
27588
  });
27182
- var deleteCommand3 = defineCommand157({
27589
+ var deleteCommand3 = defineCommand158({
27183
27590
  meta: {
27184
27591
  name: "delete",
27185
27592
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -27220,7 +27627,7 @@ var deleteCommand3 = defineCommand157({
27220
27627
  });
27221
27628
 
27222
27629
  // src/commands/videos/get.ts
27223
- import { defineCommand as defineCommand158 } from "citty";
27630
+ import { defineCommand as defineCommand159 } from "citty";
27224
27631
  registerSchema({
27225
27632
  command: "videos.get",
27226
27633
  description: "Get a single video by ID",
@@ -27228,7 +27635,7 @@ registerSchema({
27228
27635
  id: { type: "string", description: "Video ID", required: true }
27229
27636
  }
27230
27637
  });
27231
- var getCommand5 = defineCommand158({
27638
+ var getCommand5 = defineCommand159({
27232
27639
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
27233
27640
  args: {
27234
27641
  id: { type: "positional", description: "Video ID", required: false },
@@ -27265,7 +27672,7 @@ var getCommand5 = defineCommand158({
27265
27672
  });
27266
27673
 
27267
27674
  // src/commands/videos/search.ts
27268
- import { defineCommand as defineCommand159 } from "citty";
27675
+ import { defineCommand as defineCommand160 } from "citty";
27269
27676
  registerSchema({
27270
27677
  command: "videos.search",
27271
27678
  description: "Search videos by text query. Only returns ready videos.",
@@ -27275,7 +27682,7 @@ registerSchema({
27275
27682
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27276
27683
  }
27277
27684
  });
27278
- var searchCommand3 = defineCommand159({
27685
+ var searchCommand3 = defineCommand160({
27279
27686
  meta: {
27280
27687
  name: "search",
27281
27688
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -27327,7 +27734,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
27327
27734
  // src/commands/videos/upload.ts
27328
27735
  import { readFile as readFile20, stat as stat5 } from "fs/promises";
27329
27736
  import { extname as extname3 } from "path";
27330
- import { defineCommand as defineCommand160 } from "citty";
27737
+ import { defineCommand as defineCommand161 } from "citty";
27331
27738
  var MIME_MAP = {
27332
27739
  ".mp4": "video/mp4",
27333
27740
  ".mov": "video/quicktime",
@@ -27361,7 +27768,7 @@ function detectContentType(filePath) {
27361
27768
  }
27362
27769
  return mime;
27363
27770
  }
27364
- var uploadCommand2 = defineCommand160({
27771
+ var uploadCommand2 = defineCommand161({
27365
27772
  meta: {
27366
27773
  name: "upload",
27367
27774
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -27415,7 +27822,7 @@ var uploadCommand2 = defineCommand160({
27415
27822
  });
27416
27823
 
27417
27824
  // src/commands/videos/index.ts
27418
- var videosCommand = defineCommand161({
27825
+ var videosCommand = defineCommand162({
27419
27826
  meta: {
27420
27827
  name: "videos",
27421
27828
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -27438,10 +27845,10 @@ Examples:
27438
27845
  });
27439
27846
 
27440
27847
  // src/commands/winning-ads/index.ts
27441
- import { defineCommand as defineCommand172 } from "citty";
27848
+ import { defineCommand as defineCommand173 } from "citty";
27442
27849
 
27443
27850
  // src/commands/winning-ads/advertisers.ts
27444
- import { defineCommand as defineCommand162 } from "citty";
27851
+ import { defineCommand as defineCommand163 } from "citty";
27445
27852
 
27446
27853
  // src/commands/winning-ads/shared.ts
27447
27854
  function splitList(value) {
@@ -27494,7 +27901,7 @@ function advertiserNormalizer(record, full) {
27494
27901
  last_synced_at: record.last_synced_at ?? null
27495
27902
  };
27496
27903
  }
27497
- var advertisersCommand2 = defineCommand162({
27904
+ var advertisersCommand2 = defineCommand163({
27498
27905
  meta: {
27499
27906
  name: "advertisers",
27500
27907
  description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
@@ -27552,7 +27959,7 @@ var advertisersCommand2 = defineCommand162({
27552
27959
  });
27553
27960
 
27554
27961
  // src/commands/winning-ads/brief.ts
27555
- import { defineCommand as defineCommand163 } from "citty";
27962
+ import { defineCommand as defineCommand164 } from "citty";
27556
27963
  registerSchema({
27557
27964
  command: "winning-ads.brief",
27558
27965
  description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
@@ -27598,7 +28005,7 @@ function parseDna(raw) {
27598
28005
  }
27599
28006
  return parsed;
27600
28007
  }
27601
- var briefCommand = defineCommand163({
28008
+ var briefCommand = defineCommand164({
27602
28009
  meta: {
27603
28010
  name: "brief",
27604
28011
  description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
@@ -27634,7 +28041,7 @@ var briefCommand = defineCommand163({
27634
28041
  });
27635
28042
 
27636
28043
  // src/commands/winning-ads/feed.ts
27637
- import { defineCommand as defineCommand164 } from "citty";
28044
+ import { defineCommand as defineCommand165 } from "citty";
27638
28045
  function buildFeedParams(input) {
27639
28046
  const params = {};
27640
28047
  const advertiser = splitList(input.advertiser);
@@ -27686,7 +28093,7 @@ registerSchema({
27686
28093
  format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
27687
28094
  }
27688
28095
  });
27689
- var feedCommand = defineCommand164({
28096
+ var feedCommand = defineCommand165({
27690
28097
  meta: {
27691
28098
  name: "feed",
27692
28099
  description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
@@ -27771,7 +28178,7 @@ var feedCommand = defineCommand164({
27771
28178
  });
27772
28179
 
27773
28180
  // src/commands/winning-ads/follow.ts
27774
- import { defineCommand as defineCommand165 } from "citty";
28181
+ import { defineCommand as defineCommand166 } from "citty";
27775
28182
  var PLATFORMS = ["meta", "linkedin"];
27776
28183
  registerSchema({
27777
28184
  command: "winning-ads.follow",
@@ -27786,7 +28193,7 @@ registerSchema({
27786
28193
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
27787
28194
  }
27788
28195
  });
27789
- var followCommand = defineCommand165({
28196
+ var followCommand = defineCommand166({
27790
28197
  meta: {
27791
28198
  name: "follow",
27792
28199
  description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
@@ -27833,7 +28240,7 @@ var followCommand = defineCommand165({
27833
28240
  });
27834
28241
 
27835
28242
  // src/commands/winning-ads/following.ts
27836
- import { defineCommand as defineCommand166 } from "citty";
28243
+ import { defineCommand as defineCommand167 } from "citty";
27837
28244
  registerSchema({
27838
28245
  command: "winning-ads.following",
27839
28246
  description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
@@ -27866,7 +28273,7 @@ function followingNormalizer(record, full) {
27866
28273
  platforms: Array.isArray(record.platforms) ? record.platforms : []
27867
28274
  };
27868
28275
  }
27869
- var followingCommand = defineCommand166({
28276
+ var followingCommand = defineCommand167({
27870
28277
  meta: {
27871
28278
  name: "following",
27872
28279
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -27901,7 +28308,7 @@ var followingCommand = defineCommand166({
27901
28308
  });
27902
28309
 
27903
28310
  // src/commands/winning-ads/patterns.ts
27904
- import { defineCommand as defineCommand167 } from "citty";
28311
+ import { defineCommand as defineCommand168 } from "citty";
27905
28312
  registerSchema({
27906
28313
  command: "winning-ads.patterns",
27907
28314
  description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
@@ -27940,7 +28347,7 @@ function discriminatorRow(record) {
27940
28347
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
27941
28348
  };
27942
28349
  }
27943
- var patternsCommand = defineCommand167({
28350
+ var patternsCommand = defineCommand168({
27944
28351
  meta: {
27945
28352
  name: "patterns",
27946
28353
  description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
@@ -27996,7 +28403,7 @@ var patternsCommand = defineCommand167({
27996
28403
  });
27997
28404
 
27998
28405
  // src/commands/winning-ads/search.ts
27999
- import { defineCommand as defineCommand168 } from "citty";
28406
+ import { defineCommand as defineCommand169 } from "citty";
28000
28407
  registerSchema({
28001
28408
  command: "winning-ads.search",
28002
28409
  description: "Search the ad-dna corpus of scored winning ads. Returns a lean shortlist (advertiser, summary, scores, media_url) to pick a reference to reproduce.",
@@ -28104,7 +28511,7 @@ function buildSearchBody(args) {
28104
28511
  }
28105
28512
  return body;
28106
28513
  }
28107
- var searchCommand4 = defineCommand168({
28514
+ var searchCommand4 = defineCommand169({
28108
28515
  meta: {
28109
28516
  name: "search",
28110
28517
  description: "Search winning reference ads. Example: baker winning-ads search 'B2B SaaS before/after AI automation' --platform meta --format static --winner-category winner --exclude-advertiser adv_123 --output md"
@@ -28219,7 +28626,7 @@ var searchCommand4 = defineCommand168({
28219
28626
  });
28220
28627
 
28221
28628
  // src/commands/winning-ads/seeds.ts
28222
- import { defineCommand as defineCommand169 } from "citty";
28629
+ import { defineCommand as defineCommand170 } from "citty";
28223
28630
  function leanRow(r) {
28224
28631
  return {
28225
28632
  key: r.key,
@@ -28247,7 +28654,7 @@ function makeSeedCommand(opts) {
28247
28654
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
28248
28655
  }
28249
28656
  });
28250
- return defineCommand169({
28657
+ return defineCommand170({
28251
28658
  meta: { name: opts.name, description: opts.description },
28252
28659
  args: {
28253
28660
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -28296,7 +28703,7 @@ var formatsCommand = makeSeedCommand({
28296
28703
  });
28297
28704
 
28298
28705
  // src/commands/winning-ads/unfollow.ts
28299
- import { defineCommand as defineCommand170 } from "citty";
28706
+ import { defineCommand as defineCommand171 } from "citty";
28300
28707
  registerSchema({
28301
28708
  command: "winning-ads.unfollow",
28302
28709
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -28304,7 +28711,7 @@ registerSchema({
28304
28711
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
28305
28712
  }
28306
28713
  });
28307
- var unfollowCommand = defineCommand170({
28714
+ var unfollowCommand = defineCommand171({
28308
28715
  meta: {
28309
28716
  name: "unfollow",
28310
28717
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -28325,7 +28732,7 @@ var unfollowCommand = defineCommand170({
28325
28732
  });
28326
28733
 
28327
28734
  // src/commands/winning-ads/winners.ts
28328
- import { defineCommand as defineCommand171 } from "citty";
28735
+ import { defineCommand as defineCommand172 } from "citty";
28329
28736
  registerSchema({
28330
28737
  command: "winning-ads.winners",
28331
28738
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -28335,7 +28742,7 @@ registerSchema({
28335
28742
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
28336
28743
  }
28337
28744
  });
28338
- var winnersCommand = defineCommand171({
28745
+ var winnersCommand = defineCommand172({
28339
28746
  meta: {
28340
28747
  name: "winners",
28341
28748
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -28385,7 +28792,7 @@ var winnersCommand = defineCommand171({
28385
28792
  });
28386
28793
 
28387
28794
  // src/commands/winning-ads/index.ts
28388
- var winningAdsCommand = defineCommand172({
28795
+ var winningAdsCommand = defineCommand173({
28389
28796
  meta: {
28390
28797
  name: "winning-ads",
28391
28798
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -28450,7 +28857,7 @@ function getCliVersion() {
28450
28857
  }
28451
28858
 
28452
28859
  // src/cli.ts
28453
- var main = defineCommand173({
28860
+ var main = defineCommand174({
28454
28861
  meta: {
28455
28862
  name: "baker",
28456
28863
  version: getCliVersion(),
@@ -28476,6 +28883,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28476
28883
  testimonials: testimonialsCommand,
28477
28884
  canvas: canvasCommand,
28478
28885
  tags: tagsCommand3,
28886
+ chats: chatsCommand,
28479
28887
  history: historyCommand,
28480
28888
  "winning-ads": winningAdsCommand,
28481
28889
  mcp: mcpCommand,