@koda-sl/baker-cli 0.120.0 → 0.121.0-dev.36aef87f5

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
@@ -13,7 +13,7 @@ import {
13
13
  generateCatalog,
14
14
  resolveConcurrency,
15
15
  validateCanvasDeep
16
- } from "./chunk-IWPAXJC3.js";
16
+ } from "./chunk-MWFJ5NOP.js";
17
17
  import {
18
18
  csvOrJson,
19
19
  daysAgoIso,
@@ -49,7 +49,7 @@ import {
49
49
  import "./chunk-5WRI5ZAA.js";
50
50
 
51
51
  // src/cli.ts
52
- import { defineCommand as defineCommand160, runMain } from "citty";
52
+ import { defineCommand as defineCommand161, runMain } from "citty";
53
53
 
54
54
  // src/commands/actions/index.ts
55
55
  import { defineCommand as defineCommand18 } from "citty";
@@ -848,7 +848,6 @@ var LINKEDIN_LIMITS = {
848
848
  choiceOptionsMax: 30,
849
849
  choiceOptionTextMax: 100,
850
850
  thankYouMessageMax: 300,
851
- privacyPolicyTextMax: 2e3,
852
851
  legalDisclaimerMax: 2e3,
853
852
  consentsMax: 5,
854
853
  // Campaign Manager caps disclosure checkboxes at 5
@@ -1443,7 +1442,6 @@ var leadFormFields = {
1443
1442
  /** Form language, e.g. { country: "US", language: "en" }. Defaults to the account locale on LinkedIn. */
1444
1443
  locale: z2.object({ country: z2.string().length(2), language: z2.string().length(2) }).optional(),
1445
1444
  privacyPolicyUrl: httpsUrlSchema,
1446
- privacyPolicyText: z2.string().max(LEAD.privacyPolicyTextMax).optional(),
1447
1445
  questions: z2.array(leadFormQuestionSchema).min(1).max(LEAD.questionsMax),
1448
1446
  consents: z2.array(leadFormConsentSchema).max(LEAD.consentsMax).optional(),
1449
1447
  hiddenFields: z2.array(leadFormHiddenFieldSchema).max(LEAD.hiddenFieldsMax).optional(),
@@ -1918,142 +1916,241 @@ var imagesIngestResponseSchema = z4.object({
1918
1916
  contentHash: z4.string()
1919
1917
  });
1920
1918
 
1921
- // ../api/src/testimonials.ts
1919
+ // ../api/src/tags.ts
1922
1920
  import { z as z5 } from "zod";
1923
- var testimonialSourceTypeSchema = z5.enum(["google", "trustpilot"]);
1924
- var testimonialStatusSchema = z5.enum(["pending", "processing", "ready", "error"]);
1925
- var testimonialSentimentSchema = z5.enum(["positive", "neutral", "negative"]);
1926
- var testimonialDocSchema = z5.object({
1927
- _id: z5.string(),
1928
- _creationTime: z5.number(),
1929
- companyId: z5.string(),
1930
- sourceId: z5.string(),
1921
+ var TAG_TYPES = [
1922
+ "meta",
1923
+ "amplitude",
1924
+ "googleAds",
1925
+ "tiktok",
1926
+ "vwo",
1927
+ "hotjar",
1928
+ "clarity",
1929
+ "pinterest",
1930
+ "code",
1931
+ "googleAnalytics",
1932
+ "googleTagManager",
1933
+ "hubspot",
1934
+ "linkedinInsightTag",
1935
+ "onetrust",
1936
+ "posthog",
1937
+ "datafast",
1938
+ "recaptcha",
1939
+ "twitterAds"
1940
+ ];
1941
+ var tagTypeSchema = z5.enum(TAG_TYPES);
1942
+ var tagDraftOpKindSchema = z5.enum(["create", "update", "delete"]);
1943
+ var tagDraftOpViewSchema = z5.object({
1944
+ /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
1945
+ ref: z5.string(),
1946
+ kind: tagDraftOpKindSchema,
1947
+ type: tagTypeSchema,
1948
+ /** Present on update/delete ops — the real tag this op targets. */
1949
+ tagId: z5.string().optional(),
1950
+ /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
1951
+ config: z5.record(z5.string(), z5.string()),
1952
+ /** Update only — fields the op explicitly clears. */
1953
+ clearFields: z5.array(z5.string()).optional(),
1954
+ /** Names of secret fields already provided via the dashboard secure form. Never values. */
1955
+ secretsSet: z5.array(z5.string()),
1956
+ /** Names of secret fields still awaiting user input. */
1957
+ secretsPending: z5.array(z5.string()),
1958
+ summary: z5.string(),
1959
+ stagedAt: z5.number()
1960
+ });
1961
+ var tagsEffectiveEntrySchema = z5.object({
1962
+ /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
1963
+ ref: z5.string(),
1964
+ tagId: z5.string().optional(),
1965
+ type: tagTypeSchema,
1966
+ /** Value of the type's identifying field, when set. */
1967
+ identifier: z5.string().optional(),
1968
+ /** Redacted config; for staged updates, production config with the patch merged. */
1969
+ config: z5.record(z5.string(), z5.string()),
1970
+ /** Absent = live production tag with no staged changes in this chat. */
1971
+ staged: tagDraftOpKindSchema.optional(),
1972
+ secretsSet: z5.array(z5.string()),
1973
+ secretsPending: z5.array(z5.string())
1974
+ });
1975
+ var tagsListRequestSchema = z5.object({ chatId: z5.string() });
1976
+ var tagsListResponseSchema = z5.object({ tags: z5.array(tagsEffectiveEntrySchema) });
1977
+ var tagsDraftListRequestSchema = z5.object({ chatId: z5.string() });
1978
+ var tagsDraftListResponseSchema = z5.object({
1979
+ status: z5.enum(["active", "publishing", "applied", "discarded", "none"]),
1980
+ ops: z5.array(tagDraftOpViewSchema)
1981
+ });
1982
+ var tagInputRequestSchema = z5.object({
1983
+ // Every tag change is a tab in the approval form: create/edit show the full
1984
+ // body; delete shows a confirm. No tag change bypasses this approval.
1985
+ mode: z5.enum(["create", "edit", "delete"]),
1986
+ tagType: tagTypeSchema,
1987
+ /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
1988
+ ref: z5.string().optional(),
1989
+ /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
1990
+ prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
1991
+ /** Secret field names the agent asks the user to provide. */
1992
+ requestedSecretFields: z5.array(z5.string()).optional(),
1993
+ /** Short message shown above the form explaining why the input is needed. */
1994
+ message: z5.string().optional()
1995
+ });
1996
+ var tagChangeToolInputSchema = z5.object({
1997
+ changes: z5.array(tagInputRequestSchema).min(1).max(8)
1998
+ });
1999
+ var tagInputResultSchema = z5.discriminatedUnion("status", [
2000
+ z5.object({
2001
+ status: z5.literal("submitted"),
2002
+ ref: z5.string(),
2003
+ type: tagTypeSchema,
2004
+ /** Identifying field name → value (non-secret), when the type has one. */
2005
+ identifier: z5.record(z5.string(), z5.string()).optional(),
2006
+ secretFieldsSet: z5.array(z5.string()),
2007
+ note: z5.string().optional()
2008
+ }),
2009
+ z5.object({
2010
+ status: z5.literal("declined"),
2011
+ reason: z5.string().optional()
2012
+ })
2013
+ ]);
2014
+ var tagChangeToolResultSchema = z5.object({
2015
+ results: z5.array(tagInputResultSchema)
2016
+ });
2017
+
2018
+ // ../api/src/testimonials.ts
2019
+ import { z as z6 } from "zod";
2020
+ var testimonialSourceTypeSchema = z6.enum(["google", "trustpilot"]);
2021
+ var testimonialStatusSchema = z6.enum(["pending", "processing", "ready", "error"]);
2022
+ var testimonialSentimentSchema = z6.enum(["positive", "neutral", "negative"]);
2023
+ var testimonialDocSchema = z6.object({
2024
+ _id: z6.string(),
2025
+ _creationTime: z6.number(),
2026
+ companyId: z6.string(),
2027
+ sourceId: z6.string(),
1931
2028
  sourceType: testimonialSourceTypeSchema,
1932
- reviewText: z5.string(),
1933
- reviewTitle: z5.string().optional(),
1934
- searchText: z5.string().optional(),
1935
- reviewerName: z5.string().optional(),
1936
- reviewerImageUrl: z5.string().optional(),
1937
- reviewerImageId: z5.string().optional(),
1938
- reviewerLocation: z5.string().optional(),
1939
- rating: z5.number().optional(),
1940
- reviewDate: z5.number().optional(),
1941
- ownerAnswer: z5.string().optional(),
1942
- mediaUrls: z5.array(z5.string()).optional(),
1943
- imageIds: z5.array(z5.string()).optional(),
1944
- videoIds: z5.array(z5.string()).optional(),
1945
- sourceUrl: z5.string().optional(),
1946
- rawData: z5.unknown().optional(),
1947
- tags: z5.array(z5.string()),
1948
- highlight: z5.string().optional(),
1949
- language: z5.string().optional(),
1950
- summary: z5.string().optional(),
2029
+ reviewText: z6.string(),
2030
+ reviewTitle: z6.string().optional(),
2031
+ searchText: z6.string().optional(),
2032
+ reviewerName: z6.string().optional(),
2033
+ reviewerImageUrl: z6.string().optional(),
2034
+ reviewerImageId: z6.string().optional(),
2035
+ reviewerLocation: z6.string().optional(),
2036
+ rating: z6.number().optional(),
2037
+ reviewDate: z6.number().optional(),
2038
+ ownerAnswer: z6.string().optional(),
2039
+ mediaUrls: z6.array(z6.string()).optional(),
2040
+ imageIds: z6.array(z6.string()).optional(),
2041
+ videoIds: z6.array(z6.string()).optional(),
2042
+ sourceUrl: z6.string().optional(),
2043
+ rawData: z6.unknown().optional(),
2044
+ tags: z6.array(z6.string()),
2045
+ highlight: z6.string().optional(),
2046
+ language: z6.string().optional(),
2047
+ summary: z6.string().optional(),
1951
2048
  sentiment: testimonialSentimentSchema.optional(),
1952
- textEmbedding: z5.array(z5.number()).optional(),
1953
- externalId: z5.string().optional(),
1954
- contentHash: z5.string().optional(),
2049
+ textEmbedding: z6.array(z6.number()).optional(),
2050
+ externalId: z6.string().optional(),
2051
+ contentHash: z6.string().optional(),
1955
2052
  status: testimonialStatusSchema,
1956
- errorMessage: z5.string().optional(),
1957
- createdAt: z5.number(),
1958
- updatedAt: z5.number()
2053
+ errorMessage: z6.string().optional(),
2054
+ createdAt: z6.number(),
2055
+ updatedAt: z6.number()
1959
2056
  });
1960
- var testimonialsListRequestSchema = z5.object({
2057
+ var testimonialsListRequestSchema = z6.object({
1961
2058
  source: testimonialSourceTypeSchema.optional(),
1962
- rating_min: z5.coerce.number().int().min(1).max(5).optional(),
1963
- rating_max: z5.coerce.number().int().min(1).max(5).optional(),
1964
- tags: z5.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2059
+ rating_min: z6.coerce.number().int().min(1).max(5).optional(),
2060
+ rating_max: z6.coerce.number().int().min(1).max(5).optional(),
2061
+ tags: z6.string().transform((s) => s.split(",").filter(Boolean)).optional(),
1965
2062
  status: testimonialStatusSchema.optional(),
1966
2063
  sentiment: testimonialSentimentSchema.optional(),
1967
- language: z5.string().min(2).max(5).optional(),
1968
- limit: z5.coerce.number().int().positive().max(200).optional()
1969
- });
1970
- var testimonialsListResponseSchema = z5.array(testimonialDocSchema);
1971
- var testimonialsGetRequestSchema = z5.object({ id: z5.string().min(1, "Missing id parameter") });
1972
- var testimonialsSearchRequestSchema = z5.object({
1973
- query: z5.string().min(1),
1974
- limit: z5.coerce.number().int().positive().max(100).optional(),
2064
+ language: z6.string().min(2).max(5).optional(),
2065
+ limit: z6.coerce.number().int().positive().max(200).optional()
2066
+ });
2067
+ var testimonialsListResponseSchema = z6.array(testimonialDocSchema);
2068
+ var testimonialsGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
2069
+ var testimonialsSearchRequestSchema = z6.object({
2070
+ query: z6.string().min(1),
2071
+ limit: z6.coerce.number().int().positive().max(100).optional(),
1975
2072
  source: testimonialSourceTypeSchema.optional(),
1976
- rating_min: z5.coerce.number().int().min(1).max(5).optional(),
1977
- rating_max: z5.coerce.number().int().min(1).max(5).optional(),
1978
- tags: z5.array(z5.string()).optional(),
2073
+ rating_min: z6.coerce.number().int().min(1).max(5).optional(),
2074
+ rating_max: z6.coerce.number().int().min(1).max(5).optional(),
2075
+ tags: z6.array(z6.string()).optional(),
1979
2076
  status: testimonialStatusSchema.optional(),
1980
2077
  sentiment: testimonialSentimentSchema.optional(),
1981
- language: z5.string().min(2).max(5).optional()
2078
+ language: z6.string().min(2).max(5).optional()
1982
2079
  }).refine(
1983
2080
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
1984
2081
  { message: "rating_min must be less than or equal to rating_max" }
1985
2082
  );
1986
- var testimonialsSearchResponseSchema = z5.array(testimonialDocSchema);
1987
- var testimonialsOutscraperWebhookResponseSchema = z5.object({
1988
- ok: z5.literal(true),
1989
- note: z5.string().optional()
2083
+ var testimonialsSearchResponseSchema = z6.array(testimonialDocSchema);
2084
+ var testimonialsOutscraperWebhookResponseSchema = z6.object({
2085
+ ok: z6.literal(true),
2086
+ note: z6.string().optional()
1990
2087
  });
1991
2088
 
1992
2089
  // ../api/src/videos.ts
1993
- import { z as z6 } from "zod";
1994
- var videoStatusSchema = z6.enum(["uploading", "uploaded", "processing", "ready", "error"]);
1995
- var videoTranscriptSegmentSchema = z6.object({
1996
- text: z6.string(),
1997
- startSecond: z6.number(),
1998
- endSecond: z6.number()
1999
- });
2000
- var videoSceneSchema = z6.object({
2001
- title: z6.string(),
2002
- description: z6.string(),
2003
- startSecond: z6.number(),
2004
- endSecond: z6.number(),
2005
- thumbnailTime: z6.number()
2006
- });
2007
- var videoDocSchema = z6.object({
2008
- _id: z6.string(),
2009
- _creationTime: z6.number(),
2010
- companyId: z6.string(),
2011
- muxAssetId: z6.string(),
2012
- muxPlaybackId: z6.string(),
2013
- muxUploadId: z6.string(),
2014
- name: z6.string(),
2015
- description: z6.string(),
2016
- tags: z6.array(z6.string()),
2017
- source: z6.string(),
2018
- externalId: z6.string().optional(),
2019
- sourceId: z6.string().optional(),
2020
- width: z6.number().optional(),
2021
- height: z6.number().optional(),
2022
- aspectRatio: z6.number().optional(),
2023
- duration: z6.number().optional(),
2024
- transcript: z6.string().optional(),
2025
- transcriptSegments: z6.array(videoTranscriptSegmentSchema).optional(),
2026
- scenes: z6.array(videoSceneSchema).optional(),
2027
- descriptionEmbedding: z6.array(z6.number()).optional(),
2028
- searchText: z6.string().optional(),
2090
+ import { z as z7 } from "zod";
2091
+ var videoStatusSchema = z7.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2092
+ var videoTranscriptSegmentSchema = z7.object({
2093
+ text: z7.string(),
2094
+ startSecond: z7.number(),
2095
+ endSecond: z7.number()
2096
+ });
2097
+ var videoSceneSchema = z7.object({
2098
+ title: z7.string(),
2099
+ description: z7.string(),
2100
+ startSecond: z7.number(),
2101
+ endSecond: z7.number(),
2102
+ thumbnailTime: z7.number()
2103
+ });
2104
+ var videoDocSchema = z7.object({
2105
+ _id: z7.string(),
2106
+ _creationTime: z7.number(),
2107
+ companyId: z7.string(),
2108
+ muxAssetId: z7.string(),
2109
+ muxPlaybackId: z7.string(),
2110
+ muxUploadId: z7.string(),
2111
+ name: z7.string(),
2112
+ description: z7.string(),
2113
+ tags: z7.array(z7.string()),
2114
+ source: z7.string(),
2115
+ externalId: z7.string().optional(),
2116
+ sourceId: z7.string().optional(),
2117
+ width: z7.number().optional(),
2118
+ height: z7.number().optional(),
2119
+ aspectRatio: z7.number().optional(),
2120
+ duration: z7.number().optional(),
2121
+ transcript: z7.string().optional(),
2122
+ transcriptSegments: z7.array(videoTranscriptSegmentSchema).optional(),
2123
+ scenes: z7.array(videoSceneSchema).optional(),
2124
+ descriptionEmbedding: z7.array(z7.number()).optional(),
2125
+ searchText: z7.string().optional(),
2029
2126
  status: videoStatusSchema,
2030
- errorMessage: z6.string().optional(),
2031
- createdAt: z6.number(),
2032
- updatedAt: z6.number(),
2033
- thumbnailUrl: z6.string()
2034
- });
2035
- var videosWebhookResponseSchema = z6.object({ ok: z6.literal(true) });
2036
- var videosGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
2037
- var videosSearchRequestSchema = z6.object({
2038
- query: z6.string().min(1),
2039
- limit: z6.coerce.number().int().positive().max(100).optional(),
2040
- tags: z6.array(z6.string()).optional()
2041
- });
2042
- var videoSearchResultSchema = z6.object({
2043
- _id: z6.string(),
2044
- thumbnailUrl: z6.string(),
2045
- name: z6.string(),
2046
- description: z6.string(),
2047
- tags: z6.array(z6.string()),
2048
- status: z6.string(),
2049
- duration: z6.number().optional(),
2050
- muxPlaybackId: z6.string(),
2051
- createdAt: z6.number()
2052
- });
2053
- var videosSearchResponseSchema = z6.array(videoSearchResultSchema);
2054
- var videosUploadResponseSchema = z6.object({ uploadUrl: z6.string(), videoId: z6.string() });
2055
- var videosDeleteRequestSchema = z6.object({ id: z6.string().min(1, "Missing video ID") });
2056
- var videosDeleteResponseSchema = z6.object({ ok: z6.literal(true) });
2127
+ errorMessage: z7.string().optional(),
2128
+ createdAt: z7.number(),
2129
+ updatedAt: z7.number(),
2130
+ thumbnailUrl: z7.string()
2131
+ });
2132
+ var videosWebhookResponseSchema = z7.object({ ok: z7.literal(true) });
2133
+ var videosGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2134
+ var videosSearchRequestSchema = z7.object({
2135
+ query: z7.string().min(1),
2136
+ limit: z7.coerce.number().int().positive().max(100).optional(),
2137
+ tags: z7.array(z7.string()).optional()
2138
+ });
2139
+ var videoSearchResultSchema = z7.object({
2140
+ _id: z7.string(),
2141
+ thumbnailUrl: z7.string(),
2142
+ name: z7.string(),
2143
+ description: z7.string(),
2144
+ tags: z7.array(z7.string()),
2145
+ status: z7.string(),
2146
+ duration: z7.number().optional(),
2147
+ muxPlaybackId: z7.string(),
2148
+ createdAt: z7.number()
2149
+ });
2150
+ var videosSearchResponseSchema = z7.array(videoSearchResultSchema);
2151
+ var videosUploadResponseSchema = z7.object({ uploadUrl: z7.string(), videoId: z7.string() });
2152
+ var videosDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing video ID") });
2153
+ var videosDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
2057
2154
 
2058
2155
  // src/commands/actions/complete.ts
2059
2156
  import { defineCommand as defineCommand2 } from "citty";
@@ -3866,37 +3963,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
3866
3963
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
3867
3964
 
3868
3965
  // ../api/src/ads-google/ops.ts
3869
- import { z as z7 } from "zod";
3870
- var tempRefSchema2 = z7.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
3871
- var refSchema = z7.union([
3872
- z7.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
3873
- z7.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
3966
+ import { z as z8 } from "zod";
3967
+ var tempRefSchema2 = z8.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
3968
+ var refSchema = z8.union([
3969
+ z8.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
3970
+ z8.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
3874
3971
  tempRefSchema2
3875
3972
  ]);
3876
3973
  var targetRefSchema = refSchema;
3877
- var microsSchema = z7.number().int().positive("expected a positive micros amount");
3878
- var httpsUrlSchema2 = z7.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
3879
- var customerIdSchema = z7.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
3880
- var stageableStatusSchema2 = z7.enum(STAGEABLE_CREATE_STATUSES2);
3881
- var matchTypeSchema = z7.enum(KEYWORD_MATCH_TYPES);
3882
- var keywordTextSchema = z7.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");
3883
- var budgetCreateSchema = z7.object({
3884
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
3974
+ var microsSchema = z8.number().int().positive("expected a positive micros amount");
3975
+ var httpsUrlSchema2 = z8.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
3976
+ var customerIdSchema = z8.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
3977
+ var stageableStatusSchema2 = z8.enum(STAGEABLE_CREATE_STATUSES2);
3978
+ var matchTypeSchema = z8.enum(KEYWORD_MATCH_TYPES);
3979
+ var keywordTextSchema = z8.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");
3980
+ var budgetCreateSchema = z8.object({
3981
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
3885
3982
  amountMicros: microsSchema,
3886
- deliveryMethod: z7.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
3887
- explicitlyShared: z7.boolean().default(false)
3983
+ deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
3984
+ explicitlyShared: z8.boolean().default(false)
3888
3985
  });
3889
- var budgetUpdateSchema = z7.object({
3890
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
3986
+ var budgetUpdateSchema = z8.object({
3987
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
3891
3988
  amountMicros: microsSchema.optional(),
3892
- deliveryMethod: z7.enum(BUDGET_DELIVERY_METHODS).optional()
3989
+ deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).optional()
3893
3990
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
3894
- var biddingConfigSchema = z7.object({
3895
- type: z7.enum(BIDDING_STRATEGY_TYPES),
3991
+ var biddingConfigSchema = z8.object({
3992
+ type: z8.enum(BIDDING_STRATEGY_TYPES),
3896
3993
  targetCpaMicros: microsSchema.optional(),
3897
- targetRoas: z7.number().positive().optional(),
3994
+ targetRoas: z8.number().positive().optional(),
3898
3995
  cpcBidCeilingMicros: microsSchema.optional(),
3899
- enhancedCpcEnabled: z7.boolean().optional()
3996
+ enhancedCpcEnabled: z8.boolean().optional()
3900
3997
  }).superRefine((p, ctx) => {
3901
3998
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
3902
3999
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -3905,17 +4002,17 @@ var biddingConfigSchema = z7.object({
3905
4002
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
3906
4003
  }
3907
4004
  });
3908
- var networkSettingsSchema = z7.object({
3909
- targetGoogleSearch: z7.boolean().optional(),
3910
- targetSearchNetwork: z7.boolean().optional(),
3911
- targetContentNetwork: z7.boolean().optional(),
3912
- targetPartnerSearchNetwork: z7.boolean().optional()
4005
+ var networkSettingsSchema = z8.object({
4006
+ targetGoogleSearch: z8.boolean().optional(),
4007
+ targetSearchNetwork: z8.boolean().optional(),
4008
+ targetContentNetwork: z8.boolean().optional(),
4009
+ targetPartnerSearchNetwork: z8.boolean().optional()
3913
4010
  });
3914
- var dateSchema = z7.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
3915
- var campaignCreateSchema2 = z7.object({
3916
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
3917
- channelType: z7.enum(ADVERTISING_CHANNEL_TYPES),
3918
- channelSubType: z7.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4011
+ var dateSchema = z8.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4012
+ var campaignCreateSchema2 = z8.object({
4013
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4014
+ channelType: z8.enum(ADVERTISING_CHANNEL_TYPES),
4015
+ channelSubType: z8.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
3919
4016
  budget: refSchema,
3920
4017
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
3921
4018
  bidding: biddingConfigSchema.optional(),
@@ -3924,7 +4021,7 @@ var campaignCreateSchema2 = z7.object({
3924
4021
  startDate: dateSchema.optional(),
3925
4022
  endDate: dateSchema.optional(),
3926
4023
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
3927
- objective: z7.enum(CAMPAIGN_OBJECTIVES).optional(),
4024
+ objective: z8.enum(CAMPAIGN_OBJECTIVES).optional(),
3928
4025
  status: stageableStatusSchema2.default("PAUSED")
3929
4026
  }).superRefine((p, ctx) => {
3930
4027
  if (!p.bidding && !p.biddingStrategy) {
@@ -3948,129 +4045,129 @@ var campaignCreateSchema2 = z7.object({
3948
4045
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
3949
4046
  }
3950
4047
  });
3951
- var campaignUpdateSchema2 = z7.object({
3952
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4048
+ var campaignUpdateSchema2 = z8.object({
4049
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
3953
4050
  budget: refSchema.optional(),
3954
4051
  bidding: biddingConfigSchema.optional(),
3955
4052
  networkSettings: networkSettingsSchema.optional(),
3956
4053
  startDate: dateSchema.optional(),
3957
4054
  endDate: dateSchema.optional(),
3958
- status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4055
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
3959
4056
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
3960
- var adGroupCreateSchema = z7.object({
3961
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4057
+ var adGroupCreateSchema = z8.object({
4058
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
3962
4059
  campaign: refSchema,
3963
- type: z7.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4060
+ type: z8.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
3964
4061
  cpcBidMicros: microsSchema.optional(),
3965
4062
  status: stageableStatusSchema2.default("PAUSED")
3966
4063
  });
3967
- var adGroupUpdateSchema = z7.object({
3968
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4064
+ var adGroupUpdateSchema = z8.object({
4065
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
3969
4066
  cpcBidMicros: microsSchema.optional(),
3970
- status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4067
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
3971
4068
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
3972
- var keywordAddSchema = z7.object({
4069
+ var keywordAddSchema = z8.object({
3973
4070
  adGroup: refSchema,
3974
4071
  text: keywordTextSchema,
3975
4072
  matchType: matchTypeSchema,
3976
4073
  cpcBidMicros: microsSchema.optional(),
3977
- finalUrls: z7.array(httpsUrlSchema2).optional(),
4074
+ finalUrls: z8.array(httpsUrlSchema2).optional(),
3978
4075
  status: stageableStatusSchema2.default("ENABLED")
3979
4076
  });
3980
- var keywordUpdateSchema = z7.object({
4077
+ var keywordUpdateSchema = z8.object({
3981
4078
  cpcBidMicros: microsSchema.optional(),
3982
- finalUrls: z7.array(httpsUrlSchema2).optional(),
3983
- status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4079
+ finalUrls: z8.array(httpsUrlSchema2).optional(),
4080
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
3984
4081
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
3985
- var negativeKeywordAddSchema = z7.object({
3986
- level: z7.enum(["adGroup", "campaign"]),
4082
+ var negativeKeywordAddSchema = z8.object({
4083
+ level: z8.enum(["adGroup", "campaign"]),
3987
4084
  parent: refSchema,
3988
4085
  text: keywordTextSchema,
3989
4086
  matchType: matchTypeSchema
3990
4087
  });
3991
- var sharedSetCreateSchema = z7.object({
3992
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
3993
- type: z7.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4088
+ var sharedSetCreateSchema = z8.object({
4089
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4090
+ type: z8.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
3994
4091
  });
3995
- var sharedSetMemberAddSchema = z7.object({
4092
+ var sharedSetMemberAddSchema = z8.object({
3996
4093
  sharedSet: refSchema,
3997
4094
  text: keywordTextSchema,
3998
4095
  matchType: matchTypeSchema
3999
4096
  });
4000
- var campaignSharedSetAttachSchema = z7.object({
4097
+ var campaignSharedSetAttachSchema = z8.object({
4001
4098
  campaign: refSchema,
4002
4099
  sharedSet: refSchema
4003
4100
  });
4004
- var adTextAssetSchema = z7.object({
4005
- text: z7.string().min(1),
4006
- pinnedField: z7.enum(PINNED_FIELDS).optional()
4101
+ var adTextAssetSchema = z8.object({
4102
+ text: z8.string().min(1),
4103
+ pinnedField: z8.enum(PINNED_FIELDS).optional()
4007
4104
  });
4008
- var responsiveSearchAdSchema = z7.object({
4009
- format: z7.literal("responsiveSearch"),
4010
- headlines: z7.array(
4105
+ var responsiveSearchAdSchema = z8.object({
4106
+ format: z8.literal("responsiveSearch"),
4107
+ headlines: z8.array(
4011
4108
  adTextAssetSchema.refine(
4012
4109
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4013
4110
  "headline exceeds 30 chars"
4014
4111
  )
4015
4112
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4016
- descriptions: z7.array(
4113
+ descriptions: z8.array(
4017
4114
  adTextAssetSchema.refine(
4018
4115
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4019
4116
  "description exceeds 90 chars"
4020
4117
  )
4021
4118
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4022
- path1: z7.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4023
- path2: z7.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4024
- finalUrls: z7.array(httpsUrlSchema2).min(1)
4025
- });
4026
- var responsiveDisplayAdSchema = z7.object({
4027
- format: z7.literal("responsiveDisplay"),
4028
- headlines: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4029
- longHeadline: z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4030
- descriptions: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4031
- businessName: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4119
+ path1: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4120
+ path2: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4121
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4122
+ });
4123
+ var responsiveDisplayAdSchema = z8.object({
4124
+ format: z8.literal("responsiveDisplay"),
4125
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4126
+ longHeadline: z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4127
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4128
+ businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4032
4129
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4033
4130
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4034
4131
  // image (1:1) to serve; the logo images are optional.
4035
- marketingImageAssets: z7.array(refSchema).optional(),
4036
- squareMarketingImageAssets: z7.array(refSchema).optional(),
4037
- logoImageAssets: z7.array(refSchema).optional(),
4038
- finalUrls: z7.array(httpsUrlSchema2).min(1)
4039
- });
4040
- var callAdSchema = z7.object({
4041
- format: z7.literal("call"),
4042
- countryCode: z7.string().length(2),
4043
- phoneNumber: z7.string().min(3),
4044
- headline1: z7.string().min(1).max(30),
4045
- headline2: z7.string().min(1).max(30),
4046
- description1: z7.string().min(1).max(90),
4047
- description2: z7.string().min(1).max(90),
4048
- businessName: z7.string().min(1).max(25),
4049
- finalUrls: z7.array(httpsUrlSchema2).min(1)
4050
- });
4051
- var appAdSchema = z7.object({
4052
- format: z7.literal("app"),
4053
- headlines: z7.array(z7.object({ text: z7.string().min(1).max(30) })).min(1),
4054
- descriptions: z7.array(z7.object({ text: z7.string().min(1).max(90) })).min(1)
4055
- });
4056
- var videoAdSchema = z7.object({
4057
- format: z7.literal("video"),
4132
+ marketingImageAssets: z8.array(refSchema).optional(),
4133
+ squareMarketingImageAssets: z8.array(refSchema).optional(),
4134
+ logoImageAssets: z8.array(refSchema).optional(),
4135
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4136
+ });
4137
+ var callAdSchema = z8.object({
4138
+ format: z8.literal("call"),
4139
+ countryCode: z8.string().length(2),
4140
+ phoneNumber: z8.string().min(3),
4141
+ headline1: z8.string().min(1).max(30),
4142
+ headline2: z8.string().min(1).max(30),
4143
+ description1: z8.string().min(1).max(90),
4144
+ description2: z8.string().min(1).max(90),
4145
+ businessName: z8.string().min(1).max(25),
4146
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4147
+ });
4148
+ var appAdSchema = z8.object({
4149
+ format: z8.literal("app"),
4150
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(1),
4151
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1)
4152
+ });
4153
+ var videoAdSchema = z8.object({
4154
+ format: z8.literal("video"),
4058
4155
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4059
4156
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4060
- videoAssets: z7.array(refSchema).min(1),
4061
- finalUrls: z7.array(httpsUrlSchema2).min(1)
4062
- });
4063
- var demandGenAdSchema = z7.object({
4064
- format: z7.literal("demandGen"),
4065
- headlines: z7.array(z7.object({ text: z7.string().min(1).max(40) })).min(1).max(5),
4066
- descriptions: z7.array(z7.object({ text: z7.string().min(1).max(90) })).min(1).max(5),
4067
- businessName: z7.string().min(1).max(25),
4068
- finalUrls: z7.array(httpsUrlSchema2).min(1),
4069
- imageAssets: z7.array(refSchema).optional(),
4070
- squareImageAssets: z7.array(refSchema).optional(),
4071
- logoImageAssets: z7.array(refSchema).optional()
4072
- });
4073
- var adContentSchema = z7.discriminatedUnion("format", [
4157
+ videoAssets: z8.array(refSchema).min(1),
4158
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4159
+ });
4160
+ var demandGenAdSchema = z8.object({
4161
+ format: z8.literal("demandGen"),
4162
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(40) })).min(1).max(5),
4163
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1).max(5),
4164
+ businessName: z8.string().min(1).max(25),
4165
+ finalUrls: z8.array(httpsUrlSchema2).min(1),
4166
+ imageAssets: z8.array(refSchema).optional(),
4167
+ squareImageAssets: z8.array(refSchema).optional(),
4168
+ logoImageAssets: z8.array(refSchema).optional()
4169
+ });
4170
+ var adContentSchema = z8.discriminatedUnion("format", [
4074
4171
  responsiveSearchAdSchema,
4075
4172
  responsiveDisplayAdSchema,
4076
4173
  callAdSchema,
@@ -4078,45 +4175,45 @@ var adContentSchema = z7.discriminatedUnion("format", [
4078
4175
  videoAdSchema,
4079
4176
  demandGenAdSchema
4080
4177
  ]);
4081
- var adCreateSchema = z7.object({
4178
+ var adCreateSchema = z8.object({
4082
4179
  adGroup: refSchema,
4083
4180
  status: stageableStatusSchema2.default("PAUSED"),
4084
4181
  content: adContentSchema
4085
4182
  });
4086
- var adUpdateSchema = z7.object({
4087
- status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4183
+ var adUpdateSchema = z8.object({
4184
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4088
4185
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4089
- content: z7.record(z7.string(), z7.unknown()).optional()
4186
+ content: z8.record(z8.string(), z8.unknown()).optional()
4090
4187
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4091
- var textAssetSchema = z7.object({ type: z7.literal("text"), text: z7.string().min(1) });
4092
- var imageAssetSchema = z7.object({
4093
- type: z7.literal("image"),
4094
- imageId: z7.string().min(1),
4095
- name: z7.string().optional()
4096
- });
4097
- var youtubeVideoAssetSchema = z7.object({
4098
- type: z7.literal("youtubeVideo"),
4099
- youtubeVideoId: z7.string().min(1),
4100
- name: z7.string().optional()
4101
- });
4102
- var sitelinkAssetSchema = z7.object({
4103
- type: z7.literal("sitelink"),
4104
- linkText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4105
- description1: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4106
- description2: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4107
- finalUrls: z7.array(httpsUrlSchema2).min(1)
4108
- });
4109
- var calloutAssetSchema = z7.object({
4110
- type: z7.literal("callout"),
4111
- calloutText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4112
- });
4113
- var structuredSnippetAssetSchema = z7.object({
4114
- type: z7.literal("structuredSnippet"),
4115
- header: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4116
- values: z7.array(z7.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4117
- });
4118
- var callToActionAssetSchema = z7.object({ type: z7.literal("callToAction"), callToAction: z7.string().min(1) });
4119
- var assetCreateSchema = z7.discriminatedUnion("type", [
4188
+ var textAssetSchema = z8.object({ type: z8.literal("text"), text: z8.string().min(1) });
4189
+ var imageAssetSchema = z8.object({
4190
+ type: z8.literal("image"),
4191
+ imageId: z8.string().min(1),
4192
+ name: z8.string().optional()
4193
+ });
4194
+ var youtubeVideoAssetSchema = z8.object({
4195
+ type: z8.literal("youtubeVideo"),
4196
+ youtubeVideoId: z8.string().min(1),
4197
+ name: z8.string().optional()
4198
+ });
4199
+ var sitelinkAssetSchema = z8.object({
4200
+ type: z8.literal("sitelink"),
4201
+ linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4202
+ description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4203
+ description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4204
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4205
+ });
4206
+ var calloutAssetSchema = z8.object({
4207
+ type: z8.literal("callout"),
4208
+ calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4209
+ });
4210
+ var structuredSnippetAssetSchema = z8.object({
4211
+ type: z8.literal("structuredSnippet"),
4212
+ header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4213
+ values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4214
+ });
4215
+ var callToActionAssetSchema = z8.object({ type: z8.literal("callToAction"), callToAction: z8.string().min(1) });
4216
+ var assetCreateSchema = z8.discriminatedUnion("type", [
4120
4217
  textAssetSchema,
4121
4218
  imageAssetSchema,
4122
4219
  youtubeVideoAssetSchema,
@@ -4125,136 +4222,136 @@ var assetCreateSchema = z7.discriminatedUnion("type", [
4125
4222
  structuredSnippetAssetSchema,
4126
4223
  callToActionAssetSchema
4127
4224
  ]);
4128
- var assetUpdateSchema = z7.object({
4129
- name: z7.string().min(1).optional(),
4130
- linkText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4131
- description1: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4132
- description2: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4133
- finalUrls: z7.array(httpsUrlSchema2).min(1).optional(),
4134
- calloutText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4135
- header: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4136
- values: z7.array(z7.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4137
- callToAction: z7.string().min(1).optional(),
4138
- text: z7.string().min(1).optional()
4225
+ var assetUpdateSchema = z8.object({
4226
+ name: z8.string().min(1).optional(),
4227
+ linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4228
+ description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4229
+ description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4230
+ finalUrls: z8.array(httpsUrlSchema2).min(1).optional(),
4231
+ calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4232
+ header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4233
+ values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4234
+ callToAction: z8.string().min(1).optional(),
4235
+ text: z8.string().min(1).optional()
4139
4236
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4140
- var assetLinkAttachSchema = z7.object({
4141
- level: z7.enum(["campaign", "adGroup", "customer"]),
4237
+ var assetLinkAttachSchema = z8.object({
4238
+ level: z8.enum(["campaign", "adGroup", "customer"]),
4142
4239
  parent: refSchema.optional(),
4143
4240
  asset: refSchema,
4144
- fieldType: z7.enum(ASSET_FIELD_TYPES)
4241
+ fieldType: z8.enum(ASSET_FIELD_TYPES)
4145
4242
  }).superRefine((value, ctx) => {
4146
4243
  if (value.level !== "customer" && !value.parent) {
4147
4244
  ctx.addIssue({
4148
- code: z7.ZodIssueCode.custom,
4245
+ code: z8.ZodIssueCode.custom,
4149
4246
  path: ["parent"],
4150
4247
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4151
4248
  });
4152
4249
  }
4153
4250
  });
4154
- var assetGroupCreateSchema = z7.object({
4251
+ var assetGroupCreateSchema = z8.object({
4155
4252
  campaign: refSchema,
4156
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4157
- finalUrls: z7.array(httpsUrlSchema2).min(1),
4158
- headlines: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4159
- longHeadlines: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4160
- descriptions: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4161
- businessName: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4162
- imageAssets: z7.array(refSchema).optional(),
4163
- squareImageAssets: z7.array(refSchema).optional(),
4164
- logoAssets: z7.array(refSchema).optional(),
4165
- status: z7.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4166
- });
4167
- var assetGroupUpdateSchema = z7.object({
4168
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4169
- finalUrls: z7.array(httpsUrlSchema2).min(1).optional(),
4170
- status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4253
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4254
+ finalUrls: z8.array(httpsUrlSchema2).min(1),
4255
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4256
+ longHeadlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4257
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4258
+ businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4259
+ imageAssets: z8.array(refSchema).optional(),
4260
+ squareImageAssets: z8.array(refSchema).optional(),
4261
+ logoAssets: z8.array(refSchema).optional(),
4262
+ status: z8.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4263
+ });
4264
+ var assetGroupUpdateSchema = z8.object({
4265
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4266
+ finalUrls: z8.array(httpsUrlSchema2).min(1).optional(),
4267
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4171
4268
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4172
- var audienceCreateSchema2 = z7.object({
4173
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4174
- type: z7.enum(USER_LIST_TYPES).default("BASIC"),
4175
- description: z7.string().optional(),
4269
+ var audienceCreateSchema2 = z8.object({
4270
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4271
+ type: z8.enum(USER_LIST_TYPES).default("BASIC"),
4272
+ description: z8.string().optional(),
4176
4273
  /** Customer-match members (crm-based) — file-first for large lists. */
4177
- members: z7.array(z7.record(z7.string(), z7.string())).optional(),
4178
- sourceFileRef: z7.string().optional()
4274
+ members: z8.array(z8.record(z8.string(), z8.string())).optional(),
4275
+ sourceFileRef: z8.string().optional()
4179
4276
  });
4180
- var audienceCriterionAttachSchema = z7.object({
4181
- level: z7.enum(["campaign", "adGroup"]),
4277
+ var audienceCriterionAttachSchema = z8.object({
4278
+ level: z8.enum(["campaign", "adGroup"]),
4182
4279
  parent: refSchema,
4183
4280
  userList: refSchema,
4184
- negative: z7.boolean().default(false)
4281
+ negative: z8.boolean().default(false)
4185
4282
  });
4186
- var conversionActionCreateSchema = z7.object({
4187
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4188
- type: z7.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4189
- category: z7.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4190
- countingType: z7.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4283
+ var conversionActionCreateSchema = z8.object({
4284
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4285
+ type: z8.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4286
+ category: z8.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4287
+ countingType: z8.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4191
4288
  defaultValueMicros: microsSchema.optional(),
4192
- defaultCurrencyCode: z7.string().length(3).optional(),
4193
- clickThroughLookbackWindowDays: z7.number().int().positive().optional(),
4194
- viewThroughLookbackWindowDays: z7.number().int().positive().optional(),
4195
- status: z7.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4196
- });
4197
- var conversionActionUpdateSchema = z7.object({
4198
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4199
- category: z7.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4200
- countingType: z7.enum(CONVERSION_COUNTING_TYPES).optional(),
4289
+ defaultCurrencyCode: z8.string().length(3).optional(),
4290
+ clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
4291
+ viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
4292
+ status: z8.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4293
+ });
4294
+ var conversionActionUpdateSchema = z8.object({
4295
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4296
+ category: z8.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4297
+ countingType: z8.enum(CONVERSION_COUNTING_TYPES).optional(),
4201
4298
  defaultValueMicros: microsSchema.optional(),
4202
- defaultCurrencyCode: z7.string().length(3).optional(),
4203
- clickThroughLookbackWindowDays: z7.number().int().positive().optional(),
4204
- viewThroughLookbackWindowDays: z7.number().int().positive().optional(),
4205
- status: z7.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4299
+ defaultCurrencyCode: z8.string().length(3).optional(),
4300
+ clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
4301
+ viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
4302
+ status: z8.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4206
4303
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4207
- var biddingStrategyCreateSchema = z7.object({
4208
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4304
+ var biddingStrategyCreateSchema = z8.object({
4305
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4209
4306
  config: biddingConfigSchema
4210
4307
  }).superRefine((p, ctx) => {
4211
4308
  if (p.config.type === "MANUAL_CPC") {
4212
4309
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4213
4310
  }
4214
4311
  });
4215
- var biddingStrategyUpdateSchema = z7.object({
4216
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4312
+ var biddingStrategyUpdateSchema = z8.object({
4313
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4217
4314
  config: biddingConfigSchema.optional()
4218
4315
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4219
- var labelCreateSchema = z7.object({
4220
- name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4221
- backgroundColor: z7.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4222
- description: z7.string().optional()
4316
+ var labelCreateSchema = z8.object({
4317
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4318
+ backgroundColor: z8.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4319
+ description: z8.string().optional()
4223
4320
  });
4224
- var labelAttachSchema = z7.object({
4225
- level: z7.enum(["campaign", "adGroup", "ad"]),
4321
+ var labelAttachSchema = z8.object({
4322
+ level: z8.enum(["campaign", "adGroup", "ad"]),
4226
4323
  parent: refSchema,
4227
4324
  label: refSchema
4228
4325
  });
4229
- var locationCriterionSchema = z7.object({
4230
- criterionType: z7.literal("location"),
4231
- geoTargetConstant: z7.union([z7.string().regex(GEO_TARGET_CONSTANT_REGEX), z7.string().regex(NUMERIC_ID_REGEX2)])
4232
- });
4233
- var languageCriterionSchema = z7.object({
4234
- criterionType: z7.literal("language"),
4235
- languageConstant: z7.union([z7.string().regex(LANGUAGE_CONSTANT_REGEX), z7.string().regex(NUMERIC_ID_REGEX2)])
4236
- });
4237
- var adScheduleCriterionSchema = z7.object({
4238
- criterionType: z7.literal("adSchedule"),
4239
- dayOfWeek: z7.enum(DAYS_OF_WEEK),
4240
- startHour: z7.number().int().min(0).max(23),
4241
- startMinute: z7.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4242
- endHour: z7.number().int().min(0).max(24),
4243
- endMinute: z7.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4244
- });
4245
- var deviceCriterionSchema = z7.object({
4246
- criterionType: z7.literal("device"),
4247
- device: z7.enum(DEVICE_TYPES),
4326
+ var locationCriterionSchema = z8.object({
4327
+ criterionType: z8.literal("location"),
4328
+ geoTargetConstant: z8.union([z8.string().regex(GEO_TARGET_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
4329
+ });
4330
+ var languageCriterionSchema = z8.object({
4331
+ criterionType: z8.literal("language"),
4332
+ languageConstant: z8.union([z8.string().regex(LANGUAGE_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
4333
+ });
4334
+ var adScheduleCriterionSchema = z8.object({
4335
+ criterionType: z8.literal("adSchedule"),
4336
+ dayOfWeek: z8.enum(DAYS_OF_WEEK),
4337
+ startHour: z8.number().int().min(0).max(23),
4338
+ startMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4339
+ endHour: z8.number().int().min(0).max(24),
4340
+ endMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4341
+ });
4342
+ var deviceCriterionSchema = z8.object({
4343
+ criterionType: z8.literal("device"),
4344
+ device: z8.enum(DEVICE_TYPES),
4248
4345
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4249
4346
  // 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.
4250
- bidModifier: z7.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4347
+ bidModifier: z8.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4251
4348
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4252
4349
  })
4253
4350
  });
4254
- var campaignCriterionAddSchema = z7.object({
4351
+ var campaignCriterionAddSchema = z8.object({
4255
4352
  campaign: refSchema,
4256
- negative: z7.boolean().default(false),
4257
- criterion: z7.discriminatedUnion("criterionType", [
4353
+ negative: z8.boolean().default(false),
4354
+ criterion: z8.discriminatedUnion("criterionType", [
4258
4355
  locationCriterionSchema,
4259
4356
  languageCriterionSchema,
4260
4357
  adScheduleCriterionSchema,
@@ -4264,7 +4361,7 @@ var campaignCriterionAddSchema = z7.object({
4264
4361
  const c = val.criterion;
4265
4362
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4266
4363
  ctx.addIssue({
4267
- code: z7.ZodIssueCode.custom,
4364
+ code: z8.ZodIssueCode.custom,
4268
4365
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4269
4366
  path: ["criterion", "endMinute"]
4270
4367
  });
@@ -4316,17 +4413,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4316
4413
  "google.campaignCriterion.add",
4317
4414
  "google.campaignCriterion.remove"
4318
4415
  ];
4319
- var googleDraftOpKindSchema = z7.enum(GOOGLE_DRAFT_OP_KINDS);
4416
+ var googleDraftOpKindSchema = z8.enum(GOOGLE_DRAFT_OP_KINDS);
4320
4417
  function createOp2(kind, payload) {
4321
- return z7.object({ kind: z7.literal(kind), customerId: customerIdSchema, payload });
4418
+ return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, payload });
4322
4419
  }
4323
4420
  function updateOp2(kind, payload) {
4324
- return z7.object({ kind: z7.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4421
+ return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4325
4422
  }
4326
4423
  function targetOp(kind) {
4327
- return z7.object({ kind: z7.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4424
+ return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4328
4425
  }
4329
- var googleDraftOpInputSchema = z7.discriminatedUnion("kind", [
4426
+ var googleDraftOpInputSchema = z8.discriminatedUnion("kind", [
4330
4427
  createOp2("google.budget.create", budgetCreateSchema),
4331
4428
  updateOp2("google.budget.update", budgetUpdateSchema),
4332
4429
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4374,132 +4471,132 @@ var googleDraftOpInputSchema = z7.discriminatedUnion("kind", [
4374
4471
  ]);
4375
4472
 
4376
4473
  // ../api/src/ads-google/wire.ts
4377
- import { z as z8 } from "zod";
4378
- var googleWriteModeSchema = z8.enum(["live", "simulated"]);
4379
- var googleDraftOpResultSchema = z8.object({
4380
- status: z8.enum(["applied", "simulated", "failed", "skipped"]),
4381
- resourceName: z8.string().optional(),
4382
- error: z8.string().optional(),
4383
- skippedBecause: z8.string().optional(),
4384
- executedAt: z8.number().optional()
4385
- });
4386
- var googleDraftStageRequestSchema = z8.object({
4387
- chatId: z8.string(),
4474
+ import { z as z9 } from "zod";
4475
+ var googleWriteModeSchema = z9.enum(["live", "simulated"]);
4476
+ var googleDraftOpResultSchema = z9.object({
4477
+ status: z9.enum(["applied", "simulated", "failed", "skipped"]),
4478
+ resourceName: z9.string().optional(),
4479
+ error: z9.string().optional(),
4480
+ skippedBecause: z9.string().optional(),
4481
+ executedAt: z9.number().optional()
4482
+ });
4483
+ var googleDraftStageRequestSchema = z9.object({
4484
+ chatId: z9.string(),
4388
4485
  op: googleDraftOpInputSchema
4389
4486
  });
4390
- var googleDraftStageResponseSchema = z8.object({
4391
- staged: z8.literal(true),
4392
- ref: z8.string(),
4487
+ var googleDraftStageResponseSchema = z9.object({
4488
+ staged: z9.literal(true),
4489
+ ref: z9.string(),
4393
4490
  kind: googleDraftOpKindSchema,
4394
4491
  mode: googleWriteModeSchema,
4395
- dependsOn: z8.array(z8.string()),
4396
- summary: z8.string(),
4397
- warnings: z8.array(z8.string()),
4492
+ dependsOn: z9.array(z9.string()),
4493
+ summary: z9.string(),
4494
+ warnings: z9.array(z9.string()),
4398
4495
  /** True when the op amended an already-staged op in place instead of appending a new one. */
4399
- amended: z8.boolean().optional()
4496
+ amended: z9.boolean().optional()
4400
4497
  });
4401
- var googleDraftAmendRequestSchema = z8.object({
4402
- chatId: z8.string(),
4403
- ref: z8.string(),
4404
- patch: z8.record(z8.string(), z8.unknown())
4498
+ var googleDraftAmendRequestSchema = z9.object({
4499
+ chatId: z9.string(),
4500
+ ref: z9.string(),
4501
+ patch: z9.record(z9.string(), z9.unknown())
4405
4502
  });
4406
- var googleDraftShowRequestSchema = z8.object({
4407
- chatId: z8.string(),
4408
- ref: z8.string()
4503
+ var googleDraftShowRequestSchema = z9.object({
4504
+ chatId: z9.string(),
4505
+ ref: z9.string()
4409
4506
  });
4410
4507
  var GOOGLE_DRAFT_BATCH_MAX = 500;
4411
- var googleDraftStageBatchRequestSchema = z8.object({
4412
- chatId: z8.string(),
4413
- ops: z8.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4508
+ var googleDraftStageBatchRequestSchema = z9.object({
4509
+ chatId: z9.string(),
4510
+ ops: z9.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4414
4511
  });
4415
- var googleDraftStageBatchResponseSchema = z8.object({
4416
- staged: z8.literal(true),
4512
+ var googleDraftStageBatchResponseSchema = z9.object({
4513
+ staged: z9.literal(true),
4417
4514
  mode: googleWriteModeSchema,
4418
- count: z8.number(),
4419
- ops: z8.array(
4420
- z8.object({
4421
- ref: z8.string(),
4515
+ count: z9.number(),
4516
+ ops: z9.array(
4517
+ z9.object({
4518
+ ref: z9.string(),
4422
4519
  kind: googleDraftOpKindSchema,
4423
- dependsOn: z8.array(z8.string()),
4424
- summary: z8.string(),
4425
- warnings: z8.array(z8.string())
4520
+ dependsOn: z9.array(z9.string()),
4521
+ summary: z9.string(),
4522
+ warnings: z9.array(z9.string())
4426
4523
  })
4427
4524
  )
4428
4525
  });
4429
- var googleDraftOpViewSchema = z8.object({
4430
- ref: z8.string(),
4526
+ var googleDraftOpViewSchema = z9.object({
4527
+ ref: z9.string(),
4431
4528
  kind: googleDraftOpKindSchema,
4432
- customerId: z8.string(),
4433
- target: z8.string().optional(),
4434
- dependsOn: z8.array(z8.string()),
4435
- summary: z8.string(),
4436
- stagedAt: z8.number(),
4529
+ customerId: z9.string(),
4530
+ target: z9.string().optional(),
4531
+ dependsOn: z9.array(z9.string()),
4532
+ summary: z9.string(),
4533
+ stagedAt: z9.number(),
4437
4534
  result: googleDraftOpResultSchema.optional()
4438
4535
  });
4439
- var googleDraftShowResponseSchema = z8.object({
4536
+ var googleDraftShowResponseSchema = z9.object({
4440
4537
  op: googleDraftOpViewSchema.extend({
4441
- payload: z8.unknown().optional(),
4442
- warnings: z8.array(z8.string()).optional(),
4443
- annotations: z8.unknown().optional()
4538
+ payload: z9.unknown().optional(),
4539
+ warnings: z9.array(z9.string()).optional(),
4540
+ annotations: z9.unknown().optional()
4444
4541
  })
4445
4542
  });
4446
- var googleDraftListRequestSchema = z8.object({
4447
- chatId: z8.string()
4543
+ var googleDraftListRequestSchema = z9.object({
4544
+ chatId: z9.string()
4448
4545
  });
4449
- var googleDraftAdvisorySchema = z8.object({
4450
- scope: z8.enum(["campaign", "adGroup"]),
4451
- message: z8.string()
4546
+ var googleDraftAdvisorySchema = z9.object({
4547
+ scope: z9.enum(["campaign", "adGroup"]),
4548
+ message: z9.string()
4452
4549
  });
4453
- var googleDraftStatusCollectionSchema = z8.object({
4454
- label: z8.string(),
4455
- added: z8.number(),
4456
- removed: z8.number(),
4457
- existing: z8.number()
4550
+ var googleDraftStatusCollectionSchema = z9.object({
4551
+ label: z9.string(),
4552
+ added: z9.number(),
4553
+ removed: z9.number(),
4554
+ existing: z9.number()
4458
4555
  });
4459
- var googleDraftChangeOperationSchema = z8.enum(["create", "update", "pause", "resume", "remove"]);
4460
- var googleDraftStatusNodeSchema = z8.lazy(
4461
- () => z8.object({
4462
- entity: z8.string(),
4463
- name: z8.string(),
4556
+ var googleDraftChangeOperationSchema = z9.enum(["create", "update", "pause", "resume", "remove"]);
4557
+ var googleDraftStatusNodeSchema = z9.lazy(
4558
+ () => z9.object({
4559
+ entity: z9.string(),
4560
+ name: z9.string(),
4464
4561
  operation: googleDraftChangeOperationSchema.optional(),
4465
- existing: z8.boolean(),
4466
- collections: z8.array(googleDraftStatusCollectionSchema),
4467
- children: z8.array(googleDraftStatusNodeSchema),
4468
- warnings: z8.array(z8.string()).optional()
4562
+ existing: z9.boolean(),
4563
+ collections: z9.array(googleDraftStatusCollectionSchema),
4564
+ children: z9.array(googleDraftStatusNodeSchema),
4565
+ warnings: z9.array(z9.string()).optional()
4469
4566
  })
4470
4567
  );
4471
- var googleDraftListResponseSchema = z8.object({
4472
- status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
4568
+ var googleDraftListResponseSchema = z9.object({
4569
+ status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
4473
4570
  mode: googleWriteModeSchema,
4474
- count: z8.number(),
4475
- ops: z8.array(googleDraftOpViewSchema),
4571
+ count: z9.number(),
4572
+ ops: z9.array(googleDraftOpViewSchema),
4476
4573
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
4477
- tree: z8.array(googleDraftStatusNodeSchema).optional(),
4574
+ tree: z9.array(googleDraftStatusNodeSchema).optional(),
4478
4575
  /** Non-blocking completeness advisories for the whole draft. */
4479
- advisories: z8.array(googleDraftAdvisorySchema).optional()
4576
+ advisories: z9.array(googleDraftAdvisorySchema).optional()
4480
4577
  });
4481
- var googleDraftRemoveRequestSchema = z8.object({
4482
- chatId: z8.string(),
4483
- ref: z8.string()
4578
+ var googleDraftRemoveRequestSchema = z9.object({
4579
+ chatId: z9.string(),
4580
+ ref: z9.string()
4484
4581
  });
4485
- var googleDraftRemoveResponseSchema = z8.object({
4582
+ var googleDraftRemoveResponseSchema = z9.object({
4486
4583
  /** The requested ref plus any dependents removed by cascade. */
4487
- removed: z8.array(z8.string())
4584
+ removed: z9.array(z9.string())
4488
4585
  });
4489
- var googleDraftClearRequestSchema = z8.object({
4490
- chatId: z8.string()
4586
+ var googleDraftClearRequestSchema = z9.object({
4587
+ chatId: z9.string()
4491
4588
  });
4492
- var googleDraftClearResponseSchema = z8.object({
4493
- cleared: z8.number()
4589
+ var googleDraftClearResponseSchema = z9.object({
4590
+ cleared: z9.number()
4494
4591
  });
4495
- var googleFieldErrorSchema = z8.object({
4496
- path: z8.string(),
4497
- message: z8.string()
4592
+ var googleFieldErrorSchema = z9.object({
4593
+ path: z9.string(),
4594
+ message: z9.string()
4498
4595
  });
4499
- var googleDraftErrorResponseSchema = z8.object({
4500
- code: z8.string(),
4501
- error: z8.string(),
4502
- fields: z8.array(googleFieldErrorSchema).optional()
4596
+ var googleDraftErrorResponseSchema = z9.object({
4597
+ code: z9.string(),
4598
+ error: z9.string(),
4599
+ fields: z9.array(googleFieldErrorSchema).optional()
4503
4600
  });
4504
4601
 
4505
4602
  // src/commands/ads/google/draft-status.ts
@@ -9383,7 +9480,7 @@ var leadFormsCreateCommand = defineCommand38({
9383
9480
  Required: name, headline (\u226460), privacyPolicyUrl, questions[] (\u226412; playbook: \u22644 for completion).
9384
9481
  Each question is a predefined profile field ({ name, predefinedField: "EMAIL" }) or a custom question ({ name, questionType: "MULTIPLE_CHOICE", options: [...] }; \u22643 custom).
9385
9482
  Best-practice fields the preview will nudge for if missing: 1-3 qualifying questions, consents[] (disclosure checkboxes), thankYou.message + thankYou.landingUrl|appointmentUrl.
9386
- Also supported: locale, formImageId|formImageUrn, privacyPolicyText, hiddenFields[], legalDisclaimer, thankYou.cta. Example: baker ads linkedin lead-forms create --file form.json`
9483
+ Also supported: locale, formImageId|formImageUrn, hiddenFields[], legalDisclaimer, thankYou.cta. Example: baker ads linkedin lead-forms create --file form.json`
9387
9484
  },
9388
9485
  args: {
9389
9486
  ...accountArgs,
@@ -10807,17 +10904,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
10807
10904
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
10808
10905
 
10809
10906
  // ../api/src/ads-meta/ops.ts
10810
- import { z as z9 } from "zod";
10811
- var tempRefSchema3 = z9.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
10812
- var parentRefSchema2 = z9.union([z9.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
10813
- var moneySchema2 = z9.object({
10814
- amount: z9.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"),
10815
- currencyCode: z9.string().length(3).optional()
10816
- });
10817
- var httpsUrlSchema3 = z9.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
10818
- var bakerMediaIdSchema2 = z9.string().min(1);
10819
- var stageableStatusSchema3 = z9.enum(STAGEABLE_CREATE_STATUSES3);
10820
- var updateStatusSchema = z9.enum(UPDATE_STATUSES);
10907
+ import { z as z10 } from "zod";
10908
+ var tempRefSchema3 = z10.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
10909
+ var parentRefSchema2 = z10.union([z10.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
10910
+ var moneySchema2 = z10.object({
10911
+ amount: z10.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"),
10912
+ currencyCode: z10.string().length(3).optional()
10913
+ });
10914
+ var httpsUrlSchema3 = z10.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
10915
+ var bakerMediaIdSchema2 = z10.string().min(1);
10916
+ var stageableStatusSchema3 = z10.enum(STAGEABLE_CREATE_STATUSES3);
10917
+ var updateStatusSchema = z10.enum(UPDATE_STATUSES);
10821
10918
  function currencyMinimums2(currencyCode) {
10822
10919
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
10823
10920
  }
@@ -10829,50 +10926,50 @@ function validateDailyBudgetFloor(money, ctx, path12) {
10829
10926
  }
10830
10927
  }
10831
10928
  }
10832
- var geoLocationsSchema = z9.object({
10833
- countries: z9.array(z9.string().length(2)).optional(),
10834
- regions: z9.array(z9.object({ key: z9.string() })).optional(),
10835
- cities: z9.array(z9.object({ key: z9.string(), radius: z9.number().optional(), distance_unit: z9.string().optional() })).optional(),
10836
- zips: z9.array(z9.object({ key: z9.string() })).optional(),
10837
- location_types: z9.array(z9.string()).optional()
10838
- }).catchall(z9.unknown());
10839
- var idNameSchema = z9.object({ id: z9.string(), name: z9.string().optional() });
10840
- var metaTargetingSchema = z9.object({
10929
+ var geoLocationsSchema = z10.object({
10930
+ countries: z10.array(z10.string().length(2)).optional(),
10931
+ regions: z10.array(z10.object({ key: z10.string() })).optional(),
10932
+ cities: z10.array(z10.object({ key: z10.string(), radius: z10.number().optional(), distance_unit: z10.string().optional() })).optional(),
10933
+ zips: z10.array(z10.object({ key: z10.string() })).optional(),
10934
+ location_types: z10.array(z10.string()).optional()
10935
+ }).catchall(z10.unknown());
10936
+ var idNameSchema = z10.object({ id: z10.string(), name: z10.string().optional() });
10937
+ var metaTargetingSchema = z10.object({
10841
10938
  geo_locations: geoLocationsSchema.optional(),
10842
10939
  excluded_geo_locations: geoLocationsSchema.optional(),
10843
- age_min: z9.number().int().min(13).max(65).optional(),
10844
- age_max: z9.number().int().min(13).max(65).optional(),
10845
- genders: z9.array(z9.union([z9.literal(1), z9.literal(2)])).optional(),
10846
- locales: z9.array(z9.number().int()).optional(),
10847
- interests: z9.array(idNameSchema).optional(),
10848
- behaviors: z9.array(idNameSchema).optional(),
10849
- custom_audiences: z9.array(z9.object({ id: parentRefSchema2 })).optional(),
10850
- excluded_custom_audiences: z9.array(z9.object({ id: parentRefSchema2 })).optional(),
10851
- flexible_spec: z9.array(z9.record(z9.string(), z9.unknown())).optional(),
10852
- exclusions: z9.record(z9.string(), z9.unknown()).optional(),
10853
- publisher_platforms: z9.array(z9.string()).optional(),
10854
- facebook_positions: z9.array(z9.string()).optional(),
10855
- instagram_positions: z9.array(z9.string()).optional(),
10856
- audience_network_positions: z9.array(z9.string()).optional(),
10857
- messenger_positions: z9.array(z9.string()).optional(),
10858
- device_platforms: z9.array(z9.string()).optional(),
10859
- targeting_automation: z9.object({ advantage_audience: z9.union([z9.literal(0), z9.literal(1)]) }).partial().optional()
10860
- }).catchall(z9.unknown());
10861
- var specialAdCategoriesSchema = z9.array(z9.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
10862
- var campaignCreateSchema3 = z9.object({
10863
- name: z9.string().min(1).max(META_LIMITS.campaign.nameMax),
10864
- objective: z9.enum(OBJECTIVES),
10940
+ age_min: z10.number().int().min(13).max(65).optional(),
10941
+ age_max: z10.number().int().min(13).max(65).optional(),
10942
+ genders: z10.array(z10.union([z10.literal(1), z10.literal(2)])).optional(),
10943
+ locales: z10.array(z10.number().int()).optional(),
10944
+ interests: z10.array(idNameSchema).optional(),
10945
+ behaviors: z10.array(idNameSchema).optional(),
10946
+ custom_audiences: z10.array(z10.object({ id: parentRefSchema2 })).optional(),
10947
+ excluded_custom_audiences: z10.array(z10.object({ id: parentRefSchema2 })).optional(),
10948
+ flexible_spec: z10.array(z10.record(z10.string(), z10.unknown())).optional(),
10949
+ exclusions: z10.record(z10.string(), z10.unknown()).optional(),
10950
+ publisher_platforms: z10.array(z10.string()).optional(),
10951
+ facebook_positions: z10.array(z10.string()).optional(),
10952
+ instagram_positions: z10.array(z10.string()).optional(),
10953
+ audience_network_positions: z10.array(z10.string()).optional(),
10954
+ messenger_positions: z10.array(z10.string()).optional(),
10955
+ device_platforms: z10.array(z10.string()).optional(),
10956
+ targeting_automation: z10.object({ advantage_audience: z10.union([z10.literal(0), z10.literal(1)]) }).partial().optional()
10957
+ }).catchall(z10.unknown());
10958
+ var specialAdCategoriesSchema = z10.array(z10.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
10959
+ var campaignCreateSchema3 = z10.object({
10960
+ name: z10.string().min(1).max(META_LIMITS.campaign.nameMax),
10961
+ objective: z10.enum(OBJECTIVES),
10865
10962
  status: stageableStatusSchema3.default("PAUSED"),
10866
10963
  special_ad_categories: specialAdCategoriesSchema,
10867
- special_ad_category_country: z9.array(z9.string().length(2)).optional(),
10868
- buying_type: z9.enum(BUYING_TYPES).default("AUCTION"),
10869
- bid_strategy: z9.enum(BID_STRATEGIES).optional(),
10964
+ special_ad_category_country: z10.array(z10.string().length(2)).optional(),
10965
+ buying_type: z10.enum(BUYING_TYPES).default("AUCTION"),
10966
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
10870
10967
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
10871
10968
  dailyBudget: moneySchema2.optional(),
10872
10969
  lifetimeBudget: moneySchema2.optional(),
10873
10970
  spendCap: moneySchema2.optional(),
10874
- start_time: z9.number().int().positive().optional(),
10875
- stop_time: z9.number().int().positive().optional()
10971
+ start_time: z10.number().int().positive().optional(),
10972
+ stop_time: z10.number().int().positive().optional()
10876
10973
  }).superRefine((p, ctx) => {
10877
10974
  if (p.dailyBudget && p.lifetimeBudget) {
10878
10975
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -10882,15 +10979,15 @@ var campaignCreateSchema3 = z9.object({
10882
10979
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
10883
10980
  }
10884
10981
  });
10885
- var campaignUpdateSchema3 = z9.object({
10886
- name: z9.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
10982
+ var campaignUpdateSchema3 = z10.object({
10983
+ name: z10.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
10887
10984
  status: updateStatusSchema.optional(),
10888
- bid_strategy: z9.enum(BID_STRATEGIES).optional(),
10985
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
10889
10986
  dailyBudget: moneySchema2.optional(),
10890
10987
  lifetimeBudget: moneySchema2.optional(),
10891
10988
  spendCap: moneySchema2.optional(),
10892
- start_time: z9.number().int().positive().optional(),
10893
- stop_time: z9.number().int().positive().optional()
10989
+ start_time: z10.number().int().positive().optional(),
10990
+ stop_time: z10.number().int().positive().optional()
10894
10991
  }).superRefine((p, ctx) => {
10895
10992
  if (!Object.values(p).some((val) => val !== void 0)) {
10896
10993
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -10900,38 +10997,38 @@ var campaignUpdateSchema3 = z9.object({
10900
10997
  }
10901
10998
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
10902
10999
  });
10903
- var promotedObjectSchema = z9.object({
11000
+ var promotedObjectSchema = z10.object({
10904
11001
  page_id: parentRefSchema2.optional(),
10905
- pixel_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
10906
- custom_event_type: z9.enum(CUSTOM_EVENT_TYPES).optional(),
10907
- application_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
10908
- object_store_url: z9.string().url().optional(),
10909
- product_catalog_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
10910
- product_set_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
10911
- whatsapp_phone_number: z9.string().optional(),
10912
- offline_conversion_data_set_id: z9.string().regex(NUMERIC_ID_REGEX3).optional()
11002
+ pixel_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11003
+ custom_event_type: z10.enum(CUSTOM_EVENT_TYPES).optional(),
11004
+ application_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11005
+ object_store_url: z10.string().url().optional(),
11006
+ product_catalog_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11007
+ product_set_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11008
+ whatsapp_phone_number: z10.string().optional(),
11009
+ offline_conversion_data_set_id: z10.string().regex(NUMERIC_ID_REGEX3).optional()
10913
11010
  }).partial();
10914
- var attributionSpecSchema = z9.array(
10915
- z9.object({
10916
- event_type: z9.enum(ATTRIBUTION_EVENT_TYPES),
10917
- window_days: z9.union([z9.literal(1), z9.literal(7), z9.literal(28)])
11011
+ var attributionSpecSchema = z10.array(
11012
+ z10.object({
11013
+ event_type: z10.enum(ATTRIBUTION_EVENT_TYPES),
11014
+ window_days: z10.union([z10.literal(1), z10.literal(7), z10.literal(28)])
10918
11015
  })
10919
11016
  );
10920
11017
  var adSetFields = {
10921
- name: z9.string().min(1).max(META_LIMITS.adSet.nameMax),
11018
+ name: z10.string().min(1).max(META_LIMITS.adSet.nameMax),
10922
11019
  campaign_id: parentRefSchema2,
10923
11020
  status: stageableStatusSchema3.default("PAUSED"),
10924
11021
  dailyBudget: moneySchema2.optional(),
10925
11022
  lifetimeBudget: moneySchema2.optional(),
10926
11023
  bidAmount: moneySchema2.optional(),
10927
- bid_strategy: z9.enum(BID_STRATEGIES).optional(),
10928
- billing_event: z9.enum(BILLING_EVENTS),
10929
- optimization_goal: z9.enum(OPTIMIZATION_GOALS),
10930
- destination_type: z9.enum(DESTINATION_TYPES).optional(),
11024
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
11025
+ billing_event: z10.enum(BILLING_EVENTS),
11026
+ optimization_goal: z10.enum(OPTIMIZATION_GOALS),
11027
+ destination_type: z10.enum(DESTINATION_TYPES).optional(),
10931
11028
  promoted_object: promotedObjectSchema.optional(),
10932
11029
  attribution_spec: attributionSpecSchema.optional(),
10933
- start_time: z9.number().int().positive().optional(),
10934
- end_time: z9.number().int().positive().optional(),
11030
+ start_time: z10.number().int().positive().optional(),
11031
+ end_time: z10.number().int().positive().optional(),
10935
11032
  targeting: metaTargetingSchema
10936
11033
  };
10937
11034
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -10949,22 +11046,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
10949
11046
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
10950
11047
  }
10951
11048
  }
10952
- var adSetCreateSchema = z9.object(adSetFields).superRefine((p, ctx) => {
11049
+ var adSetCreateSchema = z10.object(adSetFields).superRefine((p, ctx) => {
10953
11050
  validateAdSetBudgetAndBid(p, ctx);
10954
11051
  });
10955
- var adSetUpdateSchema = z9.object({
11052
+ var adSetUpdateSchema = z10.object({
10956
11053
  name: adSetFields.name.optional(),
10957
11054
  status: updateStatusSchema.optional(),
10958
11055
  dailyBudget: moneySchema2.optional(),
10959
11056
  lifetimeBudget: moneySchema2.optional(),
10960
11057
  bidAmount: moneySchema2.optional(),
10961
- bid_strategy: z9.enum(BID_STRATEGIES).optional(),
10962
- optimization_goal: z9.enum(OPTIMIZATION_GOALS).optional(),
10963
- destination_type: z9.enum(DESTINATION_TYPES).optional(),
11058
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
11059
+ optimization_goal: z10.enum(OPTIMIZATION_GOALS).optional(),
11060
+ destination_type: z10.enum(DESTINATION_TYPES).optional(),
10964
11061
  promoted_object: promotedObjectSchema.optional(),
10965
11062
  attribution_spec: attributionSpecSchema.optional(),
10966
- start_time: z9.number().int().positive().optional(),
10967
- end_time: z9.number().int().positive().optional(),
11063
+ start_time: z10.number().int().positive().optional(),
11064
+ end_time: z10.number().int().positive().optional(),
10968
11065
  targeting: metaTargetingSchema.optional()
10969
11066
  }).superRefine((p, ctx) => {
10970
11067
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -10972,38 +11069,38 @@ var adSetUpdateSchema = z9.object({
10972
11069
  }
10973
11070
  validateAdSetBudgetAndBid(p, ctx);
10974
11071
  });
10975
- var messageSchema = z9.string().min(1).max(META_LIMITS.creative.messageHardMax);
10976
- var headlineSchema2 = z9.string().min(1).max(META_LIMITS.creative.headlineMax);
10977
- var descriptionSchema = z9.string().min(1).max(META_LIMITS.creative.descriptionMax);
10978
- var callToActionSchema = z9.object({
10979
- type: z9.enum(CTA_TYPES2),
11072
+ var messageSchema = z10.string().min(1).max(META_LIMITS.creative.messageHardMax);
11073
+ var headlineSchema2 = z10.string().min(1).max(META_LIMITS.creative.headlineMax);
11074
+ var descriptionSchema = z10.string().min(1).max(META_LIMITS.creative.descriptionMax);
11075
+ var callToActionSchema = z10.object({
11076
+ type: z10.enum(CTA_TYPES2),
10980
11077
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
10981
11078
  link: httpsUrlSchema3.optional()
10982
11079
  });
10983
- var creativeEnhancementsSchema = z9.object({
10984
- standardEnhancements: z9.enum(ENROLL_STATUSES).optional(),
10985
- features: z9.record(z9.string(), z9.enum(ENROLL_STATUSES)).optional()
11080
+ var creativeEnhancementsSchema = z10.object({
11081
+ standardEnhancements: z10.enum(ENROLL_STATUSES).optional(),
11082
+ features: z10.record(z10.string(), z10.enum(ENROLL_STATUSES)).optional()
10986
11083
  });
10987
11084
  var creativeSharedFields = {
10988
- name: z9.string().max(META_LIMITS.creative.nameMax).optional(),
11085
+ name: z10.string().max(META_LIMITS.creative.nameMax).optional(),
10989
11086
  /** Facebook Page id backing the ad's identity. */
10990
11087
  page_id: parentRefSchema2,
10991
11088
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
10992
- instagram_user_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
11089
+ instagram_user_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
10993
11090
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
10994
- url_tags: z9.string().max(1e3).optional(),
11091
+ url_tags: z10.string().max(1e3).optional(),
10995
11092
  enhancements: creativeEnhancementsSchema.optional()
10996
11093
  };
10997
11094
  var imageMediaFields = {
10998
- imageHash: z9.string().regex(IMAGE_HASH_REGEX).optional(),
11095
+ imageHash: z10.string().regex(IMAGE_HASH_REGEX).optional(),
10999
11096
  imageRef: tempRefSchema3.optional()
11000
11097
  };
11001
11098
  var videoMediaFields = {
11002
- videoId: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
11099
+ videoId: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11003
11100
  videoRef: tempRefSchema3.optional(),
11004
11101
  /** Thumbnail for a video creative — image hash, ref, or public url. */
11005
- thumbnailHash: z9.string().regex(IMAGE_HASH_REGEX).optional(),
11006
- imageUrl: z9.string().url().optional()
11102
+ thumbnailHash: z10.string().regex(IMAGE_HASH_REGEX).optional(),
11103
+ imageUrl: z10.string().url().optional()
11007
11104
  };
11008
11105
  function countImageRefs(p) {
11009
11106
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11011,8 +11108,8 @@ function countImageRefs(p) {
11011
11108
  function countVideoRefs(p) {
11012
11109
  return [p.videoId, p.videoRef].filter(Boolean).length;
11013
11110
  }
11014
- var singleCreativeSchema = z9.object({
11015
- creativeType: z9.literal("single"),
11111
+ var singleCreativeSchema = z10.object({
11112
+ creativeType: z10.literal("single"),
11016
11113
  ...creativeSharedFields,
11017
11114
  /** Primary text. */
11018
11115
  message: messageSchema,
@@ -11021,7 +11118,7 @@ var singleCreativeSchema = z9.object({
11021
11118
  headline: headlineSchema2.optional(),
11022
11119
  description: descriptionSchema.optional(),
11023
11120
  /** Display URL / caption shown under the headline. */
11024
- caption: z9.string().max(255).optional(),
11121
+ caption: z10.string().max(255).optional(),
11025
11122
  call_to_action: callToActionSchema.optional(),
11026
11123
  ...imageMediaFields,
11027
11124
  ...videoMediaFields
@@ -11045,10 +11142,10 @@ var singleCreativeSchema = z9.object({
11045
11142
  });
11046
11143
  }
11047
11144
  });
11048
- var carouselCardSchema = z9.object({
11145
+ var carouselCardSchema = z10.object({
11049
11146
  link: httpsUrlSchema3,
11050
- headline: z9.string().max(META_LIMITS.creative.headlineMax).optional(),
11051
- description: z9.string().max(META_LIMITS.creative.descriptionMax).optional(),
11147
+ headline: z10.string().max(META_LIMITS.creative.headlineMax).optional(),
11148
+ description: z10.string().max(META_LIMITS.creative.descriptionMax).optional(),
11052
11149
  call_to_action: callToActionSchema.optional(),
11053
11150
  ...imageMediaFields,
11054
11151
  ...videoMediaFields
@@ -11068,35 +11165,35 @@ var carouselCardSchema = z9.object({
11068
11165
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11069
11166
  }
11070
11167
  });
11071
- var carouselCreativeSchema2 = z9.object({
11072
- creativeType: z9.literal("carousel"),
11168
+ var carouselCreativeSchema2 = z10.object({
11169
+ creativeType: z10.literal("carousel"),
11073
11170
  ...creativeSharedFields,
11074
11171
  message: messageSchema,
11075
11172
  /** Optional "see more" card destination applied when a card has no own link. */
11076
11173
  link: httpsUrlSchema3.optional(),
11077
11174
  call_to_action: callToActionSchema.optional(),
11078
- cards: z9.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11175
+ cards: z10.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11079
11176
  });
11080
- var dynamicImageSchema = z9.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11081
- var dynamicVideoSchema = z9.object({
11177
+ var dynamicImageSchema = z10.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11178
+ var dynamicVideoSchema = z10.object({
11082
11179
  videoId: videoMediaFields.videoId,
11083
11180
  videoRef: videoMediaFields.videoRef,
11084
11181
  thumbnailHash: videoMediaFields.thumbnailHash
11085
11182
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11086
11183
  var DYN = META_LIMITS.creative;
11087
- var dynamicCreativeSchema = z9.object({
11088
- creativeType: z9.literal("dynamic"),
11184
+ var dynamicCreativeSchema = z10.object({
11185
+ creativeType: z10.literal("dynamic"),
11089
11186
  ...creativeSharedFields,
11090
- bodies: z9.array(z9.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11091
- titles: z9.array(z9.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11092
- descriptions: z9.array(z9.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11093
- images: z9.array(dynamicImageSchema).optional(),
11094
- videos: z9.array(dynamicVideoSchema).optional(),
11095
- ad_formats: z9.array(z9.enum(AD_FORMATS2)).min(1),
11096
- call_to_action_types: z9.array(z9.enum(CTA_TYPES2)).optional(),
11097
- link_urls: z9.array(z9.object({ website_url: httpsUrlSchema3, display_url: z9.string().optional() })).min(1),
11187
+ bodies: z10.array(z10.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11188
+ titles: z10.array(z10.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11189
+ descriptions: z10.array(z10.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11190
+ images: z10.array(dynamicImageSchema).optional(),
11191
+ videos: z10.array(dynamicVideoSchema).optional(),
11192
+ ad_formats: z10.array(z10.enum(AD_FORMATS2)).min(1),
11193
+ call_to_action_types: z10.array(z10.enum(CTA_TYPES2)).optional(),
11194
+ link_urls: z10.array(z10.object({ website_url: httpsUrlSchema3, display_url: z10.string().optional() })).min(1),
11098
11195
  /** Multi-language / placement customization — structural passthrough for v1. */
11099
- asset_customization_rules: z9.array(z9.record(z9.string(), z9.unknown())).optional()
11196
+ asset_customization_rules: z10.array(z10.record(z10.string(), z10.unknown())).optional()
11100
11197
  }).superRefine((p, ctx) => {
11101
11198
  if (!(p.images?.length || p.videos?.length)) {
11102
11199
  ctx.addIssue({
@@ -11106,57 +11203,57 @@ var dynamicCreativeSchema = z9.object({
11106
11203
  });
11107
11204
  }
11108
11205
  });
11109
- var existingPostCreativeSchema = z9.object({
11110
- creativeType: z9.literal("existing_post"),
11206
+ var existingPostCreativeSchema = z10.object({
11207
+ creativeType: z10.literal("existing_post"),
11111
11208
  name: creativeSharedFields.name,
11112
11209
  /** "<page_id>_<post_id>" object story id of the post to promote. */
11113
- object_story_id: z9.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11210
+ object_story_id: z10.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11114
11211
  instagram_user_id: creativeSharedFields.instagram_user_id,
11115
11212
  url_tags: creativeSharedFields.url_tags,
11116
11213
  enhancements: creativeSharedFields.enhancements
11117
11214
  });
11118
- var creativeContentSchema2 = z9.discriminatedUnion("creativeType", [
11215
+ var creativeContentSchema2 = z10.discriminatedUnion("creativeType", [
11119
11216
  singleCreativeSchema,
11120
11217
  carouselCreativeSchema2,
11121
11218
  dynamicCreativeSchema,
11122
11219
  existingPostCreativeSchema
11123
11220
  ]);
11124
11221
  var adCreativeCreateSchema = creativeContentSchema2;
11125
- var adCreativeUpdateSchema = z9.object({
11126
- name: z9.string().max(META_LIMITS.creative.nameMax).optional(),
11222
+ var adCreativeUpdateSchema = z10.object({
11223
+ name: z10.string().max(META_LIMITS.creative.nameMax).optional(),
11127
11224
  status: updateStatusSchema.optional(),
11128
11225
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11129
- content: z9.record(z9.string(), z9.unknown()).optional()
11226
+ content: z10.record(z10.string(), z10.unknown()).optional()
11130
11227
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11131
- var adCreateSchema2 = z9.object({
11132
- name: z9.string().min(1).max(META_LIMITS.ad.nameMax),
11228
+ var adCreateSchema2 = z10.object({
11229
+ name: z10.string().min(1).max(META_LIMITS.ad.nameMax),
11133
11230
  adset_id: parentRefSchema2,
11134
11231
  status: stageableStatusSchema3.default("PAUSED"),
11135
- creative: z9.object({ creative_id: parentRefSchema2 }),
11232
+ creative: z10.object({ creative_id: parentRefSchema2 }),
11136
11233
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11137
- tracking_specs: z9.array(z9.record(z9.string(), z9.unknown())).optional()
11234
+ tracking_specs: z10.array(z10.record(z10.string(), z10.unknown())).optional()
11138
11235
  });
11139
- var adUpdateSchema2 = z9.object({
11140
- name: z9.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11236
+ var adUpdateSchema2 = z10.object({
11237
+ name: z10.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11141
11238
  status: updateStatusSchema.optional(),
11142
11239
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
11143
- creative: z9.object({ creative_id: parentRefSchema2 }).optional(),
11144
- tracking_specs: z9.array(z9.record(z9.string(), z9.unknown())).optional()
11240
+ creative: z10.object({ creative_id: parentRefSchema2 }).optional(),
11241
+ tracking_specs: z10.array(z10.record(z10.string(), z10.unknown())).optional()
11145
11242
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11146
- var lookalikeSpecSchema = z9.object({
11147
- origin: z9.array(z9.object({ id: parentRefSchema2 })).min(1),
11148
- ratio: z9.number().min(0.01).max(0.2).optional(),
11149
- country: z9.string().length(2).optional()
11150
- });
11151
- var customAudienceCreateSchema = z9.object({
11152
- name: z9.string().min(1).max(META_LIMITS.audience.nameMax),
11153
- subtype: z9.enum(CUSTOM_AUDIENCE_SUBTYPES),
11154
- description: z9.string().max(500).optional(),
11155
- customer_file_source: z9.string().optional(),
11156
- retention_days: z9.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11243
+ var lookalikeSpecSchema = z10.object({
11244
+ origin: z10.array(z10.object({ id: parentRefSchema2 })).min(1),
11245
+ ratio: z10.number().min(0.01).max(0.2).optional(),
11246
+ country: z10.string().length(2).optional()
11247
+ });
11248
+ var customAudienceCreateSchema = z10.object({
11249
+ name: z10.string().min(1).max(META_LIMITS.audience.nameMax),
11250
+ subtype: z10.enum(CUSTOM_AUDIENCE_SUBTYPES),
11251
+ description: z10.string().max(500).optional(),
11252
+ customer_file_source: z10.string().optional(),
11253
+ retention_days: z10.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11157
11254
  lookalike_spec: lookalikeSpecSchema.optional(),
11158
11255
  /** Website/engagement rule — structural passthrough validated by Meta. */
11159
- rule: z9.record(z9.string(), z9.unknown()).optional()
11256
+ rule: z10.record(z10.string(), z10.unknown()).optional()
11160
11257
  }).superRefine((p, ctx) => {
11161
11258
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11162
11259
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11165,16 +11262,16 @@ var customAudienceCreateSchema = z9.object({
11165
11262
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11166
11263
  }
11167
11264
  });
11168
- var customAudienceUpdateSchema = z9.object({
11169
- name: z9.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11170
- description: z9.string().max(500).optional()
11265
+ var customAudienceUpdateSchema = z10.object({
11266
+ name: z10.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11267
+ description: z10.string().max(500).optional()
11171
11268
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11172
- var mediaUploadSchema = z9.object({
11173
- kind: z9.enum(MEDIA_KINDS),
11269
+ var mediaUploadSchema = z10.object({
11270
+ kind: z10.enum(MEDIA_KINDS),
11174
11271
  bakerImageId: bakerMediaIdSchema2.optional(),
11175
11272
  bakerVideoId: bakerMediaIdSchema2.optional(),
11176
11273
  /** Optional display name / filename hint. */
11177
- name: z9.string().max(255).optional()
11274
+ name: z10.string().max(255).optional()
11178
11275
  }).superRefine((p, ctx) => {
11179
11276
  if (p.kind === "image" && !p.bakerImageId) {
11180
11277
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11196,16 +11293,16 @@ var META_DRAFT_OP_KINDS = [
11196
11293
  "customAudience.update",
11197
11294
  "media.upload"
11198
11295
  ];
11199
- var metaDraftOpKindSchema = z9.enum(META_DRAFT_OP_KINDS);
11200
- var accountIdSchema2 = z9.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11201
- var updateTargetSchema2 = z9.union([z9.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11296
+ var metaDraftOpKindSchema = z10.enum(META_DRAFT_OP_KINDS);
11297
+ var accountIdSchema2 = z10.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11298
+ var updateTargetSchema2 = z10.union([z10.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11202
11299
  function createOp3(kind, payload) {
11203
- return z9.object({ kind: z9.literal(kind), accountId: accountIdSchema2, payload });
11300
+ return z10.object({ kind: z10.literal(kind), accountId: accountIdSchema2, payload });
11204
11301
  }
11205
11302
  function updateOp3(kind, payload) {
11206
- return z9.object({ kind: z9.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11303
+ return z10.object({ kind: z10.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11207
11304
  }
11208
- var metaDraftOpInputSchema = z9.discriminatedUnion("kind", [
11305
+ var metaDraftOpInputSchema = z10.discriminatedUnion("kind", [
11209
11306
  createOp3("campaign.create", campaignCreateSchema3),
11210
11307
  updateOp3("campaign.update", campaignUpdateSchema3),
11211
11308
  createOp3("adSet.create", adSetCreateSchema),
@@ -11220,89 +11317,89 @@ var metaDraftOpInputSchema = z9.discriminatedUnion("kind", [
11220
11317
  ]);
11221
11318
 
11222
11319
  // ../api/src/ads-meta/wire.ts
11223
- import { z as z10 } from "zod";
11224
- var metaWriteModeSchema = z10.enum(["live", "simulated"]);
11225
- var metaDraftOpResultSchema = z10.object({
11226
- status: z10.enum(["applied", "simulated", "failed", "skipped"]),
11320
+ import { z as z11 } from "zod";
11321
+ var metaWriteModeSchema = z11.enum(["live", "simulated"]);
11322
+ var metaDraftOpResultSchema = z11.object({
11323
+ status: z11.enum(["applied", "simulated", "failed", "skipped"]),
11227
11324
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11228
- id: z10.string().optional(),
11325
+ id: z11.string().optional(),
11229
11326
  /** For media.upload ops: the resulting image hash. */
11230
- hash: z10.string().optional(),
11231
- error: z10.string().optional(),
11232
- skippedBecause: z10.string().optional(),
11233
- executedAt: z10.number().optional()
11327
+ hash: z11.string().optional(),
11328
+ error: z11.string().optional(),
11329
+ skippedBecause: z11.string().optional(),
11330
+ executedAt: z11.number().optional()
11234
11331
  });
11235
- var metaDraftStageRequestSchema = z10.object({
11236
- chatId: z10.string(),
11332
+ var metaDraftStageRequestSchema = z11.object({
11333
+ chatId: z11.string(),
11237
11334
  op: metaDraftOpInputSchema
11238
11335
  });
11239
- var metaDraftStageResponseSchema = z10.object({
11240
- staged: z10.literal(true),
11241
- ref: z10.string(),
11336
+ var metaDraftStageResponseSchema = z11.object({
11337
+ staged: z11.literal(true),
11338
+ ref: z11.string(),
11242
11339
  kind: metaDraftOpKindSchema,
11243
11340
  mode: metaWriteModeSchema,
11244
- dependsOn: z10.array(z10.string()),
11245
- summary: z10.string(),
11246
- warnings: z10.array(z10.string()),
11341
+ dependsOn: z11.array(z11.string()),
11342
+ summary: z11.string(),
11343
+ warnings: z11.array(z11.string()),
11247
11344
  /** True when the op amended an already-staged op in place instead of appending a new one. */
11248
- amended: z10.boolean().optional()
11249
- });
11250
- var metaDraftDuplicateRequestSchema = z10.object({
11251
- chatId: z10.string(),
11252
- accountId: z10.string(),
11253
- entity: z10.enum(["campaign", "adSet", "ad"]),
11254
- sourceId: z10.string(),
11255
- overrides: z10.record(z10.string(), z10.unknown()).optional(),
11345
+ amended: z11.boolean().optional()
11346
+ });
11347
+ var metaDraftDuplicateRequestSchema = z11.object({
11348
+ chatId: z11.string(),
11349
+ accountId: z11.string(),
11350
+ entity: z11.enum(["campaign", "adSet", "ad"]),
11351
+ sourceId: z11.string(),
11352
+ overrides: z11.record(z11.string(), z11.unknown()).optional(),
11256
11353
  /** Pause the original after the copy publishes. */
11257
- replace: z10.boolean().optional()
11354
+ replace: z11.boolean().optional()
11258
11355
  });
11259
- var metaDraftOpViewSchema = z10.object({
11260
- ref: z10.string(),
11356
+ var metaDraftOpViewSchema = z11.object({
11357
+ ref: z11.string(),
11261
11358
  kind: metaDraftOpKindSchema,
11262
- accountId: z10.string(),
11263
- target: z10.string().optional(),
11264
- dependsOn: z10.array(z10.string()),
11265
- summary: z10.string(),
11266
- stagedAt: z10.number(),
11359
+ accountId: z11.string(),
11360
+ target: z11.string().optional(),
11361
+ dependsOn: z11.array(z11.string()),
11362
+ summary: z11.string(),
11363
+ stagedAt: z11.number(),
11267
11364
  result: metaDraftOpResultSchema.optional()
11268
11365
  });
11269
- var metaDraftListRequestSchema = z10.object({
11270
- chatId: z10.string()
11366
+ var metaDraftListRequestSchema = z11.object({
11367
+ chatId: z11.string()
11271
11368
  });
11272
- var metaDraftAdvisorySchema = z10.object({
11273
- ref: z10.string(),
11274
- message: z10.string()
11369
+ var metaDraftAdvisorySchema = z11.object({
11370
+ ref: z11.string(),
11371
+ message: z11.string()
11275
11372
  });
11276
- var metaDraftListResponseSchema = z10.object({
11277
- status: z10.enum(["active", "publishing", "applied", "discarded", "none"]),
11373
+ var metaDraftListResponseSchema = z11.object({
11374
+ status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
11278
11375
  mode: metaWriteModeSchema,
11279
- count: z10.number(),
11280
- ops: z10.array(metaDraftOpViewSchema),
11376
+ count: z11.number(),
11377
+ ops: z11.array(metaDraftOpViewSchema),
11281
11378
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11282
- advisories: z10.array(metaDraftAdvisorySchema)
11379
+ advisories: z11.array(metaDraftAdvisorySchema)
11283
11380
  });
11284
- var metaDraftRemoveRequestSchema = z10.object({
11285
- chatId: z10.string(),
11286
- ref: z10.string()
11381
+ var metaDraftRemoveRequestSchema = z11.object({
11382
+ chatId: z11.string(),
11383
+ ref: z11.string()
11287
11384
  });
11288
- var metaDraftRemoveResponseSchema = z10.object({
11385
+ var metaDraftRemoveResponseSchema = z11.object({
11289
11386
  /** The requested ref plus any dependents removed by cascade. */
11290
- removed: z10.array(z10.string())
11387
+ removed: z11.array(z11.string())
11291
11388
  });
11292
- var metaDraftClearRequestSchema = z10.object({
11293
- chatId: z10.string()
11389
+ var metaDraftClearRequestSchema = z11.object({
11390
+ chatId: z11.string()
11294
11391
  });
11295
- var metaDraftClearResponseSchema = z10.object({
11296
- cleared: z10.number()
11392
+ var metaDraftClearResponseSchema = z11.object({
11393
+ cleared: z11.number()
11297
11394
  });
11298
- var metaFieldErrorSchema = z10.object({
11299
- path: z10.string(),
11300
- message: z10.string()
11395
+ var metaFieldErrorSchema = z11.object({
11396
+ path: z11.string(),
11397
+ message: z11.string()
11301
11398
  });
11302
- var metaDraftErrorResponseSchema = z10.object({
11303
- code: z10.string(),
11304
- error: z10.string(),
11305
- fields: z10.array(metaFieldErrorSchema).optional()
11399
+ var metaDraftErrorResponseSchema = z11.object({
11400
+ code: z11.string(),
11401
+ error: z11.string(),
11402
+ fields: z11.array(metaFieldErrorSchema).optional()
11306
11403
  });
11307
11404
 
11308
11405
  // src/commands/ads/meta/write-shared.ts
@@ -14579,27 +14676,27 @@ import path6 from "path";
14579
14676
  import { defineCommand as defineCommand89 } from "citty";
14580
14677
 
14581
14678
  // src/engine/scaffold/staticAd.ts
14582
- import { z as z11 } from "zod";
14679
+ import { z as z12 } from "zod";
14583
14680
  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"]);
14584
14681
  var DEFAULT_ASPECT_RATIO = "9:16";
14585
- var Blueprint = z11.object({
14586
- meta: z11.object({ estimated_aspect_ratio: z11.string().optional() }).loose().optional(),
14587
- text_content: z11.array(z11.object({ text: z11.string().optional() }).loose()).optional()
14682
+ var Blueprint = z12.object({
14683
+ meta: z12.object({ estimated_aspect_ratio: z12.string().optional() }).loose().optional(),
14684
+ text_content: z12.array(z12.object({ text: z12.string().optional() }).loose()).optional()
14588
14685
  }).loose();
14589
- var ElementLocator = z11.object({
14590
- collection: z11.enum(["subjects", "people", "brands_logos"]),
14591
- index: z11.number().int().nonnegative()
14686
+ var ElementLocator = z12.object({
14687
+ collection: z12.enum(["subjects", "people", "brands_logos"]),
14688
+ index: z12.number().int().nonnegative()
14592
14689
  }).loose();
14593
- var MainElement = z11.object({
14690
+ var MainElement = z12.object({
14594
14691
  // logo | product | person | animal | badge | other
14595
- type: z11.string(),
14596
- label: z11.string().optional(),
14597
- description: z11.string().optional(),
14598
- expression: z11.string().nullable().optional(),
14599
- reason: z11.string().optional(),
14692
+ type: z12.string(),
14693
+ label: z12.string().optional(),
14694
+ description: z12.string().optional(),
14695
+ expression: z12.string().nullable().optional(),
14696
+ reason: z12.string().optional(),
14600
14697
  locator: ElementLocator.optional()
14601
14698
  }).loose();
14602
- var MainElements = z11.array(MainElement);
14699
+ var MainElements = z12.array(MainElement);
14603
14700
  function sanitizeId(raw, fallback) {
14604
14701
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
14605
14702
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -15135,7 +15232,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
15135
15232
  import { toCardinal as nwNl } from "n2words/nl-NL";
15136
15233
  import { toCardinal as nwPl } from "n2words/pl-PL";
15137
15234
  import { toCardinal as nwPt } from "n2words/pt-PT";
15138
- import { z as z12 } from "zod";
15235
+ import { z as z13 } from "zod";
15139
15236
 
15140
15237
  // src/engine/scaffold/lib/shoot-modes.ts
15141
15238
  var SHOOT_MODES = [
@@ -15448,71 +15545,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15448
15545
  "{{out.video}}"
15449
15546
  ];
15450
15547
  }
15451
- var FrameAsset = z12.object({ url: z12.string().optional() }).loose().optional();
15452
- var DialogueLine = z12.object({
15453
- speaker: z12.string().optional(),
15454
- line: z12.string().optional(),
15548
+ var FrameAsset = z13.object({ url: z13.string().optional() }).loose().optional();
15549
+ var DialogueLine = z13.object({
15550
+ speaker: z13.string().optional(),
15551
+ line: z13.string().optional(),
15455
15552
  // Absolute seconds on the source timeline (the deconstruct emits both).
15456
- start_s: z12.number().optional(),
15457
- end_s: z12.number().optional(),
15458
- delivery: z12.string().optional(),
15459
- voice_description: z12.string().optional(),
15553
+ start_s: z13.number().optional(),
15554
+ end_s: z13.number().optional(),
15555
+ delivery: z13.string().optional(),
15556
+ voice_description: z13.string().optional(),
15460
15557
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15461
15558
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15462
15559
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15463
15560
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15464
15561
  // the VO path; absent keeps the presence-based decision (old blueprints).
15465
- on_camera: z12.boolean().optional()
15562
+ on_camera: z13.boolean().optional()
15466
15563
  }).loose();
15467
- var Sfx = z12.object({
15468
- at_s: z12.number().optional(),
15469
- duration_s: z12.number().optional(),
15470
- sound_effect_prompt: z12.string().optional(),
15471
- description: z12.string().optional()
15564
+ var Sfx = z13.object({
15565
+ at_s: z13.number().optional(),
15566
+ duration_s: z13.number().optional(),
15567
+ sound_effect_prompt: z13.string().optional(),
15568
+ description: z13.string().optional()
15472
15569
  }).loose();
15473
- var CompositionRegion = z12.object({
15570
+ var CompositionRegion = z13.object({
15474
15571
  // full | top | bottom | left | right | inset
15475
- panel: z12.string().optional(),
15572
+ panel: z13.string().optional(),
15476
15573
  // 9-grid anchor for an `inset` presenter box.
15477
- position: z12.string().optional(),
15478
- is_presenter: z12.boolean().optional(),
15574
+ position: z13.string().optional(),
15575
+ is_presenter: z13.boolean().optional(),
15479
15576
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15480
- cast_ref: z12.string().optional(),
15577
+ cast_ref: z13.string().optional(),
15481
15578
  // What the region's content IS: camera | screen_capture | static_graphic |
15482
15579
  // generated. Authoritative for routing when present (regex-over-prose fallback
15483
15580
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15484
15581
  // overlay layer, never AI-generated.
15485
- kind: z12.string().optional(),
15582
+ kind: z13.string().optional(),
15486
15583
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15487
15584
  // screen_capture region shows. Two scenes share it only when they show the SAME
15488
15585
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15489
15586
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15490
15587
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15491
15588
  // instead of asking the operator for one screenshot that can't cover both.
15492
- surface_id: z12.string().optional(),
15589
+ surface_id: z13.string().optional(),
15493
15590
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15494
15591
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15495
15592
  // must re-composite, not paint into the surface.
15496
- nested: z12.array(z12.object({}).loose()).optional(),
15497
- summary: z12.string().optional(),
15498
- frame_prompt: z12.string().optional(),
15499
- motion_prompt: z12.string().optional()
15593
+ nested: z13.array(z13.object({}).loose()).optional(),
15594
+ summary: z13.string().optional(),
15595
+ frame_prompt: z13.string().optional(),
15596
+ motion_prompt: z13.string().optional()
15500
15597
  }).loose();
15501
- var SceneComposition = z12.object({
15598
+ var SceneComposition = z13.object({
15502
15599
  // full_frame (default) | split_screen | pip | keyed_overlay
15503
- layout: z12.string().optional(),
15600
+ layout: z13.string().optional(),
15504
15601
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15505
- split_axis: z12.string().optional(),
15506
- regions: z12.array(CompositionRegion).optional()
15602
+ split_axis: z13.string().optional(),
15603
+ regions: z13.array(CompositionRegion).optional()
15507
15604
  }).loose();
15508
- var CameraMotion = z12.object({ movement: z12.string().optional(), detail: z12.string().optional() }).loose();
15509
- var TranscriptWord = z12.object({ text: z12.string().optional() }).loose();
15510
- var Scene = z12.object({
15511
- start_s: z12.number().optional(),
15512
- end_s: z12.number().optional(),
15513
- duration_s: z12.number().optional(),
15514
- summary: z12.string().optional(),
15515
- action_detail: z12.string().optional(),
15605
+ var CameraMotion = z13.object({ movement: z13.string().optional(), detail: z13.string().optional() }).loose();
15606
+ var TranscriptWord = z13.object({ text: z13.string().optional() }).loose();
15607
+ var Scene = z13.object({
15608
+ start_s: z13.number().optional(),
15609
+ end_s: z13.number().optional(),
15610
+ duration_s: z13.number().optional(),
15611
+ summary: z13.string().optional(),
15612
+ action_detail: z13.string().optional(),
15516
15613
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15517
15614
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15518
15615
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15520,82 +15617,82 @@ var Scene = z12.object({
15520
15617
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15521
15618
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15522
15619
  // UGC/product mode; a human can override per scene by setting this.
15523
- shoot_mode: z12.string().optional(),
15620
+ shoot_mode: z13.string().optional(),
15524
15621
  // Diegetic ambient the clip's native audio should carry (no music). When
15525
15622
  // absent the scene falls back to its shoot mode's default ambience.
15526
- ambient: z12.string().optional(),
15623
+ ambient: z13.string().optional(),
15527
15624
  camera_motion: CameraMotion.optional(),
15528
- start_frame_prompt: z12.string().optional(),
15529
- end_frame_prompt: z12.string().optional(),
15530
- motion_prompt: z12.string().optional(),
15625
+ start_frame_prompt: z13.string().optional(),
15626
+ end_frame_prompt: z13.string().optional(),
15627
+ motion_prompt: z13.string().optional(),
15531
15628
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15532
15629
  // script re-craft checklist. Inferred from position when absent.
15533
- narrative_role: z12.string().optional(),
15630
+ narrative_role: z13.string().optional(),
15534
15631
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15535
15632
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15536
15633
  // into the hook's start-frame description so the generator renders that state,
15537
15634
  // not a calm influencer (CCA-11).
15538
- hook_mechanic: z12.object({ mechanic: z12.string().optional(), why_it_stops_scroll: z12.string().optional() }).loose().optional(),
15635
+ hook_mechanic: z13.object({ mechanic: z13.string().optional(), why_it_stops_scroll: z13.string().optional() }).loose().optional(),
15539
15636
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15540
- scene_setting: z12.string().optional(),
15637
+ scene_setting: z13.string().optional(),
15541
15638
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15542
15639
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15543
15640
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15544
15641
  // ignored (nothing follows it).
15545
- transition_out: z12.object({ type: z12.string().optional(), description: z12.string().optional() }).loose().optional(),
15546
- dialogue: z12.array(DialogueLine).optional(),
15547
- sfx: z12.array(Sfx).optional(),
15548
- overlays: z12.array(z12.unknown()).optional(),
15549
- floating_elements: z12.array(z12.unknown()).optional(),
15642
+ transition_out: z13.object({ type: z13.string().optional(), description: z13.string().optional() }).loose().optional(),
15643
+ dialogue: z13.array(DialogueLine).optional(),
15644
+ sfx: z13.array(Sfx).optional(),
15645
+ overlays: z13.array(z13.unknown()).optional(),
15646
+ floating_elements: z13.array(z13.unknown()).optional(),
15550
15647
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15551
15648
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15552
15649
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15553
15650
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
15554
- motion_level: z12.enum(["static", "subtle", "dynamic"]).optional(),
15555
- transcript_slice: z12.array(TranscriptWord).optional(),
15651
+ motion_level: z13.enum(["static", "subtle", "dynamic"]).optional(),
15652
+ transcript_slice: z13.array(TranscriptWord).optional(),
15556
15653
  start_frame_asset: FrameAsset,
15557
15654
  end_frame_asset: FrameAsset,
15558
15655
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15559
15656
  // previous one (the SAME physical shot, broken up only because it exceeded the
15560
15657
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15561
15658
  // start frame IS the previous scene's end frame — so the join is seamless.
15562
- continues_previous: z12.boolean().optional()
15659
+ continues_previous: z13.boolean().optional()
15563
15660
  }).loose();
15564
- var VideoBlueprint = z12.object({
15565
- source: z12.object({ aspect_ratio: z12.string().optional(), duration_s: z12.number().optional() }).loose().optional(),
15566
- global: z12.object({
15567
- music: z12.object({
15568
- present: z12.boolean().optional(),
15569
- music_prompt: z12.string().optional(),
15661
+ var VideoBlueprint = z13.object({
15662
+ source: z13.object({ aspect_ratio: z13.string().optional(), duration_s: z13.number().optional() }).loose().optional(),
15663
+ global: z13.object({
15664
+ music: z13.object({
15665
+ present: z13.boolean().optional(),
15666
+ music_prompt: z13.string().optional(),
15570
15667
  // Absolute second the music enters in the reference (the bed often
15571
15668
  // kicks in mid-ad, after the hook). We start the regenerated track here
15572
15669
  // instead of at 0 so the timing matches.
15573
- starts_at_s: z12.number().optional(),
15670
+ starts_at_s: z13.number().optional(),
15574
15671
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15575
15672
  // reference track. We never reuse it — only style the regenerated bed.
15576
- identified_track: z12.object({ title: z12.string().optional(), artist: z12.string().optional() }).loose().nullish()
15673
+ identified_track: z13.object({ title: z13.string().optional(), artist: z13.string().optional() }).loose().nullish()
15577
15674
  }).loose().optional(),
15578
- cast: z12.array(
15579
- z12.object({
15580
- id: z12.string().optional(),
15581
- description: z12.string().optional(),
15675
+ cast: z13.array(
15676
+ z13.object({
15677
+ id: z13.string().optional(),
15678
+ description: z13.string().optional(),
15582
15679
  // The deconstruct's note on the target-market localization (e.g. "native
15583
15680
  // French speaker") — read to derive the spoken-track language code.
15584
- market_localization_note: z12.string().optional()
15681
+ market_localization_note: z13.string().optional()
15585
15682
  }).loose()
15586
15683
  ).optional(),
15587
- voiceover: z12.object({
15684
+ voiceover: z13.object({
15588
15685
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15589
15686
  // voiceover | none → narration over the picture (no lip-sync).
15590
- mode: z12.string().optional(),
15591
- voice_description: z12.string().optional(),
15592
- persona: z12.string().optional()
15687
+ mode: z13.string().optional(),
15688
+ voice_description: z13.string().optional(),
15689
+ persona: z13.string().optional()
15593
15690
  }).loose().optional(),
15594
15691
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15595
15692
  // first hex is the dominant brand colour); never to drive frame generation.
15596
- style: z12.object({ palette: z12.array(z12.object({ hex: z12.string().optional() }).loose()).optional() }).loose().optional()
15693
+ style: z13.object({ palette: z13.array(z13.object({ hex: z13.string().optional() }).loose()).optional() }).loose().optional()
15597
15694
  }).loose().optional(),
15598
- scenes: z12.array(Scene).min(1)
15695
+ scenes: z13.array(Scene).min(1)
15599
15696
  }).loose();
15600
15697
  function injectHookPhysicality(blueprint) {
15601
15698
  for (const scene of blueprint.scenes) {
@@ -15605,26 +15702,26 @@ function injectHookPhysicality(blueprint) {
15605
15702
  scene.start_frame_prompt = `${prompt} The subject's physical state IS the scroll-stopper \u2014 render it explicitly, not a calm pose: ${why}.`;
15606
15703
  }
15607
15704
  }
15608
- var AppearsItem = z12.union([z12.number(), z12.object({ scene: z12.number(), edge: z12.string().optional() }).loose()]);
15609
- var RecurringElement = z12.object({
15705
+ var AppearsItem = z13.union([z13.number(), z13.object({ scene: z13.number(), edge: z13.string().optional() }).loose()]);
15706
+ var RecurringElement = z13.object({
15610
15707
  // person | animal | product | logo | badge | other
15611
- type: z12.string(),
15612
- label: z12.string().optional(),
15613
- description: z12.string().optional(),
15614
- expression: z12.string().nullable().optional(),
15708
+ type: z13.string(),
15709
+ label: z13.string().optional(),
15710
+ description: z13.string().optional(),
15711
+ expression: z13.string().nullable().optional(),
15615
15712
  // When the element maps to a global cast entry, its stable id (for annotation).
15616
- cast_id: z12.string().nullable().optional(),
15713
+ cast_id: z13.string().nullable().optional(),
15617
15714
  // The label of another element that is the SAME individual as this one, shown
15618
15715
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15619
15716
  // pink shirt and believer in a white shirt). Each look gets its own reference
15620
15717
  // slot, but the face/identity must stay identical across them.
15621
- same_as: z12.string().nullable().optional(),
15718
+ same_as: z13.string().nullable().optional(),
15622
15719
  // Scenes the element appears in. Either a bare list of scene indices (both
15623
15720
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
15624
- scenes: z12.array(z12.number()).optional(),
15625
- appears_in: z12.array(AppearsItem).optional()
15721
+ scenes: z13.array(z13.number()).optional(),
15722
+ appears_in: z13.array(AppearsItem).optional()
15626
15723
  }).loose();
15627
- var RecurringElements = z12.array(RecurringElement);
15724
+ var RecurringElements = z13.array(RecurringElement);
15628
15725
  function sanitizeId2(raw, fallback) {
15629
15726
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15630
15727
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -16042,7 +16139,7 @@ function scrubFloatSentences(text, floatDescs) {
16042
16139
  return kept;
16043
16140
  }
16044
16141
  function sceneFloatDescs(scene) {
16045
- const floats = z12.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16142
+ const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16046
16143
  if (!floats.success) return [];
16047
16144
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
16048
16145
  }
@@ -17382,25 +17479,25 @@ function buildSfxMusic(blueprint, nodes) {
17382
17479
  }
17383
17480
  return tracks;
17384
17481
  }
17385
- var OverlayStyle = z12.object({ color_hex: z12.string().optional(), background: z12.string().optional(), size: z12.string().optional() }).loose();
17386
- var Overlay = z12.object({
17387
- text: z12.string().optional(),
17388
- appears_at_s: z12.number().optional(),
17389
- duration_s: z12.number().optional(),
17390
- position: z12.string().optional(),
17391
- role: z12.string().optional(),
17392
- animation: z12.string().optional(),
17393
- animation_detail: z12.string().optional(),
17482
+ var OverlayStyle = z13.object({ color_hex: z13.string().optional(), background: z13.string().optional(), size: z13.string().optional() }).loose();
17483
+ var Overlay = z13.object({
17484
+ text: z13.string().optional(),
17485
+ appears_at_s: z13.number().optional(),
17486
+ duration_s: z13.number().optional(),
17487
+ position: z13.string().optional(),
17488
+ role: z13.string().optional(),
17489
+ animation: z13.string().optional(),
17490
+ animation_detail: z13.string().optional(),
17394
17491
  style: OverlayStyle.optional()
17395
17492
  }).loose();
17396
- var FloatingElement = z12.object({
17397
- kind: z12.string().optional(),
17398
- description: z12.string().optional(),
17399
- brand_name: z12.string().nullish(),
17400
- what_it_represents: z12.string().optional(),
17401
- appears_at_s: z12.number().optional(),
17402
- duration_s: z12.number().optional(),
17403
- position: z12.string().optional()
17493
+ var FloatingElement = z13.object({
17494
+ kind: z13.string().optional(),
17495
+ description: z13.string().optional(),
17496
+ brand_name: z13.string().nullish(),
17497
+ what_it_represents: z13.string().optional(),
17498
+ appears_at_s: z13.number().optional(),
17499
+ duration_s: z13.number().optional(),
17500
+ position: z13.string().optional()
17404
17501
  }).loose();
17405
17502
  function escapeHtml(s) {
17406
17503
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17432,7 +17529,7 @@ function positionClass(position) {
17432
17529
  function collectCaptions(blueprint) {
17433
17530
  return blueprint.scenes.flatMap((scene) => {
17434
17531
  const sceneStart = scene.start_s ?? 0;
17435
- const overlays = z12.array(Overlay).safeParse(scene.overlays ?? []);
17532
+ const overlays = z13.array(Overlay).safeParse(scene.overlays ?? []);
17436
17533
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17437
17534
  const at = ov.appears_at_s ?? sceneStart;
17438
17535
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17512,7 +17609,7 @@ function collectFloatWindows(blueprint, uiRouted) {
17512
17609
  const windows = /* @__PURE__ */ new Map();
17513
17610
  blueprint.scenes.forEach((scene, i) => {
17514
17611
  const sceneStart = scene.start_s ?? 0;
17515
- const floats = z12.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17612
+ const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17516
17613
  if (!floats.success) return;
17517
17614
  for (const fe of floats.data) {
17518
17615
  const at = fe.appears_at_s ?? sceneStart;
@@ -17898,8 +17995,8 @@ function buildMotionBoard(blueprint) {
17898
17995
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
17899
17996
  cursor = end_s;
17900
17997
  const spoken = sceneSpokenText(scene);
17901
- const overlays = z12.array(Overlay).safeParse(scene.overlays ?? []);
17902
- const floats = z12.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17998
+ const overlays = z13.array(Overlay).safeParse(scene.overlays ?? []);
17999
+ const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17903
18000
  const graphics = [
17904
18001
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
17905
18002
  kind: "text",
@@ -23815,11 +23912,121 @@ var schemaCommand = defineCommand147({
23815
23912
  }
23816
23913
  });
23817
23914
 
23915
+ // src/commands/tags/index.ts
23916
+ import { defineCommand as defineCommand148 } from "citty";
23917
+
23918
+ // src/commands/tags/shared.ts
23919
+ function failApi3(err) {
23920
+ if (err instanceof ApiError) {
23921
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
23922
+ process.exit(1);
23923
+ }
23924
+ if (err instanceof Error) {
23925
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: err.message } });
23926
+ process.exit(1);
23927
+ }
23928
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
23929
+ process.exit(1);
23930
+ }
23931
+ function renderEffectiveEntry(entry) {
23932
+ const parts = [entry.ref, entry.type];
23933
+ if (entry.identifier !== void 0) {
23934
+ parts.push(entry.identifier);
23935
+ }
23936
+ if (entry.staged !== void 0) {
23937
+ parts.push(`[staged: ${entry.staged}]`);
23938
+ }
23939
+ const secretBits = [
23940
+ ...entry.secretsSet.map((field) => `${field} \u2713 set`),
23941
+ ...entry.secretsPending.map((field) => `${field} \u23F3 pending`)
23942
+ ];
23943
+ if (secretBits.length > 0) {
23944
+ parts.push(`[secrets: ${secretBits.join(", ")}]`);
23945
+ }
23946
+ return parts.join(" ");
23947
+ }
23948
+
23949
+ // src/commands/tags/index.ts
23950
+ registerSchema({
23951
+ command: "tags.list",
23952
+ description: "Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only \u2014 every tag change (create, edit, delete) goes through the request_tag_input approval tool.",
23953
+ args: {
23954
+ json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false }
23955
+ }
23956
+ });
23957
+ async function listTags(json) {
23958
+ try {
23959
+ const chatId = requireChatId();
23960
+ const response = await apiPost("/api/tags/list", { chatId });
23961
+ if (json) {
23962
+ writeJson({ ok: true, data: response });
23963
+ return;
23964
+ }
23965
+ if (response.tags.length === 0) {
23966
+ process.stdout.write("No tags configured. Propose one with the request_tag_input tool (baker_ui).\n");
23967
+ return;
23968
+ }
23969
+ process.stdout.write(`${response.tags.map(renderEffectiveEntry).join("\n")}
23970
+ `);
23971
+ } catch (err) {
23972
+ failApi3(err);
23973
+ }
23974
+ }
23975
+ var listCommand7 = defineCommand148({
23976
+ meta: {
23977
+ name: "list",
23978
+ description: "Effective tags for this chat (production + staged). Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
23979
+ },
23980
+ args: { json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" } },
23981
+ run: async ({ args }) => {
23982
+ await listTags(args.json === true);
23983
+ }
23984
+ });
23985
+ async function listDraft3() {
23986
+ try {
23987
+ const chatId = requireChatId();
23988
+ const response = await apiPost("/api/tags/draft", { chatId });
23989
+ writeJson({ ok: true, data: response });
23990
+ } catch (err) {
23991
+ failApi3(err);
23992
+ }
23993
+ }
23994
+ var draftCommand3 = defineCommand148({
23995
+ meta: {
23996
+ name: "draft",
23997
+ 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)."
23998
+ },
23999
+ run: async () => {
24000
+ await listDraft3();
24001
+ }
24002
+ });
24003
+ var tagsCommand3 = defineCommand148({
24004
+ meta: {
24005
+ name: "tags",
24006
+ 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.
24007
+
24008
+ This command is READ-ONLY. Every tag change \u2014 create, edit, or delete \u2014 goes through the request_tag_input tool (baker_ui MCP server): propose one or more changes (each becomes a tab in one approval form), pre-fill the non-secret fields you know, and the user reviews, fills secrets, and approves or skips each. Secret values (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, OAuth connections) never pass through the CLI or the chat.
24009
+
24010
+ Refs: \`baker tags list\` prints each tag's ref \u2014 a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.
24011
+
24012
+ Examples:
24013
+ baker tags list # production + staged, with secret status
24014
+ baker tags draft # review the staged changes awaiting publish`
24015
+ },
24016
+ subCommands: {
24017
+ list: listCommand7,
24018
+ draft: draftCommand3
24019
+ },
24020
+ run: async () => {
24021
+ await listTags(false);
24022
+ }
24023
+ });
24024
+
23818
24025
  // src/commands/testimonials/index.ts
23819
- import { defineCommand as defineCommand151 } from "citty";
24026
+ import { defineCommand as defineCommand152 } from "citty";
23820
24027
 
23821
24028
  // src/commands/testimonials/get.ts
23822
- import { defineCommand as defineCommand148 } from "citty";
24029
+ import { defineCommand as defineCommand149 } from "citty";
23823
24030
  registerSchema({
23824
24031
  command: "testimonials.get",
23825
24032
  description: "Get a single testimonial by ID",
@@ -23827,7 +24034,7 @@ registerSchema({
23827
24034
  id: { type: "string", description: "Testimonial ID", required: true }
23828
24035
  }
23829
24036
  });
23830
- var getCommand4 = defineCommand148({
24037
+ var getCommand4 = defineCommand149({
23831
24038
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
23832
24039
  args: {
23833
24040
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -23864,7 +24071,7 @@ var getCommand4 = defineCommand148({
23864
24071
  });
23865
24072
 
23866
24073
  // src/commands/testimonials/list.ts
23867
- import { defineCommand as defineCommand149 } from "citty";
24074
+ import { defineCommand as defineCommand150 } from "citty";
23868
24075
  registerSchema({
23869
24076
  command: "testimonials.list",
23870
24077
  description: "List testimonials with optional filters.",
@@ -23894,7 +24101,7 @@ registerSchema({
23894
24101
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
23895
24102
  }
23896
24103
  });
23897
- var listCommand7 = defineCommand149({
24104
+ var listCommand8 = defineCommand150({
23898
24105
  meta: {
23899
24106
  name: "list",
23900
24107
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -23943,7 +24150,7 @@ var listCommand7 = defineCommand149({
23943
24150
  });
23944
24151
 
23945
24152
  // src/commands/testimonials/search.ts
23946
- import { defineCommand as defineCommand150 } from "citty";
24153
+ import { defineCommand as defineCommand151 } from "citty";
23947
24154
  registerSchema({
23948
24155
  command: "testimonials.search",
23949
24156
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -23974,7 +24181,7 @@ registerSchema({
23974
24181
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
23975
24182
  }
23976
24183
  });
23977
- var searchCommand2 = defineCommand150({
24184
+ var searchCommand2 = defineCommand151({
23978
24185
  meta: {
23979
24186
  name: "search",
23980
24187
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -24045,10 +24252,10 @@ var searchCommand2 = defineCommand150({
24045
24252
  });
24046
24253
 
24047
24254
  // src/commands/testimonials/tags.ts
24048
- var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
24255
+ var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
24049
24256
 
24050
24257
  // src/commands/testimonials/index.ts
24051
- var testimonialsCommand = defineCommand151({
24258
+ var testimonialsCommand = defineCommand152({
24052
24259
  meta: {
24053
24260
  name: "testimonials",
24054
24261
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -24063,16 +24270,16 @@ Examples:
24063
24270
  subCommands: {
24064
24271
  get: getCommand4,
24065
24272
  search: searchCommand2,
24066
- list: listCommand7,
24067
- tags: tagsCommand3
24273
+ list: listCommand8,
24274
+ tags: tagsCommand4
24068
24275
  }
24069
24276
  });
24070
24277
 
24071
24278
  // src/commands/videos/index.ts
24072
- import { defineCommand as defineCommand156 } from "citty";
24279
+ import { defineCommand as defineCommand157 } from "citty";
24073
24280
 
24074
24281
  // src/commands/videos/delete.ts
24075
- import { defineCommand as defineCommand152 } from "citty";
24282
+ import { defineCommand as defineCommand153 } from "citty";
24076
24283
  registerSchema({
24077
24284
  command: "videos.delete",
24078
24285
  description: "Delete a video by ID",
@@ -24086,7 +24293,7 @@ registerSchema({
24086
24293
  }
24087
24294
  }
24088
24295
  });
24089
- var deleteCommand3 = defineCommand152({
24296
+ var deleteCommand3 = defineCommand153({
24090
24297
  meta: {
24091
24298
  name: "delete",
24092
24299
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -24127,7 +24334,7 @@ var deleteCommand3 = defineCommand152({
24127
24334
  });
24128
24335
 
24129
24336
  // src/commands/videos/get.ts
24130
- import { defineCommand as defineCommand153 } from "citty";
24337
+ import { defineCommand as defineCommand154 } from "citty";
24131
24338
  registerSchema({
24132
24339
  command: "videos.get",
24133
24340
  description: "Get a single video by ID",
@@ -24135,7 +24342,7 @@ registerSchema({
24135
24342
  id: { type: "string", description: "Video ID", required: true }
24136
24343
  }
24137
24344
  });
24138
- var getCommand5 = defineCommand153({
24345
+ var getCommand5 = defineCommand154({
24139
24346
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
24140
24347
  args: {
24141
24348
  id: { type: "positional", description: "Video ID", required: false },
@@ -24172,7 +24379,7 @@ var getCommand5 = defineCommand153({
24172
24379
  });
24173
24380
 
24174
24381
  // src/commands/videos/search.ts
24175
- import { defineCommand as defineCommand154 } from "citty";
24382
+ import { defineCommand as defineCommand155 } from "citty";
24176
24383
  registerSchema({
24177
24384
  command: "videos.search",
24178
24385
  description: "Search videos by text query. Only returns ready videos.",
@@ -24182,7 +24389,7 @@ registerSchema({
24182
24389
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24183
24390
  }
24184
24391
  });
24185
- var searchCommand3 = defineCommand154({
24392
+ var searchCommand3 = defineCommand155({
24186
24393
  meta: {
24187
24394
  name: "search",
24188
24395
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -24229,12 +24436,12 @@ var searchCommand3 = defineCommand154({
24229
24436
  });
24230
24437
 
24231
24438
  // src/commands/videos/tags.ts
24232
- var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
24439
+ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
24233
24440
 
24234
24441
  // src/commands/videos/upload.ts
24235
24442
  import { readFile as readFile12, stat as stat3 } from "fs/promises";
24236
24443
  import { extname as extname3 } from "path";
24237
- import { defineCommand as defineCommand155 } from "citty";
24444
+ import { defineCommand as defineCommand156 } from "citty";
24238
24445
  var MIME_MAP = {
24239
24446
  ".mp4": "video/mp4",
24240
24447
  ".mov": "video/quicktime",
@@ -24268,7 +24475,7 @@ function detectContentType(filePath) {
24268
24475
  }
24269
24476
  return mime;
24270
24477
  }
24271
- var uploadCommand2 = defineCommand155({
24478
+ var uploadCommand2 = defineCommand156({
24272
24479
  meta: {
24273
24480
  name: "upload",
24274
24481
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -24322,7 +24529,7 @@ var uploadCommand2 = defineCommand155({
24322
24529
  });
24323
24530
 
24324
24531
  // src/commands/videos/index.ts
24325
- var videosCommand = defineCommand156({
24532
+ var videosCommand = defineCommand157({
24326
24533
  meta: {
24327
24534
  name: "videos",
24328
24535
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -24340,15 +24547,15 @@ Examples:
24340
24547
  search: searchCommand3,
24341
24548
  upload: uploadCommand2,
24342
24549
  delete: deleteCommand3,
24343
- tags: tagsCommand4
24550
+ tags: tagsCommand5
24344
24551
  }
24345
24552
  });
24346
24553
 
24347
24554
  // src/commands/winning-ads/index.ts
24348
- import { defineCommand as defineCommand159 } from "citty";
24555
+ import { defineCommand as defineCommand160 } from "citty";
24349
24556
 
24350
24557
  // src/commands/winning-ads/advertisers.ts
24351
- import { defineCommand as defineCommand157 } from "citty";
24558
+ import { defineCommand as defineCommand158 } from "citty";
24352
24559
  registerSchema({
24353
24560
  command: "winning-ads.advertisers",
24354
24561
  description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
@@ -24361,7 +24568,7 @@ registerSchema({
24361
24568
  function identity(record) {
24362
24569
  return record;
24363
24570
  }
24364
- var advertisersCommand2 = defineCommand157({
24571
+ var advertisersCommand2 = defineCommand158({
24365
24572
  meta: {
24366
24573
  name: "advertisers",
24367
24574
  description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
@@ -24412,7 +24619,7 @@ var advertisersCommand2 = defineCommand157({
24412
24619
  });
24413
24620
 
24414
24621
  // src/commands/winning-ads/search.ts
24415
- import { defineCommand as defineCommand158 } from "citty";
24622
+ import { defineCommand as defineCommand159 } from "citty";
24416
24623
  registerSchema({
24417
24624
  command: "winning-ads.search",
24418
24625
  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.",
@@ -24520,7 +24727,7 @@ function buildSearchBody(args) {
24520
24727
  }
24521
24728
  return body;
24522
24729
  }
24523
- var searchCommand4 = defineCommand158({
24730
+ var searchCommand4 = defineCommand159({
24524
24731
  meta: {
24525
24732
  name: "search",
24526
24733
  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"
@@ -24632,7 +24839,7 @@ var searchCommand4 = defineCommand158({
24632
24839
  });
24633
24840
 
24634
24841
  // src/commands/winning-ads/index.ts
24635
- var winningAdsCommand = defineCommand159({
24842
+ var winningAdsCommand = defineCommand160({
24636
24843
  meta: {
24637
24844
  name: "winning-ads",
24638
24845
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -24672,11 +24879,11 @@ function getCliVersion() {
24672
24879
  }
24673
24880
 
24674
24881
  // src/cli.ts
24675
- var main = defineCommand160({
24882
+ var main = defineCommand161({
24676
24883
  meta: {
24677
24884
  name: "baker",
24678
24885
  version: getCliVersion(),
24679
- description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, and ad platform data in Baker.
24886
+ description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, marketing tags, and ad platform data in Baker.
24680
24887
 
24681
24888
  Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
24682
24889
  Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
@@ -24696,6 +24903,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
24696
24903
  videos: videosCommand,
24697
24904
  testimonials: testimonialsCommand,
24698
24905
  canvas: canvasCommand,
24906
+ tags: tagsCommand3,
24699
24907
  "winning-ads": winningAdsCommand,
24700
24908
  mcp: mcpCommand,
24701
24909
  schema: schemaCommand