@koda-sl/baker-cli 0.132.1 → 0.133.0-dev.42a8955b3

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
@@ -31,7 +31,7 @@ import {
31
31
  toModelSafeImage,
32
32
  ulid,
33
33
  validateCanvasDeep
34
- } from "./chunk-MWR25ZMU.js";
34
+ } from "./chunk-O3TH7JW5.js";
35
35
  import {
36
36
  csvOrJson,
37
37
  daysAgoIso,
@@ -70,7 +70,7 @@ import {
70
70
  } from "./chunk-RK67WL4O.js";
71
71
 
72
72
  // src/cli.ts
73
- import { defineCommand as defineCommand171, runMain } from "citty";
73
+ import { defineCommand as defineCommand172, runMain } from "citty";
74
74
 
75
75
  // src/commands/actions/index.ts
76
76
  import { defineCommand as defineCommand18 } from "citty";
@@ -1901,8 +1901,29 @@ var linkedinDraftErrorResponseSchema = z4.object({
1901
1901
  fields: z4.array(linkedinFieldErrorSchema).optional()
1902
1902
  });
1903
1903
 
1904
- // ../api/src/flows.ts
1904
+ // ../api/src/analytics/wire.ts
1905
1905
  import { z as z5 } from "zod";
1906
+ var ANALYTICS_REPORTS = ["overview", "timeseries", "pages", "sources", "events"];
1907
+ var analyticsReportSchema = z5.enum(ANALYTICS_REPORTS);
1908
+ var ANALYTICS_PERIODS = ["today", "7d", "28d", "90d"];
1909
+ var analyticsPeriodSchema = z5.enum(ANALYTICS_PERIODS);
1910
+ var analyticsQueryRequestSchema = z5.object({
1911
+ report: analyticsReportSchema,
1912
+ period: analyticsPeriodSchema.default("28d"),
1913
+ limit: z5.number().int().min(1).max(100).optional()
1914
+ });
1915
+ var analyticsRowSchema = z5.record(z5.string(), z5.union([z5.string(), z5.number(), z5.null()]));
1916
+ var analyticsQueryResponseSchema = z5.object({
1917
+ report: analyticsReportSchema,
1918
+ /** Inclusive UTC start of the window, `YYYY-MM-DD HH:mm:ss`. */
1919
+ from: z5.string(),
1920
+ /** Exclusive UTC end of the window, `YYYY-MM-DD HH:mm:ss`. */
1921
+ to: z5.string(),
1922
+ rows: z5.array(analyticsRowSchema)
1923
+ });
1924
+
1925
+ // ../api/src/flows.ts
1926
+ import { z as z6 } from "zod";
1906
1927
  var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1907
1928
  "email",
1908
1929
  "zapier",
@@ -1913,7 +1934,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1913
1934
  "crmble",
1914
1935
  "goHighlevelContact"
1915
1936
  ];
1916
- var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1937
+ var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1917
1938
  var FLOW_SECRET_FIELDS = {
1918
1939
  email: [],
1919
1940
  zapier: ["zapUrl"],
@@ -1941,94 +1962,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
1941
1962
  "highlevel",
1942
1963
  "highlevelForm"
1943
1964
  ];
1944
- var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
1945
- var flowInputRequestSchema = z5.discriminatedUnion("target", [
1946
- z5.object({
1965
+ var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
1966
+ var flowInputRequestSchema = z6.discriminatedUnion("target", [
1967
+ z6.object({
1947
1968
  /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
1948
- target: z5.literal("sideEffect"),
1949
- flowSlug: z5.string(),
1969
+ target: z6.literal("sideEffect"),
1970
+ flowSlug: z6.string(),
1950
1971
  /** `id` of the FlowNode holding the side effect. */
1951
- nodeId: z5.string(),
1972
+ nodeId: z6.string(),
1952
1973
  /** `id` of the side effect within that node's `sideEffects[]`. */
1953
- sideEffectId: z5.string(),
1974
+ sideEffectId: z6.string(),
1954
1975
  sideEffectType: flowSideEffectTypeSchema,
1955
1976
  /** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
1956
- prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
1977
+ prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
1957
1978
  /** Secret credential field names the agent asks the user to provide. */
1958
- requestedSecretFields: z5.array(z5.string()).optional(),
1959
- message: z5.string().optional()
1979
+ requestedSecretFields: z6.array(z6.string()).optional(),
1980
+ message: z6.string().optional()
1960
1981
  }),
1961
- z5.object({
1982
+ z6.object({
1962
1983
  /** Configure a widget node's third-party `form.external` (+ `providerId`). */
1963
- target: z5.literal("node"),
1964
- flowSlug: z5.string(),
1984
+ target: z6.literal("node"),
1985
+ flowSlug: z6.string(),
1965
1986
  /** `id` of the widget FlowNode. */
1966
- nodeId: z5.string(),
1987
+ nodeId: z6.string(),
1967
1988
  nodeType: flowResourceNodeTypeSchema,
1968
- message: z5.string().optional()
1989
+ message: z6.string().optional()
1969
1990
  })
1970
1991
  ]);
1971
- var flowInputToolInputSchema = z5.object({
1972
- requests: z5.array(flowInputRequestSchema).min(1).max(8)
1992
+ var flowInputToolInputSchema = z6.object({
1993
+ requests: z6.array(flowInputRequestSchema).min(1).max(8)
1973
1994
  });
1974
- var flowInputResultSchema = z5.discriminatedUnion("status", [
1975
- z5.object({
1976
- status: z5.literal("submitted"),
1995
+ var flowInputResultSchema = z6.discriminatedUnion("status", [
1996
+ z6.object({
1997
+ status: z6.literal("submitted"),
1977
1998
  /** Echoes which piece this result resolves. */
1978
- nodeId: z5.string(),
1979
- sideEffectId: z5.string().optional(),
1999
+ nodeId: z6.string(),
2000
+ sideEffectId: z6.string().optional(),
1980
2001
  /** Names of secret fields the user provided. Never values. */
1981
- secretFieldsSet: z5.array(z5.string()),
2002
+ secretFieldsSet: z6.array(z6.string()),
1982
2003
  /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
1983
- note: z5.string().optional()
2004
+ note: z6.string().optional()
1984
2005
  }),
1985
- z5.object({
1986
- status: z5.literal("declined"),
1987
- nodeId: z5.string(),
1988
- sideEffectId: z5.string().optional(),
1989
- reason: z5.string().optional()
2006
+ z6.object({
2007
+ status: z6.literal("declined"),
2008
+ nodeId: z6.string(),
2009
+ sideEffectId: z6.string().optional(),
2010
+ reason: z6.string().optional()
1990
2011
  })
1991
2012
  ]);
1992
- var flowInputToolResultSchema = z5.object({
1993
- results: z5.array(flowInputResultSchema)
2013
+ var flowInputToolResultSchema = z6.object({
2014
+ results: z6.array(flowInputResultSchema)
1994
2015
  });
1995
- var flowsListRequestSchema = z5.object({ chatId: z5.string() });
1996
- var flowSummarySchema = z5.object({
1997
- slug: z5.string(),
1998
- name: z5.string(),
2016
+ var flowsListRequestSchema = z6.object({ chatId: z6.string() });
2017
+ var flowSummarySchema = z6.object({
2018
+ slug: z6.string(),
2019
+ name: z6.string(),
1999
2020
  /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
2000
- needsConfig: z5.number()
2021
+ needsConfig: z6.number()
2001
2022
  });
2002
- var flowsListResponseSchema = z5.object({ flows: z5.array(flowSummarySchema) });
2003
- var flowsShowRequestSchema = z5.object({
2004
- chatId: z5.string(),
2005
- slug: z5.string(),
2006
- full: z5.boolean().optional()
2023
+ var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
2024
+ var flowsShowRequestSchema = z6.object({
2025
+ chatId: z6.string(),
2026
+ slug: z6.string(),
2027
+ full: z6.boolean().optional()
2007
2028
  });
2008
- var flowConfigStatusSchema = z5.object({
2009
- nodeId: z5.string(),
2010
- nodeName: z5.string().optional(),
2029
+ var flowConfigStatusSchema = z6.object({
2030
+ nodeId: z6.string(),
2031
+ nodeName: z6.string().optional(),
2011
2032
  /** "sideEffect" credential/connection, or "node" widget resource. */
2012
- target: z5.enum(["sideEffect", "node"]),
2013
- sideEffectId: z5.string().optional(),
2014
- kind: z5.string(),
2033
+ target: z6.enum(["sideEffect", "node"]),
2034
+ sideEffectId: z6.string().optional(),
2035
+ kind: z6.string(),
2015
2036
  /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
2016
- status: z5.string(),
2037
+ status: z6.string(),
2017
2038
  /** True when a `request_flow_input` call is still needed for this piece. */
2018
- needsInput: z5.boolean()
2039
+ needsInput: z6.boolean()
2019
2040
  });
2020
- var flowsShowResponseSchema = z5.object({
2021
- slug: z5.string(),
2022
- name: z5.string(),
2041
+ var flowsShowResponseSchema = z6.object({
2042
+ slug: z6.string(),
2043
+ name: z6.string(),
2023
2044
  /** Confidential fields and whether each is configured. */
2024
- config: z5.array(flowConfigStatusSchema),
2045
+ config: z6.array(flowConfigStatusSchema),
2025
2046
  /** Present only with `--full`: the whole flow tree, secret values redacted. */
2026
- tree: z5.unknown().optional()
2047
+ tree: z6.unknown().optional()
2027
2048
  });
2028
2049
 
2029
2050
  // ../api/src/images.ts
2030
- import { z as z6 } from "zod";
2031
- var imageSourceSchema = z6.enum([
2051
+ import { z as z7 } from "zod";
2052
+ var imageSourceSchema = z7.enum([
2032
2053
  "uploaded",
2033
2054
  "website",
2034
2055
  "google_testimonial",
@@ -2044,49 +2065,49 @@ var imageSourceSchema = z6.enum([
2044
2065
  "pinterest",
2045
2066
  "ai_generated"
2046
2067
  ]);
2047
- var imageStatusSchema = z6.enum(["uploading", "processing", "ready", "error"]);
2048
- var upscaleConfigSchema = z6.object({
2049
- model: z6.literal("philz1337x/crystal-upscaler"),
2050
- input: z6.object({
2051
- scale_factor: z6.number(),
2052
- creativity: z6.number(),
2053
- output_format: z6.string()
2068
+ var imageStatusSchema = z7.enum(["uploading", "processing", "ready", "error"]);
2069
+ var upscaleConfigSchema = z7.object({
2070
+ model: z7.literal("philz1337x/crystal-upscaler"),
2071
+ input: z7.object({
2072
+ scale_factor: z7.number(),
2073
+ creativity: z7.number(),
2074
+ output_format: z7.string()
2054
2075
  }),
2055
- status: z6.enum(["pending", "completed"])
2076
+ status: z7.enum(["pending", "completed"])
2056
2077
  });
2057
- var imageDocSchema = z6.object({
2058
- _id: z6.string(),
2059
- _creationTime: z6.number(),
2060
- companyId: z6.string(),
2061
- storageKey: z6.string(),
2078
+ var imageDocSchema = z7.object({
2079
+ _id: z7.string(),
2080
+ _creationTime: z7.number(),
2081
+ companyId: z7.string(),
2082
+ storageKey: z7.string(),
2062
2083
  upscaleConfig: upscaleConfigSchema.optional(),
2063
- upscaledStorageKey: z6.string().optional(),
2064
- name: z6.string(),
2065
- description: z6.string(),
2066
- tags: z6.array(z6.string()),
2067
- source: z6.string(),
2068
- externalId: z6.string().optional(),
2069
- externalUrl: z6.string().optional(),
2070
- contentHash: z6.string().optional(),
2071
- sourceId: z6.string().optional(),
2072
- descriptionContext: z6.string().optional(),
2073
- width: z6.number().optional(),
2074
- height: z6.number().optional(),
2075
- aspectRatio: z6.number().optional(),
2076
- dominantColor: z6.string().optional(),
2077
- imagePalette: z6.array(z6.string()).optional(),
2078
- thumbhashDataUri: z6.string().optional(),
2079
- isLightImage: z6.boolean().optional(),
2080
- descriptionEmbedding: z6.array(z6.number()).optional(),
2081
- imageEmbedding: z6.array(z6.number()).optional(),
2082
- searchText: z6.string().optional(),
2084
+ upscaledStorageKey: z7.string().optional(),
2085
+ name: z7.string(),
2086
+ description: z7.string(),
2087
+ tags: z7.array(z7.string()),
2088
+ source: z7.string(),
2089
+ externalId: z7.string().optional(),
2090
+ externalUrl: z7.string().optional(),
2091
+ contentHash: z7.string().optional(),
2092
+ sourceId: z7.string().optional(),
2093
+ descriptionContext: z7.string().optional(),
2094
+ width: z7.number().optional(),
2095
+ height: z7.number().optional(),
2096
+ aspectRatio: z7.number().optional(),
2097
+ dominantColor: z7.string().optional(),
2098
+ imagePalette: z7.array(z7.string()).optional(),
2099
+ thumbhashDataUri: z7.string().optional(),
2100
+ isLightImage: z7.boolean().optional(),
2101
+ descriptionEmbedding: z7.array(z7.number()).optional(),
2102
+ imageEmbedding: z7.array(z7.number()).optional(),
2103
+ searchText: z7.string().optional(),
2083
2104
  status: imageStatusSchema,
2084
- errorMessage: z6.string().optional(),
2085
- createdAt: z6.number(),
2086
- updatedAt: z6.number(),
2087
- imageUrl: z6.string()
2105
+ errorMessage: z7.string().optional(),
2106
+ createdAt: z7.number(),
2107
+ updatedAt: z7.number(),
2108
+ imageUrl: z7.string()
2088
2109
  });
2089
- var imageHitSourceSchema = z6.enum([
2110
+ var imageHitSourceSchema = z7.enum([
2090
2111
  "library",
2091
2112
  "magnific",
2092
2113
  "google_images",
@@ -2097,242 +2118,242 @@ var imageHitSourceSchema = z6.enum([
2097
2118
  "giphy",
2098
2119
  "pinterest"
2099
2120
  ]);
2100
- var imageHitSchema = z6.object({
2121
+ var imageHitSchema = z7.object({
2101
2122
  source: imageHitSourceSchema,
2102
- url: z6.string(),
2103
- thumbnailUrl: z6.string().optional(),
2104
- width: z6.number().optional(),
2105
- height: z6.number().optional(),
2106
- aspectRatio: z6.number().optional(),
2107
- dominantColor: z6.string().optional(),
2108
- externalId: z6.string().optional(),
2109
- externalUrl: z6.string().optional(),
2110
- providerMeta: z6.record(z6.string(), z6.unknown()).optional(),
2111
- descriptionContext: z6.string().optional(),
2112
- _id: z6.string().optional(),
2113
- name: z6.string().optional(),
2114
- description: z6.string().optional(),
2115
- tags: z6.array(z6.string()).optional(),
2116
- score: z6.number().optional(),
2117
- alsoInLibrary: z6.string().optional(),
2118
- prefetchedBytes: z6.string().optional(),
2119
- prefetchedContentType: z6.string().optional()
2123
+ url: z7.string(),
2124
+ thumbnailUrl: z7.string().optional(),
2125
+ width: z7.number().optional(),
2126
+ height: z7.number().optional(),
2127
+ aspectRatio: z7.number().optional(),
2128
+ dominantColor: z7.string().optional(),
2129
+ externalId: z7.string().optional(),
2130
+ externalUrl: z7.string().optional(),
2131
+ providerMeta: z7.record(z7.string(), z7.unknown()).optional(),
2132
+ descriptionContext: z7.string().optional(),
2133
+ _id: z7.string().optional(),
2134
+ name: z7.string().optional(),
2135
+ description: z7.string().optional(),
2136
+ tags: z7.array(z7.string()).optional(),
2137
+ score: z7.number().optional(),
2138
+ alsoInLibrary: z7.string().optional(),
2139
+ prefetchedBytes: z7.string().optional(),
2140
+ prefetchedContentType: z7.string().optional()
2120
2141
  });
2121
2142
  var ingestedImageHitSchema = imageHitSchema.extend({
2122
- imageId: z6.string().optional(),
2123
- imageUrl: z6.string().optional(),
2124
- deduped: z6.boolean().optional(),
2125
- sourceUrl: z6.string().optional()
2126
- });
2127
- var autoIngestItemSchema = z6.object({
2128
- imageId: z6.string(),
2129
- deduped: z6.boolean(),
2130
- imageUrl: z6.string(),
2131
- sourceUrl: z6.string(),
2132
- externalUrl: z6.string().optional()
2143
+ imageId: z7.string().optional(),
2144
+ imageUrl: z7.string().optional(),
2145
+ deduped: z7.boolean().optional(),
2146
+ sourceUrl: z7.string().optional()
2147
+ });
2148
+ var autoIngestItemSchema = z7.object({
2149
+ imageId: z7.string(),
2150
+ deduped: z7.boolean(),
2151
+ imageUrl: z7.string(),
2152
+ sourceUrl: z7.string(),
2153
+ externalUrl: z7.string().optional()
2133
2154
  });
2134
2155
  function providerHitsResponseSchema() {
2135
- return z6.object({
2136
- hits: z6.array(ingestedImageHitSchema),
2137
- ingested: z6.array(autoIngestItemSchema)
2156
+ return z7.object({
2157
+ hits: z7.array(ingestedImageHitSchema),
2158
+ ingested: z7.array(autoIngestItemSchema)
2138
2159
  });
2139
2160
  }
2140
- var imagesGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
2141
- var imagesSearchRequestSchema = z6.object({
2142
- query: z6.string().min(1),
2143
- limit: z6.coerce.number().int().positive().max(100).optional(),
2144
- aspectRatio: z6.string().optional(),
2145
- tags: z6.array(z6.string()).optional(),
2146
- source: z6.string().optional(),
2147
- externalUrlHost: z6.string().optional()
2148
- });
2149
- var imageSearchResultSchema = z6.object({
2150
- _id: z6.string(),
2151
- imageUrl: z6.string(),
2152
- name: z6.string(),
2153
- description: z6.string(),
2154
- tags: z6.array(z6.string()),
2155
- width: z6.number().optional(),
2156
- height: z6.number().optional(),
2157
- aspectRatio: z6.number().optional(),
2158
- dominantColor: z6.string().optional(),
2159
- imagePalette: z6.array(z6.string()).optional(),
2160
- source: z6.string(),
2161
- externalUrl: z6.string().optional(),
2162
- score: z6.number()
2163
- });
2164
- var imagesSearchResponseSchema = z6.array(imageSearchResultSchema);
2165
- var imagesUploadRequestSchema = z6.object({
2166
- base64: z6.string().min(1),
2167
- contentType: z6.string().min(1),
2168
- source: z6.string().optional(),
2169
- descriptionContext: z6.string().optional()
2170
- });
2171
- var imagesUploadResponseSchema = z6.object({ imageId: z6.string() });
2172
- var imagesDeleteRequestSchema = z6.object({ id: z6.string().min(1, "Missing image ID") });
2173
- var imagesDeleteResponseSchema = z6.object({ ok: z6.literal(true) });
2174
- var imagesUpscaleRequestSchema = z6.object({ imageId: z6.string().min(1, "Missing image ID") });
2175
- var imagesUpscaleResponseSchema = z6.object({
2176
- imageId: z6.string(),
2177
- status: z6.literal("processing")
2161
+ var imagesGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2162
+ var imagesSearchRequestSchema = z7.object({
2163
+ query: z7.string().min(1),
2164
+ limit: z7.coerce.number().int().positive().max(100).optional(),
2165
+ aspectRatio: z7.string().optional(),
2166
+ tags: z7.array(z7.string()).optional(),
2167
+ source: z7.string().optional(),
2168
+ externalUrlHost: z7.string().optional()
2169
+ });
2170
+ var imageSearchResultSchema = z7.object({
2171
+ _id: z7.string(),
2172
+ imageUrl: z7.string(),
2173
+ name: z7.string(),
2174
+ description: z7.string(),
2175
+ tags: z7.array(z7.string()),
2176
+ width: z7.number().optional(),
2177
+ height: z7.number().optional(),
2178
+ aspectRatio: z7.number().optional(),
2179
+ dominantColor: z7.string().optional(),
2180
+ imagePalette: z7.array(z7.string()).optional(),
2181
+ source: z7.string(),
2182
+ externalUrl: z7.string().optional(),
2183
+ score: z7.number()
2184
+ });
2185
+ var imagesSearchResponseSchema = z7.array(imageSearchResultSchema);
2186
+ var imagesUploadRequestSchema = z7.object({
2187
+ base64: z7.string().min(1),
2188
+ contentType: z7.string().min(1),
2189
+ source: z7.string().optional(),
2190
+ descriptionContext: z7.string().optional()
2191
+ });
2192
+ var imagesUploadResponseSchema = z7.object({ imageId: z7.string() });
2193
+ var imagesDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing image ID") });
2194
+ var imagesDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
2195
+ var imagesUpscaleRequestSchema = z7.object({ imageId: z7.string().min(1, "Missing image ID") });
2196
+ var imagesUpscaleResponseSchema = z7.object({
2197
+ imageId: z7.string(),
2198
+ status: z7.literal("processing")
2178
2199
  });
2179
2200
  var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
2180
- var imagesFindRequestSchema = z6.object({
2181
- query: z6.string().min(1),
2182
- sources: z6.array(z6.enum(IMAGES_FIND_SOURCES)).optional(),
2183
- limit: z6.coerce.number().int().positive().max(50).optional(),
2184
- fallback: z6.boolean().optional(),
2185
- threshold: z6.number().min(0).max(1).optional(),
2186
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2187
- descriptionContext: z6.string().optional()
2188
- });
2189
- var imagesFindResponseSchema = z6.object({
2190
- groups: z6.object({
2191
- library: z6.array(imageHitSchema),
2192
- external: z6.array(ingestedImageHitSchema)
2201
+ var imagesFindRequestSchema = z7.object({
2202
+ query: z7.string().min(1),
2203
+ sources: z7.array(z7.enum(IMAGES_FIND_SOURCES)).optional(),
2204
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2205
+ fallback: z7.boolean().optional(),
2206
+ threshold: z7.number().min(0).max(1).optional(),
2207
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2208
+ descriptionContext: z7.string().optional()
2209
+ });
2210
+ var imagesFindResponseSchema = z7.object({
2211
+ groups: z7.object({
2212
+ library: z7.array(imageHitSchema),
2213
+ external: z7.array(ingestedImageHitSchema)
2193
2214
  }),
2194
- meta: z6.object({
2195
- counts: z6.record(z6.string(), z6.number()),
2196
- errors: z6.array(z6.object({ source: imageHitSourceSchema, message: z6.string() }))
2215
+ meta: z7.object({
2216
+ counts: z7.record(z7.string(), z7.number()),
2217
+ errors: z7.array(z7.object({ source: imageHitSourceSchema, message: z7.string() }))
2197
2218
  }),
2198
- ingested: z6.array(autoIngestItemSchema)
2199
- });
2200
- var imagesStockRequestSchema = z6.object({
2201
- query: z6.string().min(1),
2202
- orientation: z6.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2203
- contentType: z6.enum(["photo", "vector", "psd"]).optional(),
2204
- license: z6.enum(["freemium", "premium"]).optional(),
2205
- color: z6.string().optional(),
2206
- aiGenerated: z6.enum(["exclude", "only"]).optional(),
2207
- people: z6.enum(["include", "exclude", "only"]).optional(),
2208
- order: z6.enum(["relevance", "recent"]).optional(),
2209
- limit: z6.coerce.number().int().positive().max(50).optional(),
2210
- page: z6.coerce.number().int().positive().optional(),
2211
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2212
- descriptionContext: z6.string().optional()
2219
+ ingested: z7.array(autoIngestItemSchema)
2220
+ });
2221
+ var imagesStockRequestSchema = z7.object({
2222
+ query: z7.string().min(1),
2223
+ orientation: z7.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2224
+ contentType: z7.enum(["photo", "vector", "psd"]).optional(),
2225
+ license: z7.enum(["freemium", "premium"]).optional(),
2226
+ color: z7.string().optional(),
2227
+ aiGenerated: z7.enum(["exclude", "only"]).optional(),
2228
+ people: z7.enum(["include", "exclude", "only"]).optional(),
2229
+ order: z7.enum(["relevance", "recent"]).optional(),
2230
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2231
+ page: z7.coerce.number().int().positive().optional(),
2232
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2233
+ descriptionContext: z7.string().optional()
2213
2234
  });
2214
2235
  var imagesStockResponseSchema = providerHitsResponseSchema();
2215
- var imagesGoogleRequestSchema = z6.object({
2216
- query: z6.string().min(1),
2217
- type: z6.string().optional(),
2218
- size: z6.string().optional(),
2219
- color: z6.string().optional(),
2220
- safe: z6.enum(["off", "active"]).optional(),
2221
- limit: z6.coerce.number().int().positive().max(50).optional(),
2222
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2223
- descriptionContext: z6.string().optional()
2236
+ var imagesGoogleRequestSchema = z7.object({
2237
+ query: z7.string().min(1),
2238
+ type: z7.string().optional(),
2239
+ size: z7.string().optional(),
2240
+ color: z7.string().optional(),
2241
+ safe: z7.enum(["off", "active"]).optional(),
2242
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2243
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2244
+ descriptionContext: z7.string().optional()
2224
2245
  });
2225
2246
  var imagesGoogleResponseSchema = providerHitsResponseSchema();
2226
- var imagesPinterestRequestSchema = z6.object({
2227
- query: z6.string().min(1),
2228
- limit: z6.coerce.number().int().positive().max(20).optional(),
2229
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2230
- descriptionContext: z6.string().optional()
2247
+ var imagesPinterestRequestSchema = z7.object({
2248
+ query: z7.string().min(1),
2249
+ limit: z7.coerce.number().int().positive().max(20).optional(),
2250
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2251
+ descriptionContext: z7.string().optional()
2231
2252
  });
2232
2253
  var imagesPinterestResponseSchema = providerHitsResponseSchema();
2233
- var rgbTriple = z6.tuple([
2234
- z6.number().int().min(0).max(255),
2235
- z6.number().int().min(0).max(255),
2236
- z6.number().int().min(0).max(255)
2254
+ var rgbTriple = z7.tuple([
2255
+ z7.number().int().min(0).max(255),
2256
+ z7.number().int().min(0).max(255),
2257
+ z7.number().int().min(0).max(255)
2237
2258
  ]);
2238
- var imageGenerateModelSchema = z6.enum([
2259
+ var imageGenerateModelSchema = z7.enum([
2239
2260
  "openai/gpt-5.4-image-2",
2240
2261
  "google/gemini-3.5-flash",
2241
2262
  "google/gemini-3.1-flash-image-preview",
2242
2263
  "google/gemini-3-pro-image-preview",
2243
2264
  "recraft/recraft-v4.1-pro-vector"
2244
2265
  ]);
2245
- var imagesGenerateRequestSchema = z6.object({
2246
- prompt: z6.string().min(1),
2266
+ var imagesGenerateRequestSchema = z7.object({
2267
+ prompt: z7.string().min(1),
2247
2268
  model: imageGenerateModelSchema.optional(),
2248
2269
  // Aspect ratio + size are validated loosely as strings; the per-model enum
2249
2270
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
2250
- aspectRatio: z6.string().optional(),
2251
- imageSize: z6.string().optional(),
2271
+ aspectRatio: z7.string().optional(),
2272
+ imageSize: z7.string().optional(),
2252
2273
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
2253
- quality: z6.enum(["auto", "low", "medium", "high"]).optional(),
2274
+ quality: z7.enum(["auto", "low", "medium", "high"]).optional(),
2254
2275
  // Recraft v4.1 Pro Vector levers (ignored by other models).
2255
- strength: z6.coerce.number().min(0).max(1).optional(),
2256
- rgbColors: z6.array(rgbTriple).optional(),
2276
+ strength: z7.coerce.number().min(0).max(1).optional(),
2277
+ rgbColors: z7.array(rgbTriple).optional(),
2257
2278
  backgroundRgbColor: rgbTriple.optional(),
2258
2279
  // Public image URLs used as visual references (multi-reference, in order).
2259
- referenceUrls: z6.array(z6.string().url()).optional(),
2260
- descriptionContext: z6.string().optional()
2261
- });
2262
- var generatedImageSchema = z6.object({
2263
- imageId: z6.string(),
2264
- deduped: z6.boolean(),
2265
- imageUrl: z6.string(),
2266
- width: z6.number().optional(),
2267
- height: z6.number().optional()
2268
- });
2269
- var imagesGenerateResponseSchema = z6.object({
2270
- model: z6.string(),
2271
- costUsd: z6.number(),
2272
- images: z6.array(generatedImageSchema)
2273
- });
2274
- var imagesLogoRequestSchema = z6.object({
2275
- domain: z6.string().min(1),
2276
- variant: z6.enum(["icon", "logo", "symbol"]).optional(),
2277
- autoIngest: z6.coerce.number().int().min(0).max(5).optional(),
2278
- descriptionContext: z6.string().optional()
2280
+ referenceUrls: z7.array(z7.string().url()).optional(),
2281
+ descriptionContext: z7.string().optional()
2282
+ });
2283
+ var generatedImageSchema = z7.object({
2284
+ imageId: z7.string(),
2285
+ deduped: z7.boolean(),
2286
+ imageUrl: z7.string(),
2287
+ width: z7.number().optional(),
2288
+ height: z7.number().optional()
2289
+ });
2290
+ var imagesGenerateResponseSchema = z7.object({
2291
+ model: z7.string(),
2292
+ costUsd: z7.number(),
2293
+ images: z7.array(generatedImageSchema)
2294
+ });
2295
+ var imagesLogoRequestSchema = z7.object({
2296
+ domain: z7.string().min(1),
2297
+ variant: z7.enum(["icon", "logo", "symbol"]).optional(),
2298
+ autoIngest: z7.coerce.number().int().min(0).max(5).optional(),
2299
+ descriptionContext: z7.string().optional()
2279
2300
  });
2280
2301
  var imagesLogoResponseSchema = providerHitsResponseSchema();
2281
- var imagesIconRequestSchema = z6.object({
2282
- name: z6.string().min(1),
2283
- set: z6.string().optional(),
2284
- color: z6.string().optional(),
2285
- width: z6.coerce.number().int().positive().optional(),
2286
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2287
- descriptionContext: z6.string().optional()
2302
+ var imagesIconRequestSchema = z7.object({
2303
+ name: z7.string().min(1),
2304
+ set: z7.string().optional(),
2305
+ color: z7.string().optional(),
2306
+ width: z7.coerce.number().int().positive().optional(),
2307
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2308
+ descriptionContext: z7.string().optional()
2288
2309
  });
2289
2310
  var imagesIconResponseSchema = providerHitsResponseSchema();
2290
- var imagesExtractRequestSchema = z6.object({
2291
- url: z6.string().url(),
2292
- waitFor: z6.coerce.number().int().min(0).max(3e4).optional(),
2293
- limit: z6.coerce.number().int().positive().max(50).optional(),
2294
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2295
- descriptionContext: z6.string().optional()
2311
+ var imagesExtractRequestSchema = z7.object({
2312
+ url: z7.string().url(),
2313
+ waitFor: z7.coerce.number().int().min(0).max(3e4).optional(),
2314
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2315
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2316
+ descriptionContext: z7.string().optional()
2296
2317
  });
2297
2318
  var imagesExtractResponseSchema = providerHitsResponseSchema();
2298
- var imagesScreenshotRequestSchema = z6.object({
2299
- url: z6.string().url(),
2300
- fullPage: z6.boolean().optional(),
2301
- viewportWidth: z6.coerce.number().int().positive().max(3840).optional(),
2302
- viewportHeight: z6.coerce.number().int().positive().max(2160).optional(),
2303
- format: z6.enum(["webp", "png", "jpg"]).optional(),
2304
- descriptionContext: z6.string().optional()
2319
+ var imagesScreenshotRequestSchema = z7.object({
2320
+ url: z7.string().url(),
2321
+ fullPage: z7.boolean().optional(),
2322
+ viewportWidth: z7.coerce.number().int().positive().max(3840).optional(),
2323
+ viewportHeight: z7.coerce.number().int().positive().max(2160).optional(),
2324
+ format: z7.enum(["webp", "png", "jpg"]).optional(),
2325
+ descriptionContext: z7.string().optional()
2305
2326
  });
2306
2327
  var imagesScreenshotResponseSchema = providerHitsResponseSchema();
2307
- var imagesGiphyRequestSchema = z6.object({
2308
- query: z6.string().min(1).optional(),
2309
- trending: z6.coerce.boolean().optional(),
2310
- limit: z6.coerce.number().int().positive().max(50).optional(),
2311
- rating: z6.enum(["g", "pg", "pg-13", "r"]).optional(),
2312
- lang: z6.string().optional(),
2313
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2314
- descriptionContext: z6.string().optional()
2328
+ var imagesGiphyRequestSchema = z7.object({
2329
+ query: z7.string().min(1).optional(),
2330
+ trending: z7.coerce.boolean().optional(),
2331
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2332
+ rating: z7.enum(["g", "pg", "pg-13", "r"]).optional(),
2333
+ lang: z7.string().optional(),
2334
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2335
+ descriptionContext: z7.string().optional()
2315
2336
  });
2316
2337
  var imagesGifResponseSchema = providerHitsResponseSchema();
2317
2338
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2318
- var imagesIngestRequestSchema = z6.object({
2319
- url: z6.string().url(),
2339
+ var imagesIngestRequestSchema = z7.object({
2340
+ url: z7.string().url(),
2320
2341
  // Validate source at the HTTP boundary so unknown values produce the standard
2321
2342
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2322
2343
  // `assertImageSource` inside the action.
2323
2344
  source: imageSourceSchema,
2324
- externalId: z6.string().optional(),
2325
- externalUrl: z6.string().optional(),
2326
- descriptionContext: z6.string().optional()
2345
+ externalId: z7.string().optional(),
2346
+ externalUrl: z7.string().optional(),
2347
+ descriptionContext: z7.string().optional()
2327
2348
  });
2328
- var imagesIngestResponseSchema = z6.object({
2329
- imageId: z6.string(),
2330
- deduped: z6.boolean(),
2331
- contentHash: z6.string()
2349
+ var imagesIngestResponseSchema = z7.object({
2350
+ imageId: z7.string(),
2351
+ deduped: z7.boolean(),
2352
+ contentHash: z7.string()
2332
2353
  });
2333
2354
 
2334
2355
  // ../api/src/tags.ts
2335
- import { z as z7 } from "zod";
2356
+ import { z as z8 } from "zod";
2336
2357
  var TAG_TYPES = [
2337
2358
  "meta",
2338
2359
  "amplitude",
@@ -2353,7 +2374,7 @@ var TAG_TYPES = [
2353
2374
  "recaptcha",
2354
2375
  "twitterAds"
2355
2376
  ];
2356
- var tagTypeSchema = z7.enum(TAG_TYPES);
2377
+ var tagTypeSchema = z8.enum(TAG_TYPES);
2357
2378
  var TAG_IDENTIFYING_FIELD = {
2358
2379
  meta: "pixelId",
2359
2380
  googleAds: "conversionID",
@@ -2374,218 +2395,218 @@ var TAG_IDENTIFYING_FIELD = {
2374
2395
  recaptcha: "siteKey",
2375
2396
  twitterAds: "pixelId"
2376
2397
  };
2377
- var tagDraftOpKindSchema = z7.enum(["create", "update", "delete"]);
2378
- var tagDraftOpViewSchema = z7.object({
2398
+ var tagDraftOpKindSchema = z8.enum(["create", "update", "delete"]);
2399
+ var tagDraftOpViewSchema = z8.object({
2379
2400
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2380
- ref: z7.string(),
2401
+ ref: z8.string(),
2381
2402
  kind: tagDraftOpKindSchema,
2382
2403
  type: tagTypeSchema,
2383
2404
  /** Present on update/delete ops — the real tag this op targets. */
2384
- tagId: z7.string().optional(),
2405
+ tagId: z8.string().optional(),
2385
2406
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2386
- config: z7.record(z7.string(), z7.string()),
2407
+ config: z8.record(z8.string(), z8.string()),
2387
2408
  /** Update only — fields the op explicitly clears. */
2388
- clearFields: z7.array(z7.string()).optional(),
2409
+ clearFields: z8.array(z8.string()).optional(),
2389
2410
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2390
- secretsSet: z7.array(z7.string()),
2411
+ secretsSet: z8.array(z8.string()),
2391
2412
  /** Names of secret fields still awaiting user input. */
2392
- secretsPending: z7.array(z7.string()),
2393
- summary: z7.string(),
2394
- stagedAt: z7.number()
2413
+ secretsPending: z8.array(z8.string()),
2414
+ summary: z8.string(),
2415
+ stagedAt: z8.number()
2395
2416
  });
2396
- var tagsEffectiveEntrySchema = z7.object({
2417
+ var tagsEffectiveEntrySchema = z8.object({
2397
2418
  /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
2398
- ref: z7.string(),
2399
- tagId: z7.string().optional(),
2419
+ ref: z8.string(),
2420
+ tagId: z8.string().optional(),
2400
2421
  type: tagTypeSchema,
2401
2422
  /** Value of the type's identifying field, when set. */
2402
- identifier: z7.string().optional(),
2423
+ identifier: z8.string().optional(),
2403
2424
  /** Redacted config; for staged updates, production config with the patch merged. */
2404
- config: z7.record(z7.string(), z7.string()),
2425
+ config: z8.record(z8.string(), z8.string()),
2405
2426
  /** Absent = live production tag with no staged changes in this chat. */
2406
2427
  staged: tagDraftOpKindSchema.optional(),
2407
- secretsSet: z7.array(z7.string()),
2408
- secretsPending: z7.array(z7.string())
2428
+ secretsSet: z8.array(z8.string()),
2429
+ secretsPending: z8.array(z8.string())
2409
2430
  });
2410
- var tagsListRequestSchema = z7.object({ chatId: z7.string() });
2411
- var tagsListResponseSchema = z7.object({ tags: z7.array(tagsEffectiveEntrySchema) });
2412
- var tagsDraftListRequestSchema = z7.object({ chatId: z7.string() });
2413
- var tagsDraftListResponseSchema = z7.object({
2414
- status: z7.enum(["active", "publishing", "applied", "discarded", "none"]),
2415
- ops: z7.array(tagDraftOpViewSchema)
2431
+ var tagsListRequestSchema = z8.object({ chatId: z8.string() });
2432
+ var tagsListResponseSchema = z8.object({ tags: z8.array(tagsEffectiveEntrySchema) });
2433
+ var tagsDraftListRequestSchema = z8.object({ chatId: z8.string() });
2434
+ var tagsDraftListResponseSchema = z8.object({
2435
+ status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
2436
+ ops: z8.array(tagDraftOpViewSchema)
2416
2437
  });
2417
- var tagInputRequestSchema = z7.object({
2438
+ var tagInputRequestSchema = z8.object({
2418
2439
  // Every tag change is a tab in the approval form: create/edit show the full
2419
2440
  // body; delete shows a confirm. No tag change bypasses this approval.
2420
- mode: z7.enum(["create", "edit", "delete"]),
2441
+ mode: z8.enum(["create", "edit", "delete"]),
2421
2442
  tagType: tagTypeSchema,
2422
2443
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2423
- ref: z7.string().optional(),
2444
+ ref: z8.string().optional(),
2424
2445
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2425
- prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
2446
+ prefilledConfig: z8.record(z8.string(), z8.string()).optional(),
2426
2447
  /** Secret field names the agent asks the user to provide. */
2427
- requestedSecretFields: z7.array(z7.string()).optional(),
2448
+ requestedSecretFields: z8.array(z8.string()).optional(),
2428
2449
  /** Short message shown above the form explaining why the input is needed. */
2429
- message: z7.string().optional()
2450
+ message: z8.string().optional()
2430
2451
  });
2431
- var tagChangeToolInputSchema = z7.object({
2432
- changes: z7.array(tagInputRequestSchema).min(1).max(8)
2452
+ var tagChangeToolInputSchema = z8.object({
2453
+ changes: z8.array(tagInputRequestSchema).min(1).max(8)
2433
2454
  });
2434
- var tagInputResultSchema = z7.discriminatedUnion("status", [
2435
- z7.object({
2436
- status: z7.literal("submitted"),
2437
- ref: z7.string(),
2455
+ var tagInputResultSchema = z8.discriminatedUnion("status", [
2456
+ z8.object({
2457
+ status: z8.literal("submitted"),
2458
+ ref: z8.string(),
2438
2459
  type: tagTypeSchema,
2439
2460
  /** Identifying field name → value (non-secret), when the type has one. */
2440
- identifier: z7.record(z7.string(), z7.string()).optional(),
2441
- secretFieldsSet: z7.array(z7.string()),
2442
- note: z7.string().optional()
2461
+ identifier: z8.record(z8.string(), z8.string()).optional(),
2462
+ secretFieldsSet: z8.array(z8.string()),
2463
+ note: z8.string().optional()
2443
2464
  }),
2444
- z7.object({
2445
- status: z7.literal("declined"),
2446
- reason: z7.string().optional()
2465
+ z8.object({
2466
+ status: z8.literal("declined"),
2467
+ reason: z8.string().optional()
2447
2468
  })
2448
2469
  ]);
2449
- var tagChangeToolResultSchema = z7.object({
2450
- results: z7.array(tagInputResultSchema)
2470
+ var tagChangeToolResultSchema = z8.object({
2471
+ results: z8.array(tagInputResultSchema)
2451
2472
  });
2452
2473
 
2453
2474
  // ../api/src/testimonials.ts
2454
- import { z as z8 } from "zod";
2455
- var testimonialSourceTypeSchema = z8.enum(["google", "trustpilot"]);
2456
- var testimonialStatusSchema = z8.enum(["pending", "processing", "ready", "error"]);
2457
- var testimonialSentimentSchema = z8.enum(["positive", "neutral", "negative"]);
2458
- var testimonialDocSchema = z8.object({
2459
- _id: z8.string(),
2460
- _creationTime: z8.number(),
2461
- companyId: z8.string(),
2462
- sourceId: z8.string(),
2475
+ import { z as z9 } from "zod";
2476
+ var testimonialSourceTypeSchema = z9.enum(["google", "trustpilot"]);
2477
+ var testimonialStatusSchema = z9.enum(["pending", "processing", "ready", "error"]);
2478
+ var testimonialSentimentSchema = z9.enum(["positive", "neutral", "negative"]);
2479
+ var testimonialDocSchema = z9.object({
2480
+ _id: z9.string(),
2481
+ _creationTime: z9.number(),
2482
+ companyId: z9.string(),
2483
+ sourceId: z9.string(),
2463
2484
  sourceType: testimonialSourceTypeSchema,
2464
- reviewText: z8.string(),
2465
- reviewTitle: z8.string().optional(),
2466
- searchText: z8.string().optional(),
2467
- reviewerName: z8.string().optional(),
2468
- reviewerImageUrl: z8.string().optional(),
2469
- reviewerImageId: z8.string().optional(),
2470
- reviewerLocation: z8.string().optional(),
2471
- rating: z8.number().optional(),
2472
- reviewDate: z8.number().optional(),
2473
- ownerAnswer: z8.string().optional(),
2474
- mediaUrls: z8.array(z8.string()).optional(),
2475
- imageIds: z8.array(z8.string()).optional(),
2476
- videoIds: z8.array(z8.string()).optional(),
2477
- sourceUrl: z8.string().optional(),
2478
- rawData: z8.unknown().optional(),
2479
- tags: z8.array(z8.string()),
2480
- highlight: z8.string().optional(),
2481
- language: z8.string().optional(),
2482
- summary: z8.string().optional(),
2485
+ reviewText: z9.string(),
2486
+ reviewTitle: z9.string().optional(),
2487
+ searchText: z9.string().optional(),
2488
+ reviewerName: z9.string().optional(),
2489
+ reviewerImageUrl: z9.string().optional(),
2490
+ reviewerImageId: z9.string().optional(),
2491
+ reviewerLocation: z9.string().optional(),
2492
+ rating: z9.number().optional(),
2493
+ reviewDate: z9.number().optional(),
2494
+ ownerAnswer: z9.string().optional(),
2495
+ mediaUrls: z9.array(z9.string()).optional(),
2496
+ imageIds: z9.array(z9.string()).optional(),
2497
+ videoIds: z9.array(z9.string()).optional(),
2498
+ sourceUrl: z9.string().optional(),
2499
+ rawData: z9.unknown().optional(),
2500
+ tags: z9.array(z9.string()),
2501
+ highlight: z9.string().optional(),
2502
+ language: z9.string().optional(),
2503
+ summary: z9.string().optional(),
2483
2504
  sentiment: testimonialSentimentSchema.optional(),
2484
- textEmbedding: z8.array(z8.number()).optional(),
2485
- externalId: z8.string().optional(),
2486
- contentHash: z8.string().optional(),
2505
+ textEmbedding: z9.array(z9.number()).optional(),
2506
+ externalId: z9.string().optional(),
2507
+ contentHash: z9.string().optional(),
2487
2508
  status: testimonialStatusSchema,
2488
- errorMessage: z8.string().optional(),
2489
- createdAt: z8.number(),
2490
- updatedAt: z8.number()
2509
+ errorMessage: z9.string().optional(),
2510
+ createdAt: z9.number(),
2511
+ updatedAt: z9.number()
2491
2512
  });
2492
- var testimonialsListRequestSchema = z8.object({
2513
+ var testimonialsListRequestSchema = z9.object({
2493
2514
  source: testimonialSourceTypeSchema.optional(),
2494
- rating_min: z8.coerce.number().int().min(1).max(5).optional(),
2495
- rating_max: z8.coerce.number().int().min(1).max(5).optional(),
2496
- tags: z8.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2515
+ rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2516
+ rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2517
+ tags: z9.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2497
2518
  status: testimonialStatusSchema.optional(),
2498
2519
  sentiment: testimonialSentimentSchema.optional(),
2499
- language: z8.string().min(2).max(5).optional(),
2500
- limit: z8.coerce.number().int().positive().max(200).optional()
2501
- });
2502
- var testimonialsListResponseSchema = z8.array(testimonialDocSchema);
2503
- var testimonialsGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2504
- var testimonialsSearchRequestSchema = z8.object({
2505
- query: z8.string().min(1),
2506
- limit: z8.coerce.number().int().positive().max(100).optional(),
2520
+ language: z9.string().min(2).max(5).optional(),
2521
+ limit: z9.coerce.number().int().positive().max(200).optional()
2522
+ });
2523
+ var testimonialsListResponseSchema = z9.array(testimonialDocSchema);
2524
+ var testimonialsGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2525
+ var testimonialsSearchRequestSchema = z9.object({
2526
+ query: z9.string().min(1),
2527
+ limit: z9.coerce.number().int().positive().max(100).optional(),
2507
2528
  source: testimonialSourceTypeSchema.optional(),
2508
- rating_min: z8.coerce.number().int().min(1).max(5).optional(),
2509
- rating_max: z8.coerce.number().int().min(1).max(5).optional(),
2510
- tags: z8.array(z8.string()).optional(),
2529
+ rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2530
+ rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2531
+ tags: z9.array(z9.string()).optional(),
2511
2532
  status: testimonialStatusSchema.optional(),
2512
2533
  sentiment: testimonialSentimentSchema.optional(),
2513
- language: z8.string().min(2).max(5).optional()
2534
+ language: z9.string().min(2).max(5).optional()
2514
2535
  }).refine(
2515
2536
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2516
2537
  { message: "rating_min must be less than or equal to rating_max" }
2517
2538
  );
2518
- var testimonialsSearchResponseSchema = z8.array(testimonialDocSchema);
2519
- var testimonialsOutscraperWebhookResponseSchema = z8.object({
2520
- ok: z8.literal(true),
2521
- note: z8.string().optional()
2539
+ var testimonialsSearchResponseSchema = z9.array(testimonialDocSchema);
2540
+ var testimonialsOutscraperWebhookResponseSchema = z9.object({
2541
+ ok: z9.literal(true),
2542
+ note: z9.string().optional()
2522
2543
  });
2523
2544
 
2524
2545
  // ../api/src/videos.ts
2525
- import { z as z9 } from "zod";
2526
- var videoStatusSchema = z9.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2527
- var videoTranscriptSegmentSchema = z9.object({
2528
- text: z9.string(),
2529
- startSecond: z9.number(),
2530
- endSecond: z9.number()
2531
- });
2532
- var videoSceneSchema = z9.object({
2533
- title: z9.string(),
2534
- description: z9.string(),
2535
- startSecond: z9.number(),
2536
- endSecond: z9.number(),
2537
- thumbnailTime: z9.number()
2538
- });
2539
- var videoDocSchema = z9.object({
2540
- _id: z9.string(),
2541
- _creationTime: z9.number(),
2542
- companyId: z9.string(),
2543
- muxAssetId: z9.string(),
2544
- muxPlaybackId: z9.string(),
2545
- muxUploadId: z9.string(),
2546
- name: z9.string(),
2547
- description: z9.string(),
2548
- tags: z9.array(z9.string()),
2549
- source: z9.string(),
2550
- externalId: z9.string().optional(),
2551
- sourceId: z9.string().optional(),
2552
- width: z9.number().optional(),
2553
- height: z9.number().optional(),
2554
- aspectRatio: z9.number().optional(),
2555
- duration: z9.number().optional(),
2556
- transcript: z9.string().optional(),
2557
- transcriptSegments: z9.array(videoTranscriptSegmentSchema).optional(),
2558
- scenes: z9.array(videoSceneSchema).optional(),
2559
- descriptionEmbedding: z9.array(z9.number()).optional(),
2560
- searchText: z9.string().optional(),
2546
+ import { z as z10 } from "zod";
2547
+ var videoStatusSchema = z10.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2548
+ var videoTranscriptSegmentSchema = z10.object({
2549
+ text: z10.string(),
2550
+ startSecond: z10.number(),
2551
+ endSecond: z10.number()
2552
+ });
2553
+ var videoSceneSchema = z10.object({
2554
+ title: z10.string(),
2555
+ description: z10.string(),
2556
+ startSecond: z10.number(),
2557
+ endSecond: z10.number(),
2558
+ thumbnailTime: z10.number()
2559
+ });
2560
+ var videoDocSchema = z10.object({
2561
+ _id: z10.string(),
2562
+ _creationTime: z10.number(),
2563
+ companyId: z10.string(),
2564
+ muxAssetId: z10.string(),
2565
+ muxPlaybackId: z10.string(),
2566
+ muxUploadId: z10.string(),
2567
+ name: z10.string(),
2568
+ description: z10.string(),
2569
+ tags: z10.array(z10.string()),
2570
+ source: z10.string(),
2571
+ externalId: z10.string().optional(),
2572
+ sourceId: z10.string().optional(),
2573
+ width: z10.number().optional(),
2574
+ height: z10.number().optional(),
2575
+ aspectRatio: z10.number().optional(),
2576
+ duration: z10.number().optional(),
2577
+ transcript: z10.string().optional(),
2578
+ transcriptSegments: z10.array(videoTranscriptSegmentSchema).optional(),
2579
+ scenes: z10.array(videoSceneSchema).optional(),
2580
+ descriptionEmbedding: z10.array(z10.number()).optional(),
2581
+ searchText: z10.string().optional(),
2561
2582
  status: videoStatusSchema,
2562
- errorMessage: z9.string().optional(),
2563
- createdAt: z9.number(),
2564
- updatedAt: z9.number(),
2565
- thumbnailUrl: z9.string()
2566
- });
2567
- var videosWebhookResponseSchema = z9.object({ ok: z9.literal(true) });
2568
- var videosGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2569
- var videosSearchRequestSchema = z9.object({
2570
- query: z9.string().min(1),
2571
- limit: z9.coerce.number().int().positive().max(100).optional(),
2572
- tags: z9.array(z9.string()).optional()
2573
- });
2574
- var videoSearchResultSchema = z9.object({
2575
- _id: z9.string(),
2576
- thumbnailUrl: z9.string(),
2577
- name: z9.string(),
2578
- description: z9.string(),
2579
- tags: z9.array(z9.string()),
2580
- status: z9.string(),
2581
- duration: z9.number().optional(),
2582
- muxPlaybackId: z9.string(),
2583
- createdAt: z9.number()
2584
- });
2585
- var videosSearchResponseSchema = z9.array(videoSearchResultSchema);
2586
- var videosUploadResponseSchema = z9.object({ uploadUrl: z9.string(), videoId: z9.string() });
2587
- var videosDeleteRequestSchema = z9.object({ id: z9.string().min(1, "Missing video ID") });
2588
- var videosDeleteResponseSchema = z9.object({ ok: z9.literal(true) });
2583
+ errorMessage: z10.string().optional(),
2584
+ createdAt: z10.number(),
2585
+ updatedAt: z10.number(),
2586
+ thumbnailUrl: z10.string()
2587
+ });
2588
+ var videosWebhookResponseSchema = z10.object({ ok: z10.literal(true) });
2589
+ var videosGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2590
+ var videosSearchRequestSchema = z10.object({
2591
+ query: z10.string().min(1),
2592
+ limit: z10.coerce.number().int().positive().max(100).optional(),
2593
+ tags: z10.array(z10.string()).optional()
2594
+ });
2595
+ var videoSearchResultSchema = z10.object({
2596
+ _id: z10.string(),
2597
+ thumbnailUrl: z10.string(),
2598
+ name: z10.string(),
2599
+ description: z10.string(),
2600
+ tags: z10.array(z10.string()),
2601
+ status: z10.string(),
2602
+ duration: z10.number().optional(),
2603
+ muxPlaybackId: z10.string(),
2604
+ createdAt: z10.number()
2605
+ });
2606
+ var videosSearchResponseSchema = z10.array(videoSearchResultSchema);
2607
+ var videosUploadResponseSchema = z10.object({ uploadUrl: z10.string(), videoId: z10.string() });
2608
+ var videosDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing video ID") });
2609
+ var videosDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
2589
2610
 
2590
2611
  // src/commands/actions/complete.ts
2591
2612
  import { defineCommand as defineCommand2 } from "citty";
@@ -4398,37 +4419,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4398
4419
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4399
4420
 
4400
4421
  // ../api/src/ads-google/ops.ts
4401
- import { z as z10 } from "zod";
4402
- var tempRefSchema2 = z10.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4403
- var refSchema = z10.union([
4404
- z10.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4405
- z10.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4422
+ import { z as z11 } from "zod";
4423
+ var tempRefSchema2 = z11.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4424
+ var refSchema = z11.union([
4425
+ z11.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4426
+ z11.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4406
4427
  tempRefSchema2
4407
4428
  ]);
4408
4429
  var targetRefSchema = refSchema;
4409
- var microsSchema = z10.number().int().positive("expected a positive micros amount");
4410
- var httpsUrlSchema2 = z10.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4411
- var customerIdSchema = z10.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4412
- var stageableStatusSchema2 = z10.enum(STAGEABLE_CREATE_STATUSES2);
4413
- var matchTypeSchema = z10.enum(KEYWORD_MATCH_TYPES);
4414
- var keywordTextSchema = z10.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4415
- var budgetCreateSchema = z10.object({
4416
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4430
+ var microsSchema = z11.number().int().positive("expected a positive micros amount");
4431
+ var httpsUrlSchema2 = z11.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4432
+ var customerIdSchema = z11.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4433
+ var stageableStatusSchema2 = z11.enum(STAGEABLE_CREATE_STATUSES2);
4434
+ var matchTypeSchema = z11.enum(KEYWORD_MATCH_TYPES);
4435
+ 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");
4436
+ var budgetCreateSchema = z11.object({
4437
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4417
4438
  amountMicros: microsSchema,
4418
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4419
- explicitlyShared: z10.boolean().default(false)
4439
+ deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4440
+ explicitlyShared: z11.boolean().default(false)
4420
4441
  });
4421
- var budgetUpdateSchema = z10.object({
4422
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4442
+ var budgetUpdateSchema = z11.object({
4443
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4423
4444
  amountMicros: microsSchema.optional(),
4424
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).optional()
4445
+ deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).optional()
4425
4446
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4426
- var biddingConfigSchema = z10.object({
4427
- type: z10.enum(BIDDING_STRATEGY_TYPES),
4447
+ var biddingConfigSchema = z11.object({
4448
+ type: z11.enum(BIDDING_STRATEGY_TYPES),
4428
4449
  targetCpaMicros: microsSchema.optional(),
4429
- targetRoas: z10.number().positive().optional(),
4450
+ targetRoas: z11.number().positive().optional(),
4430
4451
  cpcBidCeilingMicros: microsSchema.optional(),
4431
- enhancedCpcEnabled: z10.boolean().optional()
4452
+ enhancedCpcEnabled: z11.boolean().optional()
4432
4453
  }).superRefine((p, ctx) => {
4433
4454
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4434
4455
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4437,17 +4458,17 @@ var biddingConfigSchema = z10.object({
4437
4458
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4438
4459
  }
4439
4460
  });
4440
- var networkSettingsSchema = z10.object({
4441
- targetGoogleSearch: z10.boolean().optional(),
4442
- targetSearchNetwork: z10.boolean().optional(),
4443
- targetContentNetwork: z10.boolean().optional(),
4444
- targetPartnerSearchNetwork: z10.boolean().optional()
4461
+ var networkSettingsSchema = z11.object({
4462
+ targetGoogleSearch: z11.boolean().optional(),
4463
+ targetSearchNetwork: z11.boolean().optional(),
4464
+ targetContentNetwork: z11.boolean().optional(),
4465
+ targetPartnerSearchNetwork: z11.boolean().optional()
4445
4466
  });
4446
- var dateSchema = z10.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4447
- var campaignCreateSchema2 = z10.object({
4448
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4449
- channelType: z10.enum(ADVERTISING_CHANNEL_TYPES),
4450
- channelSubType: z10.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4467
+ var dateSchema = z11.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4468
+ var campaignCreateSchema2 = z11.object({
4469
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4470
+ channelType: z11.enum(ADVERTISING_CHANNEL_TYPES),
4471
+ channelSubType: z11.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4451
4472
  budget: refSchema,
4452
4473
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4453
4474
  bidding: biddingConfigSchema.optional(),
@@ -4456,7 +4477,7 @@ var campaignCreateSchema2 = z10.object({
4456
4477
  startDate: dateSchema.optional(),
4457
4478
  endDate: dateSchema.optional(),
4458
4479
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4459
- objective: z10.enum(CAMPAIGN_OBJECTIVES).optional(),
4480
+ objective: z11.enum(CAMPAIGN_OBJECTIVES).optional(),
4460
4481
  status: stageableStatusSchema2.default("PAUSED")
4461
4482
  }).superRefine((p, ctx) => {
4462
4483
  if (!p.bidding && !p.biddingStrategy) {
@@ -4480,129 +4501,129 @@ var campaignCreateSchema2 = z10.object({
4480
4501
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4481
4502
  }
4482
4503
  });
4483
- var campaignUpdateSchema2 = z10.object({
4484
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4504
+ var campaignUpdateSchema2 = z11.object({
4505
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4485
4506
  budget: refSchema.optional(),
4486
4507
  bidding: biddingConfigSchema.optional(),
4487
4508
  networkSettings: networkSettingsSchema.optional(),
4488
4509
  startDate: dateSchema.optional(),
4489
4510
  endDate: dateSchema.optional(),
4490
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4511
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4491
4512
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4492
- var adGroupCreateSchema = z10.object({
4493
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4513
+ var adGroupCreateSchema = z11.object({
4514
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4494
4515
  campaign: refSchema,
4495
- type: z10.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4516
+ type: z11.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4496
4517
  cpcBidMicros: microsSchema.optional(),
4497
4518
  status: stageableStatusSchema2.default("PAUSED")
4498
4519
  });
4499
- var adGroupUpdateSchema = z10.object({
4500
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4520
+ var adGroupUpdateSchema = z11.object({
4521
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4501
4522
  cpcBidMicros: microsSchema.optional(),
4502
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4523
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4503
4524
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4504
- var keywordAddSchema = z10.object({
4525
+ var keywordAddSchema = z11.object({
4505
4526
  adGroup: refSchema,
4506
4527
  text: keywordTextSchema,
4507
4528
  matchType: matchTypeSchema,
4508
4529
  cpcBidMicros: microsSchema.optional(),
4509
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4530
+ finalUrls: z11.array(httpsUrlSchema2).optional(),
4510
4531
  status: stageableStatusSchema2.default("ENABLED")
4511
4532
  });
4512
- var keywordUpdateSchema = z10.object({
4533
+ var keywordUpdateSchema = z11.object({
4513
4534
  cpcBidMicros: microsSchema.optional(),
4514
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4515
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4535
+ finalUrls: z11.array(httpsUrlSchema2).optional(),
4536
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4516
4537
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4517
- var negativeKeywordAddSchema = z10.object({
4518
- level: z10.enum(["adGroup", "campaign"]),
4538
+ var negativeKeywordAddSchema = z11.object({
4539
+ level: z11.enum(["adGroup", "campaign"]),
4519
4540
  parent: refSchema,
4520
4541
  text: keywordTextSchema,
4521
4542
  matchType: matchTypeSchema
4522
4543
  });
4523
- var sharedSetCreateSchema = z10.object({
4524
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4525
- type: z10.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4544
+ var sharedSetCreateSchema = z11.object({
4545
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4546
+ type: z11.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4526
4547
  });
4527
- var sharedSetMemberAddSchema = z10.object({
4548
+ var sharedSetMemberAddSchema = z11.object({
4528
4549
  sharedSet: refSchema,
4529
4550
  text: keywordTextSchema,
4530
4551
  matchType: matchTypeSchema
4531
4552
  });
4532
- var campaignSharedSetAttachSchema = z10.object({
4553
+ var campaignSharedSetAttachSchema = z11.object({
4533
4554
  campaign: refSchema,
4534
4555
  sharedSet: refSchema
4535
4556
  });
4536
- var adTextAssetSchema = z10.object({
4537
- text: z10.string().min(1),
4538
- pinnedField: z10.enum(PINNED_FIELDS).optional()
4557
+ var adTextAssetSchema = z11.object({
4558
+ text: z11.string().min(1),
4559
+ pinnedField: z11.enum(PINNED_FIELDS).optional()
4539
4560
  });
4540
- var responsiveSearchAdSchema = z10.object({
4541
- format: z10.literal("responsiveSearch"),
4542
- headlines: z10.array(
4561
+ var responsiveSearchAdSchema = z11.object({
4562
+ format: z11.literal("responsiveSearch"),
4563
+ headlines: z11.array(
4543
4564
  adTextAssetSchema.refine(
4544
4565
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4545
4566
  "headline exceeds 30 chars"
4546
4567
  )
4547
4568
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4548
- descriptions: z10.array(
4569
+ descriptions: z11.array(
4549
4570
  adTextAssetSchema.refine(
4550
4571
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4551
4572
  "description exceeds 90 chars"
4552
4573
  )
4553
4574
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4554
- path1: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4555
- path2: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4556
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4557
- });
4558
- var responsiveDisplayAdSchema = z10.object({
4559
- format: z10.literal("responsiveDisplay"),
4560
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4561
- longHeadline: z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4562
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4563
- businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4575
+ path1: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4576
+ path2: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4577
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4578
+ });
4579
+ var responsiveDisplayAdSchema = z11.object({
4580
+ format: z11.literal("responsiveDisplay"),
4581
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4582
+ longHeadline: z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4583
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4584
+ businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4564
4585
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4565
4586
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4566
4587
  // image (1:1) to serve; the logo images are optional.
4567
- marketingImageAssets: z10.array(refSchema).optional(),
4568
- squareMarketingImageAssets: z10.array(refSchema).optional(),
4569
- logoImageAssets: z10.array(refSchema).optional(),
4570
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4571
- });
4572
- var callAdSchema = z10.object({
4573
- format: z10.literal("call"),
4574
- countryCode: z10.string().length(2),
4575
- phoneNumber: z10.string().min(3),
4576
- headline1: z10.string().min(1).max(30),
4577
- headline2: z10.string().min(1).max(30),
4578
- description1: z10.string().min(1).max(90),
4579
- description2: z10.string().min(1).max(90),
4580
- businessName: z10.string().min(1).max(25),
4581
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4582
- });
4583
- var appAdSchema = z10.object({
4584
- format: z10.literal("app"),
4585
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(30) })).min(1),
4586
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1)
4587
- });
4588
- var videoAdSchema = z10.object({
4589
- format: z10.literal("video"),
4588
+ marketingImageAssets: z11.array(refSchema).optional(),
4589
+ squareMarketingImageAssets: z11.array(refSchema).optional(),
4590
+ logoImageAssets: z11.array(refSchema).optional(),
4591
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4592
+ });
4593
+ var callAdSchema = z11.object({
4594
+ format: z11.literal("call"),
4595
+ countryCode: z11.string().length(2),
4596
+ phoneNumber: z11.string().min(3),
4597
+ headline1: z11.string().min(1).max(30),
4598
+ headline2: z11.string().min(1).max(30),
4599
+ description1: z11.string().min(1).max(90),
4600
+ description2: z11.string().min(1).max(90),
4601
+ businessName: z11.string().min(1).max(25),
4602
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4603
+ });
4604
+ var appAdSchema = z11.object({
4605
+ format: z11.literal("app"),
4606
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(30) })).min(1),
4607
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1)
4608
+ });
4609
+ var videoAdSchema = z11.object({
4610
+ format: z11.literal("video"),
4590
4611
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4591
4612
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4592
- videoAssets: z10.array(refSchema).min(1),
4593
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4594
- });
4595
- var demandGenAdSchema = z10.object({
4596
- format: z10.literal("demandGen"),
4597
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(40) })).min(1).max(5),
4598
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1).max(5),
4599
- businessName: z10.string().min(1).max(25),
4600
- finalUrls: z10.array(httpsUrlSchema2).min(1),
4601
- imageAssets: z10.array(refSchema).optional(),
4602
- squareImageAssets: z10.array(refSchema).optional(),
4603
- logoImageAssets: z10.array(refSchema).optional()
4604
- });
4605
- var adContentSchema = z10.discriminatedUnion("format", [
4613
+ videoAssets: z11.array(refSchema).min(1),
4614
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4615
+ });
4616
+ var demandGenAdSchema = z11.object({
4617
+ format: z11.literal("demandGen"),
4618
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(40) })).min(1).max(5),
4619
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1).max(5),
4620
+ businessName: z11.string().min(1).max(25),
4621
+ finalUrls: z11.array(httpsUrlSchema2).min(1),
4622
+ imageAssets: z11.array(refSchema).optional(),
4623
+ squareImageAssets: z11.array(refSchema).optional(),
4624
+ logoImageAssets: z11.array(refSchema).optional()
4625
+ });
4626
+ var adContentSchema = z11.discriminatedUnion("format", [
4606
4627
  responsiveSearchAdSchema,
4607
4628
  responsiveDisplayAdSchema,
4608
4629
  callAdSchema,
@@ -4610,45 +4631,45 @@ var adContentSchema = z10.discriminatedUnion("format", [
4610
4631
  videoAdSchema,
4611
4632
  demandGenAdSchema
4612
4633
  ]);
4613
- var adCreateSchema = z10.object({
4634
+ var adCreateSchema = z11.object({
4614
4635
  adGroup: refSchema,
4615
4636
  status: stageableStatusSchema2.default("PAUSED"),
4616
4637
  content: adContentSchema
4617
4638
  });
4618
- var adUpdateSchema = z10.object({
4619
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4639
+ var adUpdateSchema = z11.object({
4640
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4620
4641
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4621
- content: z10.record(z10.string(), z10.unknown()).optional()
4642
+ content: z11.record(z11.string(), z11.unknown()).optional()
4622
4643
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4623
- var textAssetSchema = z10.object({ type: z10.literal("text"), text: z10.string().min(1) });
4624
- var imageAssetSchema = z10.object({
4625
- type: z10.literal("image"),
4626
- imageId: z10.string().min(1),
4627
- name: z10.string().optional()
4628
- });
4629
- var youtubeVideoAssetSchema = z10.object({
4630
- type: z10.literal("youtubeVideo"),
4631
- youtubeVideoId: z10.string().min(1),
4632
- name: z10.string().optional()
4633
- });
4634
- var sitelinkAssetSchema = z10.object({
4635
- type: z10.literal("sitelink"),
4636
- linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4637
- description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4638
- description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4639
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4640
- });
4641
- var calloutAssetSchema = z10.object({
4642
- type: z10.literal("callout"),
4643
- calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4644
- });
4645
- var structuredSnippetAssetSchema = z10.object({
4646
- type: z10.literal("structuredSnippet"),
4647
- header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4648
- values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4649
- });
4650
- var callToActionAssetSchema = z10.object({ type: z10.literal("callToAction"), callToAction: z10.string().min(1) });
4651
- var assetCreateSchema = z10.discriminatedUnion("type", [
4644
+ var textAssetSchema = z11.object({ type: z11.literal("text"), text: z11.string().min(1) });
4645
+ var imageAssetSchema = z11.object({
4646
+ type: z11.literal("image"),
4647
+ imageId: z11.string().min(1),
4648
+ name: z11.string().optional()
4649
+ });
4650
+ var youtubeVideoAssetSchema = z11.object({
4651
+ type: z11.literal("youtubeVideo"),
4652
+ youtubeVideoId: z11.string().min(1),
4653
+ name: z11.string().optional()
4654
+ });
4655
+ var sitelinkAssetSchema = z11.object({
4656
+ type: z11.literal("sitelink"),
4657
+ linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4658
+ description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4659
+ description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4660
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4661
+ });
4662
+ var calloutAssetSchema = z11.object({
4663
+ type: z11.literal("callout"),
4664
+ calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4665
+ });
4666
+ var structuredSnippetAssetSchema = z11.object({
4667
+ type: z11.literal("structuredSnippet"),
4668
+ header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4669
+ values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4670
+ });
4671
+ var callToActionAssetSchema = z11.object({ type: z11.literal("callToAction"), callToAction: z11.string().min(1) });
4672
+ var assetCreateSchema = z11.discriminatedUnion("type", [
4652
4673
  textAssetSchema,
4653
4674
  imageAssetSchema,
4654
4675
  youtubeVideoAssetSchema,
@@ -4657,136 +4678,136 @@ var assetCreateSchema = z10.discriminatedUnion("type", [
4657
4678
  structuredSnippetAssetSchema,
4658
4679
  callToActionAssetSchema
4659
4680
  ]);
4660
- var assetUpdateSchema = z10.object({
4661
- name: z10.string().min(1).optional(),
4662
- linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4663
- description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4664
- description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4665
- finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
4666
- calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4667
- header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4668
- values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4669
- callToAction: z10.string().min(1).optional(),
4670
- text: z10.string().min(1).optional()
4681
+ var assetUpdateSchema = z11.object({
4682
+ name: z11.string().min(1).optional(),
4683
+ linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4684
+ description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4685
+ description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4686
+ finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4687
+ calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4688
+ header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4689
+ values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4690
+ callToAction: z11.string().min(1).optional(),
4691
+ text: z11.string().min(1).optional()
4671
4692
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4672
- var assetLinkAttachSchema = z10.object({
4673
- level: z10.enum(["campaign", "adGroup", "customer"]),
4693
+ var assetLinkAttachSchema = z11.object({
4694
+ level: z11.enum(["campaign", "adGroup", "customer"]),
4674
4695
  parent: refSchema.optional(),
4675
4696
  asset: refSchema,
4676
- fieldType: z10.enum(ASSET_FIELD_TYPES)
4697
+ fieldType: z11.enum(ASSET_FIELD_TYPES)
4677
4698
  }).superRefine((value, ctx) => {
4678
4699
  if (value.level !== "customer" && !value.parent) {
4679
4700
  ctx.addIssue({
4680
- code: z10.ZodIssueCode.custom,
4701
+ code: z11.ZodIssueCode.custom,
4681
4702
  path: ["parent"],
4682
4703
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4683
4704
  });
4684
4705
  }
4685
4706
  });
4686
- var assetGroupCreateSchema = z10.object({
4707
+ var assetGroupCreateSchema = z11.object({
4687
4708
  campaign: refSchema,
4688
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4689
- finalUrls: z10.array(httpsUrlSchema2).min(1),
4690
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4691
- longHeadlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4692
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4693
- businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4694
- imageAssets: z10.array(refSchema).optional(),
4695
- squareImageAssets: z10.array(refSchema).optional(),
4696
- logoAssets: z10.array(refSchema).optional(),
4697
- status: z10.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4698
- });
4699
- var assetGroupUpdateSchema = z10.object({
4700
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4701
- finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
4702
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4709
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4710
+ finalUrls: z11.array(httpsUrlSchema2).min(1),
4711
+ 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),
4712
+ 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),
4713
+ 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),
4714
+ businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4715
+ imageAssets: z11.array(refSchema).optional(),
4716
+ squareImageAssets: z11.array(refSchema).optional(),
4717
+ logoAssets: z11.array(refSchema).optional(),
4718
+ status: z11.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4719
+ });
4720
+ var assetGroupUpdateSchema = z11.object({
4721
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4722
+ finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4723
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4703
4724
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4704
- var audienceCreateSchema2 = z10.object({
4705
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4706
- type: z10.enum(USER_LIST_TYPES).default("BASIC"),
4707
- description: z10.string().optional(),
4725
+ var audienceCreateSchema2 = z11.object({
4726
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4727
+ type: z11.enum(USER_LIST_TYPES).default("BASIC"),
4728
+ description: z11.string().optional(),
4708
4729
  /** Customer-match members (crm-based) — file-first for large lists. */
4709
- members: z10.array(z10.record(z10.string(), z10.string())).optional(),
4710
- sourceFileRef: z10.string().optional()
4730
+ members: z11.array(z11.record(z11.string(), z11.string())).optional(),
4731
+ sourceFileRef: z11.string().optional()
4711
4732
  });
4712
- var audienceCriterionAttachSchema = z10.object({
4713
- level: z10.enum(["campaign", "adGroup"]),
4733
+ var audienceCriterionAttachSchema = z11.object({
4734
+ level: z11.enum(["campaign", "adGroup"]),
4714
4735
  parent: refSchema,
4715
4736
  userList: refSchema,
4716
- negative: z10.boolean().default(false)
4737
+ negative: z11.boolean().default(false)
4717
4738
  });
4718
- var conversionActionCreateSchema = z10.object({
4719
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4720
- type: z10.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4721
- category: z10.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4722
- countingType: z10.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4739
+ var conversionActionCreateSchema = z11.object({
4740
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4741
+ type: z11.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4742
+ category: z11.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4743
+ countingType: z11.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4723
4744
  defaultValueMicros: microsSchema.optional(),
4724
- defaultCurrencyCode: z10.string().length(3).optional(),
4725
- clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
4726
- viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
4727
- status: z10.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4728
- });
4729
- var conversionActionUpdateSchema = z10.object({
4730
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4731
- category: z10.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4732
- countingType: z10.enum(CONVERSION_COUNTING_TYPES).optional(),
4745
+ defaultCurrencyCode: z11.string().length(3).optional(),
4746
+ clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4747
+ viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4748
+ status: z11.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4749
+ });
4750
+ var conversionActionUpdateSchema = z11.object({
4751
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4752
+ category: z11.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4753
+ countingType: z11.enum(CONVERSION_COUNTING_TYPES).optional(),
4733
4754
  defaultValueMicros: microsSchema.optional(),
4734
- defaultCurrencyCode: z10.string().length(3).optional(),
4735
- clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
4736
- viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
4737
- status: z10.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4755
+ defaultCurrencyCode: z11.string().length(3).optional(),
4756
+ clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4757
+ viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4758
+ status: z11.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4738
4759
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4739
- var biddingStrategyCreateSchema = z10.object({
4740
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4760
+ var biddingStrategyCreateSchema = z11.object({
4761
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4741
4762
  config: biddingConfigSchema
4742
4763
  }).superRefine((p, ctx) => {
4743
4764
  if (p.config.type === "MANUAL_CPC") {
4744
4765
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4745
4766
  }
4746
4767
  });
4747
- var biddingStrategyUpdateSchema = z10.object({
4748
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4768
+ var biddingStrategyUpdateSchema = z11.object({
4769
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4749
4770
  config: biddingConfigSchema.optional()
4750
4771
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4751
- var labelCreateSchema = z10.object({
4752
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4753
- backgroundColor: z10.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4754
- description: z10.string().optional()
4772
+ var labelCreateSchema = z11.object({
4773
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4774
+ backgroundColor: z11.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4775
+ description: z11.string().optional()
4755
4776
  });
4756
- var labelAttachSchema = z10.object({
4757
- level: z10.enum(["campaign", "adGroup", "ad"]),
4777
+ var labelAttachSchema = z11.object({
4778
+ level: z11.enum(["campaign", "adGroup", "ad"]),
4758
4779
  parent: refSchema,
4759
4780
  label: refSchema
4760
4781
  });
4761
- var locationCriterionSchema = z10.object({
4762
- criterionType: z10.literal("location"),
4763
- geoTargetConstant: z10.union([z10.string().regex(GEO_TARGET_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
4764
- });
4765
- var languageCriterionSchema = z10.object({
4766
- criterionType: z10.literal("language"),
4767
- languageConstant: z10.union([z10.string().regex(LANGUAGE_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
4768
- });
4769
- var adScheduleCriterionSchema = z10.object({
4770
- criterionType: z10.literal("adSchedule"),
4771
- dayOfWeek: z10.enum(DAYS_OF_WEEK),
4772
- startHour: z10.number().int().min(0).max(23),
4773
- startMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4774
- endHour: z10.number().int().min(0).max(24),
4775
- endMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4776
- });
4777
- var deviceCriterionSchema = z10.object({
4778
- criterionType: z10.literal("device"),
4779
- device: z10.enum(DEVICE_TYPES),
4782
+ var locationCriterionSchema = z11.object({
4783
+ criterionType: z11.literal("location"),
4784
+ geoTargetConstant: z11.union([z11.string().regex(GEO_TARGET_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4785
+ });
4786
+ var languageCriterionSchema = z11.object({
4787
+ criterionType: z11.literal("language"),
4788
+ languageConstant: z11.union([z11.string().regex(LANGUAGE_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4789
+ });
4790
+ var adScheduleCriterionSchema = z11.object({
4791
+ criterionType: z11.literal("adSchedule"),
4792
+ dayOfWeek: z11.enum(DAYS_OF_WEEK),
4793
+ startHour: z11.number().int().min(0).max(23),
4794
+ startMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4795
+ endHour: z11.number().int().min(0).max(24),
4796
+ endMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4797
+ });
4798
+ var deviceCriterionSchema = z11.object({
4799
+ criterionType: z11.literal("device"),
4800
+ device: z11.enum(DEVICE_TYPES),
4780
4801
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4781
4802
  // 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.
4782
- bidModifier: z10.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4803
+ bidModifier: z11.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4783
4804
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4784
4805
  })
4785
4806
  });
4786
- var campaignCriterionAddSchema = z10.object({
4807
+ var campaignCriterionAddSchema = z11.object({
4787
4808
  campaign: refSchema,
4788
- negative: z10.boolean().default(false),
4789
- criterion: z10.discriminatedUnion("criterionType", [
4809
+ negative: z11.boolean().default(false),
4810
+ criterion: z11.discriminatedUnion("criterionType", [
4790
4811
  locationCriterionSchema,
4791
4812
  languageCriterionSchema,
4792
4813
  adScheduleCriterionSchema,
@@ -4796,7 +4817,7 @@ var campaignCriterionAddSchema = z10.object({
4796
4817
  const c = val.criterion;
4797
4818
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4798
4819
  ctx.addIssue({
4799
- code: z10.ZodIssueCode.custom,
4820
+ code: z11.ZodIssueCode.custom,
4800
4821
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4801
4822
  path: ["criterion", "endMinute"]
4802
4823
  });
@@ -4848,17 +4869,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4848
4869
  "google.campaignCriterion.add",
4849
4870
  "google.campaignCriterion.remove"
4850
4871
  ];
4851
- var googleDraftOpKindSchema = z10.enum(GOOGLE_DRAFT_OP_KINDS);
4872
+ var googleDraftOpKindSchema = z11.enum(GOOGLE_DRAFT_OP_KINDS);
4852
4873
  function createOp2(kind, payload) {
4853
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, payload });
4874
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, payload });
4854
4875
  }
4855
4876
  function updateOp2(kind, payload) {
4856
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4877
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4857
4878
  }
4858
4879
  function targetOp(kind) {
4859
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4880
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4860
4881
  }
4861
- var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4882
+ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
4862
4883
  createOp2("google.budget.create", budgetCreateSchema),
4863
4884
  updateOp2("google.budget.update", budgetUpdateSchema),
4864
4885
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4906,132 +4927,132 @@ var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4906
4927
  ]);
4907
4928
 
4908
4929
  // ../api/src/ads-google/wire.ts
4909
- import { z as z11 } from "zod";
4910
- var googleWriteModeSchema = z11.enum(["live", "simulated"]);
4911
- var googleDraftOpResultSchema = z11.object({
4912
- status: z11.enum(["applied", "simulated", "failed", "skipped"]),
4913
- resourceName: z11.string().optional(),
4914
- error: z11.string().optional(),
4915
- skippedBecause: z11.string().optional(),
4916
- executedAt: z11.number().optional()
4917
- });
4918
- var googleDraftStageRequestSchema = z11.object({
4919
- chatId: z11.string(),
4930
+ import { z as z12 } from "zod";
4931
+ var googleWriteModeSchema = z12.enum(["live", "simulated"]);
4932
+ var googleDraftOpResultSchema = z12.object({
4933
+ status: z12.enum(["applied", "simulated", "failed", "skipped"]),
4934
+ resourceName: z12.string().optional(),
4935
+ error: z12.string().optional(),
4936
+ skippedBecause: z12.string().optional(),
4937
+ executedAt: z12.number().optional()
4938
+ });
4939
+ var googleDraftStageRequestSchema = z12.object({
4940
+ chatId: z12.string(),
4920
4941
  op: googleDraftOpInputSchema
4921
4942
  });
4922
- var googleDraftStageResponseSchema = z11.object({
4923
- staged: z11.literal(true),
4924
- ref: z11.string(),
4943
+ var googleDraftStageResponseSchema = z12.object({
4944
+ staged: z12.literal(true),
4945
+ ref: z12.string(),
4925
4946
  kind: googleDraftOpKindSchema,
4926
4947
  mode: googleWriteModeSchema,
4927
- dependsOn: z11.array(z11.string()),
4928
- summary: z11.string(),
4929
- warnings: z11.array(z11.string()),
4948
+ dependsOn: z12.array(z12.string()),
4949
+ summary: z12.string(),
4950
+ warnings: z12.array(z12.string()),
4930
4951
  /** True when the op amended an already-staged op in place instead of appending a new one. */
4931
- amended: z11.boolean().optional()
4952
+ amended: z12.boolean().optional()
4932
4953
  });
4933
- var googleDraftAmendRequestSchema = z11.object({
4934
- chatId: z11.string(),
4935
- ref: z11.string(),
4936
- patch: z11.record(z11.string(), z11.unknown())
4954
+ var googleDraftAmendRequestSchema = z12.object({
4955
+ chatId: z12.string(),
4956
+ ref: z12.string(),
4957
+ patch: z12.record(z12.string(), z12.unknown())
4937
4958
  });
4938
- var googleDraftShowRequestSchema = z11.object({
4939
- chatId: z11.string(),
4940
- ref: z11.string()
4959
+ var googleDraftShowRequestSchema = z12.object({
4960
+ chatId: z12.string(),
4961
+ ref: z12.string()
4941
4962
  });
4942
4963
  var GOOGLE_DRAFT_BATCH_MAX = 500;
4943
- var googleDraftStageBatchRequestSchema = z11.object({
4944
- chatId: z11.string(),
4945
- ops: z11.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4964
+ var googleDraftStageBatchRequestSchema = z12.object({
4965
+ chatId: z12.string(),
4966
+ ops: z12.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4946
4967
  });
4947
- var googleDraftStageBatchResponseSchema = z11.object({
4948
- staged: z11.literal(true),
4968
+ var googleDraftStageBatchResponseSchema = z12.object({
4969
+ staged: z12.literal(true),
4949
4970
  mode: googleWriteModeSchema,
4950
- count: z11.number(),
4951
- ops: z11.array(
4952
- z11.object({
4953
- ref: z11.string(),
4971
+ count: z12.number(),
4972
+ ops: z12.array(
4973
+ z12.object({
4974
+ ref: z12.string(),
4954
4975
  kind: googleDraftOpKindSchema,
4955
- dependsOn: z11.array(z11.string()),
4956
- summary: z11.string(),
4957
- warnings: z11.array(z11.string())
4976
+ dependsOn: z12.array(z12.string()),
4977
+ summary: z12.string(),
4978
+ warnings: z12.array(z12.string())
4958
4979
  })
4959
4980
  )
4960
4981
  });
4961
- var googleDraftOpViewSchema = z11.object({
4962
- ref: z11.string(),
4982
+ var googleDraftOpViewSchema = z12.object({
4983
+ ref: z12.string(),
4963
4984
  kind: googleDraftOpKindSchema,
4964
- customerId: z11.string(),
4965
- target: z11.string().optional(),
4966
- dependsOn: z11.array(z11.string()),
4967
- summary: z11.string(),
4968
- stagedAt: z11.number(),
4985
+ customerId: z12.string(),
4986
+ target: z12.string().optional(),
4987
+ dependsOn: z12.array(z12.string()),
4988
+ summary: z12.string(),
4989
+ stagedAt: z12.number(),
4969
4990
  result: googleDraftOpResultSchema.optional()
4970
4991
  });
4971
- var googleDraftShowResponseSchema = z11.object({
4992
+ var googleDraftShowResponseSchema = z12.object({
4972
4993
  op: googleDraftOpViewSchema.extend({
4973
- payload: z11.unknown().optional(),
4974
- warnings: z11.array(z11.string()).optional(),
4975
- annotations: z11.unknown().optional()
4994
+ payload: z12.unknown().optional(),
4995
+ warnings: z12.array(z12.string()).optional(),
4996
+ annotations: z12.unknown().optional()
4976
4997
  })
4977
4998
  });
4978
- var googleDraftListRequestSchema = z11.object({
4979
- chatId: z11.string()
4999
+ var googleDraftListRequestSchema = z12.object({
5000
+ chatId: z12.string()
4980
5001
  });
4981
- var googleDraftAdvisorySchema = z11.object({
4982
- scope: z11.enum(["campaign", "adGroup"]),
4983
- message: z11.string()
5002
+ var googleDraftAdvisorySchema = z12.object({
5003
+ scope: z12.enum(["campaign", "adGroup"]),
5004
+ message: z12.string()
4984
5005
  });
4985
- var googleDraftStatusCollectionSchema = z11.object({
4986
- label: z11.string(),
4987
- added: z11.number(),
4988
- removed: z11.number(),
4989
- existing: z11.number()
5006
+ var googleDraftStatusCollectionSchema = z12.object({
5007
+ label: z12.string(),
5008
+ added: z12.number(),
5009
+ removed: z12.number(),
5010
+ existing: z12.number()
4990
5011
  });
4991
- var googleDraftChangeOperationSchema = z11.enum(["create", "update", "pause", "resume", "remove"]);
4992
- var googleDraftStatusNodeSchema = z11.lazy(
4993
- () => z11.object({
4994
- entity: z11.string(),
4995
- name: z11.string(),
5012
+ var googleDraftChangeOperationSchema = z12.enum(["create", "update", "pause", "resume", "remove"]);
5013
+ var googleDraftStatusNodeSchema = z12.lazy(
5014
+ () => z12.object({
5015
+ entity: z12.string(),
5016
+ name: z12.string(),
4996
5017
  operation: googleDraftChangeOperationSchema.optional(),
4997
- existing: z11.boolean(),
4998
- collections: z11.array(googleDraftStatusCollectionSchema),
4999
- children: z11.array(googleDraftStatusNodeSchema),
5000
- warnings: z11.array(z11.string()).optional()
5018
+ existing: z12.boolean(),
5019
+ collections: z12.array(googleDraftStatusCollectionSchema),
5020
+ children: z12.array(googleDraftStatusNodeSchema),
5021
+ warnings: z12.array(z12.string()).optional()
5001
5022
  })
5002
5023
  );
5003
- var googleDraftListResponseSchema = z11.object({
5004
- status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
5024
+ var googleDraftListResponseSchema = z12.object({
5025
+ status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
5005
5026
  mode: googleWriteModeSchema,
5006
- count: z11.number(),
5007
- ops: z11.array(googleDraftOpViewSchema),
5027
+ count: z12.number(),
5028
+ ops: z12.array(googleDraftOpViewSchema),
5008
5029
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5009
- tree: z11.array(googleDraftStatusNodeSchema).optional(),
5030
+ tree: z12.array(googleDraftStatusNodeSchema).optional(),
5010
5031
  /** Non-blocking completeness advisories for the whole draft. */
5011
- advisories: z11.array(googleDraftAdvisorySchema).optional()
5032
+ advisories: z12.array(googleDraftAdvisorySchema).optional()
5012
5033
  });
5013
- var googleDraftRemoveRequestSchema = z11.object({
5014
- chatId: z11.string(),
5015
- ref: z11.string()
5034
+ var googleDraftRemoveRequestSchema = z12.object({
5035
+ chatId: z12.string(),
5036
+ ref: z12.string()
5016
5037
  });
5017
- var googleDraftRemoveResponseSchema = z11.object({
5038
+ var googleDraftRemoveResponseSchema = z12.object({
5018
5039
  /** The requested ref plus any dependents removed by cascade. */
5019
- removed: z11.array(z11.string())
5040
+ removed: z12.array(z12.string())
5020
5041
  });
5021
- var googleDraftClearRequestSchema = z11.object({
5022
- chatId: z11.string()
5042
+ var googleDraftClearRequestSchema = z12.object({
5043
+ chatId: z12.string()
5023
5044
  });
5024
- var googleDraftClearResponseSchema = z11.object({
5025
- cleared: z11.number()
5045
+ var googleDraftClearResponseSchema = z12.object({
5046
+ cleared: z12.number()
5026
5047
  });
5027
- var googleFieldErrorSchema = z11.object({
5028
- path: z11.string(),
5029
- message: z11.string()
5048
+ var googleFieldErrorSchema = z12.object({
5049
+ path: z12.string(),
5050
+ message: z12.string()
5030
5051
  });
5031
- var googleDraftErrorResponseSchema = z11.object({
5032
- code: z11.string(),
5033
- error: z11.string(),
5034
- fields: z11.array(googleFieldErrorSchema).optional()
5052
+ var googleDraftErrorResponseSchema = z12.object({
5053
+ code: z12.string(),
5054
+ error: z12.string(),
5055
+ fields: z12.array(googleFieldErrorSchema).optional()
5035
5056
  });
5036
5057
 
5037
5058
  // src/commands/ads/google/draft-status.ts
@@ -11074,17 +11095,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11074
11095
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11075
11096
 
11076
11097
  // ../api/src/ads-meta/ops.ts
11077
- import { z as z12 } from "zod";
11078
- var tempRefSchema3 = z12.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11079
- var parentRefSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11080
- var moneySchema2 = z12.object({
11081
- amount: z12.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11082
- currencyCode: z12.string().length(3).optional()
11083
- });
11084
- var httpsUrlSchema3 = z12.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11085
- var bakerMediaIdSchema2 = z12.string().min(1);
11086
- var stageableStatusSchema3 = z12.enum(STAGEABLE_CREATE_STATUSES3);
11087
- var updateStatusSchema = z12.enum(UPDATE_STATUSES);
11098
+ import { z as z13 } from "zod";
11099
+ var tempRefSchema3 = z13.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11100
+ var parentRefSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11101
+ var moneySchema2 = z13.object({
11102
+ 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"),
11103
+ currencyCode: z13.string().length(3).optional()
11104
+ });
11105
+ var httpsUrlSchema3 = z13.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11106
+ var bakerMediaIdSchema2 = z13.string().min(1);
11107
+ var stageableStatusSchema3 = z13.enum(STAGEABLE_CREATE_STATUSES3);
11108
+ var updateStatusSchema = z13.enum(UPDATE_STATUSES);
11088
11109
  function currencyMinimums2(currencyCode) {
11089
11110
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11090
11111
  }
@@ -11096,50 +11117,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
11096
11117
  }
11097
11118
  }
11098
11119
  }
11099
- var geoLocationsSchema = z12.object({
11100
- countries: z12.array(z12.string().length(2)).optional(),
11101
- regions: z12.array(z12.object({ key: z12.string() })).optional(),
11102
- cities: z12.array(z12.object({ key: z12.string(), radius: z12.number().optional(), distance_unit: z12.string().optional() })).optional(),
11103
- zips: z12.array(z12.object({ key: z12.string() })).optional(),
11104
- location_types: z12.array(z12.string()).optional()
11105
- }).catchall(z12.unknown());
11106
- var idNameSchema = z12.object({ id: z12.string(), name: z12.string().optional() });
11107
- var metaTargetingSchema = z12.object({
11120
+ var geoLocationsSchema = z13.object({
11121
+ countries: z13.array(z13.string().length(2)).optional(),
11122
+ regions: z13.array(z13.object({ key: z13.string() })).optional(),
11123
+ cities: z13.array(z13.object({ key: z13.string(), radius: z13.number().optional(), distance_unit: z13.string().optional() })).optional(),
11124
+ zips: z13.array(z13.object({ key: z13.string() })).optional(),
11125
+ location_types: z13.array(z13.string()).optional()
11126
+ }).catchall(z13.unknown());
11127
+ var idNameSchema = z13.object({ id: z13.string(), name: z13.string().optional() });
11128
+ var metaTargetingSchema = z13.object({
11108
11129
  geo_locations: geoLocationsSchema.optional(),
11109
11130
  excluded_geo_locations: geoLocationsSchema.optional(),
11110
- age_min: z12.number().int().min(13).max(65).optional(),
11111
- age_max: z12.number().int().min(13).max(65).optional(),
11112
- genders: z12.array(z12.union([z12.literal(1), z12.literal(2)])).optional(),
11113
- locales: z12.array(z12.number().int()).optional(),
11114
- interests: z12.array(idNameSchema).optional(),
11115
- behaviors: z12.array(idNameSchema).optional(),
11116
- custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
11117
- excluded_custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
11118
- flexible_spec: z12.array(z12.record(z12.string(), z12.unknown())).optional(),
11119
- exclusions: z12.record(z12.string(), z12.unknown()).optional(),
11120
- publisher_platforms: z12.array(z12.string()).optional(),
11121
- facebook_positions: z12.array(z12.string()).optional(),
11122
- instagram_positions: z12.array(z12.string()).optional(),
11123
- audience_network_positions: z12.array(z12.string()).optional(),
11124
- messenger_positions: z12.array(z12.string()).optional(),
11125
- device_platforms: z12.array(z12.string()).optional(),
11126
- targeting_automation: z12.object({ advantage_audience: z12.union([z12.literal(0), z12.literal(1)]) }).partial().optional()
11127
- }).catchall(z12.unknown());
11128
- var specialAdCategoriesSchema = z12.array(z12.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11129
- var campaignCreateSchema3 = z12.object({
11130
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax),
11131
- objective: z12.enum(OBJECTIVES),
11131
+ age_min: z13.number().int().min(13).max(65).optional(),
11132
+ age_max: z13.number().int().min(13).max(65).optional(),
11133
+ genders: z13.array(z13.union([z13.literal(1), z13.literal(2)])).optional(),
11134
+ locales: z13.array(z13.number().int()).optional(),
11135
+ interests: z13.array(idNameSchema).optional(),
11136
+ behaviors: z13.array(idNameSchema).optional(),
11137
+ custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11138
+ excluded_custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11139
+ flexible_spec: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
11140
+ exclusions: z13.record(z13.string(), z13.unknown()).optional(),
11141
+ publisher_platforms: z13.array(z13.string()).optional(),
11142
+ facebook_positions: z13.array(z13.string()).optional(),
11143
+ instagram_positions: z13.array(z13.string()).optional(),
11144
+ audience_network_positions: z13.array(z13.string()).optional(),
11145
+ messenger_positions: z13.array(z13.string()).optional(),
11146
+ device_platforms: z13.array(z13.string()).optional(),
11147
+ targeting_automation: z13.object({ advantage_audience: z13.union([z13.literal(0), z13.literal(1)]) }).partial().optional()
11148
+ }).catchall(z13.unknown());
11149
+ var specialAdCategoriesSchema = z13.array(z13.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11150
+ var campaignCreateSchema3 = z13.object({
11151
+ name: z13.string().min(1).max(META_LIMITS.campaign.nameMax),
11152
+ objective: z13.enum(OBJECTIVES),
11132
11153
  status: stageableStatusSchema3.default("PAUSED"),
11133
11154
  special_ad_categories: specialAdCategoriesSchema,
11134
- special_ad_category_country: z12.array(z12.string().length(2)).optional(),
11135
- buying_type: z12.enum(BUYING_TYPES).default("AUCTION"),
11136
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11155
+ special_ad_category_country: z13.array(z13.string().length(2)).optional(),
11156
+ buying_type: z13.enum(BUYING_TYPES).default("AUCTION"),
11157
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11137
11158
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11138
11159
  dailyBudget: moneySchema2.optional(),
11139
11160
  lifetimeBudget: moneySchema2.optional(),
11140
11161
  spendCap: moneySchema2.optional(),
11141
- start_time: z12.number().int().positive().optional(),
11142
- stop_time: z12.number().int().positive().optional()
11162
+ start_time: z13.number().int().positive().optional(),
11163
+ stop_time: z13.number().int().positive().optional()
11143
11164
  }).superRefine((p, ctx) => {
11144
11165
  if (p.dailyBudget && p.lifetimeBudget) {
11145
11166
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11149,15 +11170,15 @@ var campaignCreateSchema3 = z12.object({
11149
11170
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11150
11171
  }
11151
11172
  });
11152
- var campaignUpdateSchema3 = z12.object({
11153
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11173
+ var campaignUpdateSchema3 = z13.object({
11174
+ name: z13.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11154
11175
  status: updateStatusSchema.optional(),
11155
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11176
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11156
11177
  dailyBudget: moneySchema2.optional(),
11157
11178
  lifetimeBudget: moneySchema2.optional(),
11158
11179
  spendCap: moneySchema2.optional(),
11159
- start_time: z12.number().int().positive().optional(),
11160
- stop_time: z12.number().int().positive().optional()
11180
+ start_time: z13.number().int().positive().optional(),
11181
+ stop_time: z13.number().int().positive().optional()
11161
11182
  }).superRefine((p, ctx) => {
11162
11183
  if (!Object.values(p).some((val) => val !== void 0)) {
11163
11184
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11167,38 +11188,38 @@ var campaignUpdateSchema3 = z12.object({
11167
11188
  }
11168
11189
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11169
11190
  });
11170
- var promotedObjectSchema = z12.object({
11191
+ var promotedObjectSchema = z13.object({
11171
11192
  page_id: parentRefSchema2.optional(),
11172
- pixel_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11173
- custom_event_type: z12.enum(CUSTOM_EVENT_TYPES).optional(),
11174
- application_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11175
- object_store_url: z12.string().url().optional(),
11176
- product_catalog_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11177
- product_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11178
- whatsapp_phone_number: z12.string().optional(),
11179
- offline_conversion_data_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional()
11193
+ pixel_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11194
+ custom_event_type: z13.enum(CUSTOM_EVENT_TYPES).optional(),
11195
+ application_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11196
+ object_store_url: z13.string().url().optional(),
11197
+ product_catalog_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11198
+ product_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11199
+ whatsapp_phone_number: z13.string().optional(),
11200
+ offline_conversion_data_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional()
11180
11201
  }).partial();
11181
- var attributionSpecSchema = z12.array(
11182
- z12.object({
11183
- event_type: z12.enum(ATTRIBUTION_EVENT_TYPES),
11184
- window_days: z12.union([z12.literal(1), z12.literal(7), z12.literal(28)])
11202
+ var attributionSpecSchema = z13.array(
11203
+ z13.object({
11204
+ event_type: z13.enum(ATTRIBUTION_EVENT_TYPES),
11205
+ window_days: z13.union([z13.literal(1), z13.literal(7), z13.literal(28)])
11185
11206
  })
11186
11207
  );
11187
11208
  var adSetFields = {
11188
- name: z12.string().min(1).max(META_LIMITS.adSet.nameMax),
11209
+ name: z13.string().min(1).max(META_LIMITS.adSet.nameMax),
11189
11210
  campaign_id: parentRefSchema2,
11190
11211
  status: stageableStatusSchema3.default("PAUSED"),
11191
11212
  dailyBudget: moneySchema2.optional(),
11192
11213
  lifetimeBudget: moneySchema2.optional(),
11193
11214
  bidAmount: moneySchema2.optional(),
11194
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11195
- billing_event: z12.enum(BILLING_EVENTS),
11196
- optimization_goal: z12.enum(OPTIMIZATION_GOALS),
11197
- destination_type: z12.enum(DESTINATION_TYPES).optional(),
11215
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11216
+ billing_event: z13.enum(BILLING_EVENTS),
11217
+ optimization_goal: z13.enum(OPTIMIZATION_GOALS),
11218
+ destination_type: z13.enum(DESTINATION_TYPES).optional(),
11198
11219
  promoted_object: promotedObjectSchema.optional(),
11199
11220
  attribution_spec: attributionSpecSchema.optional(),
11200
- start_time: z12.number().int().positive().optional(),
11201
- end_time: z12.number().int().positive().optional(),
11221
+ start_time: z13.number().int().positive().optional(),
11222
+ end_time: z13.number().int().positive().optional(),
11202
11223
  targeting: metaTargetingSchema
11203
11224
  };
11204
11225
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11216,22 +11237,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11216
11237
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11217
11238
  }
11218
11239
  }
11219
- var adSetCreateSchema = z12.object(adSetFields).superRefine((p, ctx) => {
11240
+ var adSetCreateSchema = z13.object(adSetFields).superRefine((p, ctx) => {
11220
11241
  validateAdSetBudgetAndBid(p, ctx);
11221
11242
  });
11222
- var adSetUpdateSchema = z12.object({
11243
+ var adSetUpdateSchema = z13.object({
11223
11244
  name: adSetFields.name.optional(),
11224
11245
  status: updateStatusSchema.optional(),
11225
11246
  dailyBudget: moneySchema2.optional(),
11226
11247
  lifetimeBudget: moneySchema2.optional(),
11227
11248
  bidAmount: moneySchema2.optional(),
11228
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11229
- optimization_goal: z12.enum(OPTIMIZATION_GOALS).optional(),
11230
- destination_type: z12.enum(DESTINATION_TYPES).optional(),
11249
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11250
+ optimization_goal: z13.enum(OPTIMIZATION_GOALS).optional(),
11251
+ destination_type: z13.enum(DESTINATION_TYPES).optional(),
11231
11252
  promoted_object: promotedObjectSchema.optional(),
11232
11253
  attribution_spec: attributionSpecSchema.optional(),
11233
- start_time: z12.number().int().positive().optional(),
11234
- end_time: z12.number().int().positive().optional(),
11254
+ start_time: z13.number().int().positive().optional(),
11255
+ end_time: z13.number().int().positive().optional(),
11235
11256
  targeting: metaTargetingSchema.optional()
11236
11257
  }).superRefine((p, ctx) => {
11237
11258
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11239,38 +11260,38 @@ var adSetUpdateSchema = z12.object({
11239
11260
  }
11240
11261
  validateAdSetBudgetAndBid(p, ctx);
11241
11262
  });
11242
- var messageSchema = z12.string().min(1).max(META_LIMITS.creative.messageHardMax);
11243
- var headlineSchema2 = z12.string().min(1).max(META_LIMITS.creative.headlineMax);
11244
- var descriptionSchema = z12.string().min(1).max(META_LIMITS.creative.descriptionMax);
11245
- var callToActionSchema = z12.object({
11246
- type: z12.enum(CTA_TYPES2),
11263
+ var messageSchema = z13.string().min(1).max(META_LIMITS.creative.messageHardMax);
11264
+ var headlineSchema2 = z13.string().min(1).max(META_LIMITS.creative.headlineMax);
11265
+ var descriptionSchema = z13.string().min(1).max(META_LIMITS.creative.descriptionMax);
11266
+ var callToActionSchema = z13.object({
11267
+ type: z13.enum(CTA_TYPES2),
11247
11268
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11248
11269
  link: httpsUrlSchema3.optional()
11249
11270
  });
11250
- var creativeEnhancementsSchema = z12.object({
11251
- standardEnhancements: z12.enum(ENROLL_STATUSES).optional(),
11252
- features: z12.record(z12.string(), z12.enum(ENROLL_STATUSES)).optional()
11271
+ var creativeEnhancementsSchema = z13.object({
11272
+ standardEnhancements: z13.enum(ENROLL_STATUSES).optional(),
11273
+ features: z13.record(z13.string(), z13.enum(ENROLL_STATUSES)).optional()
11253
11274
  });
11254
11275
  var creativeSharedFields = {
11255
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11276
+ name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11256
11277
  /** Facebook Page id backing the ad's identity. */
11257
11278
  page_id: parentRefSchema2,
11258
11279
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11259
- instagram_user_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11280
+ instagram_user_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11260
11281
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11261
- url_tags: z12.string().max(1e3).optional(),
11282
+ url_tags: z13.string().max(1e3).optional(),
11262
11283
  enhancements: creativeEnhancementsSchema.optional()
11263
11284
  };
11264
11285
  var imageMediaFields = {
11265
- imageHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11286
+ imageHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11266
11287
  imageRef: tempRefSchema3.optional()
11267
11288
  };
11268
11289
  var videoMediaFields = {
11269
- videoId: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11290
+ videoId: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11270
11291
  videoRef: tempRefSchema3.optional(),
11271
11292
  /** Thumbnail for a video creative — image hash, ref, or public url. */
11272
- thumbnailHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11273
- imageUrl: z12.string().url().optional()
11293
+ thumbnailHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11294
+ imageUrl: z13.string().url().optional()
11274
11295
  };
11275
11296
  function countImageRefs(p) {
11276
11297
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11278,8 +11299,8 @@ function countImageRefs(p) {
11278
11299
  function countVideoRefs(p) {
11279
11300
  return [p.videoId, p.videoRef].filter(Boolean).length;
11280
11301
  }
11281
- var singleCreativeSchema = z12.object({
11282
- creativeType: z12.literal("single"),
11302
+ var singleCreativeSchema = z13.object({
11303
+ creativeType: z13.literal("single"),
11283
11304
  ...creativeSharedFields,
11284
11305
  /** Primary text. */
11285
11306
  message: messageSchema,
@@ -11288,7 +11309,7 @@ var singleCreativeSchema = z12.object({
11288
11309
  headline: headlineSchema2.optional(),
11289
11310
  description: descriptionSchema.optional(),
11290
11311
  /** Display URL / caption shown under the headline. */
11291
- caption: z12.string().max(255).optional(),
11312
+ caption: z13.string().max(255).optional(),
11292
11313
  call_to_action: callToActionSchema.optional(),
11293
11314
  ...imageMediaFields,
11294
11315
  ...videoMediaFields
@@ -11312,10 +11333,10 @@ var singleCreativeSchema = z12.object({
11312
11333
  });
11313
11334
  }
11314
11335
  });
11315
- var carouselCardSchema = z12.object({
11336
+ var carouselCardSchema = z13.object({
11316
11337
  link: httpsUrlSchema3,
11317
- headline: z12.string().max(META_LIMITS.creative.headlineMax).optional(),
11318
- description: z12.string().max(META_LIMITS.creative.descriptionMax).optional(),
11338
+ headline: z13.string().max(META_LIMITS.creative.headlineMax).optional(),
11339
+ description: z13.string().max(META_LIMITS.creative.descriptionMax).optional(),
11319
11340
  call_to_action: callToActionSchema.optional(),
11320
11341
  ...imageMediaFields,
11321
11342
  ...videoMediaFields
@@ -11335,35 +11356,35 @@ var carouselCardSchema = z12.object({
11335
11356
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11336
11357
  }
11337
11358
  });
11338
- var carouselCreativeSchema2 = z12.object({
11339
- creativeType: z12.literal("carousel"),
11359
+ var carouselCreativeSchema2 = z13.object({
11360
+ creativeType: z13.literal("carousel"),
11340
11361
  ...creativeSharedFields,
11341
11362
  message: messageSchema,
11342
11363
  /** Optional "see more" card destination applied when a card has no own link. */
11343
11364
  link: httpsUrlSchema3.optional(),
11344
11365
  call_to_action: callToActionSchema.optional(),
11345
- cards: z12.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11366
+ cards: z13.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11346
11367
  });
11347
- var dynamicImageSchema = z12.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11348
- var dynamicVideoSchema = z12.object({
11368
+ var dynamicImageSchema = z13.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11369
+ var dynamicVideoSchema = z13.object({
11349
11370
  videoId: videoMediaFields.videoId,
11350
11371
  videoRef: videoMediaFields.videoRef,
11351
11372
  thumbnailHash: videoMediaFields.thumbnailHash
11352
11373
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11353
11374
  var DYN = META_LIMITS.creative;
11354
- var dynamicCreativeSchema = z12.object({
11355
- creativeType: z12.literal("dynamic"),
11375
+ var dynamicCreativeSchema = z13.object({
11376
+ creativeType: z13.literal("dynamic"),
11356
11377
  ...creativeSharedFields,
11357
- bodies: z12.array(z12.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11358
- titles: z12.array(z12.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11359
- descriptions: z12.array(z12.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11360
- images: z12.array(dynamicImageSchema).optional(),
11361
- videos: z12.array(dynamicVideoSchema).optional(),
11362
- ad_formats: z12.array(z12.enum(AD_FORMATS2)).min(1),
11363
- call_to_action_types: z12.array(z12.enum(CTA_TYPES2)).optional(),
11364
- link_urls: z12.array(z12.object({ website_url: httpsUrlSchema3, display_url: z12.string().optional() })).min(1),
11378
+ bodies: z13.array(z13.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11379
+ titles: z13.array(z13.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11380
+ descriptions: z13.array(z13.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11381
+ images: z13.array(dynamicImageSchema).optional(),
11382
+ videos: z13.array(dynamicVideoSchema).optional(),
11383
+ ad_formats: z13.array(z13.enum(AD_FORMATS2)).min(1),
11384
+ call_to_action_types: z13.array(z13.enum(CTA_TYPES2)).optional(),
11385
+ link_urls: z13.array(z13.object({ website_url: httpsUrlSchema3, display_url: z13.string().optional() })).min(1),
11365
11386
  /** Multi-language / placement customization — structural passthrough for v1. */
11366
- asset_customization_rules: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11387
+ asset_customization_rules: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11367
11388
  }).superRefine((p, ctx) => {
11368
11389
  if (!(p.images?.length || p.videos?.length)) {
11369
11390
  ctx.addIssue({
@@ -11373,57 +11394,57 @@ var dynamicCreativeSchema = z12.object({
11373
11394
  });
11374
11395
  }
11375
11396
  });
11376
- var existingPostCreativeSchema = z12.object({
11377
- creativeType: z12.literal("existing_post"),
11397
+ var existingPostCreativeSchema = z13.object({
11398
+ creativeType: z13.literal("existing_post"),
11378
11399
  name: creativeSharedFields.name,
11379
11400
  /** "<page_id>_<post_id>" object story id of the post to promote. */
11380
- object_story_id: z12.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11401
+ object_story_id: z13.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11381
11402
  instagram_user_id: creativeSharedFields.instagram_user_id,
11382
11403
  url_tags: creativeSharedFields.url_tags,
11383
11404
  enhancements: creativeSharedFields.enhancements
11384
11405
  });
11385
- var creativeContentSchema2 = z12.discriminatedUnion("creativeType", [
11406
+ var creativeContentSchema2 = z13.discriminatedUnion("creativeType", [
11386
11407
  singleCreativeSchema,
11387
11408
  carouselCreativeSchema2,
11388
11409
  dynamicCreativeSchema,
11389
11410
  existingPostCreativeSchema
11390
11411
  ]);
11391
11412
  var adCreativeCreateSchema = creativeContentSchema2;
11392
- var adCreativeUpdateSchema = z12.object({
11393
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11413
+ var adCreativeUpdateSchema = z13.object({
11414
+ name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11394
11415
  status: updateStatusSchema.optional(),
11395
11416
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11396
- content: z12.record(z12.string(), z12.unknown()).optional()
11417
+ content: z13.record(z13.string(), z13.unknown()).optional()
11397
11418
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11398
- var adCreateSchema2 = z12.object({
11399
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax),
11419
+ var adCreateSchema2 = z13.object({
11420
+ name: z13.string().min(1).max(META_LIMITS.ad.nameMax),
11400
11421
  adset_id: parentRefSchema2,
11401
11422
  status: stageableStatusSchema3.default("PAUSED"),
11402
- creative: z12.object({ creative_id: parentRefSchema2 }),
11423
+ creative: z13.object({ creative_id: parentRefSchema2 }),
11403
11424
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11404
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11425
+ tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11405
11426
  });
11406
- var adUpdateSchema2 = z12.object({
11407
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11427
+ var adUpdateSchema2 = z13.object({
11428
+ name: z13.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11408
11429
  status: updateStatusSchema.optional(),
11409
11430
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
11410
- creative: z12.object({ creative_id: parentRefSchema2 }).optional(),
11411
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11431
+ creative: z13.object({ creative_id: parentRefSchema2 }).optional(),
11432
+ tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11412
11433
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11413
- var lookalikeSpecSchema = z12.object({
11414
- origin: z12.array(z12.object({ id: parentRefSchema2 })).min(1),
11415
- ratio: z12.number().min(0.01).max(0.2).optional(),
11416
- country: z12.string().length(2).optional()
11417
- });
11418
- var customAudienceCreateSchema = z12.object({
11419
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax),
11420
- subtype: z12.enum(CUSTOM_AUDIENCE_SUBTYPES),
11421
- description: z12.string().max(500).optional(),
11422
- customer_file_source: z12.string().optional(),
11423
- retention_days: z12.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11434
+ var lookalikeSpecSchema = z13.object({
11435
+ origin: z13.array(z13.object({ id: parentRefSchema2 })).min(1),
11436
+ ratio: z13.number().min(0.01).max(0.2).optional(),
11437
+ country: z13.string().length(2).optional()
11438
+ });
11439
+ var customAudienceCreateSchema = z13.object({
11440
+ name: z13.string().min(1).max(META_LIMITS.audience.nameMax),
11441
+ subtype: z13.enum(CUSTOM_AUDIENCE_SUBTYPES),
11442
+ description: z13.string().max(500).optional(),
11443
+ customer_file_source: z13.string().optional(),
11444
+ retention_days: z13.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11424
11445
  lookalike_spec: lookalikeSpecSchema.optional(),
11425
11446
  /** Website/engagement rule — structural passthrough validated by Meta. */
11426
- rule: z12.record(z12.string(), z12.unknown()).optional()
11447
+ rule: z13.record(z13.string(), z13.unknown()).optional()
11427
11448
  }).superRefine((p, ctx) => {
11428
11449
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11429
11450
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11432,16 +11453,16 @@ var customAudienceCreateSchema = z12.object({
11432
11453
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11433
11454
  }
11434
11455
  });
11435
- var customAudienceUpdateSchema = z12.object({
11436
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11437
- description: z12.string().max(500).optional()
11456
+ var customAudienceUpdateSchema = z13.object({
11457
+ name: z13.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11458
+ description: z13.string().max(500).optional()
11438
11459
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11439
- var mediaUploadSchema = z12.object({
11440
- kind: z12.enum(MEDIA_KINDS),
11460
+ var mediaUploadSchema = z13.object({
11461
+ kind: z13.enum(MEDIA_KINDS),
11441
11462
  bakerImageId: bakerMediaIdSchema2.optional(),
11442
11463
  bakerVideoId: bakerMediaIdSchema2.optional(),
11443
11464
  /** Optional display name / filename hint. */
11444
- name: z12.string().max(255).optional()
11465
+ name: z13.string().max(255).optional()
11445
11466
  }).superRefine((p, ctx) => {
11446
11467
  if (p.kind === "image" && !p.bakerImageId) {
11447
11468
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11463,16 +11484,16 @@ var META_DRAFT_OP_KINDS = [
11463
11484
  "customAudience.update",
11464
11485
  "media.upload"
11465
11486
  ];
11466
- var metaDraftOpKindSchema = z12.enum(META_DRAFT_OP_KINDS);
11467
- var accountIdSchema2 = z12.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11468
- var updateTargetSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11487
+ var metaDraftOpKindSchema = z13.enum(META_DRAFT_OP_KINDS);
11488
+ var accountIdSchema2 = z13.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11489
+ var updateTargetSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11469
11490
  function createOp3(kind, payload) {
11470
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, payload });
11491
+ return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, payload });
11471
11492
  }
11472
11493
  function updateOp3(kind, payload) {
11473
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11494
+ return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11474
11495
  }
11475
- var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11496
+ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11476
11497
  createOp3("campaign.create", campaignCreateSchema3),
11477
11498
  updateOp3("campaign.update", campaignUpdateSchema3),
11478
11499
  createOp3("adSet.create", adSetCreateSchema),
@@ -11487,89 +11508,89 @@ var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11487
11508
  ]);
11488
11509
 
11489
11510
  // ../api/src/ads-meta/wire.ts
11490
- import { z as z13 } from "zod";
11491
- var metaWriteModeSchema = z13.enum(["live", "simulated"]);
11492
- var metaDraftOpResultSchema = z13.object({
11493
- status: z13.enum(["applied", "simulated", "failed", "skipped"]),
11511
+ import { z as z14 } from "zod";
11512
+ var metaWriteModeSchema = z14.enum(["live", "simulated"]);
11513
+ var metaDraftOpResultSchema = z14.object({
11514
+ status: z14.enum(["applied", "simulated", "failed", "skipped"]),
11494
11515
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11495
- id: z13.string().optional(),
11516
+ id: z14.string().optional(),
11496
11517
  /** For media.upload ops: the resulting image hash. */
11497
- hash: z13.string().optional(),
11498
- error: z13.string().optional(),
11499
- skippedBecause: z13.string().optional(),
11500
- executedAt: z13.number().optional()
11518
+ hash: z14.string().optional(),
11519
+ error: z14.string().optional(),
11520
+ skippedBecause: z14.string().optional(),
11521
+ executedAt: z14.number().optional()
11501
11522
  });
11502
- var metaDraftStageRequestSchema = z13.object({
11503
- chatId: z13.string(),
11523
+ var metaDraftStageRequestSchema = z14.object({
11524
+ chatId: z14.string(),
11504
11525
  op: metaDraftOpInputSchema
11505
11526
  });
11506
- var metaDraftStageResponseSchema = z13.object({
11507
- staged: z13.literal(true),
11508
- ref: z13.string(),
11527
+ var metaDraftStageResponseSchema = z14.object({
11528
+ staged: z14.literal(true),
11529
+ ref: z14.string(),
11509
11530
  kind: metaDraftOpKindSchema,
11510
11531
  mode: metaWriteModeSchema,
11511
- dependsOn: z13.array(z13.string()),
11512
- summary: z13.string(),
11513
- warnings: z13.array(z13.string()),
11532
+ dependsOn: z14.array(z14.string()),
11533
+ summary: z14.string(),
11534
+ warnings: z14.array(z14.string()),
11514
11535
  /** True when the op amended an already-staged op in place instead of appending a new one. */
11515
- amended: z13.boolean().optional()
11516
- });
11517
- var metaDraftDuplicateRequestSchema = z13.object({
11518
- chatId: z13.string(),
11519
- accountId: z13.string(),
11520
- entity: z13.enum(["campaign", "adSet", "ad"]),
11521
- sourceId: z13.string(),
11522
- overrides: z13.record(z13.string(), z13.unknown()).optional(),
11536
+ amended: z14.boolean().optional()
11537
+ });
11538
+ var metaDraftDuplicateRequestSchema = z14.object({
11539
+ chatId: z14.string(),
11540
+ accountId: z14.string(),
11541
+ entity: z14.enum(["campaign", "adSet", "ad"]),
11542
+ sourceId: z14.string(),
11543
+ overrides: z14.record(z14.string(), z14.unknown()).optional(),
11523
11544
  /** Pause the original after the copy publishes. */
11524
- replace: z13.boolean().optional()
11545
+ replace: z14.boolean().optional()
11525
11546
  });
11526
- var metaDraftOpViewSchema = z13.object({
11527
- ref: z13.string(),
11547
+ var metaDraftOpViewSchema = z14.object({
11548
+ ref: z14.string(),
11528
11549
  kind: metaDraftOpKindSchema,
11529
- accountId: z13.string(),
11530
- target: z13.string().optional(),
11531
- dependsOn: z13.array(z13.string()),
11532
- summary: z13.string(),
11533
- stagedAt: z13.number(),
11550
+ accountId: z14.string(),
11551
+ target: z14.string().optional(),
11552
+ dependsOn: z14.array(z14.string()),
11553
+ summary: z14.string(),
11554
+ stagedAt: z14.number(),
11534
11555
  result: metaDraftOpResultSchema.optional()
11535
11556
  });
11536
- var metaDraftListRequestSchema = z13.object({
11537
- chatId: z13.string()
11557
+ var metaDraftListRequestSchema = z14.object({
11558
+ chatId: z14.string()
11538
11559
  });
11539
- var metaDraftAdvisorySchema = z13.object({
11540
- ref: z13.string(),
11541
- message: z13.string()
11560
+ var metaDraftAdvisorySchema = z14.object({
11561
+ ref: z14.string(),
11562
+ message: z14.string()
11542
11563
  });
11543
- var metaDraftListResponseSchema = z13.object({
11544
- status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
11564
+ var metaDraftListResponseSchema = z14.object({
11565
+ status: z14.enum(["active", "publishing", "applied", "discarded", "none"]),
11545
11566
  mode: metaWriteModeSchema,
11546
- count: z13.number(),
11547
- ops: z13.array(metaDraftOpViewSchema),
11567
+ count: z14.number(),
11568
+ ops: z14.array(metaDraftOpViewSchema),
11548
11569
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11549
- advisories: z13.array(metaDraftAdvisorySchema)
11570
+ advisories: z14.array(metaDraftAdvisorySchema)
11550
11571
  });
11551
- var metaDraftRemoveRequestSchema = z13.object({
11552
- chatId: z13.string(),
11553
- ref: z13.string()
11572
+ var metaDraftRemoveRequestSchema = z14.object({
11573
+ chatId: z14.string(),
11574
+ ref: z14.string()
11554
11575
  });
11555
- var metaDraftRemoveResponseSchema = z13.object({
11576
+ var metaDraftRemoveResponseSchema = z14.object({
11556
11577
  /** The requested ref plus any dependents removed by cascade. */
11557
- removed: z13.array(z13.string())
11578
+ removed: z14.array(z14.string())
11558
11579
  });
11559
- var metaDraftClearRequestSchema = z13.object({
11560
- chatId: z13.string()
11580
+ var metaDraftClearRequestSchema = z14.object({
11581
+ chatId: z14.string()
11561
11582
  });
11562
- var metaDraftClearResponseSchema = z13.object({
11563
- cleared: z13.number()
11583
+ var metaDraftClearResponseSchema = z14.object({
11584
+ cleared: z14.number()
11564
11585
  });
11565
- var metaFieldErrorSchema = z13.object({
11566
- path: z13.string(),
11567
- message: z13.string()
11586
+ var metaFieldErrorSchema = z14.object({
11587
+ path: z14.string(),
11588
+ message: z14.string()
11568
11589
  });
11569
- var metaDraftErrorResponseSchema = z13.object({
11570
- code: z13.string(),
11571
- error: z13.string(),
11572
- fields: z13.array(metaFieldErrorSchema).optional()
11590
+ var metaDraftErrorResponseSchema = z14.object({
11591
+ code: z14.string(),
11592
+ error: z14.string(),
11593
+ fields: z14.array(metaFieldErrorSchema).optional()
11573
11594
  });
11574
11595
 
11575
11596
  // src/commands/ads/meta/write-shared.ts
@@ -14523,12 +14544,168 @@ Examples:
14523
14544
  }
14524
14545
  });
14525
14546
 
14547
+ // src/commands/analytics/index.ts
14548
+ import { defineCommand as defineCommand85 } from "citty";
14549
+
14550
+ // src/commands/winning-ads/shared.ts
14551
+ function splitList(value) {
14552
+ if (!value) {
14553
+ return [];
14554
+ }
14555
+ return value.split(",").map((v) => v.trim()).filter(Boolean);
14556
+ }
14557
+ function reportError(err) {
14558
+ if (err instanceof ApiError) {
14559
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
14560
+ process.exit(1);
14561
+ }
14562
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
14563
+ process.exit(1);
14564
+ }
14565
+
14566
+ // src/commands/analytics/index.ts
14567
+ var PERIODS = "today|7d|28d|90d";
14568
+ var NO_TRAFFIC_HINT = "No visits recorded in this window. Analytics counts real visitors on published pages only \u2014 previews, bots, and pre-consent traffic are excluded.";
14569
+ function rowsEmpty(response) {
14570
+ return response.rows.length === 0 || response.rows.every((row) => Object.values(row).every((v) => v === 0 || v === "" || v === null));
14571
+ }
14572
+ var OVERVIEW_SPEC = {
14573
+ report: "overview",
14574
+ description: "Headline traffic numbers: pageviews, unique visitors, sessions, form submits. Start here. Example: baker analytics overview --period 7d",
14575
+ hasLimit: false,
14576
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : [
14577
+ "Drill down: `baker analytics pages` (top pages), `baker analytics sources` (where visitors come from), `baker analytics timeseries` (daily trend)."
14578
+ ]
14579
+ };
14580
+ var REPORTS = [
14581
+ OVERVIEW_SPEC,
14582
+ {
14583
+ report: "timeseries",
14584
+ description: "Daily pageviews, visitors, and form submits \u2014 spot trends and campaign spikes. Example: baker analytics timeseries --period 28d --output md",
14585
+ hasLimit: false,
14586
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : []
14587
+ },
14588
+ {
14589
+ report: "pages",
14590
+ description: "Top pages by pageviews, with visitors and form submits per page \u2014 find what converts. Example: baker analytics pages --period 28d --limit 20",
14591
+ hasLimit: true,
14592
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : [
14593
+ "A page with high pageviews but zero form_submits is a conversion-rate candidate \u2014 audit it with the landing skill."
14594
+ ]
14595
+ },
14596
+ {
14597
+ report: "sources",
14598
+ description: "Top traffic sources (utm_source, else referrer domain, else direct) with visitors and form submits. Example: baker analytics sources --period 28d",
14599
+ hasLimit: true,
14600
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : []
14601
+ },
14602
+ {
14603
+ report: "events",
14604
+ description: "Non-pageview events (form_submit + custom events) with totals, sessions, and visitors. Example: baker analytics events --period 90d",
14605
+ hasLimit: true,
14606
+ hints: (response) => rowsEmpty(response) ? [
14607
+ "No events in this window. Forms report `form_submit` automatically on published pages; custom events come from `window.__bakerAnalytics.track(name)`."
14608
+ ] : []
14609
+ }
14610
+ ];
14611
+ function parseLimit(value) {
14612
+ if (!value) return void 0;
14613
+ const limit = Number(value);
14614
+ return Number.isInteger(limit) && limit >= 1 && limit <= 100 ? limit : "invalid";
14615
+ }
14616
+ function parseFields(value) {
14617
+ if (!value) return void 0;
14618
+ const fields = String(value).split(",").map((f) => f.trim()).filter(Boolean);
14619
+ return fields.length > 0 ? fields : void 0;
14620
+ }
14621
+ function buildSubcommand(spec) {
14622
+ registerSchema({
14623
+ command: `analytics.${spec.report}`,
14624
+ description: spec.description,
14625
+ args: {
14626
+ period: { type: "string", description: `Time window: ${PERIODS} (default 28d)`, required: false, default: "28d" },
14627
+ ...spec.hasLimit ? { limit: { type: "number", description: "Max rows 1-100 (default per report)", required: false } } : {},
14628
+ output: { type: "string", description: "Output format: json|files|md", required: false, default: "json" },
14629
+ fields: { type: "string", description: "Comma-separated field names to include", required: false }
14630
+ }
14631
+ });
14632
+ return defineCommand85({
14633
+ meta: { name: spec.report, description: spec.description },
14634
+ args: {
14635
+ period: { type: "string", description: `Time window: ${PERIODS} (default 28d)`, default: "28d" },
14636
+ ...spec.hasLimit ? { limit: { type: "string", description: "Max rows 1-100" } } : {},
14637
+ output: { type: "string", description: "Output format: json|files|md", default: "json" },
14638
+ fields: { type: "string", description: "Comma-separated field names to include" }
14639
+ },
14640
+ run: async ({ args }) => {
14641
+ try {
14642
+ const limit = parseLimit("limit" in args ? args.limit : void 0);
14643
+ if (limit === "invalid") {
14644
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "--limit must be an integer 1-100" } });
14645
+ process.exit(1);
14646
+ }
14647
+ const body = { report: spec.report, period: String(args.period || "28d") };
14648
+ if (limit !== void 0) body.limit = limit;
14649
+ const response = await apiPost("/api/analytics/query", body);
14650
+ const format = args.output || "json";
14651
+ if (format === "json") {
14652
+ writeJson({ ok: true, data: response, meta: { count: response.rows.length }, hints: spec.hints(response) });
14653
+ return;
14654
+ }
14655
+ writeOutput({ ok: true, data: response.rows }, format, parseFields(args.fields), false, (record) => record);
14656
+ } catch (err) {
14657
+ reportError(err);
14658
+ }
14659
+ }
14660
+ });
14661
+ }
14662
+ var subCommands = Object.fromEntries(REPORTS.map((spec) => [spec.report, buildSubcommand(spec)]));
14663
+ var analyticsCommand2 = defineCommand85({
14664
+ meta: {
14665
+ name: "analytics",
14666
+ description: `Read the client's landing-page analytics: first-party pageviews, visitors, sessions, and form submits collected on every published page (no setup needed \u2014 it is always on, consent-aware, and excludes previews/bots).
14667
+
14668
+ Start here: baker analytics overview --period 7d
14669
+
14670
+ Reports:
14671
+ overview headline numbers (pageviews, visitors, sessions, form submits)
14672
+ timeseries daily trend
14673
+ pages top pages (find what converts)
14674
+ sources where visitors come from (utm_source \u2192 referrer \u2192 direct)
14675
+ events form_submit + custom events
14676
+
14677
+ All reports take --period ${PERIODS} (default 28d). List-style reports take --limit. Data is read-only and scoped to this client.
14678
+
14679
+ Examples:
14680
+ baker analytics overview
14681
+ baker analytics pages --period 7d --limit 20 --output md
14682
+ baker analytics sources --period 90d`
14683
+ },
14684
+ subCommands,
14685
+ run: async () => {
14686
+ try {
14687
+ const response = await apiPost("/api/analytics/query", {
14688
+ report: "overview",
14689
+ period: "28d"
14690
+ });
14691
+ writeJson({
14692
+ ok: true,
14693
+ data: response,
14694
+ meta: { count: response.rows.length },
14695
+ hints: OVERVIEW_SPEC.hints(response)
14696
+ });
14697
+ } catch (err) {
14698
+ reportError(err);
14699
+ }
14700
+ }
14701
+ });
14702
+
14526
14703
  // src/commands/canvas/index.ts
14527
- import { defineCommand as defineCommand95 } from "citty";
14704
+ import { defineCommand as defineCommand96 } from "citty";
14528
14705
 
14529
14706
  // src/commands/canvas/catalog.ts
14530
- import { defineCommand as defineCommand85 } from "citty";
14531
- var catalogCommand = defineCommand85({
14707
+ import { defineCommand as defineCommand86 } from "citty";
14708
+ var catalogCommand = defineCommand86({
14532
14709
  meta: {
14533
14710
  name: "catalog",
14534
14711
  description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
@@ -14543,7 +14720,7 @@ var catalogCommand = defineCommand85({
14543
14720
  // src/commands/canvas/critique.ts
14544
14721
  import { readFile } from "fs/promises";
14545
14722
  import path from "path";
14546
- import { defineCommand as defineCommand86 } from "citty";
14723
+ import { defineCommand as defineCommand87 } from "citty";
14547
14724
 
14548
14725
  // src/engine/scaffold/lib/critique.ts
14549
14726
  var VIBE_CUE = /\b(light|lighting|golden|moody|warm|cool|tone|grade|contrast|shadow|glow|rim|backlit|neon|soft)\b/i;
@@ -14663,7 +14840,7 @@ function critiqueCanvas(canvas) {
14663
14840
  }
14664
14841
 
14665
14842
  // src/commands/canvas/critique.ts
14666
- var critiqueCommand = defineCommand86({
14843
+ var critiqueCommand = defineCommand87({
14667
14844
  meta: {
14668
14845
  name: "critique",
14669
14846
  description: "Pre-spend creative critic (ADVISORY \u2014 never blocks). Scores a scaffolded creative BEFORE the billed render, so weak spots get fixed for free. A VIDEO creative is scored on hook strength, sound-off first-frame legibility, retention risk, and mechanism clarity; a STATIC ad on baked-text legibility risk, identity grounding, brand-type fidelity, and mechanism clarity. Ground a video hook against `baker winning-ads hooks` for a proven pattern."
@@ -14705,9 +14882,9 @@ import { execFile } from "child_process";
14705
14882
  import { readdir, readFile as readFile2, stat } from "fs/promises";
14706
14883
  import path2 from "path";
14707
14884
  import { promisify } from "util";
14708
- import { defineCommand as defineCommand87 } from "citty";
14885
+ import { defineCommand as defineCommand88 } from "citty";
14709
14886
  var execFileAsync = promisify(execFile);
14710
- var inspectCommand = defineCommand87({
14887
+ var inspectCommand = defineCommand88({
14711
14888
  meta: {
14712
14889
  name: "inspect",
14713
14890
  description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
@@ -14815,12 +14992,12 @@ async function probeDuration(filePath) {
14815
14992
 
14816
14993
  // src/commands/canvas/rerun.ts
14817
14994
  import path13 from "path";
14818
- import { defineCommand as defineCommand89 } from "citty";
14995
+ import { defineCommand as defineCommand90 } from "citty";
14819
14996
 
14820
14997
  // src/commands/canvas/run.ts
14821
14998
  import { readFile as readFile9 } from "fs/promises";
14822
14999
  import path12 from "path";
14823
- import { defineCommand as defineCommand88 } from "citty";
15000
+ import { defineCommand as defineCommand89 } from "citty";
14824
15001
 
14825
15002
  // src/commands/canvas/placeholders.ts
14826
15003
  function unsuppliedPlaceholderAssets(canvas) {
@@ -14982,7 +15159,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
14982
15159
  import { toCardinal as nwNl } from "n2words/nl-NL";
14983
15160
  import { toCardinal as nwPl } from "n2words/pl-PL";
14984
15161
  import { toCardinal as nwPt } from "n2words/pt-PT";
14985
- import { z as z14 } from "zod";
15162
+ import { z as z15 } from "zod";
14986
15163
 
14987
15164
  // src/engine/scaffold/lib/shoot-modes.ts
14988
15165
  var SHOOT_MODES = [
@@ -15318,71 +15495,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15318
15495
  "{{out.video}}"
15319
15496
  ];
15320
15497
  }
15321
- var FrameAsset = z14.object({ url: z14.string().optional() }).loose().optional();
15322
- var DialogueLine = z14.object({
15323
- speaker: z14.string().optional(),
15324
- line: z14.string().optional(),
15498
+ var FrameAsset = z15.object({ url: z15.string().optional() }).loose().optional();
15499
+ var DialogueLine = z15.object({
15500
+ speaker: z15.string().optional(),
15501
+ line: z15.string().optional(),
15325
15502
  // Absolute seconds on the source timeline (the deconstruct emits both).
15326
- start_s: z14.number().optional(),
15327
- end_s: z14.number().optional(),
15328
- delivery: z14.string().optional(),
15329
- voice_description: z14.string().optional(),
15503
+ start_s: z15.number().optional(),
15504
+ end_s: z15.number().optional(),
15505
+ delivery: z15.string().optional(),
15506
+ voice_description: z15.string().optional(),
15330
15507
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15331
15508
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15332
15509
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15333
15510
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15334
15511
  // the VO path; absent keeps the presence-based decision (old blueprints).
15335
- on_camera: z14.boolean().optional()
15512
+ on_camera: z15.boolean().optional()
15336
15513
  }).loose();
15337
- var Sfx = z14.object({
15338
- at_s: z14.number().optional(),
15339
- duration_s: z14.number().optional(),
15340
- sound_effect_prompt: z14.string().optional(),
15341
- description: z14.string().optional()
15514
+ var Sfx = z15.object({
15515
+ at_s: z15.number().optional(),
15516
+ duration_s: z15.number().optional(),
15517
+ sound_effect_prompt: z15.string().optional(),
15518
+ description: z15.string().optional()
15342
15519
  }).loose();
15343
- var CompositionRegion = z14.object({
15520
+ var CompositionRegion = z15.object({
15344
15521
  // full | top | bottom | left | right | inset
15345
- panel: z14.string().optional(),
15522
+ panel: z15.string().optional(),
15346
15523
  // 9-grid anchor for an `inset` presenter box.
15347
- position: z14.string().optional(),
15348
- is_presenter: z14.boolean().optional(),
15524
+ position: z15.string().optional(),
15525
+ is_presenter: z15.boolean().optional(),
15349
15526
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15350
- cast_ref: z14.string().optional(),
15527
+ cast_ref: z15.string().optional(),
15351
15528
  // What the region's content IS: camera | screen_capture | static_graphic |
15352
15529
  // generated. Authoritative for routing when present (regex-over-prose fallback
15353
15530
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15354
15531
  // overlay layer, never AI-generated.
15355
- kind: z14.string().optional(),
15532
+ kind: z15.string().optional(),
15356
15533
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15357
15534
  // screen_capture region shows. Two scenes share it only when they show the SAME
15358
15535
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15359
15536
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15360
15537
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15361
15538
  // instead of asking the operator for one screenshot that can't cover both.
15362
- surface_id: z14.string().optional(),
15539
+ surface_id: z15.string().optional(),
15363
15540
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15364
15541
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15365
15542
  // must re-composite, not paint into the surface.
15366
- nested: z14.array(z14.object({}).loose()).optional(),
15367
- summary: z14.string().optional(),
15368
- frame_prompt: z14.string().optional(),
15369
- motion_prompt: z14.string().optional()
15543
+ nested: z15.array(z15.object({}).loose()).optional(),
15544
+ summary: z15.string().optional(),
15545
+ frame_prompt: z15.string().optional(),
15546
+ motion_prompt: z15.string().optional()
15370
15547
  }).loose();
15371
- var SceneComposition = z14.object({
15548
+ var SceneComposition = z15.object({
15372
15549
  // full_frame (default) | split_screen | pip | keyed_overlay
15373
- layout: z14.string().optional(),
15550
+ layout: z15.string().optional(),
15374
15551
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15375
- split_axis: z14.string().optional(),
15376
- regions: z14.array(CompositionRegion).optional()
15552
+ split_axis: z15.string().optional(),
15553
+ regions: z15.array(CompositionRegion).optional()
15377
15554
  }).loose();
15378
- var CameraMotion = z14.object({ movement: z14.string().optional(), detail: z14.string().optional() }).loose();
15379
- var TranscriptWord = z14.object({ text: z14.string().optional() }).loose();
15380
- var Scene = z14.object({
15381
- start_s: z14.number().optional(),
15382
- end_s: z14.number().optional(),
15383
- duration_s: z14.number().optional(),
15384
- summary: z14.string().optional(),
15385
- action_detail: z14.string().optional(),
15555
+ var CameraMotion = z15.object({ movement: z15.string().optional(), detail: z15.string().optional() }).loose();
15556
+ var TranscriptWord = z15.object({ text: z15.string().optional() }).loose();
15557
+ var Scene = z15.object({
15558
+ start_s: z15.number().optional(),
15559
+ end_s: z15.number().optional(),
15560
+ duration_s: z15.number().optional(),
15561
+ summary: z15.string().optional(),
15562
+ action_detail: z15.string().optional(),
15386
15563
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15387
15564
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15388
15565
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15390,82 +15567,82 @@ var Scene = z14.object({
15390
15567
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15391
15568
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15392
15569
  // UGC/product mode; a human can override per scene by setting this.
15393
- shoot_mode: z14.string().optional(),
15570
+ shoot_mode: z15.string().optional(),
15394
15571
  // Diegetic ambient the clip's native audio should carry (no music). When
15395
15572
  // absent the scene falls back to its shoot mode's default ambience.
15396
- ambient: z14.string().optional(),
15573
+ ambient: z15.string().optional(),
15397
15574
  camera_motion: CameraMotion.optional(),
15398
- start_frame_prompt: z14.string().optional(),
15399
- end_frame_prompt: z14.string().optional(),
15400
- motion_prompt: z14.string().optional(),
15575
+ start_frame_prompt: z15.string().optional(),
15576
+ end_frame_prompt: z15.string().optional(),
15577
+ motion_prompt: z15.string().optional(),
15401
15578
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15402
15579
  // script re-craft checklist. Inferred from position when absent.
15403
- narrative_role: z14.string().optional(),
15580
+ narrative_role: z15.string().optional(),
15404
15581
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15405
15582
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15406
15583
  // into the hook's start-frame description so the generator renders that state,
15407
15584
  // not a calm influencer (CCA-11).
15408
- hook_mechanic: z14.object({ mechanic: z14.string().optional(), why_it_stops_scroll: z14.string().optional() }).loose().optional(),
15585
+ hook_mechanic: z15.object({ mechanic: z15.string().optional(), why_it_stops_scroll: z15.string().optional() }).loose().optional(),
15409
15586
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15410
- scene_setting: z14.string().optional(),
15587
+ scene_setting: z15.string().optional(),
15411
15588
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15412
15589
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15413
15590
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15414
15591
  // ignored (nothing follows it).
15415
- transition_out: z14.object({ type: z14.string().optional(), description: z14.string().optional() }).loose().optional(),
15416
- dialogue: z14.array(DialogueLine).optional(),
15417
- sfx: z14.array(Sfx).optional(),
15418
- overlays: z14.array(z14.unknown()).optional(),
15419
- floating_elements: z14.array(z14.unknown()).optional(),
15592
+ transition_out: z15.object({ type: z15.string().optional(), description: z15.string().optional() }).loose().optional(),
15593
+ dialogue: z15.array(DialogueLine).optional(),
15594
+ sfx: z15.array(Sfx).optional(),
15595
+ overlays: z15.array(z15.unknown()).optional(),
15596
+ floating_elements: z15.array(z15.unknown()).optional(),
15420
15597
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15421
15598
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15422
15599
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15423
15600
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
15424
- motion_level: z14.enum(["static", "subtle", "dynamic"]).optional(),
15425
- transcript_slice: z14.array(TranscriptWord).optional(),
15601
+ motion_level: z15.enum(["static", "subtle", "dynamic"]).optional(),
15602
+ transcript_slice: z15.array(TranscriptWord).optional(),
15426
15603
  start_frame_asset: FrameAsset,
15427
15604
  end_frame_asset: FrameAsset,
15428
15605
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15429
15606
  // previous one (the SAME physical shot, broken up only because it exceeded the
15430
15607
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15431
15608
  // start frame IS the previous scene's end frame — so the join is seamless.
15432
- continues_previous: z14.boolean().optional()
15609
+ continues_previous: z15.boolean().optional()
15433
15610
  }).loose();
15434
- var VideoBlueprint = z14.object({
15435
- source: z14.object({ aspect_ratio: z14.string().optional(), duration_s: z14.number().optional() }).loose().optional(),
15436
- global: z14.object({
15437
- music: z14.object({
15438
- present: z14.boolean().optional(),
15439
- music_prompt: z14.string().optional(),
15611
+ var VideoBlueprint = z15.object({
15612
+ source: z15.object({ aspect_ratio: z15.string().optional(), duration_s: z15.number().optional() }).loose().optional(),
15613
+ global: z15.object({
15614
+ music: z15.object({
15615
+ present: z15.boolean().optional(),
15616
+ music_prompt: z15.string().optional(),
15440
15617
  // Absolute second the music enters in the reference (the bed often
15441
15618
  // kicks in mid-ad, after the hook). We start the regenerated track here
15442
15619
  // instead of at 0 so the timing matches.
15443
- starts_at_s: z14.number().optional(),
15620
+ starts_at_s: z15.number().optional(),
15444
15621
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15445
15622
  // reference track. We never reuse it — only style the regenerated bed.
15446
- identified_track: z14.object({ title: z14.string().optional(), artist: z14.string().optional() }).loose().nullish()
15623
+ identified_track: z15.object({ title: z15.string().optional(), artist: z15.string().optional() }).loose().nullish()
15447
15624
  }).loose().optional(),
15448
- cast: z14.array(
15449
- z14.object({
15450
- id: z14.string().optional(),
15451
- description: z14.string().optional(),
15625
+ cast: z15.array(
15626
+ z15.object({
15627
+ id: z15.string().optional(),
15628
+ description: z15.string().optional(),
15452
15629
  // The deconstruct's note on the target-market localization (e.g. "native
15453
15630
  // French speaker") — read to derive the spoken-track language code.
15454
- market_localization_note: z14.string().optional()
15631
+ market_localization_note: z15.string().optional()
15455
15632
  }).loose()
15456
15633
  ).optional(),
15457
- voiceover: z14.object({
15634
+ voiceover: z15.object({
15458
15635
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15459
15636
  // voiceover | none → narration over the picture (no lip-sync).
15460
- mode: z14.string().optional(),
15461
- voice_description: z14.string().optional(),
15462
- persona: z14.string().optional()
15637
+ mode: z15.string().optional(),
15638
+ voice_description: z15.string().optional(),
15639
+ persona: z15.string().optional()
15463
15640
  }).loose().optional(),
15464
15641
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15465
15642
  // first hex is the dominant brand colour); never to drive frame generation.
15466
- style: z14.object({ palette: z14.array(z14.object({ hex: z14.string().optional() }).loose()).optional() }).loose().optional()
15643
+ style: z15.object({ palette: z15.array(z15.object({ hex: z15.string().optional() }).loose()).optional() }).loose().optional()
15467
15644
  }).loose().optional(),
15468
- scenes: z14.array(Scene).min(1)
15645
+ scenes: z15.array(Scene).min(1)
15469
15646
  }).loose();
15470
15647
  function injectHookPhysicality(blueprint) {
15471
15648
  for (const scene of blueprint.scenes) {
@@ -15482,26 +15659,26 @@ function clipIntentOf(scene, sceneIndex) {
15482
15659
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
15483
15660
  return "body";
15484
15661
  }
15485
- var AppearsItem = z14.union([z14.number(), z14.object({ scene: z14.number(), edge: z14.string().optional() }).loose()]);
15486
- var RecurringElement = z14.object({
15662
+ var AppearsItem = z15.union([z15.number(), z15.object({ scene: z15.number(), edge: z15.string().optional() }).loose()]);
15663
+ var RecurringElement = z15.object({
15487
15664
  // person | animal | product | logo | badge | other
15488
- type: z14.string(),
15489
- label: z14.string().optional(),
15490
- description: z14.string().optional(),
15491
- expression: z14.string().nullable().optional(),
15665
+ type: z15.string(),
15666
+ label: z15.string().optional(),
15667
+ description: z15.string().optional(),
15668
+ expression: z15.string().nullable().optional(),
15492
15669
  // When the element maps to a global cast entry, its stable id (for annotation).
15493
- cast_id: z14.string().nullable().optional(),
15670
+ cast_id: z15.string().nullable().optional(),
15494
15671
  // The label of another element that is the SAME individual as this one, shown
15495
15672
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15496
15673
  // pink shirt and believer in a white shirt). Each look gets its own reference
15497
15674
  // slot, but the face/identity must stay identical across them.
15498
- same_as: z14.string().nullable().optional(),
15675
+ same_as: z15.string().nullable().optional(),
15499
15676
  // Scenes the element appears in. Either a bare list of scene indices (both
15500
15677
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
15501
- scenes: z14.array(z14.number()).optional(),
15502
- appears_in: z14.array(AppearsItem).optional()
15678
+ scenes: z15.array(z15.number()).optional(),
15679
+ appears_in: z15.array(AppearsItem).optional()
15503
15680
  }).loose();
15504
- var RecurringElements = z14.array(RecurringElement);
15681
+ var RecurringElements = z15.array(RecurringElement);
15505
15682
  function sanitizeId(raw, fallback) {
15506
15683
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15507
15684
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -15974,7 +16151,7 @@ function scrubFloatSentences(text, floatDescs) {
15974
16151
  return kept;
15975
16152
  }
15976
16153
  function sceneFloatDescs(scene) {
15977
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16154
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
15978
16155
  if (!floats.success) return [];
15979
16156
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
15980
16157
  }
@@ -17398,25 +17575,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
17398
17575
  }
17399
17576
  return tracks;
17400
17577
  }
17401
- var OverlayStyle = z14.object({ color_hex: z14.string().optional(), background: z14.string().optional(), size: z14.string().optional() }).loose();
17402
- var Overlay = z14.object({
17403
- text: z14.string().optional(),
17404
- appears_at_s: z14.number().optional(),
17405
- duration_s: z14.number().optional(),
17406
- position: z14.string().optional(),
17407
- role: z14.string().optional(),
17408
- animation: z14.string().optional(),
17409
- animation_detail: z14.string().optional(),
17578
+ var OverlayStyle = z15.object({ color_hex: z15.string().optional(), background: z15.string().optional(), size: z15.string().optional() }).loose();
17579
+ var Overlay = z15.object({
17580
+ text: z15.string().optional(),
17581
+ appears_at_s: z15.number().optional(),
17582
+ duration_s: z15.number().optional(),
17583
+ position: z15.string().optional(),
17584
+ role: z15.string().optional(),
17585
+ animation: z15.string().optional(),
17586
+ animation_detail: z15.string().optional(),
17410
17587
  style: OverlayStyle.optional()
17411
17588
  }).loose();
17412
- var FloatingElement = z14.object({
17413
- kind: z14.string().optional(),
17414
- description: z14.string().optional(),
17415
- brand_name: z14.string().nullish(),
17416
- what_it_represents: z14.string().optional(),
17417
- appears_at_s: z14.number().optional(),
17418
- duration_s: z14.number().optional(),
17419
- position: z14.string().optional()
17589
+ var FloatingElement = z15.object({
17590
+ kind: z15.string().optional(),
17591
+ description: z15.string().optional(),
17592
+ brand_name: z15.string().nullish(),
17593
+ what_it_represents: z15.string().optional(),
17594
+ appears_at_s: z15.number().optional(),
17595
+ duration_s: z15.number().optional(),
17596
+ position: z15.string().optional()
17420
17597
  }).loose();
17421
17598
  function escapeHtml(s) {
17422
17599
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17448,7 +17625,7 @@ function positionClass(position) {
17448
17625
  function collectCaptions(blueprint, clock) {
17449
17626
  return blueprint.scenes.flatMap((scene, i) => {
17450
17627
  const sceneStart = scene.start_s ?? 0;
17451
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17628
+ const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
17452
17629
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17453
17630
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
17454
17631
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17528,7 +17705,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
17528
17705
  const windows = /* @__PURE__ */ new Map();
17529
17706
  blueprint.scenes.forEach((scene, i) => {
17530
17707
  const sceneStart = scene.start_s ?? 0;
17531
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17708
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17532
17709
  if (!floats.success) return;
17533
17710
  for (const fe of floats.data) {
17534
17711
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -17976,8 +18153,8 @@ function buildMotionBoard(blueprint) {
17976
18153
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
17977
18154
  cursor = end_s;
17978
18155
  const spoken = sceneSpokenText(scene);
17979
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17980
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18156
+ const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
18157
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17981
18158
  const graphics = [
17982
18159
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
17983
18160
  kind: "text",
@@ -18943,7 +19120,7 @@ async function restoreRunSnapshot(manifest, targetDir, opts = {}) {
18943
19120
  }
18944
19121
 
18945
19122
  // src/commands/canvas/run.ts
18946
- var runCommand = defineCommand88({
19123
+ var runCommand = defineCommand89({
18947
19124
  meta: { name: "run", description: "Validate and execute a canvas JSON file." },
18948
19125
  args: {
18949
19126
  file: { type: "positional", required: true, description: "Path to canvas JSON" },
@@ -19309,7 +19486,7 @@ async function postInitialRunRecord(client, payload) {
19309
19486
 
19310
19487
  // src/commands/canvas/rerun.ts
19311
19488
  var SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
19312
- var rerunCommand = defineCommand89({
19489
+ var rerunCommand = defineCommand90({
19313
19490
  meta: {
19314
19491
  name: "rerun",
19315
19492
  description: "Re-run a creative's latest recorded canvas. Restores its definition files from run history first, so it works in a fresh workspace that never had the source chat's files \u2014 an interrupted run resumes (in-flight jobs re-attach), a completed one re-renders from the cache."
@@ -19406,10 +19583,10 @@ async function fetchManifest(url) {
19406
19583
  // src/commands/canvas/scaffold-static-ad.ts
19407
19584
  import { access, mkdir as mkdir5, readFile as readFile11, writeFile as writeFile6 } from "fs/promises";
19408
19585
  import path17 from "path";
19409
- import { defineCommand as defineCommand91 } from "citty";
19586
+ import { defineCommand as defineCommand92 } from "citty";
19410
19587
 
19411
19588
  // src/engine/scaffold/staticAd.ts
19412
- import { z as z15 } from "zod";
19589
+ import { z as z16 } from "zod";
19413
19590
  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"]);
19414
19591
  var DEFAULT_ASPECT_RATIO = "9:16";
19415
19592
  var SHEET_SUBJECT_TYPE2 = {
@@ -19418,24 +19595,24 @@ var SHEET_SUBJECT_TYPE2 = {
19418
19595
  };
19419
19596
  var ACTOR_SHEET_MODEL2 = "google/gemini-3-pro-image-preview";
19420
19597
  var ACTOR_SHEET_IMAGE_SIZE = "4K";
19421
- var Blueprint = z15.object({
19422
- meta: z15.object({ estimated_aspect_ratio: z15.string().optional() }).loose().optional(),
19423
- text_content: z15.array(z15.object({ text: z15.string().optional() }).loose()).optional()
19598
+ var Blueprint = z16.object({
19599
+ meta: z16.object({ estimated_aspect_ratio: z16.string().optional() }).loose().optional(),
19600
+ text_content: z16.array(z16.object({ text: z16.string().optional() }).loose()).optional()
19424
19601
  }).loose();
19425
- var ElementLocator = z15.object({
19426
- collection: z15.enum(["subjects", "people", "brands_logos"]),
19427
- index: z15.number().int().nonnegative()
19602
+ var ElementLocator = z16.object({
19603
+ collection: z16.enum(["subjects", "people", "brands_logos"]),
19604
+ index: z16.number().int().nonnegative()
19428
19605
  }).loose();
19429
- var MainElement = z15.object({
19606
+ var MainElement = z16.object({
19430
19607
  // logo | product | person | animal | badge | other
19431
- type: z15.string(),
19432
- label: z15.string().optional(),
19433
- description: z15.string().optional(),
19434
- expression: z15.string().nullable().optional(),
19435
- reason: z15.string().optional(),
19608
+ type: z16.string(),
19609
+ label: z16.string().optional(),
19610
+ description: z16.string().optional(),
19611
+ expression: z16.string().nullable().optional(),
19612
+ reason: z16.string().optional(),
19436
19613
  locator: ElementLocator.optional()
19437
19614
  }).loose();
19438
- var MainElements = z15.array(MainElement);
19615
+ var MainElements = z16.array(MainElement);
19439
19616
  function sanitizeId2(raw, fallback) {
19440
19617
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
19441
19618
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -19712,7 +19889,7 @@ function isValidScaffoldSlug(slug) {
19712
19889
  // src/commands/canvas/sync-definition.ts
19713
19890
  import { readdir as readdir5, readFile as readFile10, stat as stat3 } from "fs/promises";
19714
19891
  import path16 from "path";
19715
- import { defineCommand as defineCommand90 } from "citty";
19892
+ import { defineCommand as defineCommand91 } from "citty";
19716
19893
 
19717
19894
  // src/commands/canvas/definition-graph.ts
19718
19895
  var MAX_NODES = 300;
@@ -19825,7 +20002,7 @@ async function resolveCanvasPath(inputPath) {
19825
20002
  const chosen = (slug ? canvases.find((name) => name === `${slug}.canvas.json`) : void 0) ?? canvases[0];
19826
20003
  return chosen ? path16.join(dir, chosen) : null;
19827
20004
  }
19828
- var syncDefinitionCommand = defineCommand90({
20005
+ var syncDefinitionCommand = defineCommand91({
19829
20006
  meta: {
19830
20007
  name: "sync-definition",
19831
20008
  description: "Push a creative's current node-graph + input thumbnails to the dashboard without rendering. Runs automatically when you edit a creative's canvas.json or prompt.json."
@@ -20034,7 +20211,7 @@ async function runVisionPasses(canvas) {
20034
20211
  return fail2("read_outputs", e instanceof Error ? e.message : String(e));
20035
20212
  }
20036
20213
  }
20037
- var scaffoldStaticAdCommand = defineCommand91({
20214
+ var scaffoldStaticAdCommand = defineCommand92({
20038
20215
  meta: {
20039
20216
  name: "scaffold-static-ad",
20040
20217
  description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. Edit prompt.json and drop the real assets, then `baker canvas run` it."
@@ -20208,7 +20385,7 @@ var scaffoldStaticAdCommand = defineCommand91({
20208
20385
  import { access as access2, cp, mkdir as mkdir6, readFile as readFile14, rm as rm6, writeFile as writeFile7 } from "fs/promises";
20209
20386
  import { tmpdir as tmpdir2 } from "os";
20210
20387
  import path20 from "path";
20211
- import { defineCommand as defineCommand92 } from "citty";
20388
+ import { defineCommand as defineCommand93 } from "citty";
20212
20389
 
20213
20390
  // src/engine/scaffold/lib/model-router.ts
20214
20391
  var SEEDANCE = "bytedance/seedance-2.0";
@@ -20662,7 +20839,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
20662
20839
  return fail3("deconstruct", e instanceof Error ? e.message : String(e));
20663
20840
  }
20664
20841
  }
20665
- var scaffoldVideoCommand = defineCommand92({
20842
+ var scaffoldVideoCommand = defineCommand93({
20666
20843
  meta: {
20667
20844
  name: "scaffold-video",
20668
20845
  description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to a split, editable blueprint: a global prompt.json plus one small scenes/sNN.json per scene) and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit a scene's scenes/sNN.json (or prompt.json for global cast/palette/brand), drop the real source images, then `baker canvas run`."
@@ -20967,7 +21144,7 @@ var scaffoldVideoCommand = defineCommand92({
20967
21144
  // src/commands/canvas/set-prompt.ts
20968
21145
  import { readFile as readFile15, writeFile as writeFile8 } from "fs/promises";
20969
21146
  import path21 from "path";
20970
- import { defineCommand as defineCommand93 } from "citty";
21147
+ import { defineCommand as defineCommand94 } from "citty";
20971
21148
  function setNodePrompt(canvas, nodeId, text) {
20972
21149
  const nodes = canvas?.nodes;
20973
21150
  if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
@@ -20982,7 +21159,7 @@ function setNodePrompt(canvas, nodeId, text) {
20982
21159
  newNodes[idx] = newNode;
20983
21160
  return { ...canvas, nodes: newNodes };
20984
21161
  }
20985
- var setPromptCommand = defineCommand93({
21162
+ var setPromptCommand = defineCommand94({
20986
21163
  meta: {
20987
21164
  name: "set-prompt",
20988
21165
  description: "Safely set a node's params.prompt (a frame description, motion prompt, etc.) without hand-editing the JSON. Prefer --text-file for multi-line/accented copy \u2014 it preserves UTF-8 exactly, unlike shell-quoted jq."
@@ -21042,8 +21219,8 @@ var setPromptCommand = defineCommand93({
21042
21219
  // src/commands/canvas/validate.ts
21043
21220
  import { readFile as readFile16 } from "fs/promises";
21044
21221
  import path22 from "path";
21045
- import { defineCommand as defineCommand94 } from "citty";
21046
- var validateCommand = defineCommand94({
21222
+ import { defineCommand as defineCommand95 } from "citty";
21223
+ var validateCommand = defineCommand95({
21047
21224
  meta: {
21048
21225
  name: "validate",
21049
21226
  description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
@@ -21113,7 +21290,7 @@ var validateCommand = defineCommand94({
21113
21290
  });
21114
21291
 
21115
21292
  // src/commands/canvas/index.ts
21116
- var canvasCommand = defineCommand95({
21293
+ var canvasCommand = defineCommand96({
21117
21294
  meta: {
21118
21295
  name: "canvas",
21119
21296
  description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
@@ -21146,10 +21323,10 @@ Subcommands:
21146
21323
  });
21147
21324
 
21148
21325
  // src/commands/creatives/index.ts
21149
- import { defineCommand as defineCommand97 } from "citty";
21326
+ import { defineCommand as defineCommand98 } from "citty";
21150
21327
 
21151
21328
  // src/commands/creatives/publish.ts
21152
- import { defineCommand as defineCommand96 } from "citty";
21329
+ import { defineCommand as defineCommand97 } from "citty";
21153
21330
 
21154
21331
  // src/commands/images/api.ts
21155
21332
  import { readFile as readFile17 } from "fs/promises";
@@ -21293,7 +21470,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
21293
21470
  chatId: chatIdFromEnv()
21294
21471
  });
21295
21472
  }
21296
- var publishCommand = defineCommand96({
21473
+ var publishCommand = defineCommand97({
21297
21474
  meta: {
21298
21475
  name: "publish",
21299
21476
  description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
@@ -21351,7 +21528,7 @@ var publishCommand = defineCommand96({
21351
21528
  });
21352
21529
 
21353
21530
  // src/commands/creatives/index.ts
21354
- var creativesCommand3 = defineCommand97({
21531
+ var creativesCommand3 = defineCommand98({
21355
21532
  meta: {
21356
21533
  name: "creatives",
21357
21534
  description: `Publish static ad creatives as first-class Baker outputs.
@@ -21367,7 +21544,7 @@ Publishing uploads the image to the Company image library, applies the official
21367
21544
  });
21368
21545
 
21369
21546
  // src/commands/flows/index.ts
21370
- import { defineCommand as defineCommand98 } from "citty";
21547
+ import { defineCommand as defineCommand99 } from "citty";
21371
21548
 
21372
21549
  // src/commands/flows/shared.ts
21373
21550
  import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
@@ -21522,7 +21699,7 @@ function displayName(slug) {
21522
21699
  const name = tree.displayName;
21523
21700
  return typeof name === "string" && name.trim() ? name.trim() : slug;
21524
21701
  }
21525
- var listCommand5 = defineCommand98({
21702
+ var listCommand5 = defineCommand99({
21526
21703
  meta: {
21527
21704
  name: "list",
21528
21705
  description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
@@ -21536,7 +21713,7 @@ var listCommand5 = defineCommand98({
21536
21713
  writeJson({ ok: true, data: { flows } });
21537
21714
  }
21538
21715
  });
21539
- var showCommand2 = defineCommand98({
21716
+ var showCommand2 = defineCommand99({
21540
21717
  meta: {
21541
21718
  name: "show",
21542
21719
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -21557,7 +21734,7 @@ var showCommand2 = defineCommand98({
21557
21734
  writeJson({ ok: true, data: response });
21558
21735
  }
21559
21736
  });
21560
- var flowsCommand = defineCommand98({
21737
+ var flowsCommand = defineCommand99({
21561
21738
  meta: {
21562
21739
  name: "flows",
21563
21740
  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).
@@ -21584,10 +21761,10 @@ Examples:
21584
21761
  });
21585
21762
 
21586
21763
  // src/commands/ga4/index.ts
21587
- import { defineCommand as defineCommand102 } from "citty";
21764
+ import { defineCommand as defineCommand103 } from "citty";
21588
21765
 
21589
21766
  // src/commands/ga4/audit.ts
21590
- import { defineCommand as defineCommand99 } from "citty";
21767
+ import { defineCommand as defineCommand100 } from "citty";
21591
21768
 
21592
21769
  // src/commands/ga4/resolve.ts
21593
21770
  async function fetchProperties(useCache = true) {
@@ -21650,7 +21827,7 @@ registerSchema({
21650
21827
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21651
21828
  }
21652
21829
  });
21653
- var auditCommand2 = defineCommand99({
21830
+ var auditCommand2 = defineCommand100({
21654
21831
  meta: {
21655
21832
  name: "audit",
21656
21833
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -21702,7 +21879,7 @@ Examples:
21702
21879
  });
21703
21880
 
21704
21881
  // src/commands/ga4/properties.ts
21705
- import { defineCommand as defineCommand100 } from "citty";
21882
+ import { defineCommand as defineCommand101 } from "citty";
21706
21883
  registerSchema({
21707
21884
  command: "ga4.properties",
21708
21885
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -21710,7 +21887,7 @@ registerSchema({
21710
21887
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21711
21888
  }
21712
21889
  });
21713
- var propertiesCommand = defineCommand100({
21890
+ var propertiesCommand = defineCommand101({
21714
21891
  meta: {
21715
21892
  name: "properties",
21716
21893
  description: `List accessible GA4 properties.
@@ -21760,7 +21937,7 @@ Examples:
21760
21937
  // src/commands/ga4/query.ts
21761
21938
  import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
21762
21939
  import { resolve as resolve2 } from "path";
21763
- import { defineCommand as defineCommand101 } from "citty";
21940
+ import { defineCommand as defineCommand102 } from "citty";
21764
21941
 
21765
21942
  // src/commands/ga4/presets.ts
21766
21943
  var GA4_PRESETS = [
@@ -21892,7 +22069,7 @@ function handleError(err) {
21892
22069
  });
21893
22070
  process.exit(1);
21894
22071
  }
21895
- var queryCommand2 = defineCommand101({
22072
+ var queryCommand2 = defineCommand102({
21896
22073
  meta: {
21897
22074
  name: "query",
21898
22075
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -21963,7 +22140,7 @@ Free-form (escape hatch):
21963
22140
  });
21964
22141
 
21965
22142
  // src/commands/ga4/index.ts
21966
- var ga4Command = defineCommand102({
22143
+ var ga4Command = defineCommand103({
21967
22144
  meta: {
21968
22145
  name: "ga4",
21969
22146
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -21986,12 +22163,12 @@ Examples:
21986
22163
  });
21987
22164
 
21988
22165
  // src/commands/gsc/index.ts
21989
- import { defineCommand as defineCommand106 } from "citty";
22166
+ import { defineCommand as defineCommand107 } from "citty";
21990
22167
 
21991
22168
  // src/commands/gsc/query.ts
21992
22169
  import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
21993
22170
  import { resolve as resolve3 } from "path";
21994
- import { defineCommand as defineCommand103 } from "citty";
22171
+ import { defineCommand as defineCommand104 } from "citty";
21995
22172
 
21996
22173
  // src/commands/gsc/presets.ts
21997
22174
  var GSC_PRESETS = [
@@ -22179,7 +22356,7 @@ function handleError2(err) {
22179
22356
  });
22180
22357
  process.exit(1);
22181
22358
  }
22182
- var queryCommand3 = defineCommand103({
22359
+ var queryCommand3 = defineCommand104({
22183
22360
  meta: {
22184
22361
  name: "query",
22185
22362
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -22257,7 +22434,7 @@ Free-form (escape hatch):
22257
22434
  });
22258
22435
 
22259
22436
  // src/commands/gsc/sitemaps.ts
22260
- import { defineCommand as defineCommand104 } from "citty";
22437
+ import { defineCommand as defineCommand105 } from "citty";
22261
22438
  registerSchema({
22262
22439
  command: "gsc.sitemaps",
22263
22440
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -22266,7 +22443,7 @@ registerSchema({
22266
22443
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22267
22444
  }
22268
22445
  });
22269
- var sitemapsCommand = defineCommand104({
22446
+ var sitemapsCommand = defineCommand105({
22270
22447
  meta: {
22271
22448
  name: "sitemaps",
22272
22449
  description: `List sitemaps for a site. Check health and errors.
@@ -22316,7 +22493,7 @@ Examples:
22316
22493
  });
22317
22494
 
22318
22495
  // src/commands/gsc/sites.ts
22319
- import { defineCommand as defineCommand105 } from "citty";
22496
+ import { defineCommand as defineCommand106 } from "citty";
22320
22497
  registerSchema({
22321
22498
  command: "gsc.sites",
22322
22499
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -22324,7 +22501,7 @@ registerSchema({
22324
22501
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22325
22502
  }
22326
22503
  });
22327
- var sitesCommand = defineCommand105({
22504
+ var sitesCommand = defineCommand106({
22328
22505
  meta: {
22329
22506
  name: "sites",
22330
22507
  description: `List verified Search Console sites.
@@ -22372,7 +22549,7 @@ Examples:
22372
22549
  });
22373
22550
 
22374
22551
  // src/commands/gsc/index.ts
22375
- var gscCommand = defineCommand106({
22552
+ var gscCommand = defineCommand107({
22376
22553
  meta: {
22377
22554
  name: "gsc",
22378
22555
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -22395,10 +22572,10 @@ Examples:
22395
22572
  });
22396
22573
 
22397
22574
  // src/commands/images/index.ts
22398
- import { defineCommand as defineCommand130 } from "citty";
22575
+ import { defineCommand as defineCommand131 } from "citty";
22399
22576
 
22400
22577
  // src/commands/images/crop.ts
22401
- import { defineCommand as defineCommand107 } from "citty";
22578
+ import { defineCommand as defineCommand108 } from "citty";
22402
22579
 
22403
22580
  // src/lib/image/crop-sprite.ts
22404
22581
  import sharp from "sharp";
@@ -22523,7 +22700,7 @@ function emitError2(err) {
22523
22700
  }
22524
22701
  process.exit(1);
22525
22702
  }
22526
- var cropCommand = defineCommand107({
22703
+ var cropCommand = defineCommand108({
22527
22704
  meta: {
22528
22705
  name: "crop",
22529
22706
  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"
@@ -22559,7 +22736,7 @@ var cropCommand = defineCommand107({
22559
22736
  });
22560
22737
 
22561
22738
  // src/commands/images/delete.ts
22562
- import { defineCommand as defineCommand108 } from "citty";
22739
+ import { defineCommand as defineCommand109 } from "citty";
22563
22740
  registerSchema({
22564
22741
  command: "images.delete",
22565
22742
  description: "Delete an image by ID",
@@ -22573,7 +22750,7 @@ registerSchema({
22573
22750
  }
22574
22751
  }
22575
22752
  });
22576
- var deleteCommand = defineCommand108({
22753
+ var deleteCommand = defineCommand109({
22577
22754
  meta: {
22578
22755
  name: "delete",
22579
22756
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -22614,7 +22791,7 @@ var deleteCommand = defineCommand108({
22614
22791
  });
22615
22792
 
22616
22793
  // src/commands/images/dimensions.ts
22617
- import { defineCommand as defineCommand109 } from "citty";
22794
+ import { defineCommand as defineCommand110 } from "citty";
22618
22795
 
22619
22796
  // src/lib/image/dimensions.ts
22620
22797
  import { imageSize } from "image-size";
@@ -22637,7 +22814,7 @@ registerSchema({
22637
22814
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
22638
22815
  }
22639
22816
  });
22640
- var dimensionsCommand = defineCommand109({
22817
+ var dimensionsCommand = defineCommand110({
22641
22818
  meta: {
22642
22819
  name: "dimensions",
22643
22820
  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"
@@ -22681,7 +22858,7 @@ var dimensionsCommand = defineCommand109({
22681
22858
  });
22682
22859
 
22683
22860
  // src/commands/images/extract.ts
22684
- import { defineCommand as defineCommand110 } from "citty";
22861
+ import { defineCommand as defineCommand111 } from "citty";
22685
22862
  registerSchema({
22686
22863
  command: "images.extract",
22687
22864
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -22697,7 +22874,7 @@ registerSchema({
22697
22874
  }
22698
22875
  }
22699
22876
  });
22700
- var extractCommand = defineCommand110({
22877
+ var extractCommand = defineCommand111({
22701
22878
  meta: {
22702
22879
  name: "extract",
22703
22880
  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"
@@ -22735,7 +22912,7 @@ var extractCommand = defineCommand110({
22735
22912
  });
22736
22913
 
22737
22914
  // src/commands/images/find.ts
22738
- import { defineCommand as defineCommand111 } from "citty";
22915
+ import { defineCommand as defineCommand112 } from "citty";
22739
22916
  registerSchema({
22740
22917
  command: "images.find",
22741
22918
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -22767,7 +22944,7 @@ registerSchema({
22767
22944
  }
22768
22945
  }
22769
22946
  });
22770
- var findCommand = defineCommand111({
22947
+ var findCommand = defineCommand112({
22771
22948
  meta: {
22772
22949
  name: "find",
22773
22950
  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"
@@ -22816,7 +22993,7 @@ var findCommand = defineCommand111({
22816
22993
 
22817
22994
  // src/commands/images/generate.ts
22818
22995
  import { readFile as readFile19 } from "fs/promises";
22819
- import { defineCommand as defineCommand112 } from "citty";
22996
+ import { defineCommand as defineCommand113 } from "citty";
22820
22997
  import sharp2 from "sharp";
22821
22998
  var GENERATE_TIMEOUT_MS = 18e4;
22822
22999
  var REFERENCE_MAX_EDGE = 1536;
@@ -22919,7 +23096,7 @@ async function resolveReferences(spec) {
22919
23096
  }
22920
23097
  return out;
22921
23098
  }
22922
- var generateCommand = defineCommand112({
23099
+ var generateCommand = defineCommand113({
22923
23100
  meta: {
22924
23101
  name: "generate",
22925
23102
  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]]'"
@@ -22971,7 +23148,7 @@ var generateCommand = defineCommand112({
22971
23148
  });
22972
23149
 
22973
23150
  // src/commands/images/get.ts
22974
- import { defineCommand as defineCommand113 } from "citty";
23151
+ import { defineCommand as defineCommand114 } from "citty";
22975
23152
  registerSchema({
22976
23153
  command: "images.get",
22977
23154
  description: "Get a single image by ID",
@@ -22979,7 +23156,7 @@ registerSchema({
22979
23156
  id: { type: "string", description: "Image ID", required: true }
22980
23157
  }
22981
23158
  });
22982
- var getCommand2 = defineCommand113({
23159
+ var getCommand2 = defineCommand114({
22983
23160
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
22984
23161
  args: {
22985
23162
  id: { type: "positional", description: "Image ID", required: false },
@@ -23015,7 +23192,7 @@ var getCommand2 = defineCommand113({
23015
23192
  });
23016
23193
 
23017
23194
  // src/commands/images/gif.ts
23018
- import { defineCommand as defineCommand114 } from "citty";
23195
+ import { defineCommand as defineCommand115 } from "citty";
23019
23196
  registerSchema({
23020
23197
  command: "images.gif",
23021
23198
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -23047,7 +23224,7 @@ registerSchema({
23047
23224
  }
23048
23225
  }
23049
23226
  });
23050
- var gifCommand = defineCommand114({
23227
+ var gifCommand = defineCommand115({
23051
23228
  meta: {
23052
23229
  name: "gif",
23053
23230
  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"
@@ -23094,7 +23271,7 @@ var gifCommand = defineCommand114({
23094
23271
  });
23095
23272
 
23096
23273
  // src/commands/images/google.ts
23097
- import { defineCommand as defineCommand115 } from "citty";
23274
+ import { defineCommand as defineCommand116 } from "citty";
23098
23275
  registerSchema({
23099
23276
  command: "images.google",
23100
23277
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -23130,7 +23307,7 @@ registerSchema({
23130
23307
  }
23131
23308
  }
23132
23309
  });
23133
- var googleCommand2 = defineCommand115({
23310
+ var googleCommand2 = defineCommand116({
23134
23311
  meta: {
23135
23312
  name: "google",
23136
23313
  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"
@@ -23178,7 +23355,7 @@ var googleCommand2 = defineCommand115({
23178
23355
  });
23179
23356
 
23180
23357
  // src/commands/images/icon.ts
23181
- import { defineCommand as defineCommand116 } from "citty";
23358
+ import { defineCommand as defineCommand117 } from "citty";
23182
23359
  registerSchema({
23183
23360
  command: "images.icon",
23184
23361
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -23204,7 +23381,7 @@ registerSchema({
23204
23381
  }
23205
23382
  }
23206
23383
  });
23207
- var iconCommand = defineCommand116({
23384
+ var iconCommand = defineCommand117({
23208
23385
  meta: {
23209
23386
  name: "icon",
23210
23387
  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'"
@@ -23244,7 +23421,7 @@ var iconCommand = defineCommand116({
23244
23421
  });
23245
23422
 
23246
23423
  // src/commands/images/ingest.ts
23247
- import { defineCommand as defineCommand117 } from "citty";
23424
+ import { defineCommand as defineCommand118 } from "citty";
23248
23425
  registerSchema({
23249
23426
  command: "images.ingest",
23250
23427
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -23256,7 +23433,7 @@ registerSchema({
23256
23433
  context: { type: "string", description: "Description context hint", required: false }
23257
23434
  }
23258
23435
  });
23259
- var ingestCommand = defineCommand117({
23436
+ var ingestCommand = defineCommand118({
23260
23437
  meta: {
23261
23438
  name: "ingest",
23262
23439
  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"
@@ -23298,7 +23475,7 @@ var ingestCommand = defineCommand117({
23298
23475
  });
23299
23476
 
23300
23477
  // src/commands/images/library.ts
23301
- import { defineCommand as defineCommand118 } from "citty";
23478
+ import { defineCommand as defineCommand119 } from "citty";
23302
23479
  registerSchema({
23303
23480
  command: "images.library",
23304
23481
  description: "Search the company image library. Returns only ready images.",
@@ -23324,7 +23501,7 @@ registerSchema({
23324
23501
  }
23325
23502
  }
23326
23503
  });
23327
- var libraryCommand = defineCommand118({
23504
+ var libraryCommand = defineCommand119({
23328
23505
  meta: {
23329
23506
  name: "library",
23330
23507
  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"
@@ -23381,7 +23558,7 @@ var libraryCommand = defineCommand118({
23381
23558
  });
23382
23559
 
23383
23560
  // src/commands/images/logo.ts
23384
- import { defineCommand as defineCommand119 } from "citty";
23561
+ import { defineCommand as defineCommand120 } from "citty";
23385
23562
  registerSchema({
23386
23563
  command: "images.logo",
23387
23564
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -23406,7 +23583,7 @@ registerSchema({
23406
23583
  }
23407
23584
  }
23408
23585
  });
23409
- var logoCommand = defineCommand119({
23586
+ var logoCommand = defineCommand120({
23410
23587
  meta: {
23411
23588
  name: "logo",
23412
23589
  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"
@@ -23444,7 +23621,7 @@ var logoCommand = defineCommand119({
23444
23621
  });
23445
23622
 
23446
23623
  // src/commands/images/normalize.ts
23447
- import { defineCommand as defineCommand120 } from "citty";
23624
+ import { defineCommand as defineCommand121 } from "citty";
23448
23625
 
23449
23626
  // src/lib/image/color-changer.ts
23450
23627
  import quantize from "quantize";
@@ -24176,7 +24353,7 @@ function coerceRawArgs(args) {
24176
24353
  "dry-run": bool(args["dry-run"])
24177
24354
  };
24178
24355
  }
24179
- var normalizeCommand = defineCommand120({
24356
+ var normalizeCommand = defineCommand121({
24180
24357
  meta: {
24181
24358
  name: "normalize",
24182
24359
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -24231,7 +24408,7 @@ Examples:
24231
24408
  });
24232
24409
 
24233
24410
  // src/commands/images/pinterest.ts
24234
- import { defineCommand as defineCommand121 } from "citty";
24411
+ import { defineCommand as defineCommand122 } from "citty";
24235
24412
  registerSchema({
24236
24413
  command: "images.pinterest",
24237
24414
  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.",
@@ -24251,7 +24428,7 @@ registerSchema({
24251
24428
  }
24252
24429
  }
24253
24430
  });
24254
- var pinterestCommand = defineCommand121({
24431
+ var pinterestCommand = defineCommand122({
24255
24432
  meta: {
24256
24433
  name: "pinterest",
24257
24434
  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'"
@@ -24291,7 +24468,7 @@ var pinterestCommand = defineCommand121({
24291
24468
  });
24292
24469
 
24293
24470
  // src/commands/images/screenshot.ts
24294
- import { defineCommand as defineCommand122 } from "citty";
24471
+ import { defineCommand as defineCommand123 } from "citty";
24295
24472
  registerSchema({
24296
24473
  command: "images.screenshot",
24297
24474
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -24307,7 +24484,7 @@ registerSchema({
24307
24484
  }
24308
24485
  }
24309
24486
  });
24310
- var screenshotCommand = defineCommand122({
24487
+ var screenshotCommand = defineCommand123({
24311
24488
  meta: {
24312
24489
  name: "screenshot",
24313
24490
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -24370,7 +24547,7 @@ var screenshotCommand = defineCommand122({
24370
24547
  });
24371
24548
 
24372
24549
  // src/commands/images/search.ts
24373
- import { defineCommand as defineCommand123 } from "citty";
24550
+ import { defineCommand as defineCommand124 } from "citty";
24374
24551
  registerSchema({
24375
24552
  command: "images.search",
24376
24553
  description: "Search images by text query. Only returns ready images.",
@@ -24386,7 +24563,7 @@ registerSchema({
24386
24563
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24387
24564
  }
24388
24565
  });
24389
- var searchCommand = defineCommand123({
24566
+ var searchCommand = defineCommand124({
24390
24567
  meta: {
24391
24568
  name: "search",
24392
24569
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -24446,7 +24623,7 @@ var searchCommand = defineCommand123({
24446
24623
  });
24447
24624
 
24448
24625
  // src/commands/images/sticker.ts
24449
- import { defineCommand as defineCommand124 } from "citty";
24626
+ import { defineCommand as defineCommand125 } from "citty";
24450
24627
  registerSchema({
24451
24628
  command: "images.sticker",
24452
24629
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -24478,7 +24655,7 @@ registerSchema({
24478
24655
  }
24479
24656
  }
24480
24657
  });
24481
- var stickerCommand = defineCommand124({
24658
+ var stickerCommand = defineCommand125({
24482
24659
  meta: {
24483
24660
  name: "sticker",
24484
24661
  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"
@@ -24525,7 +24702,7 @@ var stickerCommand = defineCommand124({
24525
24702
  });
24526
24703
 
24527
24704
  // src/commands/images/stock.ts
24528
- import { defineCommand as defineCommand125 } from "citty";
24705
+ import { defineCommand as defineCommand126 } from "citty";
24529
24706
  registerSchema({
24530
24707
  command: "images.stock",
24531
24708
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -24583,7 +24760,7 @@ registerSchema({
24583
24760
  }
24584
24761
  }
24585
24762
  });
24586
- var stockCommand = defineCommand125({
24763
+ var stockCommand = defineCommand126({
24587
24764
  meta: {
24588
24765
  name: "stock",
24589
24766
  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"
@@ -24639,7 +24816,7 @@ var stockCommand = defineCommand125({
24639
24816
  });
24640
24817
 
24641
24818
  // src/lib/tags-command.ts
24642
- import { defineCommand as defineCommand126 } from "citty";
24819
+ import { defineCommand as defineCommand127 } from "citty";
24643
24820
  function makeTagsCommand(command, label, endpoint) {
24644
24821
  registerSchema({
24645
24822
  command: `${command}.tags`,
@@ -24648,7 +24825,7 @@ function makeTagsCommand(command, label, endpoint) {
24648
24825
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
24649
24826
  }
24650
24827
  });
24651
- return defineCommand126({
24828
+ return defineCommand127({
24652
24829
  meta: {
24653
24830
  name: "tags",
24654
24831
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -24684,7 +24861,7 @@ function makeTagsCommand(command, label, endpoint) {
24684
24861
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
24685
24862
 
24686
24863
  // src/commands/images/upload.ts
24687
- import { defineCommand as defineCommand127 } from "citty";
24864
+ import { defineCommand as defineCommand128 } from "citty";
24688
24865
  registerSchema({
24689
24866
  command: "images.upload",
24690
24867
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -24722,7 +24899,7 @@ registerSchema({
24722
24899
  function isRemoteUrl2(value) {
24723
24900
  return /^https?:\/\//i.test(value);
24724
24901
  }
24725
- var uploadCommand = defineCommand127({
24902
+ var uploadCommand = defineCommand128({
24726
24903
  meta: {
24727
24904
  name: "upload",
24728
24905
  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'"
@@ -24815,7 +24992,7 @@ async function uploadLocal(target, args) {
24815
24992
  }
24816
24993
 
24817
24994
  // src/commands/images/upscale.ts
24818
- import { defineCommand as defineCommand128 } from "citty";
24995
+ import { defineCommand as defineCommand129 } from "citty";
24819
24996
  registerSchema({
24820
24997
  command: "images.upscale",
24821
24998
  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).",
@@ -24830,7 +25007,7 @@ registerSchema({
24830
25007
  }
24831
25008
  });
24832
25009
  var POLL_INTERVAL_MS3 = 1500;
24833
- var upscaleCommand = defineCommand128({
25010
+ var upscaleCommand = defineCommand129({
24834
25011
  meta: {
24835
25012
  name: "upscale",
24836
25013
  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"
@@ -24885,7 +25062,7 @@ var upscaleCommand = defineCommand128({
24885
25062
  });
24886
25063
 
24887
25064
  // src/commands/images/use.ts
24888
- import { defineCommand as defineCommand129 } from "citty";
25065
+ import { defineCommand as defineCommand130 } from "citty";
24889
25066
  registerSchema({
24890
25067
  command: "images.use",
24891
25068
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -24901,7 +25078,7 @@ registerSchema({
24901
25078
  }
24902
25079
  });
24903
25080
  var POLL_INTERVAL_MS4 = 1500;
24904
- var useCommand = defineCommand129({
25081
+ var useCommand = defineCommand130({
24905
25082
  meta: {
24906
25083
  name: "use",
24907
25084
  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"
@@ -24947,7 +25124,7 @@ var useCommand = defineCommand129({
24947
25124
  });
24948
25125
 
24949
25126
  // src/commands/images/index.ts
24950
- var imagesCommand = defineCommand130({
25127
+ var imagesCommand = defineCommand131({
24951
25128
  meta: {
24952
25129
  name: "images",
24953
25130
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -25017,7 +25194,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
25017
25194
  });
25018
25195
 
25019
25196
  // src/commands/mcp/index.ts
25020
- import { defineCommand as defineCommand131 } from "citty";
25197
+ import { defineCommand as defineCommand132 } from "citty";
25021
25198
  var SCOPES = ["user", "user_org", "company", "org"];
25022
25199
  function parseScope(raw) {
25023
25200
  const scope = raw === void 0 ? "company" : String(raw);
@@ -25056,7 +25233,7 @@ registerSchema({
25056
25233
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
25057
25234
  args: {}
25058
25235
  });
25059
- var listCommand6 = defineCommand131({
25236
+ var listCommand6 = defineCommand132({
25060
25237
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
25061
25238
  run: async () => {
25062
25239
  try {
@@ -25081,7 +25258,7 @@ registerSchema({
25081
25258
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
25082
25259
  }
25083
25260
  });
25084
- var addCommand = defineCommand131({
25261
+ var addCommand = defineCommand132({
25085
25262
  meta: {
25086
25263
  name: "add",
25087
25264
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -25122,7 +25299,7 @@ registerSchema({
25122
25299
  description: "Remove a company custom MCP server by name.",
25123
25300
  args: { name: { type: "string", description: "Server name to remove", required: true } }
25124
25301
  });
25125
- var removeCommand4 = defineCommand131({
25302
+ var removeCommand4 = defineCommand132({
25126
25303
  meta: {
25127
25304
  name: "remove",
25128
25305
  description: `Remove a company custom MCP server by name.
@@ -25144,7 +25321,7 @@ Example:
25144
25321
  }
25145
25322
  }
25146
25323
  });
25147
- var mcpCommand = defineCommand131({
25324
+ var mcpCommand = defineCommand132({
25148
25325
  meta: {
25149
25326
  name: "mcp",
25150
25327
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -25168,10 +25345,10 @@ Examples:
25168
25345
  });
25169
25346
 
25170
25347
  // src/commands/research/index.ts
25171
- import { defineCommand as defineCommand142 } from "citty";
25348
+ import { defineCommand as defineCommand143 } from "citty";
25172
25349
 
25173
25350
  // src/commands/research/advertisers.ts
25174
- import { defineCommand as defineCommand132 } from "citty";
25351
+ import { defineCommand as defineCommand133 } from "citty";
25175
25352
 
25176
25353
  // src/commands/research/output.ts
25177
25354
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -25284,7 +25461,7 @@ var FIELDS3 = {
25284
25461
  etv: "Estimated traffic value (USD)",
25285
25462
  visibility: "SERP visibility score (0-1)"
25286
25463
  };
25287
- var advertisersCommand = defineCommand132({
25464
+ var advertisersCommand = defineCommand133({
25288
25465
  meta: {
25289
25466
  name: "advertisers",
25290
25467
  description: `Find domains competing for a keyword in Google SERPs.
@@ -25331,7 +25508,7 @@ Examples:
25331
25508
  });
25332
25509
 
25333
25510
  // src/commands/research/autocomplete.ts
25334
- import { defineCommand as defineCommand133 } from "citty";
25511
+ import { defineCommand as defineCommand134 } from "citty";
25335
25512
  registerSchema({
25336
25513
  command: "research.autocomplete",
25337
25514
  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).",
@@ -25354,7 +25531,7 @@ registerSchema({
25354
25531
  var FIELDS4 = {
25355
25532
  suggestion: "Autocomplete suggestion from Google"
25356
25533
  };
25357
- var autocompleteCommand = defineCommand133({
25534
+ var autocompleteCommand = defineCommand134({
25358
25535
  meta: {
25359
25536
  name: "autocomplete",
25360
25537
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -25400,7 +25577,7 @@ Examples:
25400
25577
  });
25401
25578
 
25402
25579
  // src/commands/research/countries.ts
25403
- import { defineCommand as defineCommand134 } from "citty";
25580
+ import { defineCommand as defineCommand135 } from "citty";
25404
25581
  registerSchema({
25405
25582
  command: "research.countries",
25406
25583
  description: "List all supported country codes for --location flag in research commands.",
@@ -25457,7 +25634,7 @@ var FIELDS5 = {
25457
25634
  code: "Country code to pass as --location",
25458
25635
  name: "Country name"
25459
25636
  };
25460
- var countriesCommand = defineCommand134({
25637
+ var countriesCommand = defineCommand135({
25461
25638
  meta: {
25462
25639
  name: "countries",
25463
25640
  description: "List all supported country codes for --location flag."
@@ -25468,7 +25645,7 @@ var countriesCommand = defineCommand134({
25468
25645
  });
25469
25646
 
25470
25647
  // src/commands/research/intent.ts
25471
- import { defineCommand as defineCommand135 } from "citty";
25648
+ import { defineCommand as defineCommand136 } from "citty";
25472
25649
  registerSchema({
25473
25650
  command: "research.intent",
25474
25651
  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.",
@@ -25491,7 +25668,7 @@ var FIELDS6 = {
25491
25668
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
25492
25669
  probability: "Confidence score 0.0-1.0"
25493
25670
  };
25494
- var intentCommand = defineCommand135({
25671
+ var intentCommand = defineCommand136({
25495
25672
  meta: {
25496
25673
  name: "intent",
25497
25674
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -25539,7 +25716,7 @@ Examples:
25539
25716
  });
25540
25717
 
25541
25718
  // src/commands/research/keyword-gap.ts
25542
- import { defineCommand as defineCommand136 } from "citty";
25719
+ import { defineCommand as defineCommand137 } from "citty";
25543
25720
  registerSchema({
25544
25721
  command: "research.keyword-gap",
25545
25722
  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.",
@@ -25568,7 +25745,7 @@ var FIELDS7 = {
25568
25745
  cpc: "Cost per click USD",
25569
25746
  their_position: "Competitor's ranking position"
25570
25747
  };
25571
- var keywordGapCommand = defineCommand136({
25748
+ var keywordGapCommand = defineCommand137({
25572
25749
  meta: {
25573
25750
  name: "keyword-gap",
25574
25751
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -25642,7 +25819,7 @@ Examples:
25642
25819
  });
25643
25820
 
25644
25821
  // src/commands/research/keywords-for-site.ts
25645
- import { defineCommand as defineCommand137 } from "citty";
25822
+ import { defineCommand as defineCommand138 } from "citty";
25646
25823
  registerSchema({
25647
25824
  command: "research.keywords-for-site",
25648
25825
  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.",
@@ -25675,7 +25852,7 @@ var FIELDS8 = {
25675
25852
  competition: "LOW, MEDIUM, or HIGH",
25676
25853
  competition_index: "Competition score 0-100"
25677
25854
  };
25678
- var keywordsForSiteCommand = defineCommand137({
25855
+ var keywordsForSiteCommand = defineCommand138({
25679
25856
  meta: {
25680
25857
  name: "keywords-for-site",
25681
25858
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -25728,7 +25905,7 @@ Examples:
25728
25905
  });
25729
25906
 
25730
25907
  // src/commands/research/languages.ts
25731
- import { defineCommand as defineCommand138 } from "citty";
25908
+ import { defineCommand as defineCommand139 } from "citty";
25732
25909
  registerSchema({
25733
25910
  command: "research.languages",
25734
25911
  description: "List all supported language codes for --language flag in research commands.",
@@ -25758,7 +25935,7 @@ var FIELDS9 = {
25758
25935
  code: "Language code to pass as --language",
25759
25936
  name: "Language name (also accepted by --language)"
25760
25937
  };
25761
- var languagesCommand2 = defineCommand138({
25938
+ var languagesCommand2 = defineCommand139({
25762
25939
  meta: {
25763
25940
  name: "languages",
25764
25941
  description: "List all supported language codes for --language flag."
@@ -25769,7 +25946,7 @@ var languagesCommand2 = defineCommand138({
25769
25946
  });
25770
25947
 
25771
25948
  // src/commands/research/lighthouse.ts
25772
- import { defineCommand as defineCommand139 } from "citty";
25949
+ import { defineCommand as defineCommand140 } from "citty";
25773
25950
  registerSchema({
25774
25951
  command: "research.lighthouse",
25775
25952
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -25788,7 +25965,7 @@ var FIELDS10 = {
25788
25965
  speed_index_ms: "Speed Index in ms (good: < 3400)",
25789
25966
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
25790
25967
  };
25791
- var lighthouseCommand = defineCommand139({
25968
+ var lighthouseCommand = defineCommand140({
25792
25969
  meta: {
25793
25970
  name: "lighthouse",
25794
25971
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -25826,7 +26003,7 @@ Examples:
25826
26003
  });
25827
26004
 
25828
26005
  // src/commands/research/relevant-pages.ts
25829
- import { defineCommand as defineCommand140 } from "citty";
26006
+ import { defineCommand as defineCommand141 } from "citty";
25830
26007
  registerSchema({
25831
26008
  command: "research.relevant-pages",
25832
26009
  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).",
@@ -25852,7 +26029,7 @@ var FIELDS11 = {
25852
26029
  keywords: "Total organic keywords the page ranks for",
25853
26030
  top_10: "Keywords in positions 1-10"
25854
26031
  };
25855
- var relevantPagesCommand = defineCommand140({
26032
+ var relevantPagesCommand = defineCommand141({
25856
26033
  meta: {
25857
26034
  name: "relevant-pages",
25858
26035
  description: `Get the top pages of a competitor domain with traffic data.
@@ -25898,7 +26075,7 @@ Examples:
25898
26075
  });
25899
26076
 
25900
26077
  // src/commands/research/web.ts
25901
- import { defineCommand as defineCommand141 } from "citty";
26078
+ import { defineCommand as defineCommand142 } from "citty";
25902
26079
  registerSchema({
25903
26080
  command: "research.web",
25904
26081
  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).",
@@ -25949,7 +26126,7 @@ async function runDeepResearch(question) {
25949
26126
  }
25950
26127
  throw new Error("Deep research timed out");
25951
26128
  }
25952
- var webCommand = defineCommand141({
26129
+ var webCommand = defineCommand142({
25953
26130
  meta: {
25954
26131
  name: "web",
25955
26132
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -26009,7 +26186,7 @@ Examples:
26009
26186
  });
26010
26187
 
26011
26188
  // src/commands/research/index.ts
26012
- var researchCommand = defineCommand142({
26189
+ var researchCommand = defineCommand143({
26013
26190
  meta: {
26014
26191
  name: "research",
26015
26192
  description: `Competitive intelligence and AI-powered research commands.
@@ -26049,10 +26226,10 @@ Examples:
26049
26226
  });
26050
26227
 
26051
26228
  // src/commands/scheduled-actions/index.ts
26052
- import { defineCommand as defineCommand149 } from "citty";
26229
+ import { defineCommand as defineCommand150 } from "citty";
26053
26230
 
26054
26231
  // src/commands/scheduled-actions/create.ts
26055
- import { defineCommand as defineCommand143 } from "citty";
26232
+ import { defineCommand as defineCommand144 } from "citty";
26056
26233
 
26057
26234
  // src/commands/scheduled-actions/shared.ts
26058
26235
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -26167,7 +26344,7 @@ registerSchema({
26167
26344
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
26168
26345
  }
26169
26346
  });
26170
- var createCommand2 = defineCommand143({
26347
+ var createCommand2 = defineCommand144({
26171
26348
  meta: {
26172
26349
  name: "create",
26173
26350
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -26216,7 +26393,7 @@ var createCommand2 = defineCommand143({
26216
26393
  });
26217
26394
 
26218
26395
  // src/commands/scheduled-actions/delete.ts
26219
- import { defineCommand as defineCommand144 } from "citty";
26396
+ import { defineCommand as defineCommand145 } from "citty";
26220
26397
  registerSchema({
26221
26398
  command: "scheduled-actions.delete",
26222
26399
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -26224,7 +26401,7 @@ registerSchema({
26224
26401
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26225
26402
  }
26226
26403
  });
26227
- var deleteCommand2 = defineCommand144({
26404
+ var deleteCommand2 = defineCommand145({
26228
26405
  meta: {
26229
26406
  name: "delete",
26230
26407
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -26253,7 +26430,7 @@ var deleteCommand2 = defineCommand144({
26253
26430
  });
26254
26431
 
26255
26432
  // src/commands/scheduled-actions/get.ts
26256
- import { defineCommand as defineCommand145 } from "citty";
26433
+ import { defineCommand as defineCommand146 } from "citty";
26257
26434
  registerSchema({
26258
26435
  command: "scheduled-actions.get",
26259
26436
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -26261,7 +26438,7 @@ registerSchema({
26261
26438
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26262
26439
  }
26263
26440
  });
26264
- var getCommand3 = defineCommand145({
26441
+ var getCommand3 = defineCommand146({
26265
26442
  meta: {
26266
26443
  name: "get",
26267
26444
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -26298,13 +26475,13 @@ var getCommand3 = defineCommand145({
26298
26475
  });
26299
26476
 
26300
26477
  // src/commands/scheduled-actions/list.ts
26301
- import { defineCommand as defineCommand146 } from "citty";
26478
+ import { defineCommand as defineCommand147 } from "citty";
26302
26479
  registerSchema({
26303
26480
  command: "scheduled-actions.list",
26304
26481
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
26305
26482
  args: {}
26306
26483
  });
26307
- var listCommand7 = defineCommand146({
26484
+ var listCommand7 = defineCommand147({
26308
26485
  meta: {
26309
26486
  name: "list",
26310
26487
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -26325,7 +26502,7 @@ var listCommand7 = defineCommand146({
26325
26502
  });
26326
26503
 
26327
26504
  // src/commands/scheduled-actions/trigger.ts
26328
- import { defineCommand as defineCommand147 } from "citty";
26505
+ import { defineCommand as defineCommand148 } from "citty";
26329
26506
  registerSchema({
26330
26507
  command: "scheduled-actions.trigger",
26331
26508
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -26333,7 +26510,7 @@ registerSchema({
26333
26510
  id: { type: "string", description: "Published scheduled action ID", required: true }
26334
26511
  }
26335
26512
  });
26336
- var triggerCommand = defineCommand147({
26513
+ var triggerCommand = defineCommand148({
26337
26514
  meta: {
26338
26515
  name: "trigger",
26339
26516
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -26370,7 +26547,7 @@ var triggerCommand = defineCommand147({
26370
26547
  });
26371
26548
 
26372
26549
  // src/commands/scheduled-actions/update.ts
26373
- import { defineCommand as defineCommand148 } from "citty";
26550
+ import { defineCommand as defineCommand149 } from "citty";
26374
26551
  registerSchema({
26375
26552
  command: "scheduled-actions.update",
26376
26553
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -26395,7 +26572,7 @@ registerSchema({
26395
26572
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
26396
26573
  }
26397
26574
  });
26398
- var updateCommand2 = defineCommand148({
26575
+ var updateCommand2 = defineCommand149({
26399
26576
  meta: {
26400
26577
  name: "update",
26401
26578
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -26466,7 +26643,7 @@ var updateCommand2 = defineCommand148({
26466
26643
  });
26467
26644
 
26468
26645
  // src/commands/scheduled-actions/index.ts
26469
- var scheduledActionsCommand = defineCommand149({
26646
+ var scheduledActionsCommand = defineCommand150({
26470
26647
  meta: {
26471
26648
  name: "scheduled-actions",
26472
26649
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -26492,8 +26669,8 @@ Examples:
26492
26669
  });
26493
26670
 
26494
26671
  // src/commands/schema.ts
26495
- import { defineCommand as defineCommand150 } from "citty";
26496
- var schemaCommand = defineCommand150({
26672
+ import { defineCommand as defineCommand151 } from "citty";
26673
+ var schemaCommand = defineCommand151({
26497
26674
  meta: {
26498
26675
  name: "schema",
26499
26676
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -26529,7 +26706,7 @@ var schemaCommand = defineCommand150({
26529
26706
  });
26530
26707
 
26531
26708
  // src/commands/tags/index.ts
26532
- import { defineCommand as defineCommand151 } from "citty";
26709
+ import { defineCommand as defineCommand152 } from "citty";
26533
26710
 
26534
26711
  // src/commands/tags/shared.ts
26535
26712
  function failApi3(err) {
@@ -26595,7 +26772,7 @@ async function listTags(json) {
26595
26772
  failApi3(err);
26596
26773
  }
26597
26774
  }
26598
- var listCommand8 = defineCommand151({
26775
+ var listCommand8 = defineCommand152({
26599
26776
  meta: {
26600
26777
  name: "list",
26601
26778
  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"
@@ -26614,7 +26791,7 @@ async function listDraft3() {
26614
26791
  failApi3(err);
26615
26792
  }
26616
26793
  }
26617
- var draftCommand3 = defineCommand151({
26794
+ var draftCommand3 = defineCommand152({
26618
26795
  meta: {
26619
26796
  name: "draft",
26620
26797
  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)."
@@ -26623,7 +26800,7 @@ var draftCommand3 = defineCommand151({
26623
26800
  await listDraft3();
26624
26801
  }
26625
26802
  });
26626
- var tagsCommand3 = defineCommand151({
26803
+ var tagsCommand3 = defineCommand152({
26627
26804
  meta: {
26628
26805
  name: "tags",
26629
26806
  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.
@@ -26648,10 +26825,10 @@ Examples:
26648
26825
  });
26649
26826
 
26650
26827
  // src/commands/testimonials/index.ts
26651
- import { defineCommand as defineCommand155 } from "citty";
26828
+ import { defineCommand as defineCommand156 } from "citty";
26652
26829
 
26653
26830
  // src/commands/testimonials/get.ts
26654
- import { defineCommand as defineCommand152 } from "citty";
26831
+ import { defineCommand as defineCommand153 } from "citty";
26655
26832
  registerSchema({
26656
26833
  command: "testimonials.get",
26657
26834
  description: "Get a single testimonial by ID",
@@ -26659,7 +26836,7 @@ registerSchema({
26659
26836
  id: { type: "string", description: "Testimonial ID", required: true }
26660
26837
  }
26661
26838
  });
26662
- var getCommand4 = defineCommand152({
26839
+ var getCommand4 = defineCommand153({
26663
26840
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
26664
26841
  args: {
26665
26842
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -26696,7 +26873,7 @@ var getCommand4 = defineCommand152({
26696
26873
  });
26697
26874
 
26698
26875
  // src/commands/testimonials/list.ts
26699
- import { defineCommand as defineCommand153 } from "citty";
26876
+ import { defineCommand as defineCommand154 } from "citty";
26700
26877
  registerSchema({
26701
26878
  command: "testimonials.list",
26702
26879
  description: "List testimonials with optional filters.",
@@ -26726,7 +26903,7 @@ registerSchema({
26726
26903
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
26727
26904
  }
26728
26905
  });
26729
- var listCommand9 = defineCommand153({
26906
+ var listCommand9 = defineCommand154({
26730
26907
  meta: {
26731
26908
  name: "list",
26732
26909
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -26775,7 +26952,7 @@ var listCommand9 = defineCommand153({
26775
26952
  });
26776
26953
 
26777
26954
  // src/commands/testimonials/search.ts
26778
- import { defineCommand as defineCommand154 } from "citty";
26955
+ import { defineCommand as defineCommand155 } from "citty";
26779
26956
  registerSchema({
26780
26957
  command: "testimonials.search",
26781
26958
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -26806,7 +26983,7 @@ registerSchema({
26806
26983
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
26807
26984
  }
26808
26985
  });
26809
- var searchCommand2 = defineCommand154({
26986
+ var searchCommand2 = defineCommand155({
26810
26987
  meta: {
26811
26988
  name: "search",
26812
26989
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -26880,7 +27057,7 @@ var searchCommand2 = defineCommand154({
26880
27057
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
26881
27058
 
26882
27059
  // src/commands/testimonials/index.ts
26883
- var testimonialsCommand = defineCommand155({
27060
+ var testimonialsCommand = defineCommand156({
26884
27061
  meta: {
26885
27062
  name: "testimonials",
26886
27063
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -26901,10 +27078,10 @@ Examples:
26901
27078
  });
26902
27079
 
26903
27080
  // src/commands/videos/index.ts
26904
- import { defineCommand as defineCommand160 } from "citty";
27081
+ import { defineCommand as defineCommand161 } from "citty";
26905
27082
 
26906
27083
  // src/commands/videos/delete.ts
26907
- import { defineCommand as defineCommand156 } from "citty";
27084
+ import { defineCommand as defineCommand157 } from "citty";
26908
27085
  registerSchema({
26909
27086
  command: "videos.delete",
26910
27087
  description: "Delete a video by ID",
@@ -26918,7 +27095,7 @@ registerSchema({
26918
27095
  }
26919
27096
  }
26920
27097
  });
26921
- var deleteCommand3 = defineCommand156({
27098
+ var deleteCommand3 = defineCommand157({
26922
27099
  meta: {
26923
27100
  name: "delete",
26924
27101
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -26959,7 +27136,7 @@ var deleteCommand3 = defineCommand156({
26959
27136
  });
26960
27137
 
26961
27138
  // src/commands/videos/get.ts
26962
- import { defineCommand as defineCommand157 } from "citty";
27139
+ import { defineCommand as defineCommand158 } from "citty";
26963
27140
  registerSchema({
26964
27141
  command: "videos.get",
26965
27142
  description: "Get a single video by ID",
@@ -26967,7 +27144,7 @@ registerSchema({
26967
27144
  id: { type: "string", description: "Video ID", required: true }
26968
27145
  }
26969
27146
  });
26970
- var getCommand5 = defineCommand157({
27147
+ var getCommand5 = defineCommand158({
26971
27148
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
26972
27149
  args: {
26973
27150
  id: { type: "positional", description: "Video ID", required: false },
@@ -27004,7 +27181,7 @@ var getCommand5 = defineCommand157({
27004
27181
  });
27005
27182
 
27006
27183
  // src/commands/videos/search.ts
27007
- import { defineCommand as defineCommand158 } from "citty";
27184
+ import { defineCommand as defineCommand159 } from "citty";
27008
27185
  registerSchema({
27009
27186
  command: "videos.search",
27010
27187
  description: "Search videos by text query. Only returns ready videos.",
@@ -27014,7 +27191,7 @@ registerSchema({
27014
27191
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27015
27192
  }
27016
27193
  });
27017
- var searchCommand3 = defineCommand158({
27194
+ var searchCommand3 = defineCommand159({
27018
27195
  meta: {
27019
27196
  name: "search",
27020
27197
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -27066,7 +27243,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
27066
27243
  // src/commands/videos/upload.ts
27067
27244
  import { readFile as readFile20, stat as stat5 } from "fs/promises";
27068
27245
  import { extname as extname3 } from "path";
27069
- import { defineCommand as defineCommand159 } from "citty";
27246
+ import { defineCommand as defineCommand160 } from "citty";
27070
27247
  var MIME_MAP = {
27071
27248
  ".mp4": "video/mp4",
27072
27249
  ".mov": "video/quicktime",
@@ -27100,7 +27277,7 @@ function detectContentType(filePath) {
27100
27277
  }
27101
27278
  return mime;
27102
27279
  }
27103
- var uploadCommand2 = defineCommand159({
27280
+ var uploadCommand2 = defineCommand160({
27104
27281
  meta: {
27105
27282
  name: "upload",
27106
27283
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -27154,7 +27331,7 @@ var uploadCommand2 = defineCommand159({
27154
27331
  });
27155
27332
 
27156
27333
  // src/commands/videos/index.ts
27157
- var videosCommand = defineCommand160({
27334
+ var videosCommand = defineCommand161({
27158
27335
  meta: {
27159
27336
  name: "videos",
27160
27337
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -27177,28 +27354,10 @@ Examples:
27177
27354
  });
27178
27355
 
27179
27356
  // src/commands/winning-ads/index.ts
27180
- import { defineCommand as defineCommand170 } from "citty";
27181
-
27182
- // src/commands/winning-ads/advertisers.ts
27183
- import { defineCommand as defineCommand161 } from "citty";
27184
-
27185
- // src/commands/winning-ads/shared.ts
27186
- function splitList(value) {
27187
- if (!value) {
27188
- return [];
27189
- }
27190
- return value.split(",").map((v) => v.trim()).filter(Boolean);
27191
- }
27192
- function reportError(err) {
27193
- if (err instanceof ApiError) {
27194
- writeJson({ ok: false, error: { code: err.code, message: err.message } });
27195
- process.exit(1);
27196
- }
27197
- writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
27198
- process.exit(1);
27199
- }
27357
+ import { defineCommand as defineCommand171 } from "citty";
27200
27358
 
27201
27359
  // src/commands/winning-ads/advertisers.ts
27360
+ import { defineCommand as defineCommand162 } from "citty";
27202
27361
  registerSchema({
27203
27362
  command: "winning-ads.advertisers",
27204
27363
  description: "List brands in the shared ad-dna corpus by name or domain. Use it to find your OWN advertiser (to --exclude-advertiser on search) or a competitor (to --advertiser-id on search / winners).",
@@ -27233,7 +27392,7 @@ function advertiserNormalizer(record, full) {
27233
27392
  last_synced_at: record.last_synced_at ?? null
27234
27393
  };
27235
27394
  }
27236
- var advertisersCommand2 = defineCommand161({
27395
+ var advertisersCommand2 = defineCommand162({
27237
27396
  meta: {
27238
27397
  name: "advertisers",
27239
27398
  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'
@@ -27291,7 +27450,7 @@ var advertisersCommand2 = defineCommand161({
27291
27450
  });
27292
27451
 
27293
27452
  // src/commands/winning-ads/brief.ts
27294
- import { defineCommand as defineCommand162 } from "citty";
27453
+ import { defineCommand as defineCommand163 } from "citty";
27295
27454
  registerSchema({
27296
27455
  command: "winning-ads.brief",
27297
27456
  description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
@@ -27337,7 +27496,7 @@ function parseDna(raw) {
27337
27496
  }
27338
27497
  return parsed;
27339
27498
  }
27340
- var briefCommand = defineCommand162({
27499
+ var briefCommand = defineCommand163({
27341
27500
  meta: {
27342
27501
  name: "brief",
27343
27502
  description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
@@ -27373,7 +27532,7 @@ var briefCommand = defineCommand162({
27373
27532
  });
27374
27533
 
27375
27534
  // src/commands/winning-ads/follow.ts
27376
- import { defineCommand as defineCommand163 } from "citty";
27535
+ import { defineCommand as defineCommand164 } from "citty";
27377
27536
  var PLATFORMS = ["meta", "linkedin"];
27378
27537
  registerSchema({
27379
27538
  command: "winning-ads.follow",
@@ -27388,7 +27547,7 @@ registerSchema({
27388
27547
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
27389
27548
  }
27390
27549
  });
27391
- var followCommand = defineCommand163({
27550
+ var followCommand = defineCommand164({
27392
27551
  meta: {
27393
27552
  name: "follow",
27394
27553
  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'
@@ -27435,7 +27594,7 @@ var followCommand = defineCommand163({
27435
27594
  });
27436
27595
 
27437
27596
  // src/commands/winning-ads/following.ts
27438
- import { defineCommand as defineCommand164 } from "citty";
27597
+ import { defineCommand as defineCommand165 } from "citty";
27439
27598
  registerSchema({
27440
27599
  command: "winning-ads.following",
27441
27600
  description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
@@ -27468,7 +27627,7 @@ function followingNormalizer(record, full) {
27468
27627
  platforms: Array.isArray(record.platforms) ? record.platforms : []
27469
27628
  };
27470
27629
  }
27471
- var followingCommand = defineCommand164({
27630
+ var followingCommand = defineCommand165({
27472
27631
  meta: {
27473
27632
  name: "following",
27474
27633
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -27503,7 +27662,7 @@ var followingCommand = defineCommand164({
27503
27662
  });
27504
27663
 
27505
27664
  // src/commands/winning-ads/patterns.ts
27506
- import { defineCommand as defineCommand165 } from "citty";
27665
+ import { defineCommand as defineCommand166 } from "citty";
27507
27666
  registerSchema({
27508
27667
  command: "winning-ads.patterns",
27509
27668
  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.",
@@ -27542,7 +27701,7 @@ function discriminatorRow(record) {
27542
27701
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
27543
27702
  };
27544
27703
  }
27545
- var patternsCommand = defineCommand165({
27704
+ var patternsCommand = defineCommand166({
27546
27705
  meta: {
27547
27706
  name: "patterns",
27548
27707
  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"
@@ -27598,7 +27757,7 @@ var patternsCommand = defineCommand165({
27598
27757
  });
27599
27758
 
27600
27759
  // src/commands/winning-ads/search.ts
27601
- import { defineCommand as defineCommand166 } from "citty";
27760
+ import { defineCommand as defineCommand167 } from "citty";
27602
27761
  registerSchema({
27603
27762
  command: "winning-ads.search",
27604
27763
  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.",
@@ -27706,7 +27865,7 @@ function buildSearchBody(args) {
27706
27865
  }
27707
27866
  return body;
27708
27867
  }
27709
- var searchCommand4 = defineCommand166({
27868
+ var searchCommand4 = defineCommand167({
27710
27869
  meta: {
27711
27870
  name: "search",
27712
27871
  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"
@@ -27821,7 +27980,7 @@ var searchCommand4 = defineCommand166({
27821
27980
  });
27822
27981
 
27823
27982
  // src/commands/winning-ads/seeds.ts
27824
- import { defineCommand as defineCommand167 } from "citty";
27983
+ import { defineCommand as defineCommand168 } from "citty";
27825
27984
  function leanRow(r) {
27826
27985
  return {
27827
27986
  key: r.key,
@@ -27849,7 +28008,7 @@ function makeSeedCommand(opts) {
27849
28008
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
27850
28009
  }
27851
28010
  });
27852
- return defineCommand167({
28011
+ return defineCommand168({
27853
28012
  meta: { name: opts.name, description: opts.description },
27854
28013
  args: {
27855
28014
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -27898,7 +28057,7 @@ var formatsCommand = makeSeedCommand({
27898
28057
  });
27899
28058
 
27900
28059
  // src/commands/winning-ads/unfollow.ts
27901
- import { defineCommand as defineCommand168 } from "citty";
28060
+ import { defineCommand as defineCommand169 } from "citty";
27902
28061
  registerSchema({
27903
28062
  command: "winning-ads.unfollow",
27904
28063
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -27906,7 +28065,7 @@ registerSchema({
27906
28065
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
27907
28066
  }
27908
28067
  });
27909
- var unfollowCommand = defineCommand168({
28068
+ var unfollowCommand = defineCommand169({
27910
28069
  meta: {
27911
28070
  name: "unfollow",
27912
28071
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -27927,7 +28086,7 @@ var unfollowCommand = defineCommand168({
27927
28086
  });
27928
28087
 
27929
28088
  // src/commands/winning-ads/winners.ts
27930
- import { defineCommand as defineCommand169 } from "citty";
28089
+ import { defineCommand as defineCommand170 } from "citty";
27931
28090
  registerSchema({
27932
28091
  command: "winning-ads.winners",
27933
28092
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -27937,7 +28096,7 @@ registerSchema({
27937
28096
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
27938
28097
  }
27939
28098
  });
27940
- var winnersCommand = defineCommand169({
28099
+ var winnersCommand = defineCommand170({
27941
28100
  meta: {
27942
28101
  name: "winners",
27943
28102
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -27987,7 +28146,7 @@ var winnersCommand = defineCommand169({
27987
28146
  });
27988
28147
 
27989
28148
  // src/commands/winning-ads/index.ts
27990
- var winningAdsCommand = defineCommand170({
28149
+ var winningAdsCommand = defineCommand171({
27991
28150
  meta: {
27992
28151
  name: "winning-ads",
27993
28152
  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.
@@ -28048,7 +28207,7 @@ function getCliVersion() {
28048
28207
  }
28049
28208
 
28050
28209
  // src/cli.ts
28051
- var main = defineCommand171({
28210
+ var main = defineCommand172({
28052
28211
  meta: {
28053
28212
  name: "baker",
28054
28213
  version: getCliVersion(),
@@ -28064,6 +28223,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28064
28223
  actions: actionsCommand,
28065
28224
  "scheduled-actions": scheduledActionsCommand,
28066
28225
  ads: adsCommand2,
28226
+ analytics: analyticsCommand2,
28067
28227
  ga4: ga4Command,
28068
28228
  gsc: gscCommand,
28069
28229
  research: researchCommand,