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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +47 -0
  2. package/dist/chunk-7I2POXSJ.js +153 -0
  3. package/dist/chunk-7I2POXSJ.js.map +1 -0
  4. package/dist/{chunk-AVJ3B6LC.js → chunk-BFZELBTE.js} +4 -4
  5. package/dist/{chunk-AEBAUSIN.js → chunk-O3TH7JW5.js} +28 -5
  6. package/dist/chunk-O3TH7JW5.js.map +1 -0
  7. package/dist/{chunk-ISFSUDEQ.js → chunk-PEBP6G74.js} +3 -3
  8. package/dist/chunk-RK67WL4O.js +72 -0
  9. package/dist/{chunk-YTEAWSEM.js.map → chunk-RK67WL4O.js.map} +1 -1
  10. package/dist/{chunk-K47Q73CK.js → chunk-SCI57ZZ6.js} +40 -4
  11. package/dist/chunk-SCI57ZZ6.js.map +1 -0
  12. package/dist/cli.js +1491 -1313
  13. package/dist/cli.js.map +1 -1
  14. package/dist/client-N7XWYCHT.js +15 -0
  15. package/dist/engine/index.js +3 -2
  16. package/dist/env-3JMYIH25.js +11 -0
  17. package/dist/{output-2LGBISBQ.js → output-7M5VQPTZ.js} +5 -5
  18. package/dist/{shared-CQC3YRBA.js → shared-6SZHAUM2.js} +6 -6
  19. package/package.json +1 -1
  20. package/dist/chunk-5WRI5ZAA.js +0 -31
  21. package/dist/chunk-AEBAUSIN.js.map +0 -1
  22. package/dist/chunk-K47Q73CK.js.map +0 -1
  23. package/dist/chunk-YTEAWSEM.js +0 -39
  24. package/dist/client-PGOTU24X.js +0 -15
  25. package/dist/env-TD4VXCQ7.js +0 -10
  26. package/dist/shared-CQC3YRBA.js.map +0 -1
  27. /package/dist/{chunk-AVJ3B6LC.js.map → chunk-BFZELBTE.js.map} +0 -0
  28. /package/dist/{chunk-ISFSUDEQ.js.map → chunk-PEBP6G74.js.map} +0 -0
  29. /package/dist/{chunk-5WRI5ZAA.js.map → client-N7XWYCHT.js.map} +0 -0
  30. /package/dist/{client-PGOTU24X.js.map → env-3JMYIH25.js.map} +0 -0
  31. /package/dist/{env-TD4VXCQ7.js.map → output-7M5VQPTZ.js.map} +0 -0
  32. /package/dist/{output-2LGBISBQ.js.map → shared-6SZHAUM2.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  toModelSafeImage,
32
32
  ulid,
33
33
  validateCanvasDeep
34
- } from "./chunk-AEBAUSIN.js";
34
+ } from "./chunk-O3TH7JW5.js";
35
35
  import {
36
36
  csvOrJson,
37
37
  daysAgoIso,
@@ -40,7 +40,7 @@ import {
40
40
  resolveAccountIdArg,
41
41
  resolveEffectiveStatus,
42
42
  todayIso
43
- } from "./chunk-AVJ3B6LC.js";
43
+ } from "./chunk-BFZELBTE.js";
44
44
  import {
45
45
  buildQueryCacheKey,
46
46
  cacheGet,
@@ -53,21 +53,24 @@ import {
53
53
  writeAdsJson,
54
54
  writeAdsOutput,
55
55
  writeJsonEnvelope
56
- } from "./chunk-ISFSUDEQ.js";
56
+ } from "./chunk-PEBP6G74.js";
57
57
  import {
58
58
  ApiError,
59
59
  apiGet,
60
60
  apiPost,
61
61
  validateConvexId
62
- } from "./chunk-K47Q73CK.js";
62
+ } from "./chunk-SCI57ZZ6.js";
63
+ import {
64
+ installStreamTaps,
65
+ logInvocation
66
+ } from "./chunk-7I2POXSJ.js";
63
67
  import {
64
68
  getEnv,
65
69
  requireChatId
66
- } from "./chunk-YTEAWSEM.js";
67
- import "./chunk-5WRI5ZAA.js";
70
+ } from "./chunk-RK67WL4O.js";
68
71
 
69
72
  // src/cli.ts
70
- import { defineCommand as defineCommand171, runMain } from "citty";
73
+ import { defineCommand as defineCommand172, runMain } from "citty";
71
74
 
72
75
  // src/commands/actions/index.ts
73
76
  import { defineCommand as defineCommand18 } from "citty";
@@ -1898,8 +1901,29 @@ var linkedinDraftErrorResponseSchema = z4.object({
1898
1901
  fields: z4.array(linkedinFieldErrorSchema).optional()
1899
1902
  });
1900
1903
 
1901
- // ../api/src/flows.ts
1904
+ // ../api/src/analytics/wire.ts
1902
1905
  import { z as z5 } from "zod";
1906
+ var ANALYTICS_REPORTS = ["overview", "timeseries", "pages", "sources", "events"];
1907
+ var analyticsReportSchema = z5.enum(ANALYTICS_REPORTS);
1908
+ var ANALYTICS_PERIODS = ["today", "7d", "28d", "90d"];
1909
+ var analyticsPeriodSchema = z5.enum(ANALYTICS_PERIODS);
1910
+ var analyticsQueryRequestSchema = z5.object({
1911
+ report: analyticsReportSchema,
1912
+ period: analyticsPeriodSchema.default("28d"),
1913
+ limit: z5.number().int().min(1).max(100).optional()
1914
+ });
1915
+ var analyticsRowSchema = z5.record(z5.string(), z5.union([z5.string(), z5.number(), z5.null()]));
1916
+ var analyticsQueryResponseSchema = z5.object({
1917
+ report: analyticsReportSchema,
1918
+ /** Inclusive UTC start of the window, `YYYY-MM-DD HH:mm:ss`. */
1919
+ from: z5.string(),
1920
+ /** Exclusive UTC end of the window, `YYYY-MM-DD HH:mm:ss`. */
1921
+ to: z5.string(),
1922
+ rows: z5.array(analyticsRowSchema)
1923
+ });
1924
+
1925
+ // ../api/src/flows.ts
1926
+ import { z as z6 } from "zod";
1903
1927
  var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1904
1928
  "email",
1905
1929
  "zapier",
@@ -1910,7 +1934,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1910
1934
  "crmble",
1911
1935
  "goHighlevelContact"
1912
1936
  ];
1913
- var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1937
+ var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1914
1938
  var FLOW_SECRET_FIELDS = {
1915
1939
  email: [],
1916
1940
  zapier: ["zapUrl"],
@@ -1938,94 +1962,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
1938
1962
  "highlevel",
1939
1963
  "highlevelForm"
1940
1964
  ];
1941
- var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
1942
- var flowInputRequestSchema = z5.discriminatedUnion("target", [
1943
- z5.object({
1965
+ var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
1966
+ var flowInputRequestSchema = z6.discriminatedUnion("target", [
1967
+ z6.object({
1944
1968
  /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
1945
- target: z5.literal("sideEffect"),
1946
- flowSlug: z5.string(),
1969
+ target: z6.literal("sideEffect"),
1970
+ flowSlug: z6.string(),
1947
1971
  /** `id` of the FlowNode holding the side effect. */
1948
- nodeId: z5.string(),
1972
+ nodeId: z6.string(),
1949
1973
  /** `id` of the side effect within that node's `sideEffects[]`. */
1950
- sideEffectId: z5.string(),
1974
+ sideEffectId: z6.string(),
1951
1975
  sideEffectType: flowSideEffectTypeSchema,
1952
1976
  /** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
1953
- prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
1977
+ prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
1954
1978
  /** Secret credential field names the agent asks the user to provide. */
1955
- requestedSecretFields: z5.array(z5.string()).optional(),
1956
- message: z5.string().optional()
1979
+ requestedSecretFields: z6.array(z6.string()).optional(),
1980
+ message: z6.string().optional()
1957
1981
  }),
1958
- z5.object({
1982
+ z6.object({
1959
1983
  /** Configure a widget node's third-party `form.external` (+ `providerId`). */
1960
- target: z5.literal("node"),
1961
- flowSlug: z5.string(),
1984
+ target: z6.literal("node"),
1985
+ flowSlug: z6.string(),
1962
1986
  /** `id` of the widget FlowNode. */
1963
- nodeId: z5.string(),
1987
+ nodeId: z6.string(),
1964
1988
  nodeType: flowResourceNodeTypeSchema,
1965
- message: z5.string().optional()
1989
+ message: z6.string().optional()
1966
1990
  })
1967
1991
  ]);
1968
- var flowInputToolInputSchema = z5.object({
1969
- requests: z5.array(flowInputRequestSchema).min(1).max(8)
1992
+ var flowInputToolInputSchema = z6.object({
1993
+ requests: z6.array(flowInputRequestSchema).min(1).max(8)
1970
1994
  });
1971
- var flowInputResultSchema = z5.discriminatedUnion("status", [
1972
- z5.object({
1973
- status: z5.literal("submitted"),
1995
+ var flowInputResultSchema = z6.discriminatedUnion("status", [
1996
+ z6.object({
1997
+ status: z6.literal("submitted"),
1974
1998
  /** Echoes which piece this result resolves. */
1975
- nodeId: z5.string(),
1976
- sideEffectId: z5.string().optional(),
1999
+ nodeId: z6.string(),
2000
+ sideEffectId: z6.string().optional(),
1977
2001
  /** Names of secret fields the user provided. Never values. */
1978
- secretFieldsSet: z5.array(z5.string()),
2002
+ secretFieldsSet: z6.array(z6.string()),
1979
2003
  /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
1980
- note: z5.string().optional()
2004
+ note: z6.string().optional()
1981
2005
  }),
1982
- z5.object({
1983
- status: z5.literal("declined"),
1984
- nodeId: z5.string(),
1985
- sideEffectId: z5.string().optional(),
1986
- reason: z5.string().optional()
2006
+ z6.object({
2007
+ status: z6.literal("declined"),
2008
+ nodeId: z6.string(),
2009
+ sideEffectId: z6.string().optional(),
2010
+ reason: z6.string().optional()
1987
2011
  })
1988
2012
  ]);
1989
- var flowInputToolResultSchema = z5.object({
1990
- results: z5.array(flowInputResultSchema)
2013
+ var flowInputToolResultSchema = z6.object({
2014
+ results: z6.array(flowInputResultSchema)
1991
2015
  });
1992
- var flowsListRequestSchema = z5.object({ chatId: z5.string() });
1993
- var flowSummarySchema = z5.object({
1994
- slug: z5.string(),
1995
- name: z5.string(),
2016
+ var flowsListRequestSchema = z6.object({ chatId: z6.string() });
2017
+ var flowSummarySchema = z6.object({
2018
+ slug: z6.string(),
2019
+ name: z6.string(),
1996
2020
  /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
1997
- needsConfig: z5.number()
2021
+ needsConfig: z6.number()
1998
2022
  });
1999
- var flowsListResponseSchema = z5.object({ flows: z5.array(flowSummarySchema) });
2000
- var flowsShowRequestSchema = z5.object({
2001
- chatId: z5.string(),
2002
- slug: z5.string(),
2003
- full: z5.boolean().optional()
2023
+ var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
2024
+ var flowsShowRequestSchema = z6.object({
2025
+ chatId: z6.string(),
2026
+ slug: z6.string(),
2027
+ full: z6.boolean().optional()
2004
2028
  });
2005
- var flowConfigStatusSchema = z5.object({
2006
- nodeId: z5.string(),
2007
- nodeName: z5.string().optional(),
2029
+ var flowConfigStatusSchema = z6.object({
2030
+ nodeId: z6.string(),
2031
+ nodeName: z6.string().optional(),
2008
2032
  /** "sideEffect" credential/connection, or "node" widget resource. */
2009
- target: z5.enum(["sideEffect", "node"]),
2010
- sideEffectId: z5.string().optional(),
2011
- kind: z5.string(),
2033
+ target: z6.enum(["sideEffect", "node"]),
2034
+ sideEffectId: z6.string().optional(),
2035
+ kind: z6.string(),
2012
2036
  /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
2013
- status: z5.string(),
2037
+ status: z6.string(),
2014
2038
  /** True when a `request_flow_input` call is still needed for this piece. */
2015
- needsInput: z5.boolean()
2039
+ needsInput: z6.boolean()
2016
2040
  });
2017
- var flowsShowResponseSchema = z5.object({
2018
- slug: z5.string(),
2019
- name: z5.string(),
2041
+ var flowsShowResponseSchema = z6.object({
2042
+ slug: z6.string(),
2043
+ name: z6.string(),
2020
2044
  /** Confidential fields and whether each is configured. */
2021
- config: z5.array(flowConfigStatusSchema),
2045
+ config: z6.array(flowConfigStatusSchema),
2022
2046
  /** Present only with `--full`: the whole flow tree, secret values redacted. */
2023
- tree: z5.unknown().optional()
2047
+ tree: z6.unknown().optional()
2024
2048
  });
2025
2049
 
2026
2050
  // ../api/src/images.ts
2027
- import { z as z6 } from "zod";
2028
- var imageSourceSchema = z6.enum([
2051
+ import { z as z7 } from "zod";
2052
+ var imageSourceSchema = z7.enum([
2029
2053
  "uploaded",
2030
2054
  "website",
2031
2055
  "google_testimonial",
@@ -2041,49 +2065,49 @@ var imageSourceSchema = z6.enum([
2041
2065
  "pinterest",
2042
2066
  "ai_generated"
2043
2067
  ]);
2044
- var imageStatusSchema = z6.enum(["uploading", "processing", "ready", "error"]);
2045
- var upscaleConfigSchema = z6.object({
2046
- model: z6.literal("philz1337x/crystal-upscaler"),
2047
- input: z6.object({
2048
- scale_factor: z6.number(),
2049
- creativity: z6.number(),
2050
- output_format: z6.string()
2068
+ var imageStatusSchema = z7.enum(["uploading", "processing", "ready", "error"]);
2069
+ var upscaleConfigSchema = z7.object({
2070
+ model: z7.literal("philz1337x/crystal-upscaler"),
2071
+ input: z7.object({
2072
+ scale_factor: z7.number(),
2073
+ creativity: z7.number(),
2074
+ output_format: z7.string()
2051
2075
  }),
2052
- status: z6.enum(["pending", "completed"])
2076
+ status: z7.enum(["pending", "completed"])
2053
2077
  });
2054
- var imageDocSchema = z6.object({
2055
- _id: z6.string(),
2056
- _creationTime: z6.number(),
2057
- companyId: z6.string(),
2058
- storageKey: z6.string(),
2078
+ var imageDocSchema = z7.object({
2079
+ _id: z7.string(),
2080
+ _creationTime: z7.number(),
2081
+ companyId: z7.string(),
2082
+ storageKey: z7.string(),
2059
2083
  upscaleConfig: upscaleConfigSchema.optional(),
2060
- upscaledStorageKey: z6.string().optional(),
2061
- name: z6.string(),
2062
- description: z6.string(),
2063
- tags: z6.array(z6.string()),
2064
- source: z6.string(),
2065
- externalId: z6.string().optional(),
2066
- externalUrl: z6.string().optional(),
2067
- contentHash: z6.string().optional(),
2068
- sourceId: z6.string().optional(),
2069
- descriptionContext: z6.string().optional(),
2070
- width: z6.number().optional(),
2071
- height: z6.number().optional(),
2072
- aspectRatio: z6.number().optional(),
2073
- dominantColor: z6.string().optional(),
2074
- imagePalette: z6.array(z6.string()).optional(),
2075
- thumbhashDataUri: z6.string().optional(),
2076
- isLightImage: z6.boolean().optional(),
2077
- descriptionEmbedding: z6.array(z6.number()).optional(),
2078
- imageEmbedding: z6.array(z6.number()).optional(),
2079
- searchText: z6.string().optional(),
2084
+ upscaledStorageKey: z7.string().optional(),
2085
+ name: z7.string(),
2086
+ description: z7.string(),
2087
+ tags: z7.array(z7.string()),
2088
+ source: z7.string(),
2089
+ externalId: z7.string().optional(),
2090
+ externalUrl: z7.string().optional(),
2091
+ contentHash: z7.string().optional(),
2092
+ sourceId: z7.string().optional(),
2093
+ descriptionContext: z7.string().optional(),
2094
+ width: z7.number().optional(),
2095
+ height: z7.number().optional(),
2096
+ aspectRatio: z7.number().optional(),
2097
+ dominantColor: z7.string().optional(),
2098
+ imagePalette: z7.array(z7.string()).optional(),
2099
+ thumbhashDataUri: z7.string().optional(),
2100
+ isLightImage: z7.boolean().optional(),
2101
+ descriptionEmbedding: z7.array(z7.number()).optional(),
2102
+ imageEmbedding: z7.array(z7.number()).optional(),
2103
+ searchText: z7.string().optional(),
2080
2104
  status: imageStatusSchema,
2081
- errorMessage: z6.string().optional(),
2082
- createdAt: z6.number(),
2083
- updatedAt: z6.number(),
2084
- imageUrl: z6.string()
2105
+ errorMessage: z7.string().optional(),
2106
+ createdAt: z7.number(),
2107
+ updatedAt: z7.number(),
2108
+ imageUrl: z7.string()
2085
2109
  });
2086
- var imageHitSourceSchema = z6.enum([
2110
+ var imageHitSourceSchema = z7.enum([
2087
2111
  "library",
2088
2112
  "magnific",
2089
2113
  "google_images",
@@ -2094,242 +2118,242 @@ var imageHitSourceSchema = z6.enum([
2094
2118
  "giphy",
2095
2119
  "pinterest"
2096
2120
  ]);
2097
- var imageHitSchema = z6.object({
2121
+ var imageHitSchema = z7.object({
2098
2122
  source: imageHitSourceSchema,
2099
- url: z6.string(),
2100
- thumbnailUrl: z6.string().optional(),
2101
- width: z6.number().optional(),
2102
- height: z6.number().optional(),
2103
- aspectRatio: z6.number().optional(),
2104
- dominantColor: z6.string().optional(),
2105
- externalId: z6.string().optional(),
2106
- externalUrl: z6.string().optional(),
2107
- providerMeta: z6.record(z6.string(), z6.unknown()).optional(),
2108
- descriptionContext: z6.string().optional(),
2109
- _id: z6.string().optional(),
2110
- name: z6.string().optional(),
2111
- description: z6.string().optional(),
2112
- tags: z6.array(z6.string()).optional(),
2113
- score: z6.number().optional(),
2114
- alsoInLibrary: z6.string().optional(),
2115
- prefetchedBytes: z6.string().optional(),
2116
- prefetchedContentType: z6.string().optional()
2123
+ url: z7.string(),
2124
+ thumbnailUrl: z7.string().optional(),
2125
+ width: z7.number().optional(),
2126
+ height: z7.number().optional(),
2127
+ aspectRatio: z7.number().optional(),
2128
+ dominantColor: z7.string().optional(),
2129
+ externalId: z7.string().optional(),
2130
+ externalUrl: z7.string().optional(),
2131
+ providerMeta: z7.record(z7.string(), z7.unknown()).optional(),
2132
+ descriptionContext: z7.string().optional(),
2133
+ _id: z7.string().optional(),
2134
+ name: z7.string().optional(),
2135
+ description: z7.string().optional(),
2136
+ tags: z7.array(z7.string()).optional(),
2137
+ score: z7.number().optional(),
2138
+ alsoInLibrary: z7.string().optional(),
2139
+ prefetchedBytes: z7.string().optional(),
2140
+ prefetchedContentType: z7.string().optional()
2117
2141
  });
2118
2142
  var ingestedImageHitSchema = imageHitSchema.extend({
2119
- imageId: z6.string().optional(),
2120
- imageUrl: z6.string().optional(),
2121
- deduped: z6.boolean().optional(),
2122
- sourceUrl: z6.string().optional()
2123
- });
2124
- var autoIngestItemSchema = z6.object({
2125
- imageId: z6.string(),
2126
- deduped: z6.boolean(),
2127
- imageUrl: z6.string(),
2128
- sourceUrl: z6.string(),
2129
- externalUrl: z6.string().optional()
2143
+ imageId: z7.string().optional(),
2144
+ imageUrl: z7.string().optional(),
2145
+ deduped: z7.boolean().optional(),
2146
+ sourceUrl: z7.string().optional()
2147
+ });
2148
+ var autoIngestItemSchema = z7.object({
2149
+ imageId: z7.string(),
2150
+ deduped: z7.boolean(),
2151
+ imageUrl: z7.string(),
2152
+ sourceUrl: z7.string(),
2153
+ externalUrl: z7.string().optional()
2130
2154
  });
2131
2155
  function providerHitsResponseSchema() {
2132
- return z6.object({
2133
- hits: z6.array(ingestedImageHitSchema),
2134
- ingested: z6.array(autoIngestItemSchema)
2156
+ return z7.object({
2157
+ hits: z7.array(ingestedImageHitSchema),
2158
+ ingested: z7.array(autoIngestItemSchema)
2135
2159
  });
2136
2160
  }
2137
- var imagesGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
2138
- var imagesSearchRequestSchema = z6.object({
2139
- query: z6.string().min(1),
2140
- limit: z6.coerce.number().int().positive().max(100).optional(),
2141
- aspectRatio: z6.string().optional(),
2142
- tags: z6.array(z6.string()).optional(),
2143
- source: z6.string().optional(),
2144
- externalUrlHost: z6.string().optional()
2145
- });
2146
- var imageSearchResultSchema = z6.object({
2147
- _id: z6.string(),
2148
- imageUrl: z6.string(),
2149
- name: z6.string(),
2150
- description: z6.string(),
2151
- tags: z6.array(z6.string()),
2152
- width: z6.number().optional(),
2153
- height: z6.number().optional(),
2154
- aspectRatio: z6.number().optional(),
2155
- dominantColor: z6.string().optional(),
2156
- imagePalette: z6.array(z6.string()).optional(),
2157
- source: z6.string(),
2158
- externalUrl: z6.string().optional(),
2159
- score: z6.number()
2160
- });
2161
- var imagesSearchResponseSchema = z6.array(imageSearchResultSchema);
2162
- var imagesUploadRequestSchema = z6.object({
2163
- base64: z6.string().min(1),
2164
- contentType: z6.string().min(1),
2165
- source: z6.string().optional(),
2166
- descriptionContext: z6.string().optional()
2167
- });
2168
- var imagesUploadResponseSchema = z6.object({ imageId: z6.string() });
2169
- var imagesDeleteRequestSchema = z6.object({ id: z6.string().min(1, "Missing image ID") });
2170
- var imagesDeleteResponseSchema = z6.object({ ok: z6.literal(true) });
2171
- var imagesUpscaleRequestSchema = z6.object({ imageId: z6.string().min(1, "Missing image ID") });
2172
- var imagesUpscaleResponseSchema = z6.object({
2173
- imageId: z6.string(),
2174
- status: z6.literal("processing")
2161
+ var imagesGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2162
+ var imagesSearchRequestSchema = z7.object({
2163
+ query: z7.string().min(1),
2164
+ limit: z7.coerce.number().int().positive().max(100).optional(),
2165
+ aspectRatio: z7.string().optional(),
2166
+ tags: z7.array(z7.string()).optional(),
2167
+ source: z7.string().optional(),
2168
+ externalUrlHost: z7.string().optional()
2169
+ });
2170
+ var imageSearchResultSchema = z7.object({
2171
+ _id: z7.string(),
2172
+ imageUrl: z7.string(),
2173
+ name: z7.string(),
2174
+ description: z7.string(),
2175
+ tags: z7.array(z7.string()),
2176
+ width: z7.number().optional(),
2177
+ height: z7.number().optional(),
2178
+ aspectRatio: z7.number().optional(),
2179
+ dominantColor: z7.string().optional(),
2180
+ imagePalette: z7.array(z7.string()).optional(),
2181
+ source: z7.string(),
2182
+ externalUrl: z7.string().optional(),
2183
+ score: z7.number()
2184
+ });
2185
+ var imagesSearchResponseSchema = z7.array(imageSearchResultSchema);
2186
+ var imagesUploadRequestSchema = z7.object({
2187
+ base64: z7.string().min(1),
2188
+ contentType: z7.string().min(1),
2189
+ source: z7.string().optional(),
2190
+ descriptionContext: z7.string().optional()
2191
+ });
2192
+ var imagesUploadResponseSchema = z7.object({ imageId: z7.string() });
2193
+ var imagesDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing image ID") });
2194
+ var imagesDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
2195
+ var imagesUpscaleRequestSchema = z7.object({ imageId: z7.string().min(1, "Missing image ID") });
2196
+ var imagesUpscaleResponseSchema = z7.object({
2197
+ imageId: z7.string(),
2198
+ status: z7.literal("processing")
2175
2199
  });
2176
2200
  var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
2177
- var imagesFindRequestSchema = z6.object({
2178
- query: z6.string().min(1),
2179
- sources: z6.array(z6.enum(IMAGES_FIND_SOURCES)).optional(),
2180
- limit: z6.coerce.number().int().positive().max(50).optional(),
2181
- fallback: z6.boolean().optional(),
2182
- threshold: z6.number().min(0).max(1).optional(),
2183
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2184
- descriptionContext: z6.string().optional()
2185
- });
2186
- var imagesFindResponseSchema = z6.object({
2187
- groups: z6.object({
2188
- library: z6.array(imageHitSchema),
2189
- external: z6.array(ingestedImageHitSchema)
2201
+ var imagesFindRequestSchema = z7.object({
2202
+ query: z7.string().min(1),
2203
+ sources: z7.array(z7.enum(IMAGES_FIND_SOURCES)).optional(),
2204
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2205
+ fallback: z7.boolean().optional(),
2206
+ threshold: z7.number().min(0).max(1).optional(),
2207
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2208
+ descriptionContext: z7.string().optional()
2209
+ });
2210
+ var imagesFindResponseSchema = z7.object({
2211
+ groups: z7.object({
2212
+ library: z7.array(imageHitSchema),
2213
+ external: z7.array(ingestedImageHitSchema)
2190
2214
  }),
2191
- meta: z6.object({
2192
- counts: z6.record(z6.string(), z6.number()),
2193
- errors: z6.array(z6.object({ source: imageHitSourceSchema, message: z6.string() }))
2215
+ meta: z7.object({
2216
+ counts: z7.record(z7.string(), z7.number()),
2217
+ errors: z7.array(z7.object({ source: imageHitSourceSchema, message: z7.string() }))
2194
2218
  }),
2195
- ingested: z6.array(autoIngestItemSchema)
2196
- });
2197
- var imagesStockRequestSchema = z6.object({
2198
- query: z6.string().min(1),
2199
- orientation: z6.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2200
- contentType: z6.enum(["photo", "vector", "psd"]).optional(),
2201
- license: z6.enum(["freemium", "premium"]).optional(),
2202
- color: z6.string().optional(),
2203
- aiGenerated: z6.enum(["exclude", "only"]).optional(),
2204
- people: z6.enum(["include", "exclude", "only"]).optional(),
2205
- order: z6.enum(["relevance", "recent"]).optional(),
2206
- limit: z6.coerce.number().int().positive().max(50).optional(),
2207
- page: z6.coerce.number().int().positive().optional(),
2208
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2209
- descriptionContext: z6.string().optional()
2219
+ ingested: z7.array(autoIngestItemSchema)
2220
+ });
2221
+ var imagesStockRequestSchema = z7.object({
2222
+ query: z7.string().min(1),
2223
+ orientation: z7.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
2224
+ contentType: z7.enum(["photo", "vector", "psd"]).optional(),
2225
+ license: z7.enum(["freemium", "premium"]).optional(),
2226
+ color: z7.string().optional(),
2227
+ aiGenerated: z7.enum(["exclude", "only"]).optional(),
2228
+ people: z7.enum(["include", "exclude", "only"]).optional(),
2229
+ order: z7.enum(["relevance", "recent"]).optional(),
2230
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2231
+ page: z7.coerce.number().int().positive().optional(),
2232
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2233
+ descriptionContext: z7.string().optional()
2210
2234
  });
2211
2235
  var imagesStockResponseSchema = providerHitsResponseSchema();
2212
- var imagesGoogleRequestSchema = z6.object({
2213
- query: z6.string().min(1),
2214
- type: z6.string().optional(),
2215
- size: z6.string().optional(),
2216
- color: z6.string().optional(),
2217
- safe: z6.enum(["off", "active"]).optional(),
2218
- limit: z6.coerce.number().int().positive().max(50).optional(),
2219
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2220
- descriptionContext: z6.string().optional()
2236
+ var imagesGoogleRequestSchema = z7.object({
2237
+ query: z7.string().min(1),
2238
+ type: z7.string().optional(),
2239
+ size: z7.string().optional(),
2240
+ color: z7.string().optional(),
2241
+ safe: z7.enum(["off", "active"]).optional(),
2242
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2243
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2244
+ descriptionContext: z7.string().optional()
2221
2245
  });
2222
2246
  var imagesGoogleResponseSchema = providerHitsResponseSchema();
2223
- var imagesPinterestRequestSchema = z6.object({
2224
- query: z6.string().min(1),
2225
- limit: z6.coerce.number().int().positive().max(20).optional(),
2226
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2227
- descriptionContext: z6.string().optional()
2247
+ var imagesPinterestRequestSchema = z7.object({
2248
+ query: z7.string().min(1),
2249
+ limit: z7.coerce.number().int().positive().max(20).optional(),
2250
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2251
+ descriptionContext: z7.string().optional()
2228
2252
  });
2229
2253
  var imagesPinterestResponseSchema = providerHitsResponseSchema();
2230
- var rgbTriple = z6.tuple([
2231
- z6.number().int().min(0).max(255),
2232
- z6.number().int().min(0).max(255),
2233
- z6.number().int().min(0).max(255)
2254
+ var rgbTriple = z7.tuple([
2255
+ z7.number().int().min(0).max(255),
2256
+ z7.number().int().min(0).max(255),
2257
+ z7.number().int().min(0).max(255)
2234
2258
  ]);
2235
- var imageGenerateModelSchema = z6.enum([
2259
+ var imageGenerateModelSchema = z7.enum([
2236
2260
  "openai/gpt-5.4-image-2",
2237
2261
  "google/gemini-3.5-flash",
2238
2262
  "google/gemini-3.1-flash-image-preview",
2239
2263
  "google/gemini-3-pro-image-preview",
2240
2264
  "recraft/recraft-v4.1-pro-vector"
2241
2265
  ]);
2242
- var imagesGenerateRequestSchema = z6.object({
2243
- prompt: z6.string().min(1),
2266
+ var imagesGenerateRequestSchema = z7.object({
2267
+ prompt: z7.string().min(1),
2244
2268
  model: imageGenerateModelSchema.optional(),
2245
2269
  // Aspect ratio + size are validated loosely as strings; the per-model enum
2246
2270
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
2247
- aspectRatio: z6.string().optional(),
2248
- imageSize: z6.string().optional(),
2271
+ aspectRatio: z7.string().optional(),
2272
+ imageSize: z7.string().optional(),
2249
2273
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
2250
- quality: z6.enum(["auto", "low", "medium", "high"]).optional(),
2274
+ quality: z7.enum(["auto", "low", "medium", "high"]).optional(),
2251
2275
  // Recraft v4.1 Pro Vector levers (ignored by other models).
2252
- strength: z6.coerce.number().min(0).max(1).optional(),
2253
- rgbColors: z6.array(rgbTriple).optional(),
2276
+ strength: z7.coerce.number().min(0).max(1).optional(),
2277
+ rgbColors: z7.array(rgbTriple).optional(),
2254
2278
  backgroundRgbColor: rgbTriple.optional(),
2255
2279
  // Public image URLs used as visual references (multi-reference, in order).
2256
- referenceUrls: z6.array(z6.string().url()).optional(),
2257
- descriptionContext: z6.string().optional()
2258
- });
2259
- var generatedImageSchema = z6.object({
2260
- imageId: z6.string(),
2261
- deduped: z6.boolean(),
2262
- imageUrl: z6.string(),
2263
- width: z6.number().optional(),
2264
- height: z6.number().optional()
2265
- });
2266
- var imagesGenerateResponseSchema = z6.object({
2267
- model: z6.string(),
2268
- costUsd: z6.number(),
2269
- images: z6.array(generatedImageSchema)
2270
- });
2271
- var imagesLogoRequestSchema = z6.object({
2272
- domain: z6.string().min(1),
2273
- variant: z6.enum(["icon", "logo", "symbol"]).optional(),
2274
- autoIngest: z6.coerce.number().int().min(0).max(5).optional(),
2275
- descriptionContext: z6.string().optional()
2280
+ referenceUrls: z7.array(z7.string().url()).optional(),
2281
+ descriptionContext: z7.string().optional()
2282
+ });
2283
+ var generatedImageSchema = z7.object({
2284
+ imageId: z7.string(),
2285
+ deduped: z7.boolean(),
2286
+ imageUrl: z7.string(),
2287
+ width: z7.number().optional(),
2288
+ height: z7.number().optional()
2289
+ });
2290
+ var imagesGenerateResponseSchema = z7.object({
2291
+ model: z7.string(),
2292
+ costUsd: z7.number(),
2293
+ images: z7.array(generatedImageSchema)
2294
+ });
2295
+ var imagesLogoRequestSchema = z7.object({
2296
+ domain: z7.string().min(1),
2297
+ variant: z7.enum(["icon", "logo", "symbol"]).optional(),
2298
+ autoIngest: z7.coerce.number().int().min(0).max(5).optional(),
2299
+ descriptionContext: z7.string().optional()
2276
2300
  });
2277
2301
  var imagesLogoResponseSchema = providerHitsResponseSchema();
2278
- var imagesIconRequestSchema = z6.object({
2279
- name: z6.string().min(1),
2280
- set: z6.string().optional(),
2281
- color: z6.string().optional(),
2282
- width: z6.coerce.number().int().positive().optional(),
2283
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2284
- descriptionContext: z6.string().optional()
2302
+ var imagesIconRequestSchema = z7.object({
2303
+ name: z7.string().min(1),
2304
+ set: z7.string().optional(),
2305
+ color: z7.string().optional(),
2306
+ width: z7.coerce.number().int().positive().optional(),
2307
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2308
+ descriptionContext: z7.string().optional()
2285
2309
  });
2286
2310
  var imagesIconResponseSchema = providerHitsResponseSchema();
2287
- var imagesExtractRequestSchema = z6.object({
2288
- url: z6.string().url(),
2289
- waitFor: z6.coerce.number().int().min(0).max(3e4).optional(),
2290
- limit: z6.coerce.number().int().positive().max(50).optional(),
2291
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2292
- descriptionContext: z6.string().optional()
2311
+ var imagesExtractRequestSchema = z7.object({
2312
+ url: z7.string().url(),
2313
+ waitFor: z7.coerce.number().int().min(0).max(3e4).optional(),
2314
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2315
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2316
+ descriptionContext: z7.string().optional()
2293
2317
  });
2294
2318
  var imagesExtractResponseSchema = providerHitsResponseSchema();
2295
- var imagesScreenshotRequestSchema = z6.object({
2296
- url: z6.string().url(),
2297
- fullPage: z6.boolean().optional(),
2298
- viewportWidth: z6.coerce.number().int().positive().max(3840).optional(),
2299
- viewportHeight: z6.coerce.number().int().positive().max(2160).optional(),
2300
- format: z6.enum(["webp", "png", "jpg"]).optional(),
2301
- descriptionContext: z6.string().optional()
2319
+ var imagesScreenshotRequestSchema = z7.object({
2320
+ url: z7.string().url(),
2321
+ fullPage: z7.boolean().optional(),
2322
+ viewportWidth: z7.coerce.number().int().positive().max(3840).optional(),
2323
+ viewportHeight: z7.coerce.number().int().positive().max(2160).optional(),
2324
+ format: z7.enum(["webp", "png", "jpg"]).optional(),
2325
+ descriptionContext: z7.string().optional()
2302
2326
  });
2303
2327
  var imagesScreenshotResponseSchema = providerHitsResponseSchema();
2304
- var imagesGiphyRequestSchema = z6.object({
2305
- query: z6.string().min(1).optional(),
2306
- trending: z6.coerce.boolean().optional(),
2307
- limit: z6.coerce.number().int().positive().max(50).optional(),
2308
- rating: z6.enum(["g", "pg", "pg-13", "r"]).optional(),
2309
- lang: z6.string().optional(),
2310
- autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
2311
- descriptionContext: z6.string().optional()
2328
+ var imagesGiphyRequestSchema = z7.object({
2329
+ query: z7.string().min(1).optional(),
2330
+ trending: z7.coerce.boolean().optional(),
2331
+ limit: z7.coerce.number().int().positive().max(50).optional(),
2332
+ rating: z7.enum(["g", "pg", "pg-13", "r"]).optional(),
2333
+ lang: z7.string().optional(),
2334
+ autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
2335
+ descriptionContext: z7.string().optional()
2312
2336
  });
2313
2337
  var imagesGifResponseSchema = providerHitsResponseSchema();
2314
2338
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2315
- var imagesIngestRequestSchema = z6.object({
2316
- url: z6.string().url(),
2339
+ var imagesIngestRequestSchema = z7.object({
2340
+ url: z7.string().url(),
2317
2341
  // Validate source at the HTTP boundary so unknown values produce the standard
2318
2342
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2319
2343
  // `assertImageSource` inside the action.
2320
2344
  source: imageSourceSchema,
2321
- externalId: z6.string().optional(),
2322
- externalUrl: z6.string().optional(),
2323
- descriptionContext: z6.string().optional()
2345
+ externalId: z7.string().optional(),
2346
+ externalUrl: z7.string().optional(),
2347
+ descriptionContext: z7.string().optional()
2324
2348
  });
2325
- var imagesIngestResponseSchema = z6.object({
2326
- imageId: z6.string(),
2327
- deduped: z6.boolean(),
2328
- contentHash: z6.string()
2349
+ var imagesIngestResponseSchema = z7.object({
2350
+ imageId: z7.string(),
2351
+ deduped: z7.boolean(),
2352
+ contentHash: z7.string()
2329
2353
  });
2330
2354
 
2331
2355
  // ../api/src/tags.ts
2332
- import { z as z7 } from "zod";
2356
+ import { z as z8 } from "zod";
2333
2357
  var TAG_TYPES = [
2334
2358
  "meta",
2335
2359
  "amplitude",
@@ -2350,7 +2374,7 @@ var TAG_TYPES = [
2350
2374
  "recaptcha",
2351
2375
  "twitterAds"
2352
2376
  ];
2353
- var tagTypeSchema = z7.enum(TAG_TYPES);
2377
+ var tagTypeSchema = z8.enum(TAG_TYPES);
2354
2378
  var TAG_IDENTIFYING_FIELD = {
2355
2379
  meta: "pixelId",
2356
2380
  googleAds: "conversionID",
@@ -2371,218 +2395,218 @@ var TAG_IDENTIFYING_FIELD = {
2371
2395
  recaptcha: "siteKey",
2372
2396
  twitterAds: "pixelId"
2373
2397
  };
2374
- var tagDraftOpKindSchema = z7.enum(["create", "update", "delete"]);
2375
- var tagDraftOpViewSchema = z7.object({
2398
+ var tagDraftOpKindSchema = z8.enum(["create", "update", "delete"]);
2399
+ var tagDraftOpViewSchema = z8.object({
2376
2400
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2377
- ref: z7.string(),
2401
+ ref: z8.string(),
2378
2402
  kind: tagDraftOpKindSchema,
2379
2403
  type: tagTypeSchema,
2380
2404
  /** Present on update/delete ops — the real tag this op targets. */
2381
- tagId: z7.string().optional(),
2405
+ tagId: z8.string().optional(),
2382
2406
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2383
- config: z7.record(z7.string(), z7.string()),
2407
+ config: z8.record(z8.string(), z8.string()),
2384
2408
  /** Update only — fields the op explicitly clears. */
2385
- clearFields: z7.array(z7.string()).optional(),
2409
+ clearFields: z8.array(z8.string()).optional(),
2386
2410
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2387
- secretsSet: z7.array(z7.string()),
2411
+ secretsSet: z8.array(z8.string()),
2388
2412
  /** Names of secret fields still awaiting user input. */
2389
- secretsPending: z7.array(z7.string()),
2390
- summary: z7.string(),
2391
- stagedAt: z7.number()
2413
+ secretsPending: z8.array(z8.string()),
2414
+ summary: z8.string(),
2415
+ stagedAt: z8.number()
2392
2416
  });
2393
- var tagsEffectiveEntrySchema = z7.object({
2417
+ var tagsEffectiveEntrySchema = z8.object({
2394
2418
  /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
2395
- ref: z7.string(),
2396
- tagId: z7.string().optional(),
2419
+ ref: z8.string(),
2420
+ tagId: z8.string().optional(),
2397
2421
  type: tagTypeSchema,
2398
2422
  /** Value of the type's identifying field, when set. */
2399
- identifier: z7.string().optional(),
2423
+ identifier: z8.string().optional(),
2400
2424
  /** Redacted config; for staged updates, production config with the patch merged. */
2401
- config: z7.record(z7.string(), z7.string()),
2425
+ config: z8.record(z8.string(), z8.string()),
2402
2426
  /** Absent = live production tag with no staged changes in this chat. */
2403
2427
  staged: tagDraftOpKindSchema.optional(),
2404
- secretsSet: z7.array(z7.string()),
2405
- secretsPending: z7.array(z7.string())
2428
+ secretsSet: z8.array(z8.string()),
2429
+ secretsPending: z8.array(z8.string())
2406
2430
  });
2407
- var tagsListRequestSchema = z7.object({ chatId: z7.string() });
2408
- var tagsListResponseSchema = z7.object({ tags: z7.array(tagsEffectiveEntrySchema) });
2409
- var tagsDraftListRequestSchema = z7.object({ chatId: z7.string() });
2410
- var tagsDraftListResponseSchema = z7.object({
2411
- status: z7.enum(["active", "publishing", "applied", "discarded", "none"]),
2412
- ops: z7.array(tagDraftOpViewSchema)
2431
+ var tagsListRequestSchema = z8.object({ chatId: z8.string() });
2432
+ var tagsListResponseSchema = z8.object({ tags: z8.array(tagsEffectiveEntrySchema) });
2433
+ var tagsDraftListRequestSchema = z8.object({ chatId: z8.string() });
2434
+ var tagsDraftListResponseSchema = z8.object({
2435
+ status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
2436
+ ops: z8.array(tagDraftOpViewSchema)
2413
2437
  });
2414
- var tagInputRequestSchema = z7.object({
2438
+ var tagInputRequestSchema = z8.object({
2415
2439
  // Every tag change is a tab in the approval form: create/edit show the full
2416
2440
  // body; delete shows a confirm. No tag change bypasses this approval.
2417
- mode: z7.enum(["create", "edit", "delete"]),
2441
+ mode: z8.enum(["create", "edit", "delete"]),
2418
2442
  tagType: tagTypeSchema,
2419
2443
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2420
- ref: z7.string().optional(),
2444
+ ref: z8.string().optional(),
2421
2445
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2422
- prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
2446
+ prefilledConfig: z8.record(z8.string(), z8.string()).optional(),
2423
2447
  /** Secret field names the agent asks the user to provide. */
2424
- requestedSecretFields: z7.array(z7.string()).optional(),
2448
+ requestedSecretFields: z8.array(z8.string()).optional(),
2425
2449
  /** Short message shown above the form explaining why the input is needed. */
2426
- message: z7.string().optional()
2450
+ message: z8.string().optional()
2427
2451
  });
2428
- var tagChangeToolInputSchema = z7.object({
2429
- changes: z7.array(tagInputRequestSchema).min(1).max(8)
2452
+ var tagChangeToolInputSchema = z8.object({
2453
+ changes: z8.array(tagInputRequestSchema).min(1).max(8)
2430
2454
  });
2431
- var tagInputResultSchema = z7.discriminatedUnion("status", [
2432
- z7.object({
2433
- status: z7.literal("submitted"),
2434
- ref: z7.string(),
2455
+ var tagInputResultSchema = z8.discriminatedUnion("status", [
2456
+ z8.object({
2457
+ status: z8.literal("submitted"),
2458
+ ref: z8.string(),
2435
2459
  type: tagTypeSchema,
2436
2460
  /** Identifying field name → value (non-secret), when the type has one. */
2437
- identifier: z7.record(z7.string(), z7.string()).optional(),
2438
- secretFieldsSet: z7.array(z7.string()),
2439
- note: z7.string().optional()
2461
+ identifier: z8.record(z8.string(), z8.string()).optional(),
2462
+ secretFieldsSet: z8.array(z8.string()),
2463
+ note: z8.string().optional()
2440
2464
  }),
2441
- z7.object({
2442
- status: z7.literal("declined"),
2443
- reason: z7.string().optional()
2465
+ z8.object({
2466
+ status: z8.literal("declined"),
2467
+ reason: z8.string().optional()
2444
2468
  })
2445
2469
  ]);
2446
- var tagChangeToolResultSchema = z7.object({
2447
- results: z7.array(tagInputResultSchema)
2470
+ var tagChangeToolResultSchema = z8.object({
2471
+ results: z8.array(tagInputResultSchema)
2448
2472
  });
2449
2473
 
2450
2474
  // ../api/src/testimonials.ts
2451
- import { z as z8 } from "zod";
2452
- var testimonialSourceTypeSchema = z8.enum(["google", "trustpilot"]);
2453
- var testimonialStatusSchema = z8.enum(["pending", "processing", "ready", "error"]);
2454
- var testimonialSentimentSchema = z8.enum(["positive", "neutral", "negative"]);
2455
- var testimonialDocSchema = z8.object({
2456
- _id: z8.string(),
2457
- _creationTime: z8.number(),
2458
- companyId: z8.string(),
2459
- sourceId: z8.string(),
2475
+ import { z as z9 } from "zod";
2476
+ var testimonialSourceTypeSchema = z9.enum(["google", "trustpilot"]);
2477
+ var testimonialStatusSchema = z9.enum(["pending", "processing", "ready", "error"]);
2478
+ var testimonialSentimentSchema = z9.enum(["positive", "neutral", "negative"]);
2479
+ var testimonialDocSchema = z9.object({
2480
+ _id: z9.string(),
2481
+ _creationTime: z9.number(),
2482
+ companyId: z9.string(),
2483
+ sourceId: z9.string(),
2460
2484
  sourceType: testimonialSourceTypeSchema,
2461
- reviewText: z8.string(),
2462
- reviewTitle: z8.string().optional(),
2463
- searchText: z8.string().optional(),
2464
- reviewerName: z8.string().optional(),
2465
- reviewerImageUrl: z8.string().optional(),
2466
- reviewerImageId: z8.string().optional(),
2467
- reviewerLocation: z8.string().optional(),
2468
- rating: z8.number().optional(),
2469
- reviewDate: z8.number().optional(),
2470
- ownerAnswer: z8.string().optional(),
2471
- mediaUrls: z8.array(z8.string()).optional(),
2472
- imageIds: z8.array(z8.string()).optional(),
2473
- videoIds: z8.array(z8.string()).optional(),
2474
- sourceUrl: z8.string().optional(),
2475
- rawData: z8.unknown().optional(),
2476
- tags: z8.array(z8.string()),
2477
- highlight: z8.string().optional(),
2478
- language: z8.string().optional(),
2479
- summary: z8.string().optional(),
2485
+ reviewText: z9.string(),
2486
+ reviewTitle: z9.string().optional(),
2487
+ searchText: z9.string().optional(),
2488
+ reviewerName: z9.string().optional(),
2489
+ reviewerImageUrl: z9.string().optional(),
2490
+ reviewerImageId: z9.string().optional(),
2491
+ reviewerLocation: z9.string().optional(),
2492
+ rating: z9.number().optional(),
2493
+ reviewDate: z9.number().optional(),
2494
+ ownerAnswer: z9.string().optional(),
2495
+ mediaUrls: z9.array(z9.string()).optional(),
2496
+ imageIds: z9.array(z9.string()).optional(),
2497
+ videoIds: z9.array(z9.string()).optional(),
2498
+ sourceUrl: z9.string().optional(),
2499
+ rawData: z9.unknown().optional(),
2500
+ tags: z9.array(z9.string()),
2501
+ highlight: z9.string().optional(),
2502
+ language: z9.string().optional(),
2503
+ summary: z9.string().optional(),
2480
2504
  sentiment: testimonialSentimentSchema.optional(),
2481
- textEmbedding: z8.array(z8.number()).optional(),
2482
- externalId: z8.string().optional(),
2483
- contentHash: z8.string().optional(),
2505
+ textEmbedding: z9.array(z9.number()).optional(),
2506
+ externalId: z9.string().optional(),
2507
+ contentHash: z9.string().optional(),
2484
2508
  status: testimonialStatusSchema,
2485
- errorMessage: z8.string().optional(),
2486
- createdAt: z8.number(),
2487
- updatedAt: z8.number()
2509
+ errorMessage: z9.string().optional(),
2510
+ createdAt: z9.number(),
2511
+ updatedAt: z9.number()
2488
2512
  });
2489
- var testimonialsListRequestSchema = z8.object({
2513
+ var testimonialsListRequestSchema = z9.object({
2490
2514
  source: testimonialSourceTypeSchema.optional(),
2491
- rating_min: z8.coerce.number().int().min(1).max(5).optional(),
2492
- rating_max: z8.coerce.number().int().min(1).max(5).optional(),
2493
- tags: z8.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2515
+ rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2516
+ rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2517
+ tags: z9.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2494
2518
  status: testimonialStatusSchema.optional(),
2495
2519
  sentiment: testimonialSentimentSchema.optional(),
2496
- language: z8.string().min(2).max(5).optional(),
2497
- limit: z8.coerce.number().int().positive().max(200).optional()
2498
- });
2499
- var testimonialsListResponseSchema = z8.array(testimonialDocSchema);
2500
- var testimonialsGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2501
- var testimonialsSearchRequestSchema = z8.object({
2502
- query: z8.string().min(1),
2503
- limit: z8.coerce.number().int().positive().max(100).optional(),
2520
+ language: z9.string().min(2).max(5).optional(),
2521
+ limit: z9.coerce.number().int().positive().max(200).optional()
2522
+ });
2523
+ var testimonialsListResponseSchema = z9.array(testimonialDocSchema);
2524
+ var testimonialsGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2525
+ var testimonialsSearchRequestSchema = z9.object({
2526
+ query: z9.string().min(1),
2527
+ limit: z9.coerce.number().int().positive().max(100).optional(),
2504
2528
  source: testimonialSourceTypeSchema.optional(),
2505
- rating_min: z8.coerce.number().int().min(1).max(5).optional(),
2506
- rating_max: z8.coerce.number().int().min(1).max(5).optional(),
2507
- tags: z8.array(z8.string()).optional(),
2529
+ rating_min: z9.coerce.number().int().min(1).max(5).optional(),
2530
+ rating_max: z9.coerce.number().int().min(1).max(5).optional(),
2531
+ tags: z9.array(z9.string()).optional(),
2508
2532
  status: testimonialStatusSchema.optional(),
2509
2533
  sentiment: testimonialSentimentSchema.optional(),
2510
- language: z8.string().min(2).max(5).optional()
2534
+ language: z9.string().min(2).max(5).optional()
2511
2535
  }).refine(
2512
2536
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2513
2537
  { message: "rating_min must be less than or equal to rating_max" }
2514
2538
  );
2515
- var testimonialsSearchResponseSchema = z8.array(testimonialDocSchema);
2516
- var testimonialsOutscraperWebhookResponseSchema = z8.object({
2517
- ok: z8.literal(true),
2518
- note: z8.string().optional()
2539
+ var testimonialsSearchResponseSchema = z9.array(testimonialDocSchema);
2540
+ var testimonialsOutscraperWebhookResponseSchema = z9.object({
2541
+ ok: z9.literal(true),
2542
+ note: z9.string().optional()
2519
2543
  });
2520
2544
 
2521
2545
  // ../api/src/videos.ts
2522
- import { z as z9 } from "zod";
2523
- var videoStatusSchema = z9.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2524
- var videoTranscriptSegmentSchema = z9.object({
2525
- text: z9.string(),
2526
- startSecond: z9.number(),
2527
- endSecond: z9.number()
2528
- });
2529
- var videoSceneSchema = z9.object({
2530
- title: z9.string(),
2531
- description: z9.string(),
2532
- startSecond: z9.number(),
2533
- endSecond: z9.number(),
2534
- thumbnailTime: z9.number()
2535
- });
2536
- var videoDocSchema = z9.object({
2537
- _id: z9.string(),
2538
- _creationTime: z9.number(),
2539
- companyId: z9.string(),
2540
- muxAssetId: z9.string(),
2541
- muxPlaybackId: z9.string(),
2542
- muxUploadId: z9.string(),
2543
- name: z9.string(),
2544
- description: z9.string(),
2545
- tags: z9.array(z9.string()),
2546
- source: z9.string(),
2547
- externalId: z9.string().optional(),
2548
- sourceId: z9.string().optional(),
2549
- width: z9.number().optional(),
2550
- height: z9.number().optional(),
2551
- aspectRatio: z9.number().optional(),
2552
- duration: z9.number().optional(),
2553
- transcript: z9.string().optional(),
2554
- transcriptSegments: z9.array(videoTranscriptSegmentSchema).optional(),
2555
- scenes: z9.array(videoSceneSchema).optional(),
2556
- descriptionEmbedding: z9.array(z9.number()).optional(),
2557
- searchText: z9.string().optional(),
2546
+ import { z as z10 } from "zod";
2547
+ var videoStatusSchema = z10.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2548
+ var videoTranscriptSegmentSchema = z10.object({
2549
+ text: z10.string(),
2550
+ startSecond: z10.number(),
2551
+ endSecond: z10.number()
2552
+ });
2553
+ var videoSceneSchema = z10.object({
2554
+ title: z10.string(),
2555
+ description: z10.string(),
2556
+ startSecond: z10.number(),
2557
+ endSecond: z10.number(),
2558
+ thumbnailTime: z10.number()
2559
+ });
2560
+ var videoDocSchema = z10.object({
2561
+ _id: z10.string(),
2562
+ _creationTime: z10.number(),
2563
+ companyId: z10.string(),
2564
+ muxAssetId: z10.string(),
2565
+ muxPlaybackId: z10.string(),
2566
+ muxUploadId: z10.string(),
2567
+ name: z10.string(),
2568
+ description: z10.string(),
2569
+ tags: z10.array(z10.string()),
2570
+ source: z10.string(),
2571
+ externalId: z10.string().optional(),
2572
+ sourceId: z10.string().optional(),
2573
+ width: z10.number().optional(),
2574
+ height: z10.number().optional(),
2575
+ aspectRatio: z10.number().optional(),
2576
+ duration: z10.number().optional(),
2577
+ transcript: z10.string().optional(),
2578
+ transcriptSegments: z10.array(videoTranscriptSegmentSchema).optional(),
2579
+ scenes: z10.array(videoSceneSchema).optional(),
2580
+ descriptionEmbedding: z10.array(z10.number()).optional(),
2581
+ searchText: z10.string().optional(),
2558
2582
  status: videoStatusSchema,
2559
- errorMessage: z9.string().optional(),
2560
- createdAt: z9.number(),
2561
- updatedAt: z9.number(),
2562
- thumbnailUrl: z9.string()
2563
- });
2564
- var videosWebhookResponseSchema = z9.object({ ok: z9.literal(true) });
2565
- var videosGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2566
- var videosSearchRequestSchema = z9.object({
2567
- query: z9.string().min(1),
2568
- limit: z9.coerce.number().int().positive().max(100).optional(),
2569
- tags: z9.array(z9.string()).optional()
2570
- });
2571
- var videoSearchResultSchema = z9.object({
2572
- _id: z9.string(),
2573
- thumbnailUrl: z9.string(),
2574
- name: z9.string(),
2575
- description: z9.string(),
2576
- tags: z9.array(z9.string()),
2577
- status: z9.string(),
2578
- duration: z9.number().optional(),
2579
- muxPlaybackId: z9.string(),
2580
- createdAt: z9.number()
2581
- });
2582
- var videosSearchResponseSchema = z9.array(videoSearchResultSchema);
2583
- var videosUploadResponseSchema = z9.object({ uploadUrl: z9.string(), videoId: z9.string() });
2584
- var videosDeleteRequestSchema = z9.object({ id: z9.string().min(1, "Missing video ID") });
2585
- var videosDeleteResponseSchema = z9.object({ ok: z9.literal(true) });
2583
+ errorMessage: z10.string().optional(),
2584
+ createdAt: z10.number(),
2585
+ updatedAt: z10.number(),
2586
+ thumbnailUrl: z10.string()
2587
+ });
2588
+ var videosWebhookResponseSchema = z10.object({ ok: z10.literal(true) });
2589
+ var videosGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
2590
+ var videosSearchRequestSchema = z10.object({
2591
+ query: z10.string().min(1),
2592
+ limit: z10.coerce.number().int().positive().max(100).optional(),
2593
+ tags: z10.array(z10.string()).optional()
2594
+ });
2595
+ var videoSearchResultSchema = z10.object({
2596
+ _id: z10.string(),
2597
+ thumbnailUrl: z10.string(),
2598
+ name: z10.string(),
2599
+ description: z10.string(),
2600
+ tags: z10.array(z10.string()),
2601
+ status: z10.string(),
2602
+ duration: z10.number().optional(),
2603
+ muxPlaybackId: z10.string(),
2604
+ createdAt: z10.number()
2605
+ });
2606
+ var videosSearchResponseSchema = z10.array(videoSearchResultSchema);
2607
+ var videosUploadResponseSchema = z10.object({ uploadUrl: z10.string(), videoId: z10.string() });
2608
+ var videosDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing video ID") });
2609
+ var videosDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
2586
2610
 
2587
2611
  // src/commands/actions/complete.ts
2588
2612
  import { defineCommand as defineCommand2 } from "citty";
@@ -4395,37 +4419,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4395
4419
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4396
4420
 
4397
4421
  // ../api/src/ads-google/ops.ts
4398
- import { z as z10 } from "zod";
4399
- var tempRefSchema2 = z10.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4400
- var refSchema = z10.union([
4401
- z10.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4402
- z10.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4422
+ import { z as z11 } from "zod";
4423
+ var tempRefSchema2 = z11.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4424
+ var refSchema = z11.union([
4425
+ z11.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4426
+ z11.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4403
4427
  tempRefSchema2
4404
4428
  ]);
4405
4429
  var targetRefSchema = refSchema;
4406
- var microsSchema = z10.number().int().positive("expected a positive micros amount");
4407
- var httpsUrlSchema2 = z10.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4408
- var customerIdSchema = z10.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4409
- var stageableStatusSchema2 = z10.enum(STAGEABLE_CREATE_STATUSES2);
4410
- var matchTypeSchema = z10.enum(KEYWORD_MATCH_TYPES);
4411
- var keywordTextSchema = z10.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4412
- var budgetCreateSchema = z10.object({
4413
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4430
+ var microsSchema = z11.number().int().positive("expected a positive micros amount");
4431
+ var httpsUrlSchema2 = z11.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4432
+ var customerIdSchema = z11.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4433
+ var stageableStatusSchema2 = z11.enum(STAGEABLE_CREATE_STATUSES2);
4434
+ var matchTypeSchema = z11.enum(KEYWORD_MATCH_TYPES);
4435
+ var keywordTextSchema = z11.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4436
+ var budgetCreateSchema = z11.object({
4437
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4414
4438
  amountMicros: microsSchema,
4415
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4416
- explicitlyShared: z10.boolean().default(false)
4439
+ deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4440
+ explicitlyShared: z11.boolean().default(false)
4417
4441
  });
4418
- var budgetUpdateSchema = z10.object({
4419
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4442
+ var budgetUpdateSchema = z11.object({
4443
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4420
4444
  amountMicros: microsSchema.optional(),
4421
- deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).optional()
4445
+ deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).optional()
4422
4446
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4423
- var biddingConfigSchema = z10.object({
4424
- type: z10.enum(BIDDING_STRATEGY_TYPES),
4447
+ var biddingConfigSchema = z11.object({
4448
+ type: z11.enum(BIDDING_STRATEGY_TYPES),
4425
4449
  targetCpaMicros: microsSchema.optional(),
4426
- targetRoas: z10.number().positive().optional(),
4450
+ targetRoas: z11.number().positive().optional(),
4427
4451
  cpcBidCeilingMicros: microsSchema.optional(),
4428
- enhancedCpcEnabled: z10.boolean().optional()
4452
+ enhancedCpcEnabled: z11.boolean().optional()
4429
4453
  }).superRefine((p, ctx) => {
4430
4454
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4431
4455
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4434,17 +4458,17 @@ var biddingConfigSchema = z10.object({
4434
4458
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4435
4459
  }
4436
4460
  });
4437
- var networkSettingsSchema = z10.object({
4438
- targetGoogleSearch: z10.boolean().optional(),
4439
- targetSearchNetwork: z10.boolean().optional(),
4440
- targetContentNetwork: z10.boolean().optional(),
4441
- targetPartnerSearchNetwork: z10.boolean().optional()
4461
+ var networkSettingsSchema = z11.object({
4462
+ targetGoogleSearch: z11.boolean().optional(),
4463
+ targetSearchNetwork: z11.boolean().optional(),
4464
+ targetContentNetwork: z11.boolean().optional(),
4465
+ targetPartnerSearchNetwork: z11.boolean().optional()
4442
4466
  });
4443
- var dateSchema = z10.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4444
- var campaignCreateSchema2 = z10.object({
4445
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4446
- channelType: z10.enum(ADVERTISING_CHANNEL_TYPES),
4447
- channelSubType: z10.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4467
+ var dateSchema = z11.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4468
+ var campaignCreateSchema2 = z11.object({
4469
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4470
+ channelType: z11.enum(ADVERTISING_CHANNEL_TYPES),
4471
+ channelSubType: z11.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4448
4472
  budget: refSchema,
4449
4473
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4450
4474
  bidding: biddingConfigSchema.optional(),
@@ -4453,7 +4477,7 @@ var campaignCreateSchema2 = z10.object({
4453
4477
  startDate: dateSchema.optional(),
4454
4478
  endDate: dateSchema.optional(),
4455
4479
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4456
- objective: z10.enum(CAMPAIGN_OBJECTIVES).optional(),
4480
+ objective: z11.enum(CAMPAIGN_OBJECTIVES).optional(),
4457
4481
  status: stageableStatusSchema2.default("PAUSED")
4458
4482
  }).superRefine((p, ctx) => {
4459
4483
  if (!p.bidding && !p.biddingStrategy) {
@@ -4477,129 +4501,129 @@ var campaignCreateSchema2 = z10.object({
4477
4501
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4478
4502
  }
4479
4503
  });
4480
- var campaignUpdateSchema2 = z10.object({
4481
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4504
+ var campaignUpdateSchema2 = z11.object({
4505
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4482
4506
  budget: refSchema.optional(),
4483
4507
  bidding: biddingConfigSchema.optional(),
4484
4508
  networkSettings: networkSettingsSchema.optional(),
4485
4509
  startDate: dateSchema.optional(),
4486
4510
  endDate: dateSchema.optional(),
4487
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4511
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4488
4512
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4489
- var adGroupCreateSchema = z10.object({
4490
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4513
+ var adGroupCreateSchema = z11.object({
4514
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4491
4515
  campaign: refSchema,
4492
- type: z10.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4516
+ type: z11.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4493
4517
  cpcBidMicros: microsSchema.optional(),
4494
4518
  status: stageableStatusSchema2.default("PAUSED")
4495
4519
  });
4496
- var adGroupUpdateSchema = z10.object({
4497
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4520
+ var adGroupUpdateSchema = z11.object({
4521
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4498
4522
  cpcBidMicros: microsSchema.optional(),
4499
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4523
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4500
4524
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4501
- var keywordAddSchema = z10.object({
4525
+ var keywordAddSchema = z11.object({
4502
4526
  adGroup: refSchema,
4503
4527
  text: keywordTextSchema,
4504
4528
  matchType: matchTypeSchema,
4505
4529
  cpcBidMicros: microsSchema.optional(),
4506
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4530
+ finalUrls: z11.array(httpsUrlSchema2).optional(),
4507
4531
  status: stageableStatusSchema2.default("ENABLED")
4508
4532
  });
4509
- var keywordUpdateSchema = z10.object({
4533
+ var keywordUpdateSchema = z11.object({
4510
4534
  cpcBidMicros: microsSchema.optional(),
4511
- finalUrls: z10.array(httpsUrlSchema2).optional(),
4512
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4535
+ finalUrls: z11.array(httpsUrlSchema2).optional(),
4536
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4513
4537
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4514
- var negativeKeywordAddSchema = z10.object({
4515
- level: z10.enum(["adGroup", "campaign"]),
4538
+ var negativeKeywordAddSchema = z11.object({
4539
+ level: z11.enum(["adGroup", "campaign"]),
4516
4540
  parent: refSchema,
4517
4541
  text: keywordTextSchema,
4518
4542
  matchType: matchTypeSchema
4519
4543
  });
4520
- var sharedSetCreateSchema = z10.object({
4521
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4522
- type: z10.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4544
+ var sharedSetCreateSchema = z11.object({
4545
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4546
+ type: z11.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4523
4547
  });
4524
- var sharedSetMemberAddSchema = z10.object({
4548
+ var sharedSetMemberAddSchema = z11.object({
4525
4549
  sharedSet: refSchema,
4526
4550
  text: keywordTextSchema,
4527
4551
  matchType: matchTypeSchema
4528
4552
  });
4529
- var campaignSharedSetAttachSchema = z10.object({
4553
+ var campaignSharedSetAttachSchema = z11.object({
4530
4554
  campaign: refSchema,
4531
4555
  sharedSet: refSchema
4532
4556
  });
4533
- var adTextAssetSchema = z10.object({
4534
- text: z10.string().min(1),
4535
- pinnedField: z10.enum(PINNED_FIELDS).optional()
4557
+ var adTextAssetSchema = z11.object({
4558
+ text: z11.string().min(1),
4559
+ pinnedField: z11.enum(PINNED_FIELDS).optional()
4536
4560
  });
4537
- var responsiveSearchAdSchema = z10.object({
4538
- format: z10.literal("responsiveSearch"),
4539
- headlines: z10.array(
4561
+ var responsiveSearchAdSchema = z11.object({
4562
+ format: z11.literal("responsiveSearch"),
4563
+ headlines: z11.array(
4540
4564
  adTextAssetSchema.refine(
4541
4565
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4542
4566
  "headline exceeds 30 chars"
4543
4567
  )
4544
4568
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4545
- descriptions: z10.array(
4569
+ descriptions: z11.array(
4546
4570
  adTextAssetSchema.refine(
4547
4571
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4548
4572
  "description exceeds 90 chars"
4549
4573
  )
4550
4574
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4551
- path1: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4552
- path2: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4553
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4554
- });
4555
- var responsiveDisplayAdSchema = z10.object({
4556
- format: z10.literal("responsiveDisplay"),
4557
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4558
- longHeadline: z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4559
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4560
- businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4575
+ path1: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4576
+ path2: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4577
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4578
+ });
4579
+ var responsiveDisplayAdSchema = z11.object({
4580
+ format: z11.literal("responsiveDisplay"),
4581
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4582
+ longHeadline: z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4583
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4584
+ businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4561
4585
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4562
4586
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4563
4587
  // image (1:1) to serve; the logo images are optional.
4564
- marketingImageAssets: z10.array(refSchema).optional(),
4565
- squareMarketingImageAssets: z10.array(refSchema).optional(),
4566
- logoImageAssets: z10.array(refSchema).optional(),
4567
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4568
- });
4569
- var callAdSchema = z10.object({
4570
- format: z10.literal("call"),
4571
- countryCode: z10.string().length(2),
4572
- phoneNumber: z10.string().min(3),
4573
- headline1: z10.string().min(1).max(30),
4574
- headline2: z10.string().min(1).max(30),
4575
- description1: z10.string().min(1).max(90),
4576
- description2: z10.string().min(1).max(90),
4577
- businessName: z10.string().min(1).max(25),
4578
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4579
- });
4580
- var appAdSchema = z10.object({
4581
- format: z10.literal("app"),
4582
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(30) })).min(1),
4583
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1)
4584
- });
4585
- var videoAdSchema = z10.object({
4586
- format: z10.literal("video"),
4588
+ marketingImageAssets: z11.array(refSchema).optional(),
4589
+ squareMarketingImageAssets: z11.array(refSchema).optional(),
4590
+ logoImageAssets: z11.array(refSchema).optional(),
4591
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4592
+ });
4593
+ var callAdSchema = z11.object({
4594
+ format: z11.literal("call"),
4595
+ countryCode: z11.string().length(2),
4596
+ phoneNumber: z11.string().min(3),
4597
+ headline1: z11.string().min(1).max(30),
4598
+ headline2: z11.string().min(1).max(30),
4599
+ description1: z11.string().min(1).max(90),
4600
+ description2: z11.string().min(1).max(90),
4601
+ businessName: z11.string().min(1).max(25),
4602
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4603
+ });
4604
+ var appAdSchema = z11.object({
4605
+ format: z11.literal("app"),
4606
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(30) })).min(1),
4607
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1)
4608
+ });
4609
+ var videoAdSchema = z11.object({
4610
+ format: z11.literal("video"),
4587
4611
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4588
4612
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4589
- videoAssets: z10.array(refSchema).min(1),
4590
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4591
- });
4592
- var demandGenAdSchema = z10.object({
4593
- format: z10.literal("demandGen"),
4594
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(40) })).min(1).max(5),
4595
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1).max(5),
4596
- businessName: z10.string().min(1).max(25),
4597
- finalUrls: z10.array(httpsUrlSchema2).min(1),
4598
- imageAssets: z10.array(refSchema).optional(),
4599
- squareImageAssets: z10.array(refSchema).optional(),
4600
- logoImageAssets: z10.array(refSchema).optional()
4601
- });
4602
- var adContentSchema = z10.discriminatedUnion("format", [
4613
+ videoAssets: z11.array(refSchema).min(1),
4614
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4615
+ });
4616
+ var demandGenAdSchema = z11.object({
4617
+ format: z11.literal("demandGen"),
4618
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(40) })).min(1).max(5),
4619
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1).max(5),
4620
+ businessName: z11.string().min(1).max(25),
4621
+ finalUrls: z11.array(httpsUrlSchema2).min(1),
4622
+ imageAssets: z11.array(refSchema).optional(),
4623
+ squareImageAssets: z11.array(refSchema).optional(),
4624
+ logoImageAssets: z11.array(refSchema).optional()
4625
+ });
4626
+ var adContentSchema = z11.discriminatedUnion("format", [
4603
4627
  responsiveSearchAdSchema,
4604
4628
  responsiveDisplayAdSchema,
4605
4629
  callAdSchema,
@@ -4607,45 +4631,45 @@ var adContentSchema = z10.discriminatedUnion("format", [
4607
4631
  videoAdSchema,
4608
4632
  demandGenAdSchema
4609
4633
  ]);
4610
- var adCreateSchema = z10.object({
4634
+ var adCreateSchema = z11.object({
4611
4635
  adGroup: refSchema,
4612
4636
  status: stageableStatusSchema2.default("PAUSED"),
4613
4637
  content: adContentSchema
4614
4638
  });
4615
- var adUpdateSchema = z10.object({
4616
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4639
+ var adUpdateSchema = z11.object({
4640
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4617
4641
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4618
- content: z10.record(z10.string(), z10.unknown()).optional()
4642
+ content: z11.record(z11.string(), z11.unknown()).optional()
4619
4643
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4620
- var textAssetSchema = z10.object({ type: z10.literal("text"), text: z10.string().min(1) });
4621
- var imageAssetSchema = z10.object({
4622
- type: z10.literal("image"),
4623
- imageId: z10.string().min(1),
4624
- name: z10.string().optional()
4625
- });
4626
- var youtubeVideoAssetSchema = z10.object({
4627
- type: z10.literal("youtubeVideo"),
4628
- youtubeVideoId: z10.string().min(1),
4629
- name: z10.string().optional()
4630
- });
4631
- var sitelinkAssetSchema = z10.object({
4632
- type: z10.literal("sitelink"),
4633
- linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4634
- description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4635
- description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4636
- finalUrls: z10.array(httpsUrlSchema2).min(1)
4637
- });
4638
- var calloutAssetSchema = z10.object({
4639
- type: z10.literal("callout"),
4640
- calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4641
- });
4642
- var structuredSnippetAssetSchema = z10.object({
4643
- type: z10.literal("structuredSnippet"),
4644
- header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4645
- values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4646
- });
4647
- var callToActionAssetSchema = z10.object({ type: z10.literal("callToAction"), callToAction: z10.string().min(1) });
4648
- var assetCreateSchema = z10.discriminatedUnion("type", [
4644
+ var textAssetSchema = z11.object({ type: z11.literal("text"), text: z11.string().min(1) });
4645
+ var imageAssetSchema = z11.object({
4646
+ type: z11.literal("image"),
4647
+ imageId: z11.string().min(1),
4648
+ name: z11.string().optional()
4649
+ });
4650
+ var youtubeVideoAssetSchema = z11.object({
4651
+ type: z11.literal("youtubeVideo"),
4652
+ youtubeVideoId: z11.string().min(1),
4653
+ name: z11.string().optional()
4654
+ });
4655
+ var sitelinkAssetSchema = z11.object({
4656
+ type: z11.literal("sitelink"),
4657
+ linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4658
+ description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4659
+ description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4660
+ finalUrls: z11.array(httpsUrlSchema2).min(1)
4661
+ });
4662
+ var calloutAssetSchema = z11.object({
4663
+ type: z11.literal("callout"),
4664
+ calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4665
+ });
4666
+ var structuredSnippetAssetSchema = z11.object({
4667
+ type: z11.literal("structuredSnippet"),
4668
+ header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4669
+ values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4670
+ });
4671
+ var callToActionAssetSchema = z11.object({ type: z11.literal("callToAction"), callToAction: z11.string().min(1) });
4672
+ var assetCreateSchema = z11.discriminatedUnion("type", [
4649
4673
  textAssetSchema,
4650
4674
  imageAssetSchema,
4651
4675
  youtubeVideoAssetSchema,
@@ -4654,136 +4678,136 @@ var assetCreateSchema = z10.discriminatedUnion("type", [
4654
4678
  structuredSnippetAssetSchema,
4655
4679
  callToActionAssetSchema
4656
4680
  ]);
4657
- var assetUpdateSchema = z10.object({
4658
- name: z10.string().min(1).optional(),
4659
- linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4660
- description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4661
- description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4662
- finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
4663
- calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4664
- header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4665
- values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4666
- callToAction: z10.string().min(1).optional(),
4667
- text: z10.string().min(1).optional()
4681
+ var assetUpdateSchema = z11.object({
4682
+ name: z11.string().min(1).optional(),
4683
+ linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4684
+ description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4685
+ description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4686
+ finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4687
+ calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4688
+ header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4689
+ values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4690
+ callToAction: z11.string().min(1).optional(),
4691
+ text: z11.string().min(1).optional()
4668
4692
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4669
- var assetLinkAttachSchema = z10.object({
4670
- level: z10.enum(["campaign", "adGroup", "customer"]),
4693
+ var assetLinkAttachSchema = z11.object({
4694
+ level: z11.enum(["campaign", "adGroup", "customer"]),
4671
4695
  parent: refSchema.optional(),
4672
4696
  asset: refSchema,
4673
- fieldType: z10.enum(ASSET_FIELD_TYPES)
4697
+ fieldType: z11.enum(ASSET_FIELD_TYPES)
4674
4698
  }).superRefine((value, ctx) => {
4675
4699
  if (value.level !== "customer" && !value.parent) {
4676
4700
  ctx.addIssue({
4677
- code: z10.ZodIssueCode.custom,
4701
+ code: z11.ZodIssueCode.custom,
4678
4702
  path: ["parent"],
4679
4703
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4680
4704
  });
4681
4705
  }
4682
4706
  });
4683
- var assetGroupCreateSchema = z10.object({
4707
+ var assetGroupCreateSchema = z11.object({
4684
4708
  campaign: refSchema,
4685
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4686
- finalUrls: z10.array(httpsUrlSchema2).min(1),
4687
- headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4688
- longHeadlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4689
- descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4690
- businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4691
- imageAssets: z10.array(refSchema).optional(),
4692
- squareImageAssets: z10.array(refSchema).optional(),
4693
- logoAssets: z10.array(refSchema).optional(),
4694
- status: z10.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4695
- });
4696
- var assetGroupUpdateSchema = z10.object({
4697
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4698
- finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
4699
- status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4709
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4710
+ finalUrls: z11.array(httpsUrlSchema2).min(1),
4711
+ headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4712
+ longHeadlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4713
+ descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4714
+ businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4715
+ imageAssets: z11.array(refSchema).optional(),
4716
+ squareImageAssets: z11.array(refSchema).optional(),
4717
+ logoAssets: z11.array(refSchema).optional(),
4718
+ status: z11.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4719
+ });
4720
+ var assetGroupUpdateSchema = z11.object({
4721
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4722
+ finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
4723
+ status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4700
4724
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4701
- var audienceCreateSchema2 = z10.object({
4702
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4703
- type: z10.enum(USER_LIST_TYPES).default("BASIC"),
4704
- description: z10.string().optional(),
4725
+ var audienceCreateSchema2 = z11.object({
4726
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4727
+ type: z11.enum(USER_LIST_TYPES).default("BASIC"),
4728
+ description: z11.string().optional(),
4705
4729
  /** Customer-match members (crm-based) — file-first for large lists. */
4706
- members: z10.array(z10.record(z10.string(), z10.string())).optional(),
4707
- sourceFileRef: z10.string().optional()
4730
+ members: z11.array(z11.record(z11.string(), z11.string())).optional(),
4731
+ sourceFileRef: z11.string().optional()
4708
4732
  });
4709
- var audienceCriterionAttachSchema = z10.object({
4710
- level: z10.enum(["campaign", "adGroup"]),
4733
+ var audienceCriterionAttachSchema = z11.object({
4734
+ level: z11.enum(["campaign", "adGroup"]),
4711
4735
  parent: refSchema,
4712
4736
  userList: refSchema,
4713
- negative: z10.boolean().default(false)
4737
+ negative: z11.boolean().default(false)
4714
4738
  });
4715
- var conversionActionCreateSchema = z10.object({
4716
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4717
- type: z10.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4718
- category: z10.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4719
- countingType: z10.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4739
+ var conversionActionCreateSchema = z11.object({
4740
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4741
+ type: z11.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4742
+ category: z11.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4743
+ countingType: z11.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4720
4744
  defaultValueMicros: microsSchema.optional(),
4721
- defaultCurrencyCode: z10.string().length(3).optional(),
4722
- clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
4723
- viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
4724
- status: z10.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4725
- });
4726
- var conversionActionUpdateSchema = z10.object({
4727
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4728
- category: z10.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4729
- countingType: z10.enum(CONVERSION_COUNTING_TYPES).optional(),
4745
+ defaultCurrencyCode: z11.string().length(3).optional(),
4746
+ clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4747
+ viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4748
+ status: z11.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4749
+ });
4750
+ var conversionActionUpdateSchema = z11.object({
4751
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4752
+ category: z11.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4753
+ countingType: z11.enum(CONVERSION_COUNTING_TYPES).optional(),
4730
4754
  defaultValueMicros: microsSchema.optional(),
4731
- defaultCurrencyCode: z10.string().length(3).optional(),
4732
- clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
4733
- viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
4734
- status: z10.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4755
+ defaultCurrencyCode: z11.string().length(3).optional(),
4756
+ clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
4757
+ viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
4758
+ status: z11.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4735
4759
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4736
- var biddingStrategyCreateSchema = z10.object({
4737
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4760
+ var biddingStrategyCreateSchema = z11.object({
4761
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4738
4762
  config: biddingConfigSchema
4739
4763
  }).superRefine((p, ctx) => {
4740
4764
  if (p.config.type === "MANUAL_CPC") {
4741
4765
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4742
4766
  }
4743
4767
  });
4744
- var biddingStrategyUpdateSchema = z10.object({
4745
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4768
+ var biddingStrategyUpdateSchema = z11.object({
4769
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4746
4770
  config: biddingConfigSchema.optional()
4747
4771
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4748
- var labelCreateSchema = z10.object({
4749
- name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4750
- backgroundColor: z10.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4751
- description: z10.string().optional()
4772
+ var labelCreateSchema = z11.object({
4773
+ name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4774
+ backgroundColor: z11.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4775
+ description: z11.string().optional()
4752
4776
  });
4753
- var labelAttachSchema = z10.object({
4754
- level: z10.enum(["campaign", "adGroup", "ad"]),
4777
+ var labelAttachSchema = z11.object({
4778
+ level: z11.enum(["campaign", "adGroup", "ad"]),
4755
4779
  parent: refSchema,
4756
4780
  label: refSchema
4757
4781
  });
4758
- var locationCriterionSchema = z10.object({
4759
- criterionType: z10.literal("location"),
4760
- geoTargetConstant: z10.union([z10.string().regex(GEO_TARGET_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
4761
- });
4762
- var languageCriterionSchema = z10.object({
4763
- criterionType: z10.literal("language"),
4764
- languageConstant: z10.union([z10.string().regex(LANGUAGE_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
4765
- });
4766
- var adScheduleCriterionSchema = z10.object({
4767
- criterionType: z10.literal("adSchedule"),
4768
- dayOfWeek: z10.enum(DAYS_OF_WEEK),
4769
- startHour: z10.number().int().min(0).max(23),
4770
- startMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4771
- endHour: z10.number().int().min(0).max(24),
4772
- endMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4773
- });
4774
- var deviceCriterionSchema = z10.object({
4775
- criterionType: z10.literal("device"),
4776
- device: z10.enum(DEVICE_TYPES),
4782
+ var locationCriterionSchema = z11.object({
4783
+ criterionType: z11.literal("location"),
4784
+ geoTargetConstant: z11.union([z11.string().regex(GEO_TARGET_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4785
+ });
4786
+ var languageCriterionSchema = z11.object({
4787
+ criterionType: z11.literal("language"),
4788
+ languageConstant: z11.union([z11.string().regex(LANGUAGE_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
4789
+ });
4790
+ var adScheduleCriterionSchema = z11.object({
4791
+ criterionType: z11.literal("adSchedule"),
4792
+ dayOfWeek: z11.enum(DAYS_OF_WEEK),
4793
+ startHour: z11.number().int().min(0).max(23),
4794
+ startMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4795
+ endHour: z11.number().int().min(0).max(24),
4796
+ endMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4797
+ });
4798
+ var deviceCriterionSchema = z11.object({
4799
+ criterionType: z11.literal("device"),
4800
+ device: z11.enum(DEVICE_TYPES),
4777
4801
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4778
4802
  // to opt out of a Device type." So 0 (exclude the device) and 0.1–10.0 are valid; the (0, 0.1) gap is not.
4779
- bidModifier: z10.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4803
+ bidModifier: z11.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4780
4804
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4781
4805
  })
4782
4806
  });
4783
- var campaignCriterionAddSchema = z10.object({
4807
+ var campaignCriterionAddSchema = z11.object({
4784
4808
  campaign: refSchema,
4785
- negative: z10.boolean().default(false),
4786
- criterion: z10.discriminatedUnion("criterionType", [
4809
+ negative: z11.boolean().default(false),
4810
+ criterion: z11.discriminatedUnion("criterionType", [
4787
4811
  locationCriterionSchema,
4788
4812
  languageCriterionSchema,
4789
4813
  adScheduleCriterionSchema,
@@ -4793,7 +4817,7 @@ var campaignCriterionAddSchema = z10.object({
4793
4817
  const c = val.criterion;
4794
4818
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4795
4819
  ctx.addIssue({
4796
- code: z10.ZodIssueCode.custom,
4820
+ code: z11.ZodIssueCode.custom,
4797
4821
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4798
4822
  path: ["criterion", "endMinute"]
4799
4823
  });
@@ -4845,17 +4869,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4845
4869
  "google.campaignCriterion.add",
4846
4870
  "google.campaignCriterion.remove"
4847
4871
  ];
4848
- var googleDraftOpKindSchema = z10.enum(GOOGLE_DRAFT_OP_KINDS);
4872
+ var googleDraftOpKindSchema = z11.enum(GOOGLE_DRAFT_OP_KINDS);
4849
4873
  function createOp2(kind, payload) {
4850
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, payload });
4874
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, payload });
4851
4875
  }
4852
4876
  function updateOp2(kind, payload) {
4853
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4877
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4854
4878
  }
4855
4879
  function targetOp(kind) {
4856
- return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4880
+ return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4857
4881
  }
4858
- var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4882
+ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
4859
4883
  createOp2("google.budget.create", budgetCreateSchema),
4860
4884
  updateOp2("google.budget.update", budgetUpdateSchema),
4861
4885
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4903,132 +4927,132 @@ var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
4903
4927
  ]);
4904
4928
 
4905
4929
  // ../api/src/ads-google/wire.ts
4906
- import { z as z11 } from "zod";
4907
- var googleWriteModeSchema = z11.enum(["live", "simulated"]);
4908
- var googleDraftOpResultSchema = z11.object({
4909
- status: z11.enum(["applied", "simulated", "failed", "skipped"]),
4910
- resourceName: z11.string().optional(),
4911
- error: z11.string().optional(),
4912
- skippedBecause: z11.string().optional(),
4913
- executedAt: z11.number().optional()
4914
- });
4915
- var googleDraftStageRequestSchema = z11.object({
4916
- chatId: z11.string(),
4930
+ import { z as z12 } from "zod";
4931
+ var googleWriteModeSchema = z12.enum(["live", "simulated"]);
4932
+ var googleDraftOpResultSchema = z12.object({
4933
+ status: z12.enum(["applied", "simulated", "failed", "skipped"]),
4934
+ resourceName: z12.string().optional(),
4935
+ error: z12.string().optional(),
4936
+ skippedBecause: z12.string().optional(),
4937
+ executedAt: z12.number().optional()
4938
+ });
4939
+ var googleDraftStageRequestSchema = z12.object({
4940
+ chatId: z12.string(),
4917
4941
  op: googleDraftOpInputSchema
4918
4942
  });
4919
- var googleDraftStageResponseSchema = z11.object({
4920
- staged: z11.literal(true),
4921
- ref: z11.string(),
4943
+ var googleDraftStageResponseSchema = z12.object({
4944
+ staged: z12.literal(true),
4945
+ ref: z12.string(),
4922
4946
  kind: googleDraftOpKindSchema,
4923
4947
  mode: googleWriteModeSchema,
4924
- dependsOn: z11.array(z11.string()),
4925
- summary: z11.string(),
4926
- warnings: z11.array(z11.string()),
4948
+ dependsOn: z12.array(z12.string()),
4949
+ summary: z12.string(),
4950
+ warnings: z12.array(z12.string()),
4927
4951
  /** True when the op amended an already-staged op in place instead of appending a new one. */
4928
- amended: z11.boolean().optional()
4952
+ amended: z12.boolean().optional()
4929
4953
  });
4930
- var googleDraftAmendRequestSchema = z11.object({
4931
- chatId: z11.string(),
4932
- ref: z11.string(),
4933
- patch: z11.record(z11.string(), z11.unknown())
4954
+ var googleDraftAmendRequestSchema = z12.object({
4955
+ chatId: z12.string(),
4956
+ ref: z12.string(),
4957
+ patch: z12.record(z12.string(), z12.unknown())
4934
4958
  });
4935
- var googleDraftShowRequestSchema = z11.object({
4936
- chatId: z11.string(),
4937
- ref: z11.string()
4959
+ var googleDraftShowRequestSchema = z12.object({
4960
+ chatId: z12.string(),
4961
+ ref: z12.string()
4938
4962
  });
4939
4963
  var GOOGLE_DRAFT_BATCH_MAX = 500;
4940
- var googleDraftStageBatchRequestSchema = z11.object({
4941
- chatId: z11.string(),
4942
- ops: z11.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4964
+ var googleDraftStageBatchRequestSchema = z12.object({
4965
+ chatId: z12.string(),
4966
+ ops: z12.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4943
4967
  });
4944
- var googleDraftStageBatchResponseSchema = z11.object({
4945
- staged: z11.literal(true),
4968
+ var googleDraftStageBatchResponseSchema = z12.object({
4969
+ staged: z12.literal(true),
4946
4970
  mode: googleWriteModeSchema,
4947
- count: z11.number(),
4948
- ops: z11.array(
4949
- z11.object({
4950
- ref: z11.string(),
4971
+ count: z12.number(),
4972
+ ops: z12.array(
4973
+ z12.object({
4974
+ ref: z12.string(),
4951
4975
  kind: googleDraftOpKindSchema,
4952
- dependsOn: z11.array(z11.string()),
4953
- summary: z11.string(),
4954
- warnings: z11.array(z11.string())
4976
+ dependsOn: z12.array(z12.string()),
4977
+ summary: z12.string(),
4978
+ warnings: z12.array(z12.string())
4955
4979
  })
4956
4980
  )
4957
4981
  });
4958
- var googleDraftOpViewSchema = z11.object({
4959
- ref: z11.string(),
4982
+ var googleDraftOpViewSchema = z12.object({
4983
+ ref: z12.string(),
4960
4984
  kind: googleDraftOpKindSchema,
4961
- customerId: z11.string(),
4962
- target: z11.string().optional(),
4963
- dependsOn: z11.array(z11.string()),
4964
- summary: z11.string(),
4965
- stagedAt: z11.number(),
4985
+ customerId: z12.string(),
4986
+ target: z12.string().optional(),
4987
+ dependsOn: z12.array(z12.string()),
4988
+ summary: z12.string(),
4989
+ stagedAt: z12.number(),
4966
4990
  result: googleDraftOpResultSchema.optional()
4967
4991
  });
4968
- var googleDraftShowResponseSchema = z11.object({
4992
+ var googleDraftShowResponseSchema = z12.object({
4969
4993
  op: googleDraftOpViewSchema.extend({
4970
- payload: z11.unknown().optional(),
4971
- warnings: z11.array(z11.string()).optional(),
4972
- annotations: z11.unknown().optional()
4994
+ payload: z12.unknown().optional(),
4995
+ warnings: z12.array(z12.string()).optional(),
4996
+ annotations: z12.unknown().optional()
4973
4997
  })
4974
4998
  });
4975
- var googleDraftListRequestSchema = z11.object({
4976
- chatId: z11.string()
4999
+ var googleDraftListRequestSchema = z12.object({
5000
+ chatId: z12.string()
4977
5001
  });
4978
- var googleDraftAdvisorySchema = z11.object({
4979
- scope: z11.enum(["campaign", "adGroup"]),
4980
- message: z11.string()
5002
+ var googleDraftAdvisorySchema = z12.object({
5003
+ scope: z12.enum(["campaign", "adGroup"]),
5004
+ message: z12.string()
4981
5005
  });
4982
- var googleDraftStatusCollectionSchema = z11.object({
4983
- label: z11.string(),
4984
- added: z11.number(),
4985
- removed: z11.number(),
4986
- existing: z11.number()
5006
+ var googleDraftStatusCollectionSchema = z12.object({
5007
+ label: z12.string(),
5008
+ added: z12.number(),
5009
+ removed: z12.number(),
5010
+ existing: z12.number()
4987
5011
  });
4988
- var googleDraftChangeOperationSchema = z11.enum(["create", "update", "pause", "resume", "remove"]);
4989
- var googleDraftStatusNodeSchema = z11.lazy(
4990
- () => z11.object({
4991
- entity: z11.string(),
4992
- name: z11.string(),
5012
+ var googleDraftChangeOperationSchema = z12.enum(["create", "update", "pause", "resume", "remove"]);
5013
+ var googleDraftStatusNodeSchema = z12.lazy(
5014
+ () => z12.object({
5015
+ entity: z12.string(),
5016
+ name: z12.string(),
4993
5017
  operation: googleDraftChangeOperationSchema.optional(),
4994
- existing: z11.boolean(),
4995
- collections: z11.array(googleDraftStatusCollectionSchema),
4996
- children: z11.array(googleDraftStatusNodeSchema),
4997
- warnings: z11.array(z11.string()).optional()
5018
+ existing: z12.boolean(),
5019
+ collections: z12.array(googleDraftStatusCollectionSchema),
5020
+ children: z12.array(googleDraftStatusNodeSchema),
5021
+ warnings: z12.array(z12.string()).optional()
4998
5022
  })
4999
5023
  );
5000
- var googleDraftListResponseSchema = z11.object({
5001
- status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
5024
+ var googleDraftListResponseSchema = z12.object({
5025
+ status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
5002
5026
  mode: googleWriteModeSchema,
5003
- count: z11.number(),
5004
- ops: z11.array(googleDraftOpViewSchema),
5027
+ count: z12.number(),
5028
+ ops: z12.array(googleDraftOpViewSchema),
5005
5029
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5006
- tree: z11.array(googleDraftStatusNodeSchema).optional(),
5030
+ tree: z12.array(googleDraftStatusNodeSchema).optional(),
5007
5031
  /** Non-blocking completeness advisories for the whole draft. */
5008
- advisories: z11.array(googleDraftAdvisorySchema).optional()
5032
+ advisories: z12.array(googleDraftAdvisorySchema).optional()
5009
5033
  });
5010
- var googleDraftRemoveRequestSchema = z11.object({
5011
- chatId: z11.string(),
5012
- ref: z11.string()
5034
+ var googleDraftRemoveRequestSchema = z12.object({
5035
+ chatId: z12.string(),
5036
+ ref: z12.string()
5013
5037
  });
5014
- var googleDraftRemoveResponseSchema = z11.object({
5038
+ var googleDraftRemoveResponseSchema = z12.object({
5015
5039
  /** The requested ref plus any dependents removed by cascade. */
5016
- removed: z11.array(z11.string())
5040
+ removed: z12.array(z12.string())
5017
5041
  });
5018
- var googleDraftClearRequestSchema = z11.object({
5019
- chatId: z11.string()
5042
+ var googleDraftClearRequestSchema = z12.object({
5043
+ chatId: z12.string()
5020
5044
  });
5021
- var googleDraftClearResponseSchema = z11.object({
5022
- cleared: z11.number()
5045
+ var googleDraftClearResponseSchema = z12.object({
5046
+ cleared: z12.number()
5023
5047
  });
5024
- var googleFieldErrorSchema = z11.object({
5025
- path: z11.string(),
5026
- message: z11.string()
5048
+ var googleFieldErrorSchema = z12.object({
5049
+ path: z12.string(),
5050
+ message: z12.string()
5027
5051
  });
5028
- var googleDraftErrorResponseSchema = z11.object({
5029
- code: z11.string(),
5030
- error: z11.string(),
5031
- fields: z11.array(googleFieldErrorSchema).optional()
5052
+ var googleDraftErrorResponseSchema = z12.object({
5053
+ code: z12.string(),
5054
+ error: z12.string(),
5055
+ fields: z12.array(googleFieldErrorSchema).optional()
5032
5056
  });
5033
5057
 
5034
5058
  // src/commands/ads/google/draft-status.ts
@@ -11071,17 +11095,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11071
11095
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11072
11096
 
11073
11097
  // ../api/src/ads-meta/ops.ts
11074
- import { z as z12 } from "zod";
11075
- var tempRefSchema3 = z12.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11076
- var parentRefSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11077
- var moneySchema2 = z12.object({
11078
- amount: z12.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11079
- currencyCode: z12.string().length(3).optional()
11080
- });
11081
- var httpsUrlSchema3 = z12.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11082
- var bakerMediaIdSchema2 = z12.string().min(1);
11083
- var stageableStatusSchema3 = z12.enum(STAGEABLE_CREATE_STATUSES3);
11084
- var updateStatusSchema = z12.enum(UPDATE_STATUSES);
11098
+ import { z as z13 } from "zod";
11099
+ var tempRefSchema3 = z13.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11100
+ var parentRefSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11101
+ var moneySchema2 = z13.object({
11102
+ amount: z13.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
11103
+ currencyCode: z13.string().length(3).optional()
11104
+ });
11105
+ var httpsUrlSchema3 = z13.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11106
+ var bakerMediaIdSchema2 = z13.string().min(1);
11107
+ var stageableStatusSchema3 = z13.enum(STAGEABLE_CREATE_STATUSES3);
11108
+ var updateStatusSchema = z13.enum(UPDATE_STATUSES);
11085
11109
  function currencyMinimums2(currencyCode) {
11086
11110
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11087
11111
  }
@@ -11093,50 +11117,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
11093
11117
  }
11094
11118
  }
11095
11119
  }
11096
- var geoLocationsSchema = z12.object({
11097
- countries: z12.array(z12.string().length(2)).optional(),
11098
- regions: z12.array(z12.object({ key: z12.string() })).optional(),
11099
- cities: z12.array(z12.object({ key: z12.string(), radius: z12.number().optional(), distance_unit: z12.string().optional() })).optional(),
11100
- zips: z12.array(z12.object({ key: z12.string() })).optional(),
11101
- location_types: z12.array(z12.string()).optional()
11102
- }).catchall(z12.unknown());
11103
- var idNameSchema = z12.object({ id: z12.string(), name: z12.string().optional() });
11104
- var metaTargetingSchema = z12.object({
11120
+ var geoLocationsSchema = z13.object({
11121
+ countries: z13.array(z13.string().length(2)).optional(),
11122
+ regions: z13.array(z13.object({ key: z13.string() })).optional(),
11123
+ cities: z13.array(z13.object({ key: z13.string(), radius: z13.number().optional(), distance_unit: z13.string().optional() })).optional(),
11124
+ zips: z13.array(z13.object({ key: z13.string() })).optional(),
11125
+ location_types: z13.array(z13.string()).optional()
11126
+ }).catchall(z13.unknown());
11127
+ var idNameSchema = z13.object({ id: z13.string(), name: z13.string().optional() });
11128
+ var metaTargetingSchema = z13.object({
11105
11129
  geo_locations: geoLocationsSchema.optional(),
11106
11130
  excluded_geo_locations: geoLocationsSchema.optional(),
11107
- age_min: z12.number().int().min(13).max(65).optional(),
11108
- age_max: z12.number().int().min(13).max(65).optional(),
11109
- genders: z12.array(z12.union([z12.literal(1), z12.literal(2)])).optional(),
11110
- locales: z12.array(z12.number().int()).optional(),
11111
- interests: z12.array(idNameSchema).optional(),
11112
- behaviors: z12.array(idNameSchema).optional(),
11113
- custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
11114
- excluded_custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
11115
- flexible_spec: z12.array(z12.record(z12.string(), z12.unknown())).optional(),
11116
- exclusions: z12.record(z12.string(), z12.unknown()).optional(),
11117
- publisher_platforms: z12.array(z12.string()).optional(),
11118
- facebook_positions: z12.array(z12.string()).optional(),
11119
- instagram_positions: z12.array(z12.string()).optional(),
11120
- audience_network_positions: z12.array(z12.string()).optional(),
11121
- messenger_positions: z12.array(z12.string()).optional(),
11122
- device_platforms: z12.array(z12.string()).optional(),
11123
- targeting_automation: z12.object({ advantage_audience: z12.union([z12.literal(0), z12.literal(1)]) }).partial().optional()
11124
- }).catchall(z12.unknown());
11125
- var specialAdCategoriesSchema = z12.array(z12.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11126
- var campaignCreateSchema3 = z12.object({
11127
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax),
11128
- objective: z12.enum(OBJECTIVES),
11131
+ age_min: z13.number().int().min(13).max(65).optional(),
11132
+ age_max: z13.number().int().min(13).max(65).optional(),
11133
+ genders: z13.array(z13.union([z13.literal(1), z13.literal(2)])).optional(),
11134
+ locales: z13.array(z13.number().int()).optional(),
11135
+ interests: z13.array(idNameSchema).optional(),
11136
+ behaviors: z13.array(idNameSchema).optional(),
11137
+ custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11138
+ excluded_custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
11139
+ flexible_spec: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
11140
+ exclusions: z13.record(z13.string(), z13.unknown()).optional(),
11141
+ publisher_platforms: z13.array(z13.string()).optional(),
11142
+ facebook_positions: z13.array(z13.string()).optional(),
11143
+ instagram_positions: z13.array(z13.string()).optional(),
11144
+ audience_network_positions: z13.array(z13.string()).optional(),
11145
+ messenger_positions: z13.array(z13.string()).optional(),
11146
+ device_platforms: z13.array(z13.string()).optional(),
11147
+ targeting_automation: z13.object({ advantage_audience: z13.union([z13.literal(0), z13.literal(1)]) }).partial().optional()
11148
+ }).catchall(z13.unknown());
11149
+ var specialAdCategoriesSchema = z13.array(z13.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11150
+ var campaignCreateSchema3 = z13.object({
11151
+ name: z13.string().min(1).max(META_LIMITS.campaign.nameMax),
11152
+ objective: z13.enum(OBJECTIVES),
11129
11153
  status: stageableStatusSchema3.default("PAUSED"),
11130
11154
  special_ad_categories: specialAdCategoriesSchema,
11131
- special_ad_category_country: z12.array(z12.string().length(2)).optional(),
11132
- buying_type: z12.enum(BUYING_TYPES).default("AUCTION"),
11133
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11155
+ special_ad_category_country: z13.array(z13.string().length(2)).optional(),
11156
+ buying_type: z13.enum(BUYING_TYPES).default("AUCTION"),
11157
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11134
11158
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11135
11159
  dailyBudget: moneySchema2.optional(),
11136
11160
  lifetimeBudget: moneySchema2.optional(),
11137
11161
  spendCap: moneySchema2.optional(),
11138
- start_time: z12.number().int().positive().optional(),
11139
- stop_time: z12.number().int().positive().optional()
11162
+ start_time: z13.number().int().positive().optional(),
11163
+ stop_time: z13.number().int().positive().optional()
11140
11164
  }).superRefine((p, ctx) => {
11141
11165
  if (p.dailyBudget && p.lifetimeBudget) {
11142
11166
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11146,15 +11170,15 @@ var campaignCreateSchema3 = z12.object({
11146
11170
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11147
11171
  }
11148
11172
  });
11149
- var campaignUpdateSchema3 = z12.object({
11150
- name: z12.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11173
+ var campaignUpdateSchema3 = z13.object({
11174
+ name: z13.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11151
11175
  status: updateStatusSchema.optional(),
11152
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11176
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11153
11177
  dailyBudget: moneySchema2.optional(),
11154
11178
  lifetimeBudget: moneySchema2.optional(),
11155
11179
  spendCap: moneySchema2.optional(),
11156
- start_time: z12.number().int().positive().optional(),
11157
- stop_time: z12.number().int().positive().optional()
11180
+ start_time: z13.number().int().positive().optional(),
11181
+ stop_time: z13.number().int().positive().optional()
11158
11182
  }).superRefine((p, ctx) => {
11159
11183
  if (!Object.values(p).some((val) => val !== void 0)) {
11160
11184
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11164,38 +11188,38 @@ var campaignUpdateSchema3 = z12.object({
11164
11188
  }
11165
11189
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11166
11190
  });
11167
- var promotedObjectSchema = z12.object({
11191
+ var promotedObjectSchema = z13.object({
11168
11192
  page_id: parentRefSchema2.optional(),
11169
- pixel_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11170
- custom_event_type: z12.enum(CUSTOM_EVENT_TYPES).optional(),
11171
- application_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11172
- object_store_url: z12.string().url().optional(),
11173
- product_catalog_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11174
- product_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11175
- whatsapp_phone_number: z12.string().optional(),
11176
- offline_conversion_data_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional()
11193
+ pixel_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11194
+ custom_event_type: z13.enum(CUSTOM_EVENT_TYPES).optional(),
11195
+ application_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11196
+ object_store_url: z13.string().url().optional(),
11197
+ product_catalog_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11198
+ product_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11199
+ whatsapp_phone_number: z13.string().optional(),
11200
+ offline_conversion_data_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional()
11177
11201
  }).partial();
11178
- var attributionSpecSchema = z12.array(
11179
- z12.object({
11180
- event_type: z12.enum(ATTRIBUTION_EVENT_TYPES),
11181
- window_days: z12.union([z12.literal(1), z12.literal(7), z12.literal(28)])
11202
+ var attributionSpecSchema = z13.array(
11203
+ z13.object({
11204
+ event_type: z13.enum(ATTRIBUTION_EVENT_TYPES),
11205
+ window_days: z13.union([z13.literal(1), z13.literal(7), z13.literal(28)])
11182
11206
  })
11183
11207
  );
11184
11208
  var adSetFields = {
11185
- name: z12.string().min(1).max(META_LIMITS.adSet.nameMax),
11209
+ name: z13.string().min(1).max(META_LIMITS.adSet.nameMax),
11186
11210
  campaign_id: parentRefSchema2,
11187
11211
  status: stageableStatusSchema3.default("PAUSED"),
11188
11212
  dailyBudget: moneySchema2.optional(),
11189
11213
  lifetimeBudget: moneySchema2.optional(),
11190
11214
  bidAmount: moneySchema2.optional(),
11191
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11192
- billing_event: z12.enum(BILLING_EVENTS),
11193
- optimization_goal: z12.enum(OPTIMIZATION_GOALS),
11194
- destination_type: z12.enum(DESTINATION_TYPES).optional(),
11215
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11216
+ billing_event: z13.enum(BILLING_EVENTS),
11217
+ optimization_goal: z13.enum(OPTIMIZATION_GOALS),
11218
+ destination_type: z13.enum(DESTINATION_TYPES).optional(),
11195
11219
  promoted_object: promotedObjectSchema.optional(),
11196
11220
  attribution_spec: attributionSpecSchema.optional(),
11197
- start_time: z12.number().int().positive().optional(),
11198
- end_time: z12.number().int().positive().optional(),
11221
+ start_time: z13.number().int().positive().optional(),
11222
+ end_time: z13.number().int().positive().optional(),
11199
11223
  targeting: metaTargetingSchema
11200
11224
  };
11201
11225
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11213,22 +11237,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11213
11237
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11214
11238
  }
11215
11239
  }
11216
- var adSetCreateSchema = z12.object(adSetFields).superRefine((p, ctx) => {
11240
+ var adSetCreateSchema = z13.object(adSetFields).superRefine((p, ctx) => {
11217
11241
  validateAdSetBudgetAndBid(p, ctx);
11218
11242
  });
11219
- var adSetUpdateSchema = z12.object({
11243
+ var adSetUpdateSchema = z13.object({
11220
11244
  name: adSetFields.name.optional(),
11221
11245
  status: updateStatusSchema.optional(),
11222
11246
  dailyBudget: moneySchema2.optional(),
11223
11247
  lifetimeBudget: moneySchema2.optional(),
11224
11248
  bidAmount: moneySchema2.optional(),
11225
- bid_strategy: z12.enum(BID_STRATEGIES).optional(),
11226
- optimization_goal: z12.enum(OPTIMIZATION_GOALS).optional(),
11227
- destination_type: z12.enum(DESTINATION_TYPES).optional(),
11249
+ bid_strategy: z13.enum(BID_STRATEGIES).optional(),
11250
+ optimization_goal: z13.enum(OPTIMIZATION_GOALS).optional(),
11251
+ destination_type: z13.enum(DESTINATION_TYPES).optional(),
11228
11252
  promoted_object: promotedObjectSchema.optional(),
11229
11253
  attribution_spec: attributionSpecSchema.optional(),
11230
- start_time: z12.number().int().positive().optional(),
11231
- end_time: z12.number().int().positive().optional(),
11254
+ start_time: z13.number().int().positive().optional(),
11255
+ end_time: z13.number().int().positive().optional(),
11232
11256
  targeting: metaTargetingSchema.optional()
11233
11257
  }).superRefine((p, ctx) => {
11234
11258
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11236,38 +11260,38 @@ var adSetUpdateSchema = z12.object({
11236
11260
  }
11237
11261
  validateAdSetBudgetAndBid(p, ctx);
11238
11262
  });
11239
- var messageSchema = z12.string().min(1).max(META_LIMITS.creative.messageHardMax);
11240
- var headlineSchema2 = z12.string().min(1).max(META_LIMITS.creative.headlineMax);
11241
- var descriptionSchema = z12.string().min(1).max(META_LIMITS.creative.descriptionMax);
11242
- var callToActionSchema = z12.object({
11243
- type: z12.enum(CTA_TYPES2),
11263
+ var messageSchema = z13.string().min(1).max(META_LIMITS.creative.messageHardMax);
11264
+ var headlineSchema2 = z13.string().min(1).max(META_LIMITS.creative.headlineMax);
11265
+ var descriptionSchema = z13.string().min(1).max(META_LIMITS.creative.descriptionMax);
11266
+ var callToActionSchema = z13.object({
11267
+ type: z13.enum(CTA_TYPES2),
11244
11268
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11245
11269
  link: httpsUrlSchema3.optional()
11246
11270
  });
11247
- var creativeEnhancementsSchema = z12.object({
11248
- standardEnhancements: z12.enum(ENROLL_STATUSES).optional(),
11249
- features: z12.record(z12.string(), z12.enum(ENROLL_STATUSES)).optional()
11271
+ var creativeEnhancementsSchema = z13.object({
11272
+ standardEnhancements: z13.enum(ENROLL_STATUSES).optional(),
11273
+ features: z13.record(z13.string(), z13.enum(ENROLL_STATUSES)).optional()
11250
11274
  });
11251
11275
  var creativeSharedFields = {
11252
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11276
+ name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11253
11277
  /** Facebook Page id backing the ad's identity. */
11254
11278
  page_id: parentRefSchema2,
11255
11279
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11256
- instagram_user_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11280
+ instagram_user_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11257
11281
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11258
- url_tags: z12.string().max(1e3).optional(),
11282
+ url_tags: z13.string().max(1e3).optional(),
11259
11283
  enhancements: creativeEnhancementsSchema.optional()
11260
11284
  };
11261
11285
  var imageMediaFields = {
11262
- imageHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11286
+ imageHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11263
11287
  imageRef: tempRefSchema3.optional()
11264
11288
  };
11265
11289
  var videoMediaFields = {
11266
- videoId: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
11290
+ videoId: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
11267
11291
  videoRef: tempRefSchema3.optional(),
11268
11292
  /** Thumbnail for a video creative — image hash, ref, or public url. */
11269
- thumbnailHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
11270
- imageUrl: z12.string().url().optional()
11293
+ thumbnailHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
11294
+ imageUrl: z13.string().url().optional()
11271
11295
  };
11272
11296
  function countImageRefs(p) {
11273
11297
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11275,8 +11299,8 @@ function countImageRefs(p) {
11275
11299
  function countVideoRefs(p) {
11276
11300
  return [p.videoId, p.videoRef].filter(Boolean).length;
11277
11301
  }
11278
- var singleCreativeSchema = z12.object({
11279
- creativeType: z12.literal("single"),
11302
+ var singleCreativeSchema = z13.object({
11303
+ creativeType: z13.literal("single"),
11280
11304
  ...creativeSharedFields,
11281
11305
  /** Primary text. */
11282
11306
  message: messageSchema,
@@ -11285,7 +11309,7 @@ var singleCreativeSchema = z12.object({
11285
11309
  headline: headlineSchema2.optional(),
11286
11310
  description: descriptionSchema.optional(),
11287
11311
  /** Display URL / caption shown under the headline. */
11288
- caption: z12.string().max(255).optional(),
11312
+ caption: z13.string().max(255).optional(),
11289
11313
  call_to_action: callToActionSchema.optional(),
11290
11314
  ...imageMediaFields,
11291
11315
  ...videoMediaFields
@@ -11309,10 +11333,10 @@ var singleCreativeSchema = z12.object({
11309
11333
  });
11310
11334
  }
11311
11335
  });
11312
- var carouselCardSchema = z12.object({
11336
+ var carouselCardSchema = z13.object({
11313
11337
  link: httpsUrlSchema3,
11314
- headline: z12.string().max(META_LIMITS.creative.headlineMax).optional(),
11315
- description: z12.string().max(META_LIMITS.creative.descriptionMax).optional(),
11338
+ headline: z13.string().max(META_LIMITS.creative.headlineMax).optional(),
11339
+ description: z13.string().max(META_LIMITS.creative.descriptionMax).optional(),
11316
11340
  call_to_action: callToActionSchema.optional(),
11317
11341
  ...imageMediaFields,
11318
11342
  ...videoMediaFields
@@ -11332,35 +11356,35 @@ var carouselCardSchema = z12.object({
11332
11356
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11333
11357
  }
11334
11358
  });
11335
- var carouselCreativeSchema2 = z12.object({
11336
- creativeType: z12.literal("carousel"),
11359
+ var carouselCreativeSchema2 = z13.object({
11360
+ creativeType: z13.literal("carousel"),
11337
11361
  ...creativeSharedFields,
11338
11362
  message: messageSchema,
11339
11363
  /** Optional "see more" card destination applied when a card has no own link. */
11340
11364
  link: httpsUrlSchema3.optional(),
11341
11365
  call_to_action: callToActionSchema.optional(),
11342
- cards: z12.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11366
+ cards: z13.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11343
11367
  });
11344
- var dynamicImageSchema = z12.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11345
- var dynamicVideoSchema = z12.object({
11368
+ var dynamicImageSchema = z13.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11369
+ var dynamicVideoSchema = z13.object({
11346
11370
  videoId: videoMediaFields.videoId,
11347
11371
  videoRef: videoMediaFields.videoRef,
11348
11372
  thumbnailHash: videoMediaFields.thumbnailHash
11349
11373
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11350
11374
  var DYN = META_LIMITS.creative;
11351
- var dynamicCreativeSchema = z12.object({
11352
- creativeType: z12.literal("dynamic"),
11375
+ var dynamicCreativeSchema = z13.object({
11376
+ creativeType: z13.literal("dynamic"),
11353
11377
  ...creativeSharedFields,
11354
- bodies: z12.array(z12.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11355
- titles: z12.array(z12.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11356
- descriptions: z12.array(z12.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11357
- images: z12.array(dynamicImageSchema).optional(),
11358
- videos: z12.array(dynamicVideoSchema).optional(),
11359
- ad_formats: z12.array(z12.enum(AD_FORMATS2)).min(1),
11360
- call_to_action_types: z12.array(z12.enum(CTA_TYPES2)).optional(),
11361
- link_urls: z12.array(z12.object({ website_url: httpsUrlSchema3, display_url: z12.string().optional() })).min(1),
11378
+ bodies: z13.array(z13.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11379
+ titles: z13.array(z13.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11380
+ descriptions: z13.array(z13.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11381
+ images: z13.array(dynamicImageSchema).optional(),
11382
+ videos: z13.array(dynamicVideoSchema).optional(),
11383
+ ad_formats: z13.array(z13.enum(AD_FORMATS2)).min(1),
11384
+ call_to_action_types: z13.array(z13.enum(CTA_TYPES2)).optional(),
11385
+ link_urls: z13.array(z13.object({ website_url: httpsUrlSchema3, display_url: z13.string().optional() })).min(1),
11362
11386
  /** Multi-language / placement customization — structural passthrough for v1. */
11363
- asset_customization_rules: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11387
+ asset_customization_rules: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11364
11388
  }).superRefine((p, ctx) => {
11365
11389
  if (!(p.images?.length || p.videos?.length)) {
11366
11390
  ctx.addIssue({
@@ -11370,57 +11394,57 @@ var dynamicCreativeSchema = z12.object({
11370
11394
  });
11371
11395
  }
11372
11396
  });
11373
- var existingPostCreativeSchema = z12.object({
11374
- creativeType: z12.literal("existing_post"),
11397
+ var existingPostCreativeSchema = z13.object({
11398
+ creativeType: z13.literal("existing_post"),
11375
11399
  name: creativeSharedFields.name,
11376
11400
  /** "<page_id>_<post_id>" object story id of the post to promote. */
11377
- object_story_id: z12.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11401
+ object_story_id: z13.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11378
11402
  instagram_user_id: creativeSharedFields.instagram_user_id,
11379
11403
  url_tags: creativeSharedFields.url_tags,
11380
11404
  enhancements: creativeSharedFields.enhancements
11381
11405
  });
11382
- var creativeContentSchema2 = z12.discriminatedUnion("creativeType", [
11406
+ var creativeContentSchema2 = z13.discriminatedUnion("creativeType", [
11383
11407
  singleCreativeSchema,
11384
11408
  carouselCreativeSchema2,
11385
11409
  dynamicCreativeSchema,
11386
11410
  existingPostCreativeSchema
11387
11411
  ]);
11388
11412
  var adCreativeCreateSchema = creativeContentSchema2;
11389
- var adCreativeUpdateSchema = z12.object({
11390
- name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
11413
+ var adCreativeUpdateSchema = z13.object({
11414
+ name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
11391
11415
  status: updateStatusSchema.optional(),
11392
11416
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11393
- content: z12.record(z12.string(), z12.unknown()).optional()
11417
+ content: z13.record(z13.string(), z13.unknown()).optional()
11394
11418
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11395
- var adCreateSchema2 = z12.object({
11396
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax),
11419
+ var adCreateSchema2 = z13.object({
11420
+ name: z13.string().min(1).max(META_LIMITS.ad.nameMax),
11397
11421
  adset_id: parentRefSchema2,
11398
11422
  status: stageableStatusSchema3.default("PAUSED"),
11399
- creative: z12.object({ creative_id: parentRefSchema2 }),
11423
+ creative: z13.object({ creative_id: parentRefSchema2 }),
11400
11424
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11401
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11425
+ tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11402
11426
  });
11403
- var adUpdateSchema2 = z12.object({
11404
- name: z12.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11427
+ var adUpdateSchema2 = z13.object({
11428
+ name: z13.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11405
11429
  status: updateStatusSchema.optional(),
11406
11430
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
11407
- creative: z12.object({ creative_id: parentRefSchema2 }).optional(),
11408
- tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
11431
+ creative: z13.object({ creative_id: parentRefSchema2 }).optional(),
11432
+ tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
11409
11433
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11410
- var lookalikeSpecSchema = z12.object({
11411
- origin: z12.array(z12.object({ id: parentRefSchema2 })).min(1),
11412
- ratio: z12.number().min(0.01).max(0.2).optional(),
11413
- country: z12.string().length(2).optional()
11414
- });
11415
- var customAudienceCreateSchema = z12.object({
11416
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax),
11417
- subtype: z12.enum(CUSTOM_AUDIENCE_SUBTYPES),
11418
- description: z12.string().max(500).optional(),
11419
- customer_file_source: z12.string().optional(),
11420
- retention_days: z12.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11434
+ var lookalikeSpecSchema = z13.object({
11435
+ origin: z13.array(z13.object({ id: parentRefSchema2 })).min(1),
11436
+ ratio: z13.number().min(0.01).max(0.2).optional(),
11437
+ country: z13.string().length(2).optional()
11438
+ });
11439
+ var customAudienceCreateSchema = z13.object({
11440
+ name: z13.string().min(1).max(META_LIMITS.audience.nameMax),
11441
+ subtype: z13.enum(CUSTOM_AUDIENCE_SUBTYPES),
11442
+ description: z13.string().max(500).optional(),
11443
+ customer_file_source: z13.string().optional(),
11444
+ retention_days: z13.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11421
11445
  lookalike_spec: lookalikeSpecSchema.optional(),
11422
11446
  /** Website/engagement rule — structural passthrough validated by Meta. */
11423
- rule: z12.record(z12.string(), z12.unknown()).optional()
11447
+ rule: z13.record(z13.string(), z13.unknown()).optional()
11424
11448
  }).superRefine((p, ctx) => {
11425
11449
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11426
11450
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11429,16 +11453,16 @@ var customAudienceCreateSchema = z12.object({
11429
11453
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11430
11454
  }
11431
11455
  });
11432
- var customAudienceUpdateSchema = z12.object({
11433
- name: z12.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11434
- description: z12.string().max(500).optional()
11456
+ var customAudienceUpdateSchema = z13.object({
11457
+ name: z13.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11458
+ description: z13.string().max(500).optional()
11435
11459
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11436
- var mediaUploadSchema = z12.object({
11437
- kind: z12.enum(MEDIA_KINDS),
11460
+ var mediaUploadSchema = z13.object({
11461
+ kind: z13.enum(MEDIA_KINDS),
11438
11462
  bakerImageId: bakerMediaIdSchema2.optional(),
11439
11463
  bakerVideoId: bakerMediaIdSchema2.optional(),
11440
11464
  /** Optional display name / filename hint. */
11441
- name: z12.string().max(255).optional()
11465
+ name: z13.string().max(255).optional()
11442
11466
  }).superRefine((p, ctx) => {
11443
11467
  if (p.kind === "image" && !p.bakerImageId) {
11444
11468
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11460,16 +11484,16 @@ var META_DRAFT_OP_KINDS = [
11460
11484
  "customAudience.update",
11461
11485
  "media.upload"
11462
11486
  ];
11463
- var metaDraftOpKindSchema = z12.enum(META_DRAFT_OP_KINDS);
11464
- var accountIdSchema2 = z12.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11465
- var updateTargetSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11487
+ var metaDraftOpKindSchema = z13.enum(META_DRAFT_OP_KINDS);
11488
+ var accountIdSchema2 = z13.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11489
+ var updateTargetSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11466
11490
  function createOp3(kind, payload) {
11467
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, payload });
11491
+ return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, payload });
11468
11492
  }
11469
11493
  function updateOp3(kind, payload) {
11470
- return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11494
+ return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11471
11495
  }
11472
- var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11496
+ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
11473
11497
  createOp3("campaign.create", campaignCreateSchema3),
11474
11498
  updateOp3("campaign.update", campaignUpdateSchema3),
11475
11499
  createOp3("adSet.create", adSetCreateSchema),
@@ -11484,89 +11508,89 @@ var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
11484
11508
  ]);
11485
11509
 
11486
11510
  // ../api/src/ads-meta/wire.ts
11487
- import { z as z13 } from "zod";
11488
- var metaWriteModeSchema = z13.enum(["live", "simulated"]);
11489
- var metaDraftOpResultSchema = z13.object({
11490
- status: z13.enum(["applied", "simulated", "failed", "skipped"]),
11511
+ import { z as z14 } from "zod";
11512
+ var metaWriteModeSchema = z14.enum(["live", "simulated"]);
11513
+ var metaDraftOpResultSchema = z14.object({
11514
+ status: z14.enum(["applied", "simulated", "failed", "skipped"]),
11491
11515
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11492
- id: z13.string().optional(),
11516
+ id: z14.string().optional(),
11493
11517
  /** For media.upload ops: the resulting image hash. */
11494
- hash: z13.string().optional(),
11495
- error: z13.string().optional(),
11496
- skippedBecause: z13.string().optional(),
11497
- executedAt: z13.number().optional()
11518
+ hash: z14.string().optional(),
11519
+ error: z14.string().optional(),
11520
+ skippedBecause: z14.string().optional(),
11521
+ executedAt: z14.number().optional()
11498
11522
  });
11499
- var metaDraftStageRequestSchema = z13.object({
11500
- chatId: z13.string(),
11523
+ var metaDraftStageRequestSchema = z14.object({
11524
+ chatId: z14.string(),
11501
11525
  op: metaDraftOpInputSchema
11502
11526
  });
11503
- var metaDraftStageResponseSchema = z13.object({
11504
- staged: z13.literal(true),
11505
- ref: z13.string(),
11527
+ var metaDraftStageResponseSchema = z14.object({
11528
+ staged: z14.literal(true),
11529
+ ref: z14.string(),
11506
11530
  kind: metaDraftOpKindSchema,
11507
11531
  mode: metaWriteModeSchema,
11508
- dependsOn: z13.array(z13.string()),
11509
- summary: z13.string(),
11510
- warnings: z13.array(z13.string()),
11532
+ dependsOn: z14.array(z14.string()),
11533
+ summary: z14.string(),
11534
+ warnings: z14.array(z14.string()),
11511
11535
  /** True when the op amended an already-staged op in place instead of appending a new one. */
11512
- amended: z13.boolean().optional()
11513
- });
11514
- var metaDraftDuplicateRequestSchema = z13.object({
11515
- chatId: z13.string(),
11516
- accountId: z13.string(),
11517
- entity: z13.enum(["campaign", "adSet", "ad"]),
11518
- sourceId: z13.string(),
11519
- overrides: z13.record(z13.string(), z13.unknown()).optional(),
11536
+ amended: z14.boolean().optional()
11537
+ });
11538
+ var metaDraftDuplicateRequestSchema = z14.object({
11539
+ chatId: z14.string(),
11540
+ accountId: z14.string(),
11541
+ entity: z14.enum(["campaign", "adSet", "ad"]),
11542
+ sourceId: z14.string(),
11543
+ overrides: z14.record(z14.string(), z14.unknown()).optional(),
11520
11544
  /** Pause the original after the copy publishes. */
11521
- replace: z13.boolean().optional()
11545
+ replace: z14.boolean().optional()
11522
11546
  });
11523
- var metaDraftOpViewSchema = z13.object({
11524
- ref: z13.string(),
11547
+ var metaDraftOpViewSchema = z14.object({
11548
+ ref: z14.string(),
11525
11549
  kind: metaDraftOpKindSchema,
11526
- accountId: z13.string(),
11527
- target: z13.string().optional(),
11528
- dependsOn: z13.array(z13.string()),
11529
- summary: z13.string(),
11530
- stagedAt: z13.number(),
11550
+ accountId: z14.string(),
11551
+ target: z14.string().optional(),
11552
+ dependsOn: z14.array(z14.string()),
11553
+ summary: z14.string(),
11554
+ stagedAt: z14.number(),
11531
11555
  result: metaDraftOpResultSchema.optional()
11532
11556
  });
11533
- var metaDraftListRequestSchema = z13.object({
11534
- chatId: z13.string()
11557
+ var metaDraftListRequestSchema = z14.object({
11558
+ chatId: z14.string()
11535
11559
  });
11536
- var metaDraftAdvisorySchema = z13.object({
11537
- ref: z13.string(),
11538
- message: z13.string()
11560
+ var metaDraftAdvisorySchema = z14.object({
11561
+ ref: z14.string(),
11562
+ message: z14.string()
11539
11563
  });
11540
- var metaDraftListResponseSchema = z13.object({
11541
- status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
11564
+ var metaDraftListResponseSchema = z14.object({
11565
+ status: z14.enum(["active", "publishing", "applied", "discarded", "none"]),
11542
11566
  mode: metaWriteModeSchema,
11543
- count: z13.number(),
11544
- ops: z13.array(metaDraftOpViewSchema),
11567
+ count: z14.number(),
11568
+ ops: z14.array(metaDraftOpViewSchema),
11545
11569
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11546
- advisories: z13.array(metaDraftAdvisorySchema)
11570
+ advisories: z14.array(metaDraftAdvisorySchema)
11547
11571
  });
11548
- var metaDraftRemoveRequestSchema = z13.object({
11549
- chatId: z13.string(),
11550
- ref: z13.string()
11572
+ var metaDraftRemoveRequestSchema = z14.object({
11573
+ chatId: z14.string(),
11574
+ ref: z14.string()
11551
11575
  });
11552
- var metaDraftRemoveResponseSchema = z13.object({
11576
+ var metaDraftRemoveResponseSchema = z14.object({
11553
11577
  /** The requested ref plus any dependents removed by cascade. */
11554
- removed: z13.array(z13.string())
11578
+ removed: z14.array(z14.string())
11555
11579
  });
11556
- var metaDraftClearRequestSchema = z13.object({
11557
- chatId: z13.string()
11580
+ var metaDraftClearRequestSchema = z14.object({
11581
+ chatId: z14.string()
11558
11582
  });
11559
- var metaDraftClearResponseSchema = z13.object({
11560
- cleared: z13.number()
11583
+ var metaDraftClearResponseSchema = z14.object({
11584
+ cleared: z14.number()
11561
11585
  });
11562
- var metaFieldErrorSchema = z13.object({
11563
- path: z13.string(),
11564
- message: z13.string()
11586
+ var metaFieldErrorSchema = z14.object({
11587
+ path: z14.string(),
11588
+ message: z14.string()
11565
11589
  });
11566
- var metaDraftErrorResponseSchema = z13.object({
11567
- code: z13.string(),
11568
- error: z13.string(),
11569
- fields: z13.array(metaFieldErrorSchema).optional()
11590
+ var metaDraftErrorResponseSchema = z14.object({
11591
+ code: z14.string(),
11592
+ error: z14.string(),
11593
+ fields: z14.array(metaFieldErrorSchema).optional()
11570
11594
  });
11571
11595
 
11572
11596
  // src/commands/ads/meta/write-shared.ts
@@ -12120,10 +12144,10 @@ function duplicateCommand2(entity, label) {
12120
12144
  replace: { type: "boolean", description: "Pause the original once the copy publishes" }
12121
12145
  },
12122
12146
  run: async ({ args }) => {
12123
- const { apiPost: apiPost2 } = await import("./client-PGOTU24X.js");
12124
- const { requireChatId: requireChatId2 } = await import("./env-TD4VXCQ7.js");
12125
- const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-2LGBISBQ.js");
12126
- const { handleMetaError: handleMetaError2 } = await import("./shared-CQC3YRBA.js");
12147
+ const { apiPost: apiPost2 } = await import("./client-N7XWYCHT.js");
12148
+ const { requireChatId: requireChatId2 } = await import("./env-3JMYIH25.js");
12149
+ const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-7M5VQPTZ.js");
12150
+ const { handleMetaError: handleMetaError2 } = await import("./shared-6SZHAUM2.js");
12127
12151
  try {
12128
12152
  const accountId = bareAccountId2(args);
12129
12153
  const chatId = requireChatId2();
@@ -14520,12 +14544,181 @@ Examples:
14520
14544
  }
14521
14545
  });
14522
14546
 
14547
+ // src/commands/analytics/index.ts
14548
+ import { defineCommand as defineCommand85 } from "citty";
14549
+
14550
+ // src/commands/winning-ads/shared.ts
14551
+ function splitList(value) {
14552
+ if (!value) {
14553
+ return [];
14554
+ }
14555
+ return value.split(",").map((v) => v.trim()).filter(Boolean);
14556
+ }
14557
+ function reportError(err) {
14558
+ if (err instanceof ApiError) {
14559
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
14560
+ process.exit(1);
14561
+ }
14562
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
14563
+ process.exit(1);
14564
+ }
14565
+
14566
+ // src/commands/analytics/index.ts
14567
+ function failAnalytics(err) {
14568
+ if (err instanceof ApiError && err.code === "INTERNAL_ERROR") {
14569
+ writeJson({
14570
+ ok: false,
14571
+ error: {
14572
+ code: "INTERNAL_ERROR",
14573
+ message: "Landing analytics is unavailable \u2014 not yet configured for this environment, or temporarily unreachable. Safe to retry later. Do NOT report this as zero traffic."
14574
+ }
14575
+ });
14576
+ process.exit(1);
14577
+ }
14578
+ reportError(err);
14579
+ }
14580
+ var PERIODS = "today|7d|28d|90d";
14581
+ var NO_TRAFFIC_HINT = "No visits recorded in this window. Analytics counts real visitors on published pages only \u2014 previews, bots, and pre-consent traffic are excluded.";
14582
+ function rowsEmpty(response) {
14583
+ return response.rows.length === 0 || response.rows.every((row) => Object.values(row).every((v) => v === 0 || v === "" || v === null));
14584
+ }
14585
+ var OVERVIEW_SPEC = {
14586
+ report: "overview",
14587
+ description: "Headline traffic numbers: pageviews, unique visitors, sessions, form submits. Start here. Example: baker analytics overview --period 7d",
14588
+ hasLimit: false,
14589
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : [
14590
+ "Drill down: `baker analytics pages` (top pages), `baker analytics sources` (where visitors come from), `baker analytics timeseries` (daily trend)."
14591
+ ]
14592
+ };
14593
+ var REPORTS = [
14594
+ OVERVIEW_SPEC,
14595
+ {
14596
+ report: "timeseries",
14597
+ description: "Daily pageviews, visitors, and form submits \u2014 spot trends and campaign spikes. Example: baker analytics timeseries --period 28d --output md",
14598
+ hasLimit: false,
14599
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : []
14600
+ },
14601
+ {
14602
+ report: "pages",
14603
+ description: "Top pages by pageviews, with visitors and form submits per page \u2014 find what converts. Example: baker analytics pages --period 28d --limit 20",
14604
+ hasLimit: true,
14605
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : [
14606
+ "A page with high pageviews but zero form_submits is a conversion-rate candidate \u2014 audit it with the landing skill."
14607
+ ]
14608
+ },
14609
+ {
14610
+ report: "sources",
14611
+ description: "Top traffic sources (utm_source, else referrer domain, else direct) with visitors and form submits. Example: baker analytics sources --period 28d",
14612
+ hasLimit: true,
14613
+ hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : []
14614
+ },
14615
+ {
14616
+ report: "events",
14617
+ description: "Non-pageview events (form_submit + custom events) with totals, sessions, and visitors. Example: baker analytics events --period 90d",
14618
+ hasLimit: true,
14619
+ hints: (response) => rowsEmpty(response) ? [
14620
+ "No events in this window. Forms report `form_submit` automatically on published pages; custom events come from `window.__bakerAnalytics.track(name)`."
14621
+ ] : []
14622
+ }
14623
+ ];
14624
+ function parseLimit(value) {
14625
+ if (!value) return void 0;
14626
+ const limit = Number(value);
14627
+ return Number.isInteger(limit) && limit >= 1 && limit <= 100 ? limit : "invalid";
14628
+ }
14629
+ function parseFields(value) {
14630
+ if (!value) return void 0;
14631
+ const fields = String(value).split(",").map((f) => f.trim()).filter(Boolean);
14632
+ return fields.length > 0 ? fields : void 0;
14633
+ }
14634
+ function buildSubcommand(spec) {
14635
+ registerSchema({
14636
+ command: `analytics.${spec.report}`,
14637
+ description: spec.description,
14638
+ args: {
14639
+ period: { type: "string", description: `Time window: ${PERIODS} (default 28d)`, required: false, default: "28d" },
14640
+ ...spec.hasLimit ? { limit: { type: "number", description: "Max rows 1-100 (default per report)", required: false } } : {},
14641
+ output: { type: "string", description: "Output format: json|files|md", required: false, default: "json" },
14642
+ fields: { type: "string", description: "Comma-separated field names to include", required: false }
14643
+ }
14644
+ });
14645
+ return defineCommand85({
14646
+ meta: { name: spec.report, description: spec.description },
14647
+ args: {
14648
+ period: { type: "string", description: `Time window: ${PERIODS} (default 28d)`, default: "28d" },
14649
+ ...spec.hasLimit ? { limit: { type: "string", description: "Max rows 1-100" } } : {},
14650
+ output: { type: "string", description: "Output format: json|files|md", default: "json" },
14651
+ fields: { type: "string", description: "Comma-separated field names to include" }
14652
+ },
14653
+ run: async ({ args }) => {
14654
+ try {
14655
+ const limit = parseLimit("limit" in args ? args.limit : void 0);
14656
+ if (limit === "invalid") {
14657
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "--limit must be an integer 1-100" } });
14658
+ process.exit(1);
14659
+ }
14660
+ const body = { report: spec.report, period: String(args.period || "28d") };
14661
+ if (limit !== void 0) body.limit = limit;
14662
+ const response = await apiPost("/api/analytics/query", body);
14663
+ const format = args.output || "json";
14664
+ if (format === "json") {
14665
+ writeJson({ ok: true, data: response, meta: { count: response.rows.length }, hints: spec.hints(response) });
14666
+ return;
14667
+ }
14668
+ writeOutput({ ok: true, data: response.rows }, format, parseFields(args.fields), false, (record) => record);
14669
+ } catch (err) {
14670
+ failAnalytics(err);
14671
+ }
14672
+ }
14673
+ });
14674
+ }
14675
+ var subCommands = Object.fromEntries(REPORTS.map((spec) => [spec.report, buildSubcommand(spec)]));
14676
+ var analyticsCommand2 = defineCommand85({
14677
+ meta: {
14678
+ name: "analytics",
14679
+ description: `Read the client's landing-page analytics: first-party pageviews, visitors, sessions, and form submits collected on every published page (no setup needed \u2014 it is always on, consent-aware, and excludes previews/bots).
14680
+
14681
+ Start here: baker analytics overview --period 7d
14682
+
14683
+ Reports:
14684
+ overview headline numbers (pageviews, visitors, sessions, form submits)
14685
+ timeseries daily trend
14686
+ pages top pages (find what converts)
14687
+ sources where visitors come from (utm_source \u2192 referrer \u2192 direct)
14688
+ events form_submit + custom events
14689
+
14690
+ All reports take --period ${PERIODS} (default 28d). List-style reports take --limit. Data is read-only and scoped to this client.
14691
+
14692
+ Examples:
14693
+ baker analytics overview
14694
+ baker analytics pages --period 7d --limit 20 --output md
14695
+ baker analytics sources --period 90d`
14696
+ },
14697
+ subCommands,
14698
+ run: async () => {
14699
+ try {
14700
+ const response = await apiPost("/api/analytics/query", {
14701
+ report: "overview",
14702
+ period: "28d"
14703
+ });
14704
+ writeJson({
14705
+ ok: true,
14706
+ data: response,
14707
+ meta: { count: response.rows.length },
14708
+ hints: OVERVIEW_SPEC.hints(response)
14709
+ });
14710
+ } catch (err) {
14711
+ failAnalytics(err);
14712
+ }
14713
+ }
14714
+ });
14715
+
14523
14716
  // src/commands/canvas/index.ts
14524
- import { defineCommand as defineCommand95 } from "citty";
14717
+ import { defineCommand as defineCommand96 } from "citty";
14525
14718
 
14526
14719
  // src/commands/canvas/catalog.ts
14527
- import { defineCommand as defineCommand85 } from "citty";
14528
- var catalogCommand = defineCommand85({
14720
+ import { defineCommand as defineCommand86 } from "citty";
14721
+ var catalogCommand = defineCommand86({
14529
14722
  meta: {
14530
14723
  name: "catalog",
14531
14724
  description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
@@ -14540,7 +14733,7 @@ var catalogCommand = defineCommand85({
14540
14733
  // src/commands/canvas/critique.ts
14541
14734
  import { readFile } from "fs/promises";
14542
14735
  import path from "path";
14543
- import { defineCommand as defineCommand86 } from "citty";
14736
+ import { defineCommand as defineCommand87 } from "citty";
14544
14737
 
14545
14738
  // src/engine/scaffold/lib/critique.ts
14546
14739
  var VIBE_CUE = /\b(light|lighting|golden|moody|warm|cool|tone|grade|contrast|shadow|glow|rim|backlit|neon|soft)\b/i;
@@ -14660,7 +14853,7 @@ function critiqueCanvas(canvas) {
14660
14853
  }
14661
14854
 
14662
14855
  // src/commands/canvas/critique.ts
14663
- var critiqueCommand = defineCommand86({
14856
+ var critiqueCommand = defineCommand87({
14664
14857
  meta: {
14665
14858
  name: "critique",
14666
14859
  description: "Pre-spend creative critic (ADVISORY \u2014 never blocks). Scores a scaffolded creative BEFORE the billed render, so weak spots get fixed for free. A VIDEO creative is scored on hook strength, sound-off first-frame legibility, retention risk, and mechanism clarity; a STATIC ad on baked-text legibility risk, identity grounding, brand-type fidelity, and mechanism clarity. Ground a video hook against `baker winning-ads hooks` for a proven pattern."
@@ -14702,9 +14895,9 @@ import { execFile } from "child_process";
14702
14895
  import { readdir, readFile as readFile2, stat } from "fs/promises";
14703
14896
  import path2 from "path";
14704
14897
  import { promisify } from "util";
14705
- import { defineCommand as defineCommand87 } from "citty";
14898
+ import { defineCommand as defineCommand88 } from "citty";
14706
14899
  var execFileAsync = promisify(execFile);
14707
- var inspectCommand = defineCommand87({
14900
+ var inspectCommand = defineCommand88({
14708
14901
  meta: {
14709
14902
  name: "inspect",
14710
14903
  description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
@@ -14812,12 +15005,12 @@ async function probeDuration(filePath) {
14812
15005
 
14813
15006
  // src/commands/canvas/rerun.ts
14814
15007
  import path13 from "path";
14815
- import { defineCommand as defineCommand89 } from "citty";
15008
+ import { defineCommand as defineCommand90 } from "citty";
14816
15009
 
14817
15010
  // src/commands/canvas/run.ts
14818
15011
  import { readFile as readFile9 } from "fs/promises";
14819
15012
  import path12 from "path";
14820
- import { defineCommand as defineCommand88 } from "citty";
15013
+ import { defineCommand as defineCommand89 } from "citty";
14821
15014
 
14822
15015
  // src/commands/canvas/placeholders.ts
14823
15016
  function unsuppliedPlaceholderAssets(canvas) {
@@ -14979,7 +15172,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
14979
15172
  import { toCardinal as nwNl } from "n2words/nl-NL";
14980
15173
  import { toCardinal as nwPl } from "n2words/pl-PL";
14981
15174
  import { toCardinal as nwPt } from "n2words/pt-PT";
14982
- import { z as z14 } from "zod";
15175
+ import { z as z15 } from "zod";
14983
15176
 
14984
15177
  // src/engine/scaffold/lib/shoot-modes.ts
14985
15178
  var SHOOT_MODES = [
@@ -15315,71 +15508,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15315
15508
  "{{out.video}}"
15316
15509
  ];
15317
15510
  }
15318
- var FrameAsset = z14.object({ url: z14.string().optional() }).loose().optional();
15319
- var DialogueLine = z14.object({
15320
- speaker: z14.string().optional(),
15321
- line: z14.string().optional(),
15511
+ var FrameAsset = z15.object({ url: z15.string().optional() }).loose().optional();
15512
+ var DialogueLine = z15.object({
15513
+ speaker: z15.string().optional(),
15514
+ line: z15.string().optional(),
15322
15515
  // Absolute seconds on the source timeline (the deconstruct emits both).
15323
- start_s: z14.number().optional(),
15324
- end_s: z14.number().optional(),
15325
- delivery: z14.string().optional(),
15326
- voice_description: z14.string().optional(),
15516
+ start_s: z15.number().optional(),
15517
+ end_s: z15.number().optional(),
15518
+ delivery: z15.string().optional(),
15519
+ voice_description: z15.string().optional(),
15327
15520
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15328
15521
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15329
15522
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15330
15523
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15331
15524
  // the VO path; absent keeps the presence-based decision (old blueprints).
15332
- on_camera: z14.boolean().optional()
15525
+ on_camera: z15.boolean().optional()
15333
15526
  }).loose();
15334
- var Sfx = z14.object({
15335
- at_s: z14.number().optional(),
15336
- duration_s: z14.number().optional(),
15337
- sound_effect_prompt: z14.string().optional(),
15338
- description: z14.string().optional()
15527
+ var Sfx = z15.object({
15528
+ at_s: z15.number().optional(),
15529
+ duration_s: z15.number().optional(),
15530
+ sound_effect_prompt: z15.string().optional(),
15531
+ description: z15.string().optional()
15339
15532
  }).loose();
15340
- var CompositionRegion = z14.object({
15533
+ var CompositionRegion = z15.object({
15341
15534
  // full | top | bottom | left | right | inset
15342
- panel: z14.string().optional(),
15535
+ panel: z15.string().optional(),
15343
15536
  // 9-grid anchor for an `inset` presenter box.
15344
- position: z14.string().optional(),
15345
- is_presenter: z14.boolean().optional(),
15537
+ position: z15.string().optional(),
15538
+ is_presenter: z15.boolean().optional(),
15346
15539
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15347
- cast_ref: z14.string().optional(),
15540
+ cast_ref: z15.string().optional(),
15348
15541
  // What the region's content IS: camera | screen_capture | static_graphic |
15349
15542
  // generated. Authoritative for routing when present (regex-over-prose fallback
15350
15543
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15351
15544
  // overlay layer, never AI-generated.
15352
- kind: z14.string().optional(),
15545
+ kind: z15.string().optional(),
15353
15546
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15354
15547
  // screen_capture region shows. Two scenes share it only when they show the SAME
15355
15548
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15356
15549
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15357
15550
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15358
15551
  // instead of asking the operator for one screenshot that can't cover both.
15359
- surface_id: z14.string().optional(),
15552
+ surface_id: z15.string().optional(),
15360
15553
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15361
15554
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15362
15555
  // must re-composite, not paint into the surface.
15363
- nested: z14.array(z14.object({}).loose()).optional(),
15364
- summary: z14.string().optional(),
15365
- frame_prompt: z14.string().optional(),
15366
- motion_prompt: z14.string().optional()
15556
+ nested: z15.array(z15.object({}).loose()).optional(),
15557
+ summary: z15.string().optional(),
15558
+ frame_prompt: z15.string().optional(),
15559
+ motion_prompt: z15.string().optional()
15367
15560
  }).loose();
15368
- var SceneComposition = z14.object({
15561
+ var SceneComposition = z15.object({
15369
15562
  // full_frame (default) | split_screen | pip | keyed_overlay
15370
- layout: z14.string().optional(),
15563
+ layout: z15.string().optional(),
15371
15564
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15372
- split_axis: z14.string().optional(),
15373
- regions: z14.array(CompositionRegion).optional()
15565
+ split_axis: z15.string().optional(),
15566
+ regions: z15.array(CompositionRegion).optional()
15374
15567
  }).loose();
15375
- var CameraMotion = z14.object({ movement: z14.string().optional(), detail: z14.string().optional() }).loose();
15376
- var TranscriptWord = z14.object({ text: z14.string().optional() }).loose();
15377
- var Scene = z14.object({
15378
- start_s: z14.number().optional(),
15379
- end_s: z14.number().optional(),
15380
- duration_s: z14.number().optional(),
15381
- summary: z14.string().optional(),
15382
- action_detail: z14.string().optional(),
15568
+ var CameraMotion = z15.object({ movement: z15.string().optional(), detail: z15.string().optional() }).loose();
15569
+ var TranscriptWord = z15.object({ text: z15.string().optional() }).loose();
15570
+ var Scene = z15.object({
15571
+ start_s: z15.number().optional(),
15572
+ end_s: z15.number().optional(),
15573
+ duration_s: z15.number().optional(),
15574
+ summary: z15.string().optional(),
15575
+ action_detail: z15.string().optional(),
15383
15576
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15384
15577
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15385
15578
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15387,82 +15580,82 @@ var Scene = z14.object({
15387
15580
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15388
15581
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15389
15582
  // UGC/product mode; a human can override per scene by setting this.
15390
- shoot_mode: z14.string().optional(),
15583
+ shoot_mode: z15.string().optional(),
15391
15584
  // Diegetic ambient the clip's native audio should carry (no music). When
15392
15585
  // absent the scene falls back to its shoot mode's default ambience.
15393
- ambient: z14.string().optional(),
15586
+ ambient: z15.string().optional(),
15394
15587
  camera_motion: CameraMotion.optional(),
15395
- start_frame_prompt: z14.string().optional(),
15396
- end_frame_prompt: z14.string().optional(),
15397
- motion_prompt: z14.string().optional(),
15588
+ start_frame_prompt: z15.string().optional(),
15589
+ end_frame_prompt: z15.string().optional(),
15590
+ motion_prompt: z15.string().optional(),
15398
15591
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15399
15592
  // script re-craft checklist. Inferred from position when absent.
15400
- narrative_role: z14.string().optional(),
15593
+ narrative_role: z15.string().optional(),
15401
15594
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15402
15595
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15403
15596
  // into the hook's start-frame description so the generator renders that state,
15404
15597
  // not a calm influencer (CCA-11).
15405
- hook_mechanic: z14.object({ mechanic: z14.string().optional(), why_it_stops_scroll: z14.string().optional() }).loose().optional(),
15598
+ hook_mechanic: z15.object({ mechanic: z15.string().optional(), why_it_stops_scroll: z15.string().optional() }).loose().optional(),
15406
15599
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15407
- scene_setting: z14.string().optional(),
15600
+ scene_setting: z15.string().optional(),
15408
15601
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15409
15602
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15410
15603
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15411
15604
  // ignored (nothing follows it).
15412
- transition_out: z14.object({ type: z14.string().optional(), description: z14.string().optional() }).loose().optional(),
15413
- dialogue: z14.array(DialogueLine).optional(),
15414
- sfx: z14.array(Sfx).optional(),
15415
- overlays: z14.array(z14.unknown()).optional(),
15416
- floating_elements: z14.array(z14.unknown()).optional(),
15605
+ transition_out: z15.object({ type: z15.string().optional(), description: z15.string().optional() }).loose().optional(),
15606
+ dialogue: z15.array(DialogueLine).optional(),
15607
+ sfx: z15.array(Sfx).optional(),
15608
+ overlays: z15.array(z15.unknown()).optional(),
15609
+ floating_elements: z15.array(z15.unknown()).optional(),
15417
15610
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15418
15611
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15419
15612
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15420
15613
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
15421
- motion_level: z14.enum(["static", "subtle", "dynamic"]).optional(),
15422
- transcript_slice: z14.array(TranscriptWord).optional(),
15614
+ motion_level: z15.enum(["static", "subtle", "dynamic"]).optional(),
15615
+ transcript_slice: z15.array(TranscriptWord).optional(),
15423
15616
  start_frame_asset: FrameAsset,
15424
15617
  end_frame_asset: FrameAsset,
15425
15618
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15426
15619
  // previous one (the SAME physical shot, broken up only because it exceeded the
15427
15620
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15428
15621
  // start frame IS the previous scene's end frame — so the join is seamless.
15429
- continues_previous: z14.boolean().optional()
15622
+ continues_previous: z15.boolean().optional()
15430
15623
  }).loose();
15431
- var VideoBlueprint = z14.object({
15432
- source: z14.object({ aspect_ratio: z14.string().optional(), duration_s: z14.number().optional() }).loose().optional(),
15433
- global: z14.object({
15434
- music: z14.object({
15435
- present: z14.boolean().optional(),
15436
- music_prompt: z14.string().optional(),
15624
+ var VideoBlueprint = z15.object({
15625
+ source: z15.object({ aspect_ratio: z15.string().optional(), duration_s: z15.number().optional() }).loose().optional(),
15626
+ global: z15.object({
15627
+ music: z15.object({
15628
+ present: z15.boolean().optional(),
15629
+ music_prompt: z15.string().optional(),
15437
15630
  // Absolute second the music enters in the reference (the bed often
15438
15631
  // kicks in mid-ad, after the hook). We start the regenerated track here
15439
15632
  // instead of at 0 so the timing matches.
15440
- starts_at_s: z14.number().optional(),
15633
+ starts_at_s: z15.number().optional(),
15441
15634
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15442
15635
  // reference track. We never reuse it — only style the regenerated bed.
15443
- identified_track: z14.object({ title: z14.string().optional(), artist: z14.string().optional() }).loose().nullish()
15636
+ identified_track: z15.object({ title: z15.string().optional(), artist: z15.string().optional() }).loose().nullish()
15444
15637
  }).loose().optional(),
15445
- cast: z14.array(
15446
- z14.object({
15447
- id: z14.string().optional(),
15448
- description: z14.string().optional(),
15638
+ cast: z15.array(
15639
+ z15.object({
15640
+ id: z15.string().optional(),
15641
+ description: z15.string().optional(),
15449
15642
  // The deconstruct's note on the target-market localization (e.g. "native
15450
15643
  // French speaker") — read to derive the spoken-track language code.
15451
- market_localization_note: z14.string().optional()
15644
+ market_localization_note: z15.string().optional()
15452
15645
  }).loose()
15453
15646
  ).optional(),
15454
- voiceover: z14.object({
15647
+ voiceover: z15.object({
15455
15648
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15456
15649
  // voiceover | none → narration over the picture (no lip-sync).
15457
- mode: z14.string().optional(),
15458
- voice_description: z14.string().optional(),
15459
- persona: z14.string().optional()
15650
+ mode: z15.string().optional(),
15651
+ voice_description: z15.string().optional(),
15652
+ persona: z15.string().optional()
15460
15653
  }).loose().optional(),
15461
15654
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15462
15655
  // first hex is the dominant brand colour); never to drive frame generation.
15463
- style: z14.object({ palette: z14.array(z14.object({ hex: z14.string().optional() }).loose()).optional() }).loose().optional()
15656
+ style: z15.object({ palette: z15.array(z15.object({ hex: z15.string().optional() }).loose()).optional() }).loose().optional()
15464
15657
  }).loose().optional(),
15465
- scenes: z14.array(Scene).min(1)
15658
+ scenes: z15.array(Scene).min(1)
15466
15659
  }).loose();
15467
15660
  function injectHookPhysicality(blueprint) {
15468
15661
  for (const scene of blueprint.scenes) {
@@ -15479,26 +15672,26 @@ function clipIntentOf(scene, sceneIndex) {
15479
15672
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
15480
15673
  return "body";
15481
15674
  }
15482
- var AppearsItem = z14.union([z14.number(), z14.object({ scene: z14.number(), edge: z14.string().optional() }).loose()]);
15483
- var RecurringElement = z14.object({
15675
+ var AppearsItem = z15.union([z15.number(), z15.object({ scene: z15.number(), edge: z15.string().optional() }).loose()]);
15676
+ var RecurringElement = z15.object({
15484
15677
  // person | animal | product | logo | badge | other
15485
- type: z14.string(),
15486
- label: z14.string().optional(),
15487
- description: z14.string().optional(),
15488
- expression: z14.string().nullable().optional(),
15678
+ type: z15.string(),
15679
+ label: z15.string().optional(),
15680
+ description: z15.string().optional(),
15681
+ expression: z15.string().nullable().optional(),
15489
15682
  // When the element maps to a global cast entry, its stable id (for annotation).
15490
- cast_id: z14.string().nullable().optional(),
15683
+ cast_id: z15.string().nullable().optional(),
15491
15684
  // The label of another element that is the SAME individual as this one, shown
15492
15685
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15493
15686
  // pink shirt and believer in a white shirt). Each look gets its own reference
15494
15687
  // slot, but the face/identity must stay identical across them.
15495
- same_as: z14.string().nullable().optional(),
15688
+ same_as: z15.string().nullable().optional(),
15496
15689
  // Scenes the element appears in. Either a bare list of scene indices (both
15497
15690
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
15498
- scenes: z14.array(z14.number()).optional(),
15499
- appears_in: z14.array(AppearsItem).optional()
15691
+ scenes: z15.array(z15.number()).optional(),
15692
+ appears_in: z15.array(AppearsItem).optional()
15500
15693
  }).loose();
15501
- var RecurringElements = z14.array(RecurringElement);
15694
+ var RecurringElements = z15.array(RecurringElement);
15502
15695
  function sanitizeId(raw, fallback) {
15503
15696
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15504
15697
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -15971,7 +16164,7 @@ function scrubFloatSentences(text, floatDescs) {
15971
16164
  return kept;
15972
16165
  }
15973
16166
  function sceneFloatDescs(scene) {
15974
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16167
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
15975
16168
  if (!floats.success) return [];
15976
16169
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
15977
16170
  }
@@ -17395,25 +17588,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
17395
17588
  }
17396
17589
  return tracks;
17397
17590
  }
17398
- var OverlayStyle = z14.object({ color_hex: z14.string().optional(), background: z14.string().optional(), size: z14.string().optional() }).loose();
17399
- var Overlay = z14.object({
17400
- text: z14.string().optional(),
17401
- appears_at_s: z14.number().optional(),
17402
- duration_s: z14.number().optional(),
17403
- position: z14.string().optional(),
17404
- role: z14.string().optional(),
17405
- animation: z14.string().optional(),
17406
- animation_detail: z14.string().optional(),
17591
+ var OverlayStyle = z15.object({ color_hex: z15.string().optional(), background: z15.string().optional(), size: z15.string().optional() }).loose();
17592
+ var Overlay = z15.object({
17593
+ text: z15.string().optional(),
17594
+ appears_at_s: z15.number().optional(),
17595
+ duration_s: z15.number().optional(),
17596
+ position: z15.string().optional(),
17597
+ role: z15.string().optional(),
17598
+ animation: z15.string().optional(),
17599
+ animation_detail: z15.string().optional(),
17407
17600
  style: OverlayStyle.optional()
17408
17601
  }).loose();
17409
- var FloatingElement = z14.object({
17410
- kind: z14.string().optional(),
17411
- description: z14.string().optional(),
17412
- brand_name: z14.string().nullish(),
17413
- what_it_represents: z14.string().optional(),
17414
- appears_at_s: z14.number().optional(),
17415
- duration_s: z14.number().optional(),
17416
- position: z14.string().optional()
17602
+ var FloatingElement = z15.object({
17603
+ kind: z15.string().optional(),
17604
+ description: z15.string().optional(),
17605
+ brand_name: z15.string().nullish(),
17606
+ what_it_represents: z15.string().optional(),
17607
+ appears_at_s: z15.number().optional(),
17608
+ duration_s: z15.number().optional(),
17609
+ position: z15.string().optional()
17417
17610
  }).loose();
17418
17611
  function escapeHtml(s) {
17419
17612
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17445,7 +17638,7 @@ function positionClass(position) {
17445
17638
  function collectCaptions(blueprint, clock) {
17446
17639
  return blueprint.scenes.flatMap((scene, i) => {
17447
17640
  const sceneStart = scene.start_s ?? 0;
17448
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17641
+ const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
17449
17642
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17450
17643
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
17451
17644
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17525,7 +17718,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
17525
17718
  const windows = /* @__PURE__ */ new Map();
17526
17719
  blueprint.scenes.forEach((scene, i) => {
17527
17720
  const sceneStart = scene.start_s ?? 0;
17528
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17721
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17529
17722
  if (!floats.success) return;
17530
17723
  for (const fe of floats.data) {
17531
17724
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -17973,8 +18166,8 @@ function buildMotionBoard(blueprint) {
17973
18166
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
17974
18167
  cursor = end_s;
17975
18168
  const spoken = sceneSpokenText(scene);
17976
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17977
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18169
+ const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
18170
+ const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17978
18171
  const graphics = [
17979
18172
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
17980
18173
  kind: "text",
@@ -18940,7 +19133,7 @@ async function restoreRunSnapshot(manifest, targetDir, opts = {}) {
18940
19133
  }
18941
19134
 
18942
19135
  // src/commands/canvas/run.ts
18943
- var runCommand = defineCommand88({
19136
+ var runCommand = defineCommand89({
18944
19137
  meta: { name: "run", description: "Validate and execute a canvas JSON file." },
18945
19138
  args: {
18946
19139
  file: { type: "positional", required: true, description: "Path to canvas JSON" },
@@ -19306,7 +19499,7 @@ async function postInitialRunRecord(client, payload) {
19306
19499
 
19307
19500
  // src/commands/canvas/rerun.ts
19308
19501
  var SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
19309
- var rerunCommand = defineCommand89({
19502
+ var rerunCommand = defineCommand90({
19310
19503
  meta: {
19311
19504
  name: "rerun",
19312
19505
  description: "Re-run a creative's latest recorded canvas. Restores its definition files from run history first, so it works in a fresh workspace that never had the source chat's files \u2014 an interrupted run resumes (in-flight jobs re-attach), a completed one re-renders from the cache."
@@ -19403,10 +19596,10 @@ async function fetchManifest(url) {
19403
19596
  // src/commands/canvas/scaffold-static-ad.ts
19404
19597
  import { access, mkdir as mkdir5, readFile as readFile11, writeFile as writeFile6 } from "fs/promises";
19405
19598
  import path17 from "path";
19406
- import { defineCommand as defineCommand91 } from "citty";
19599
+ import { defineCommand as defineCommand92 } from "citty";
19407
19600
 
19408
19601
  // src/engine/scaffold/staticAd.ts
19409
- import { z as z15 } from "zod";
19602
+ import { z as z16 } from "zod";
19410
19603
  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"]);
19411
19604
  var DEFAULT_ASPECT_RATIO = "9:16";
19412
19605
  var SHEET_SUBJECT_TYPE2 = {
@@ -19415,24 +19608,24 @@ var SHEET_SUBJECT_TYPE2 = {
19415
19608
  };
19416
19609
  var ACTOR_SHEET_MODEL2 = "google/gemini-3-pro-image-preview";
19417
19610
  var ACTOR_SHEET_IMAGE_SIZE = "4K";
19418
- var Blueprint = z15.object({
19419
- meta: z15.object({ estimated_aspect_ratio: z15.string().optional() }).loose().optional(),
19420
- text_content: z15.array(z15.object({ text: z15.string().optional() }).loose()).optional()
19611
+ var Blueprint = z16.object({
19612
+ meta: z16.object({ estimated_aspect_ratio: z16.string().optional() }).loose().optional(),
19613
+ text_content: z16.array(z16.object({ text: z16.string().optional() }).loose()).optional()
19421
19614
  }).loose();
19422
- var ElementLocator = z15.object({
19423
- collection: z15.enum(["subjects", "people", "brands_logos"]),
19424
- index: z15.number().int().nonnegative()
19615
+ var ElementLocator = z16.object({
19616
+ collection: z16.enum(["subjects", "people", "brands_logos"]),
19617
+ index: z16.number().int().nonnegative()
19425
19618
  }).loose();
19426
- var MainElement = z15.object({
19619
+ var MainElement = z16.object({
19427
19620
  // logo | product | person | animal | badge | other
19428
- type: z15.string(),
19429
- label: z15.string().optional(),
19430
- description: z15.string().optional(),
19431
- expression: z15.string().nullable().optional(),
19432
- reason: z15.string().optional(),
19621
+ type: z16.string(),
19622
+ label: z16.string().optional(),
19623
+ description: z16.string().optional(),
19624
+ expression: z16.string().nullable().optional(),
19625
+ reason: z16.string().optional(),
19433
19626
  locator: ElementLocator.optional()
19434
19627
  }).loose();
19435
- var MainElements = z15.array(MainElement);
19628
+ var MainElements = z16.array(MainElement);
19436
19629
  function sanitizeId2(raw, fallback) {
19437
19630
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
19438
19631
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -19709,7 +19902,7 @@ function isValidScaffoldSlug(slug) {
19709
19902
  // src/commands/canvas/sync-definition.ts
19710
19903
  import { readdir as readdir5, readFile as readFile10, stat as stat3 } from "fs/promises";
19711
19904
  import path16 from "path";
19712
- import { defineCommand as defineCommand90 } from "citty";
19905
+ import { defineCommand as defineCommand91 } from "citty";
19713
19906
 
19714
19907
  // src/commands/canvas/definition-graph.ts
19715
19908
  var MAX_NODES = 300;
@@ -19822,7 +20015,7 @@ async function resolveCanvasPath(inputPath) {
19822
20015
  const chosen = (slug ? canvases.find((name) => name === `${slug}.canvas.json`) : void 0) ?? canvases[0];
19823
20016
  return chosen ? path16.join(dir, chosen) : null;
19824
20017
  }
19825
- var syncDefinitionCommand = defineCommand90({
20018
+ var syncDefinitionCommand = defineCommand91({
19826
20019
  meta: {
19827
20020
  name: "sync-definition",
19828
20021
  description: "Push a creative's current node-graph + input thumbnails to the dashboard without rendering. Runs automatically when you edit a creative's canvas.json or prompt.json."
@@ -20031,7 +20224,7 @@ async function runVisionPasses(canvas) {
20031
20224
  return fail2("read_outputs", e instanceof Error ? e.message : String(e));
20032
20225
  }
20033
20226
  }
20034
- var scaffoldStaticAdCommand = defineCommand91({
20227
+ var scaffoldStaticAdCommand = defineCommand92({
20035
20228
  meta: {
20036
20229
  name: "scaffold-static-ad",
20037
20230
  description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. Edit prompt.json and drop the real assets, then `baker canvas run` it."
@@ -20205,7 +20398,7 @@ var scaffoldStaticAdCommand = defineCommand91({
20205
20398
  import { access as access2, cp, mkdir as mkdir6, readFile as readFile14, rm as rm6, writeFile as writeFile7 } from "fs/promises";
20206
20399
  import { tmpdir as tmpdir2 } from "os";
20207
20400
  import path20 from "path";
20208
- import { defineCommand as defineCommand92 } from "citty";
20401
+ import { defineCommand as defineCommand93 } from "citty";
20209
20402
 
20210
20403
  // src/engine/scaffold/lib/model-router.ts
20211
20404
  var SEEDANCE = "bytedance/seedance-2.0";
@@ -20659,7 +20852,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
20659
20852
  return fail3("deconstruct", e instanceof Error ? e.message : String(e));
20660
20853
  }
20661
20854
  }
20662
- var scaffoldVideoCommand = defineCommand92({
20855
+ var scaffoldVideoCommand = defineCommand93({
20663
20856
  meta: {
20664
20857
  name: "scaffold-video",
20665
20858
  description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to a split, editable blueprint: a global prompt.json plus one small scenes/sNN.json per scene) and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit a scene's scenes/sNN.json (or prompt.json for global cast/palette/brand), drop the real source images, then `baker canvas run`."
@@ -20964,7 +21157,7 @@ var scaffoldVideoCommand = defineCommand92({
20964
21157
  // src/commands/canvas/set-prompt.ts
20965
21158
  import { readFile as readFile15, writeFile as writeFile8 } from "fs/promises";
20966
21159
  import path21 from "path";
20967
- import { defineCommand as defineCommand93 } from "citty";
21160
+ import { defineCommand as defineCommand94 } from "citty";
20968
21161
  function setNodePrompt(canvas, nodeId, text) {
20969
21162
  const nodes = canvas?.nodes;
20970
21163
  if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
@@ -20979,7 +21172,7 @@ function setNodePrompt(canvas, nodeId, text) {
20979
21172
  newNodes[idx] = newNode;
20980
21173
  return { ...canvas, nodes: newNodes };
20981
21174
  }
20982
- var setPromptCommand = defineCommand93({
21175
+ var setPromptCommand = defineCommand94({
20983
21176
  meta: {
20984
21177
  name: "set-prompt",
20985
21178
  description: "Safely set a node's params.prompt (a frame description, motion prompt, etc.) without hand-editing the JSON. Prefer --text-file for multi-line/accented copy \u2014 it preserves UTF-8 exactly, unlike shell-quoted jq."
@@ -21039,8 +21232,8 @@ var setPromptCommand = defineCommand93({
21039
21232
  // src/commands/canvas/validate.ts
21040
21233
  import { readFile as readFile16 } from "fs/promises";
21041
21234
  import path22 from "path";
21042
- import { defineCommand as defineCommand94 } from "citty";
21043
- var validateCommand = defineCommand94({
21235
+ import { defineCommand as defineCommand95 } from "citty";
21236
+ var validateCommand = defineCommand95({
21044
21237
  meta: {
21045
21238
  name: "validate",
21046
21239
  description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
@@ -21110,7 +21303,7 @@ var validateCommand = defineCommand94({
21110
21303
  });
21111
21304
 
21112
21305
  // src/commands/canvas/index.ts
21113
- var canvasCommand = defineCommand95({
21306
+ var canvasCommand = defineCommand96({
21114
21307
  meta: {
21115
21308
  name: "canvas",
21116
21309
  description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
@@ -21143,10 +21336,10 @@ Subcommands:
21143
21336
  });
21144
21337
 
21145
21338
  // src/commands/creatives/index.ts
21146
- import { defineCommand as defineCommand97 } from "citty";
21339
+ import { defineCommand as defineCommand98 } from "citty";
21147
21340
 
21148
21341
  // src/commands/creatives/publish.ts
21149
- import { defineCommand as defineCommand96 } from "citty";
21342
+ import { defineCommand as defineCommand97 } from "citty";
21150
21343
 
21151
21344
  // src/commands/images/api.ts
21152
21345
  import { readFile as readFile17 } from "fs/promises";
@@ -21290,7 +21483,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
21290
21483
  chatId: chatIdFromEnv()
21291
21484
  });
21292
21485
  }
21293
- var publishCommand = defineCommand96({
21486
+ var publishCommand = defineCommand97({
21294
21487
  meta: {
21295
21488
  name: "publish",
21296
21489
  description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
@@ -21348,7 +21541,7 @@ var publishCommand = defineCommand96({
21348
21541
  });
21349
21542
 
21350
21543
  // src/commands/creatives/index.ts
21351
- var creativesCommand3 = defineCommand97({
21544
+ var creativesCommand3 = defineCommand98({
21352
21545
  meta: {
21353
21546
  name: "creatives",
21354
21547
  description: `Publish static ad creatives as first-class Baker outputs.
@@ -21364,7 +21557,7 @@ Publishing uploads the image to the Company image library, applies the official
21364
21557
  });
21365
21558
 
21366
21559
  // src/commands/flows/index.ts
21367
- import { defineCommand as defineCommand98 } from "citty";
21560
+ import { defineCommand as defineCommand99 } from "citty";
21368
21561
 
21369
21562
  // src/commands/flows/shared.ts
21370
21563
  import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
@@ -21519,7 +21712,7 @@ function displayName(slug) {
21519
21712
  const name = tree.displayName;
21520
21713
  return typeof name === "string" && name.trim() ? name.trim() : slug;
21521
21714
  }
21522
- var listCommand5 = defineCommand98({
21715
+ var listCommand5 = defineCommand99({
21523
21716
  meta: {
21524
21717
  name: "list",
21525
21718
  description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
@@ -21533,7 +21726,7 @@ var listCommand5 = defineCommand98({
21533
21726
  writeJson({ ok: true, data: { flows } });
21534
21727
  }
21535
21728
  });
21536
- var showCommand2 = defineCommand98({
21729
+ var showCommand2 = defineCommand99({
21537
21730
  meta: {
21538
21731
  name: "show",
21539
21732
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -21554,7 +21747,7 @@ var showCommand2 = defineCommand98({
21554
21747
  writeJson({ ok: true, data: response });
21555
21748
  }
21556
21749
  });
21557
- var flowsCommand = defineCommand98({
21750
+ var flowsCommand = defineCommand99({
21558
21751
  meta: {
21559
21752
  name: "flows",
21560
21753
  description: `Read this workspace's Forms (flows) and the configuration status of their confidential fields \u2014 connection secrets, OAuth connections, and third-party field definitions (HubSpot, Calendly, HighLevel, SavvyCal).
@@ -21581,10 +21774,10 @@ Examples:
21581
21774
  });
21582
21775
 
21583
21776
  // src/commands/ga4/index.ts
21584
- import { defineCommand as defineCommand102 } from "citty";
21777
+ import { defineCommand as defineCommand103 } from "citty";
21585
21778
 
21586
21779
  // src/commands/ga4/audit.ts
21587
- import { defineCommand as defineCommand99 } from "citty";
21780
+ import { defineCommand as defineCommand100 } from "citty";
21588
21781
 
21589
21782
  // src/commands/ga4/resolve.ts
21590
21783
  async function fetchProperties(useCache = true) {
@@ -21647,7 +21840,7 @@ registerSchema({
21647
21840
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21648
21841
  }
21649
21842
  });
21650
- var auditCommand2 = defineCommand99({
21843
+ var auditCommand2 = defineCommand100({
21651
21844
  meta: {
21652
21845
  name: "audit",
21653
21846
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -21699,7 +21892,7 @@ Examples:
21699
21892
  });
21700
21893
 
21701
21894
  // src/commands/ga4/properties.ts
21702
- import { defineCommand as defineCommand100 } from "citty";
21895
+ import { defineCommand as defineCommand101 } from "citty";
21703
21896
  registerSchema({
21704
21897
  command: "ga4.properties",
21705
21898
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -21707,7 +21900,7 @@ registerSchema({
21707
21900
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
21708
21901
  }
21709
21902
  });
21710
- var propertiesCommand = defineCommand100({
21903
+ var propertiesCommand = defineCommand101({
21711
21904
  meta: {
21712
21905
  name: "properties",
21713
21906
  description: `List accessible GA4 properties.
@@ -21757,7 +21950,7 @@ Examples:
21757
21950
  // src/commands/ga4/query.ts
21758
21951
  import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
21759
21952
  import { resolve as resolve2 } from "path";
21760
- import { defineCommand as defineCommand101 } from "citty";
21953
+ import { defineCommand as defineCommand102 } from "citty";
21761
21954
 
21762
21955
  // src/commands/ga4/presets.ts
21763
21956
  var GA4_PRESETS = [
@@ -21889,7 +22082,7 @@ function handleError(err) {
21889
22082
  });
21890
22083
  process.exit(1);
21891
22084
  }
21892
- var queryCommand2 = defineCommand101({
22085
+ var queryCommand2 = defineCommand102({
21893
22086
  meta: {
21894
22087
  name: "query",
21895
22088
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -21960,7 +22153,7 @@ Free-form (escape hatch):
21960
22153
  });
21961
22154
 
21962
22155
  // src/commands/ga4/index.ts
21963
- var ga4Command = defineCommand102({
22156
+ var ga4Command = defineCommand103({
21964
22157
  meta: {
21965
22158
  name: "ga4",
21966
22159
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -21983,12 +22176,12 @@ Examples:
21983
22176
  });
21984
22177
 
21985
22178
  // src/commands/gsc/index.ts
21986
- import { defineCommand as defineCommand106 } from "citty";
22179
+ import { defineCommand as defineCommand107 } from "citty";
21987
22180
 
21988
22181
  // src/commands/gsc/query.ts
21989
22182
  import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
21990
22183
  import { resolve as resolve3 } from "path";
21991
- import { defineCommand as defineCommand103 } from "citty";
22184
+ import { defineCommand as defineCommand104 } from "citty";
21992
22185
 
21993
22186
  // src/commands/gsc/presets.ts
21994
22187
  var GSC_PRESETS = [
@@ -22176,7 +22369,7 @@ function handleError2(err) {
22176
22369
  });
22177
22370
  process.exit(1);
22178
22371
  }
22179
- var queryCommand3 = defineCommand103({
22372
+ var queryCommand3 = defineCommand104({
22180
22373
  meta: {
22181
22374
  name: "query",
22182
22375
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -22254,7 +22447,7 @@ Free-form (escape hatch):
22254
22447
  });
22255
22448
 
22256
22449
  // src/commands/gsc/sitemaps.ts
22257
- import { defineCommand as defineCommand104 } from "citty";
22450
+ import { defineCommand as defineCommand105 } from "citty";
22258
22451
  registerSchema({
22259
22452
  command: "gsc.sitemaps",
22260
22453
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -22263,7 +22456,7 @@ registerSchema({
22263
22456
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22264
22457
  }
22265
22458
  });
22266
- var sitemapsCommand = defineCommand104({
22459
+ var sitemapsCommand = defineCommand105({
22267
22460
  meta: {
22268
22461
  name: "sitemaps",
22269
22462
  description: `List sitemaps for a site. Check health and errors.
@@ -22313,7 +22506,7 @@ Examples:
22313
22506
  });
22314
22507
 
22315
22508
  // src/commands/gsc/sites.ts
22316
- import { defineCommand as defineCommand105 } from "citty";
22509
+ import { defineCommand as defineCommand106 } from "citty";
22317
22510
  registerSchema({
22318
22511
  command: "gsc.sites",
22319
22512
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -22321,7 +22514,7 @@ registerSchema({
22321
22514
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
22322
22515
  }
22323
22516
  });
22324
- var sitesCommand = defineCommand105({
22517
+ var sitesCommand = defineCommand106({
22325
22518
  meta: {
22326
22519
  name: "sites",
22327
22520
  description: `List verified Search Console sites.
@@ -22369,7 +22562,7 @@ Examples:
22369
22562
  });
22370
22563
 
22371
22564
  // src/commands/gsc/index.ts
22372
- var gscCommand = defineCommand106({
22565
+ var gscCommand = defineCommand107({
22373
22566
  meta: {
22374
22567
  name: "gsc",
22375
22568
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -22392,10 +22585,10 @@ Examples:
22392
22585
  });
22393
22586
 
22394
22587
  // src/commands/images/index.ts
22395
- import { defineCommand as defineCommand130 } from "citty";
22588
+ import { defineCommand as defineCommand131 } from "citty";
22396
22589
 
22397
22590
  // src/commands/images/crop.ts
22398
- import { defineCommand as defineCommand107 } from "citty";
22591
+ import { defineCommand as defineCommand108 } from "citty";
22399
22592
 
22400
22593
  // src/lib/image/crop-sprite.ts
22401
22594
  import sharp from "sharp";
@@ -22520,7 +22713,7 @@ function emitError2(err) {
22520
22713
  }
22521
22714
  process.exit(1);
22522
22715
  }
22523
- var cropCommand = defineCommand107({
22716
+ var cropCommand = defineCommand108({
22524
22717
  meta: {
22525
22718
  name: "crop",
22526
22719
  description: "Crop a rectangular region from an image.\n\nExample: baker images crop sprite.png --x 0 --y 0 --width 64 --height 64 --output icon.png"
@@ -22556,7 +22749,7 @@ var cropCommand = defineCommand107({
22556
22749
  });
22557
22750
 
22558
22751
  // src/commands/images/delete.ts
22559
- import { defineCommand as defineCommand108 } from "citty";
22752
+ import { defineCommand as defineCommand109 } from "citty";
22560
22753
  registerSchema({
22561
22754
  command: "images.delete",
22562
22755
  description: "Delete an image by ID",
@@ -22570,7 +22763,7 @@ registerSchema({
22570
22763
  }
22571
22764
  }
22572
22765
  });
22573
- var deleteCommand = defineCommand108({
22766
+ var deleteCommand = defineCommand109({
22574
22767
  meta: {
22575
22768
  name: "delete",
22576
22769
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -22611,7 +22804,7 @@ var deleteCommand = defineCommand108({
22611
22804
  });
22612
22805
 
22613
22806
  // src/commands/images/dimensions.ts
22614
- import { defineCommand as defineCommand109 } from "citty";
22807
+ import { defineCommand as defineCommand110 } from "citty";
22615
22808
 
22616
22809
  // src/lib/image/dimensions.ts
22617
22810
  import { imageSize } from "image-size";
@@ -22634,7 +22827,7 @@ registerSchema({
22634
22827
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
22635
22828
  }
22636
22829
  });
22637
- var dimensionsCommand = defineCommand109({
22830
+ var dimensionsCommand = defineCommand110({
22638
22831
  meta: {
22639
22832
  name: "dimensions",
22640
22833
  description: "Read image dimensions without decoding the full file.\n\nExample: baker images dimensions ./logo.png\nExample: baker images dimensions https://acme.com/hero.png"
@@ -22678,7 +22871,7 @@ var dimensionsCommand = defineCommand109({
22678
22871
  });
22679
22872
 
22680
22873
  // src/commands/images/extract.ts
22681
- import { defineCommand as defineCommand110 } from "citty";
22874
+ import { defineCommand as defineCommand111 } from "citty";
22682
22875
  registerSchema({
22683
22876
  command: "images.extract",
22684
22877
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -22694,7 +22887,7 @@ registerSchema({
22694
22887
  }
22695
22888
  }
22696
22889
  });
22697
- var extractCommand = defineCommand110({
22890
+ var extractCommand = defineCommand111({
22698
22891
  meta: {
22699
22892
  name: "extract",
22700
22893
  description: "Pull every image from a single URL via Firecrawl. ~$0.001/scrape. Cap auto-ingest at 20.\n\nExample: baker images extract https://stripe.com --auto-ingest 5"
@@ -22732,7 +22925,7 @@ var extractCommand = defineCommand110({
22732
22925
  });
22733
22926
 
22734
22927
  // src/commands/images/find.ts
22735
- import { defineCommand as defineCommand111 } from "citty";
22928
+ import { defineCommand as defineCommand112 } from "citty";
22736
22929
  registerSchema({
22737
22930
  command: "images.find",
22738
22931
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -22764,7 +22957,7 @@ registerSchema({
22764
22957
  }
22765
22958
  }
22766
22959
  });
22767
- var findCommand = defineCommand111({
22960
+ var findCommand = defineCommand112({
22768
22961
  meta: {
22769
22962
  name: "find",
22770
22963
  description: "Library-first fanout image search. Opt in to providers with --sources. `--fallback` short-circuits to externals only when library is thin. With --auto-ingest, ingested external hits return Baker-owned URLs.\n\nExample: baker images find 'office' --sources library,magnific --limit 20"
@@ -22813,7 +23006,7 @@ var findCommand = defineCommand111({
22813
23006
 
22814
23007
  // src/commands/images/generate.ts
22815
23008
  import { readFile as readFile19 } from "fs/promises";
22816
- import { defineCommand as defineCommand112 } from "citty";
23009
+ import { defineCommand as defineCommand113 } from "citty";
22817
23010
  import sharp2 from "sharp";
22818
23011
  var GENERATE_TIMEOUT_MS = 18e4;
22819
23012
  var REFERENCE_MAX_EDGE = 1536;
@@ -22916,7 +23109,7 @@ async function resolveReferences(spec) {
22916
23109
  }
22917
23110
  return out;
22918
23111
  }
22919
- var generateCommand = defineCommand112({
23112
+ var generateCommand = defineCommand113({
22920
23113
  meta: {
22921
23114
  name: "generate",
22922
23115
  description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: google/gemini-3.1-flash-image-preview (Nano Banana flash \u2014 default, fast, extreme aspect ratios) & google/gemini-3.5-flash (fast), google/gemini-3-pro-image-preview (Nano Banana Pro \u2014 highest fidelity), openai/gpt-5.4-image-2 (photoreal, cleanest in-image text, best for ad/landing reproduction), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model openai/gpt-5.4-image-2 --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
@@ -22968,7 +23161,7 @@ var generateCommand = defineCommand112({
22968
23161
  });
22969
23162
 
22970
23163
  // src/commands/images/get.ts
22971
- import { defineCommand as defineCommand113 } from "citty";
23164
+ import { defineCommand as defineCommand114 } from "citty";
22972
23165
  registerSchema({
22973
23166
  command: "images.get",
22974
23167
  description: "Get a single image by ID",
@@ -22976,7 +23169,7 @@ registerSchema({
22976
23169
  id: { type: "string", description: "Image ID", required: true }
22977
23170
  }
22978
23171
  });
22979
- var getCommand2 = defineCommand113({
23172
+ var getCommand2 = defineCommand114({
22980
23173
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
22981
23174
  args: {
22982
23175
  id: { type: "positional", description: "Image ID", required: false },
@@ -23012,7 +23205,7 @@ var getCommand2 = defineCommand113({
23012
23205
  });
23013
23206
 
23014
23207
  // src/commands/images/gif.ts
23015
- import { defineCommand as defineCommand114 } from "citty";
23208
+ import { defineCommand as defineCommand115 } from "citty";
23016
23209
  registerSchema({
23017
23210
  command: "images.gif",
23018
23211
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -23044,7 +23237,7 @@ registerSchema({
23044
23237
  }
23045
23238
  }
23046
23239
  });
23047
- var gifCommand = defineCommand114({
23240
+ var gifCommand = defineCommand115({
23048
23241
  meta: {
23049
23242
  name: "gif",
23050
23243
  description: "Search Giphy for GIFs / reaction memes \u2014 built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25"
@@ -23091,7 +23284,7 @@ var gifCommand = defineCommand114({
23091
23284
  });
23092
23285
 
23093
23286
  // src/commands/images/google.ts
23094
- import { defineCommand as defineCommand115 } from "citty";
23287
+ import { defineCommand as defineCommand116 } from "citty";
23095
23288
  registerSchema({
23096
23289
  command: "images.google",
23097
23290
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -23127,7 +23320,7 @@ registerSchema({
23127
23320
  }
23128
23321
  }
23129
23322
  });
23130
- var googleCommand2 = defineCommand115({
23323
+ var googleCommand2 = defineCommand116({
23131
23324
  meta: {
23132
23325
  name: "google",
23133
23326
  description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). \u26A0 Source unverified \u2014 watermarks, low-res, mislabeled results are common. Use as last resort. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20"
@@ -23175,7 +23368,7 @@ var googleCommand2 = defineCommand115({
23175
23368
  });
23176
23369
 
23177
23370
  // src/commands/images/icon.ts
23178
- import { defineCommand as defineCommand116 } from "citty";
23371
+ import { defineCommand as defineCommand117 } from "citty";
23179
23372
  registerSchema({
23180
23373
  command: "images.icon",
23181
23374
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -23201,7 +23394,7 @@ registerSchema({
23201
23394
  }
23202
23395
  }
23203
23396
  });
23204
- var iconCommand = defineCommand116({
23397
+ var iconCommand = defineCommand117({
23205
23398
  meta: {
23206
23399
  name: "icon",
23207
23400
  description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, \u2026). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'"
@@ -23241,7 +23434,7 @@ var iconCommand = defineCommand116({
23241
23434
  });
23242
23435
 
23243
23436
  // src/commands/images/ingest.ts
23244
- import { defineCommand as defineCommand117 } from "citty";
23437
+ import { defineCommand as defineCommand118 } from "citty";
23245
23438
  registerSchema({
23246
23439
  command: "images.ingest",
23247
23440
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -23253,7 +23446,7 @@ registerSchema({
23253
23446
  context: { type: "string", description: "Description context hint", required: false }
23254
23447
  }
23255
23448
  });
23256
- var ingestCommand = defineCommand117({
23449
+ var ingestCommand = defineCommand118({
23257
23450
  meta: {
23258
23451
  name: "ingest",
23259
23452
  description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345"
@@ -23295,7 +23488,7 @@ var ingestCommand = defineCommand117({
23295
23488
  });
23296
23489
 
23297
23490
  // src/commands/images/library.ts
23298
- import { defineCommand as defineCommand118 } from "citty";
23491
+ import { defineCommand as defineCommand119 } from "citty";
23299
23492
  registerSchema({
23300
23493
  command: "images.library",
23301
23494
  description: "Search the company image library. Returns only ready images.",
@@ -23321,7 +23514,7 @@ registerSchema({
23321
23514
  }
23322
23515
  }
23323
23516
  });
23324
- var libraryCommand = defineCommand118({
23517
+ var libraryCommand = defineCommand119({
23325
23518
  meta: {
23326
23519
  name: "library",
23327
23520
  description: "Search the company image library (hybrid BM25 + vector + Cohere rerank). Use this BEFORE any external provider.\n\nExample: baker images library 'hero banner' --aspect-ratio 16:9 --source magnific"
@@ -23378,7 +23571,7 @@ var libraryCommand = defineCommand118({
23378
23571
  });
23379
23572
 
23380
23573
  // src/commands/images/logo.ts
23381
- import { defineCommand as defineCommand119 } from "citty";
23574
+ import { defineCommand as defineCommand120 } from "citty";
23382
23575
  registerSchema({
23383
23576
  command: "images.logo",
23384
23577
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -23403,7 +23596,7 @@ registerSchema({
23403
23596
  }
23404
23597
  }
23405
23598
  });
23406
- var logoCommand = defineCommand119({
23599
+ var logoCommand = defineCommand120({
23407
23600
  meta: {
23408
23601
  name: "logo",
23409
23602
  description: "Brand logo via Brandfetch CDN. Returns up to 5 variants (icon, light/dark logo, light/dark symbol). Auto-ingests the first variant.\n\nExample: baker images logo stripe.com --variant logo"
@@ -23441,7 +23634,7 @@ var logoCommand = defineCommand119({
23441
23634
  });
23442
23635
 
23443
23636
  // src/commands/images/normalize.ts
23444
- import { defineCommand as defineCommand120 } from "citty";
23637
+ import { defineCommand as defineCommand121 } from "citty";
23445
23638
 
23446
23639
  // src/lib/image/color-changer.ts
23447
23640
  import quantize from "quantize";
@@ -24173,7 +24366,7 @@ function coerceRawArgs(args) {
24173
24366
  "dry-run": bool(args["dry-run"])
24174
24367
  };
24175
24368
  }
24176
- var normalizeCommand = defineCommand120({
24369
+ var normalizeCommand = defineCommand121({
24177
24370
  meta: {
24178
24371
  name: "normalize",
24179
24372
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -24228,7 +24421,7 @@ Examples:
24228
24421
  });
24229
24422
 
24230
24423
  // src/commands/images/pinterest.ts
24231
- import { defineCommand as defineCommand121 } from "citty";
24424
+ import { defineCommand as defineCommand122 } from "citty";
24232
24425
  registerSchema({
24233
24426
  command: "images.pinterest",
24234
24427
  description: "Pinterest image search via ScrapeCreators. Reference-grade real-world photography, product styling, interiors, fashion, food, and aesthetic mood boards. Inspect before placing \u2014 Pinterest is unverified, trademark-bearing web content.",
@@ -24248,7 +24441,7 @@ registerSchema({
24248
24441
  }
24249
24442
  }
24250
24443
  });
24251
- var pinterestCommand = defineCommand121({
24444
+ var pinterestCommand = defineCommand122({
24252
24445
  meta: {
24253
24446
  name: "pinterest",
24254
24447
  description: "Pinterest image search via ScrapeCreators ($0.00188/request). Best for photo-realistic reference imagery \u2014 lifestyle, interiors, fashion, food, product styling, and mood boards to brief AI generation against. \u26A0 Unverified, trademark-bearing web content \u2014 inspect and respect rights before placing on a customer page. Browse first; auto-ingest only the pins you commit to.\n\nExamples:\n baker images pinterest 'scandinavian living room'\n baker images pinterest 'minimalist skincare product photography' --limit 20\n baker images pinterest 'cozy coffee shop interior' --auto-ingest 2 --context 'Mood reference for hero photography'"
@@ -24288,7 +24481,7 @@ var pinterestCommand = defineCommand121({
24288
24481
  });
24289
24482
 
24290
24483
  // src/commands/images/screenshot.ts
24291
- import { defineCommand as defineCommand122 } from "citty";
24484
+ import { defineCommand as defineCommand123 } from "citty";
24292
24485
  registerSchema({
24293
24486
  command: "images.screenshot",
24294
24487
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -24304,7 +24497,7 @@ registerSchema({
24304
24497
  }
24305
24498
  }
24306
24499
  });
24307
- var screenshotCommand = defineCommand122({
24500
+ var screenshotCommand = defineCommand123({
24308
24501
  meta: {
24309
24502
  name: "screenshot",
24310
24503
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -24367,7 +24560,7 @@ var screenshotCommand = defineCommand122({
24367
24560
  });
24368
24561
 
24369
24562
  // src/commands/images/search.ts
24370
- import { defineCommand as defineCommand123 } from "citty";
24563
+ import { defineCommand as defineCommand124 } from "citty";
24371
24564
  registerSchema({
24372
24565
  command: "images.search",
24373
24566
  description: "Search images by text query. Only returns ready images.",
@@ -24383,7 +24576,7 @@ registerSchema({
24383
24576
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24384
24577
  }
24385
24578
  });
24386
- var searchCommand = defineCommand123({
24579
+ var searchCommand = defineCommand124({
24387
24580
  meta: {
24388
24581
  name: "search",
24389
24582
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -24443,7 +24636,7 @@ var searchCommand = defineCommand123({
24443
24636
  });
24444
24637
 
24445
24638
  // src/commands/images/sticker.ts
24446
- import { defineCommand as defineCommand124 } from "citty";
24639
+ import { defineCommand as defineCommand125 } from "citty";
24447
24640
  registerSchema({
24448
24641
  command: "images.sticker",
24449
24642
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -24475,7 +24668,7 @@ registerSchema({
24475
24668
  }
24476
24669
  }
24477
24670
  });
24478
- var stickerCommand = defineCommand124({
24671
+ var stickerCommand = defineCommand125({
24479
24672
  meta: {
24480
24673
  name: "sticker",
24481
24674
  description: "Search Giphy's sticker corpus \u2014 transparent-background WebPs / GIFs ideal for overlaying on ad creative (Meta, TikTok, Stories). Same Giphy free API as `baker images gif`; results carry WebP + GIF + MP4 URLs in providerMeta.\n\nExample: baker images sticker 'thumbs up' --limit 10\nExample: baker images sticker celebration --rating g --auto-ingest 3\nExample: baker images sticker --trending --limit 25"
@@ -24522,7 +24715,7 @@ var stickerCommand = defineCommand124({
24522
24715
  });
24523
24716
 
24524
24717
  // src/commands/images/stock.ts
24525
- import { defineCommand as defineCommand125 } from "citty";
24718
+ import { defineCommand as defineCommand126 } from "citty";
24526
24719
  registerSchema({
24527
24720
  command: "images.stock",
24528
24721
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -24580,7 +24773,7 @@ registerSchema({
24580
24773
  }
24581
24774
  }
24582
24775
  });
24583
- var stockCommand = defineCommand125({
24776
+ var stockCommand = defineCommand126({
24584
24777
  meta: {
24585
24778
  name: "stock",
24586
24779
  description: "Stock search via Magnific \u2014 Freepik's developer API (~250M assets: photos, vectors, illustrations, icons, PSDs). $0.002/req. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExamples:\n baker images stock 'minimalist office'\n baker images stock 'flat office workers' --type vector\n baker images stock 'hero photo of a kitchen' --type photo --orientation landscape --ai exclude\n baker images stock 'brand pattern' --color '#0a0a0a' --license freemium --auto-ingest 2"
@@ -24636,7 +24829,7 @@ var stockCommand = defineCommand125({
24636
24829
  });
24637
24830
 
24638
24831
  // src/lib/tags-command.ts
24639
- import { defineCommand as defineCommand126 } from "citty";
24832
+ import { defineCommand as defineCommand127 } from "citty";
24640
24833
  function makeTagsCommand(command, label, endpoint) {
24641
24834
  registerSchema({
24642
24835
  command: `${command}.tags`,
@@ -24645,7 +24838,7 @@ function makeTagsCommand(command, label, endpoint) {
24645
24838
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
24646
24839
  }
24647
24840
  });
24648
- return defineCommand126({
24841
+ return defineCommand127({
24649
24842
  meta: {
24650
24843
  name: "tags",
24651
24844
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -24681,7 +24874,7 @@ function makeTagsCommand(command, label, endpoint) {
24681
24874
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
24682
24875
 
24683
24876
  // src/commands/images/upload.ts
24684
- import { defineCommand as defineCommand127 } from "citty";
24877
+ import { defineCommand as defineCommand128 } from "citty";
24685
24878
  registerSchema({
24686
24879
  command: "images.upload",
24687
24880
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -24719,7 +24912,7 @@ registerSchema({
24719
24912
  function isRemoteUrl2(value) {
24720
24913
  return /^https?:\/\//i.test(value);
24721
24914
  }
24722
- var uploadCommand = defineCommand127({
24915
+ var uploadCommand = defineCommand128({
24723
24916
  meta: {
24724
24917
  name: "upload",
24725
24918
  description: "Upload an image to the library \u2014 accepts a local file path OR a remote http(s) URL.\n\nLocal: reads bytes, sends to /api/images/upload, content-type auto-detected from extension.\nRemote: dispatches to /api/images/ingest with hash-dedup on bytes + externalId.\n\nExamples:\n baker images upload ./logo.png --source uploaded\n baker images upload ./cert.png --context 'ISO 27001 badge \u2014 enterprise tier'\n baker images upload https://acme.com/hero.png --source firecrawl --context 'Acme competitor pricing hero'"
@@ -24812,7 +25005,7 @@ async function uploadLocal(target, args) {
24812
25005
  }
24813
25006
 
24814
25007
  // src/commands/images/upscale.ts
24815
- import { defineCommand as defineCommand128 } from "citty";
25008
+ import { defineCommand as defineCommand129 } from "citty";
24816
25009
  registerSchema({
24817
25010
  command: "images.upscale",
24818
25011
  description: "Upscale a library image via the backend (Replicate, cost-tracked). Waits for completion by default. The image must be status 'ready' and raster (not SVG/AVIF).",
@@ -24827,7 +25020,7 @@ registerSchema({
24827
25020
  }
24828
25021
  });
24829
25022
  var POLL_INTERVAL_MS3 = 1500;
24830
- var upscaleCommand = defineCommand128({
25023
+ var upscaleCommand = defineCommand129({
24831
25024
  meta: {
24832
25025
  name: "upscale",
24833
25026
  description: "Upscale a library image via the Convex backend (Replicate, cost-tracked at $0.05/image). Waits for completion by default.\n\nExample: baker images upscale j571abc123def\nExample: baker images upscale j571abc123def --max-wait 0 # fire-and-forget"
@@ -24882,7 +25075,7 @@ var upscaleCommand = defineCommand128({
24882
25075
  });
24883
25076
 
24884
25077
  // src/commands/images/use.ts
24885
- import { defineCommand as defineCommand129 } from "citty";
25078
+ import { defineCommand as defineCommand130 } from "citty";
24886
25079
  registerSchema({
24887
25080
  command: "images.use",
24888
25081
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -24898,7 +25091,7 @@ registerSchema({
24898
25091
  }
24899
25092
  });
24900
25093
  var POLL_INTERVAL_MS4 = 1500;
24901
- var useCommand = defineCommand129({
25094
+ var useCommand = defineCommand130({
24902
25095
  meta: {
24903
25096
  name: "use",
24904
25097
  description: "Sugar over `ingest`: download \u2192 store \u2192 wait until describe + embed complete \u2192 return ready library record.\n\nExample: baker images use https://cdn.example.com/hero.png --source uploaded"
@@ -24944,7 +25137,7 @@ var useCommand = defineCommand129({
24944
25137
  });
24945
25138
 
24946
25139
  // src/commands/images/index.ts
24947
- var imagesCommand = defineCommand130({
25140
+ var imagesCommand = defineCommand131({
24948
25141
  meta: {
24949
25142
  name: "images",
24950
25143
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -25014,7 +25207,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
25014
25207
  });
25015
25208
 
25016
25209
  // src/commands/mcp/index.ts
25017
- import { defineCommand as defineCommand131 } from "citty";
25210
+ import { defineCommand as defineCommand132 } from "citty";
25018
25211
  var SCOPES = ["user", "user_org", "company", "org"];
25019
25212
  function parseScope(raw) {
25020
25213
  const scope = raw === void 0 ? "company" : String(raw);
@@ -25053,7 +25246,7 @@ registerSchema({
25053
25246
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
25054
25247
  args: {}
25055
25248
  });
25056
- var listCommand6 = defineCommand131({
25249
+ var listCommand6 = defineCommand132({
25057
25250
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
25058
25251
  run: async () => {
25059
25252
  try {
@@ -25078,7 +25271,7 @@ registerSchema({
25078
25271
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
25079
25272
  }
25080
25273
  });
25081
- var addCommand = defineCommand131({
25274
+ var addCommand = defineCommand132({
25082
25275
  meta: {
25083
25276
  name: "add",
25084
25277
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -25119,7 +25312,7 @@ registerSchema({
25119
25312
  description: "Remove a company custom MCP server by name.",
25120
25313
  args: { name: { type: "string", description: "Server name to remove", required: true } }
25121
25314
  });
25122
- var removeCommand4 = defineCommand131({
25315
+ var removeCommand4 = defineCommand132({
25123
25316
  meta: {
25124
25317
  name: "remove",
25125
25318
  description: `Remove a company custom MCP server by name.
@@ -25141,7 +25334,7 @@ Example:
25141
25334
  }
25142
25335
  }
25143
25336
  });
25144
- var mcpCommand = defineCommand131({
25337
+ var mcpCommand = defineCommand132({
25145
25338
  meta: {
25146
25339
  name: "mcp",
25147
25340
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -25165,10 +25358,10 @@ Examples:
25165
25358
  });
25166
25359
 
25167
25360
  // src/commands/research/index.ts
25168
- import { defineCommand as defineCommand142 } from "citty";
25361
+ import { defineCommand as defineCommand143 } from "citty";
25169
25362
 
25170
25363
  // src/commands/research/advertisers.ts
25171
- import { defineCommand as defineCommand132 } from "citty";
25364
+ import { defineCommand as defineCommand133 } from "citty";
25172
25365
 
25173
25366
  // src/commands/research/output.ts
25174
25367
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -25281,7 +25474,7 @@ var FIELDS3 = {
25281
25474
  etv: "Estimated traffic value (USD)",
25282
25475
  visibility: "SERP visibility score (0-1)"
25283
25476
  };
25284
- var advertisersCommand = defineCommand132({
25477
+ var advertisersCommand = defineCommand133({
25285
25478
  meta: {
25286
25479
  name: "advertisers",
25287
25480
  description: `Find domains competing for a keyword in Google SERPs.
@@ -25328,7 +25521,7 @@ Examples:
25328
25521
  });
25329
25522
 
25330
25523
  // src/commands/research/autocomplete.ts
25331
- import { defineCommand as defineCommand133 } from "citty";
25524
+ import { defineCommand as defineCommand134 } from "citty";
25332
25525
  registerSchema({
25333
25526
  command: "research.autocomplete",
25334
25527
  description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -25351,7 +25544,7 @@ registerSchema({
25351
25544
  var FIELDS4 = {
25352
25545
  suggestion: "Autocomplete suggestion from Google"
25353
25546
  };
25354
- var autocompleteCommand = defineCommand133({
25547
+ var autocompleteCommand = defineCommand134({
25355
25548
  meta: {
25356
25549
  name: "autocomplete",
25357
25550
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -25397,7 +25590,7 @@ Examples:
25397
25590
  });
25398
25591
 
25399
25592
  // src/commands/research/countries.ts
25400
- import { defineCommand as defineCommand134 } from "citty";
25593
+ import { defineCommand as defineCommand135 } from "citty";
25401
25594
  registerSchema({
25402
25595
  command: "research.countries",
25403
25596
  description: "List all supported country codes for --location flag in research commands.",
@@ -25454,7 +25647,7 @@ var FIELDS5 = {
25454
25647
  code: "Country code to pass as --location",
25455
25648
  name: "Country name"
25456
25649
  };
25457
- var countriesCommand = defineCommand134({
25650
+ var countriesCommand = defineCommand135({
25458
25651
  meta: {
25459
25652
  name: "countries",
25460
25653
  description: "List all supported country codes for --location flag."
@@ -25465,7 +25658,7 @@ var countriesCommand = defineCommand134({
25465
25658
  });
25466
25659
 
25467
25660
  // src/commands/research/intent.ts
25468
- import { defineCommand as defineCommand135 } from "citty";
25661
+ import { defineCommand as defineCommand136 } from "citty";
25469
25662
  registerSchema({
25470
25663
  command: "research.intent",
25471
25664
  description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
@@ -25488,7 +25681,7 @@ var FIELDS6 = {
25488
25681
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
25489
25682
  probability: "Confidence score 0.0-1.0"
25490
25683
  };
25491
- var intentCommand = defineCommand135({
25684
+ var intentCommand = defineCommand136({
25492
25685
  meta: {
25493
25686
  name: "intent",
25494
25687
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -25536,7 +25729,7 @@ Examples:
25536
25729
  });
25537
25730
 
25538
25731
  // src/commands/research/keyword-gap.ts
25539
- import { defineCommand as defineCommand136 } from "citty";
25732
+ import { defineCommand as defineCommand137 } from "citty";
25540
25733
  registerSchema({
25541
25734
  command: "research.keyword-gap",
25542
25735
  description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -25565,7 +25758,7 @@ var FIELDS7 = {
25565
25758
  cpc: "Cost per click USD",
25566
25759
  their_position: "Competitor's ranking position"
25567
25760
  };
25568
- var keywordGapCommand = defineCommand136({
25761
+ var keywordGapCommand = defineCommand137({
25569
25762
  meta: {
25570
25763
  name: "keyword-gap",
25571
25764
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -25639,7 +25832,7 @@ Examples:
25639
25832
  });
25640
25833
 
25641
25834
  // src/commands/research/keywords-for-site.ts
25642
- import { defineCommand as defineCommand137 } from "citty";
25835
+ import { defineCommand as defineCommand138 } from "citty";
25643
25836
  registerSchema({
25644
25837
  command: "research.keywords-for-site",
25645
25838
  description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -25672,7 +25865,7 @@ var FIELDS8 = {
25672
25865
  competition: "LOW, MEDIUM, or HIGH",
25673
25866
  competition_index: "Competition score 0-100"
25674
25867
  };
25675
- var keywordsForSiteCommand = defineCommand137({
25868
+ var keywordsForSiteCommand = defineCommand138({
25676
25869
  meta: {
25677
25870
  name: "keywords-for-site",
25678
25871
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -25725,7 +25918,7 @@ Examples:
25725
25918
  });
25726
25919
 
25727
25920
  // src/commands/research/languages.ts
25728
- import { defineCommand as defineCommand138 } from "citty";
25921
+ import { defineCommand as defineCommand139 } from "citty";
25729
25922
  registerSchema({
25730
25923
  command: "research.languages",
25731
25924
  description: "List all supported language codes for --language flag in research commands.",
@@ -25755,7 +25948,7 @@ var FIELDS9 = {
25755
25948
  code: "Language code to pass as --language",
25756
25949
  name: "Language name (also accepted by --language)"
25757
25950
  };
25758
- var languagesCommand2 = defineCommand138({
25951
+ var languagesCommand2 = defineCommand139({
25759
25952
  meta: {
25760
25953
  name: "languages",
25761
25954
  description: "List all supported language codes for --language flag."
@@ -25766,7 +25959,7 @@ var languagesCommand2 = defineCommand138({
25766
25959
  });
25767
25960
 
25768
25961
  // src/commands/research/lighthouse.ts
25769
- import { defineCommand as defineCommand139 } from "citty";
25962
+ import { defineCommand as defineCommand140 } from "citty";
25770
25963
  registerSchema({
25771
25964
  command: "research.lighthouse",
25772
25965
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -25785,7 +25978,7 @@ var FIELDS10 = {
25785
25978
  speed_index_ms: "Speed Index in ms (good: < 3400)",
25786
25979
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
25787
25980
  };
25788
- var lighthouseCommand = defineCommand139({
25981
+ var lighthouseCommand = defineCommand140({
25789
25982
  meta: {
25790
25983
  name: "lighthouse",
25791
25984
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -25823,7 +26016,7 @@ Examples:
25823
26016
  });
25824
26017
 
25825
26018
  // src/commands/research/relevant-pages.ts
25826
- import { defineCommand as defineCommand140 } from "citty";
26019
+ import { defineCommand as defineCommand141 } from "citty";
25827
26020
  registerSchema({
25828
26021
  command: "research.relevant-pages",
25829
26022
  description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -25849,7 +26042,7 @@ var FIELDS11 = {
25849
26042
  keywords: "Total organic keywords the page ranks for",
25850
26043
  top_10: "Keywords in positions 1-10"
25851
26044
  };
25852
- var relevantPagesCommand = defineCommand140({
26045
+ var relevantPagesCommand = defineCommand141({
25853
26046
  meta: {
25854
26047
  name: "relevant-pages",
25855
26048
  description: `Get the top pages of a competitor domain with traffic data.
@@ -25895,7 +26088,7 @@ Examples:
25895
26088
  });
25896
26089
 
25897
26090
  // src/commands/research/web.ts
25898
- import { defineCommand as defineCommand141 } from "citty";
26091
+ import { defineCommand as defineCommand142 } from "citty";
25899
26092
  registerSchema({
25900
26093
  command: "research.web",
25901
26094
  description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
@@ -25946,7 +26139,7 @@ async function runDeepResearch(question) {
25946
26139
  }
25947
26140
  throw new Error("Deep research timed out");
25948
26141
  }
25949
- var webCommand = defineCommand141({
26142
+ var webCommand = defineCommand142({
25950
26143
  meta: {
25951
26144
  name: "web",
25952
26145
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -26006,7 +26199,7 @@ Examples:
26006
26199
  });
26007
26200
 
26008
26201
  // src/commands/research/index.ts
26009
- var researchCommand = defineCommand142({
26202
+ var researchCommand = defineCommand143({
26010
26203
  meta: {
26011
26204
  name: "research",
26012
26205
  description: `Competitive intelligence and AI-powered research commands.
@@ -26046,10 +26239,10 @@ Examples:
26046
26239
  });
26047
26240
 
26048
26241
  // src/commands/scheduled-actions/index.ts
26049
- import { defineCommand as defineCommand149 } from "citty";
26242
+ import { defineCommand as defineCommand150 } from "citty";
26050
26243
 
26051
26244
  // src/commands/scheduled-actions/create.ts
26052
- import { defineCommand as defineCommand143 } from "citty";
26245
+ import { defineCommand as defineCommand144 } from "citty";
26053
26246
 
26054
26247
  // src/commands/scheduled-actions/shared.ts
26055
26248
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -26164,7 +26357,7 @@ registerSchema({
26164
26357
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
26165
26358
  }
26166
26359
  });
26167
- var createCommand2 = defineCommand143({
26360
+ var createCommand2 = defineCommand144({
26168
26361
  meta: {
26169
26362
  name: "create",
26170
26363
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -26213,7 +26406,7 @@ var createCommand2 = defineCommand143({
26213
26406
  });
26214
26407
 
26215
26408
  // src/commands/scheduled-actions/delete.ts
26216
- import { defineCommand as defineCommand144 } from "citty";
26409
+ import { defineCommand as defineCommand145 } from "citty";
26217
26410
  registerSchema({
26218
26411
  command: "scheduled-actions.delete",
26219
26412
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -26221,7 +26414,7 @@ registerSchema({
26221
26414
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26222
26415
  }
26223
26416
  });
26224
- var deleteCommand2 = defineCommand144({
26417
+ var deleteCommand2 = defineCommand145({
26225
26418
  meta: {
26226
26419
  name: "delete",
26227
26420
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -26250,7 +26443,7 @@ var deleteCommand2 = defineCommand144({
26250
26443
  });
26251
26444
 
26252
26445
  // src/commands/scheduled-actions/get.ts
26253
- import { defineCommand as defineCommand145 } from "citty";
26446
+ import { defineCommand as defineCommand146 } from "citty";
26254
26447
  registerSchema({
26255
26448
  command: "scheduled-actions.get",
26256
26449
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -26258,7 +26451,7 @@ registerSchema({
26258
26451
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
26259
26452
  }
26260
26453
  });
26261
- var getCommand3 = defineCommand145({
26454
+ var getCommand3 = defineCommand146({
26262
26455
  meta: {
26263
26456
  name: "get",
26264
26457
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -26295,13 +26488,13 @@ var getCommand3 = defineCommand145({
26295
26488
  });
26296
26489
 
26297
26490
  // src/commands/scheduled-actions/list.ts
26298
- import { defineCommand as defineCommand146 } from "citty";
26491
+ import { defineCommand as defineCommand147 } from "citty";
26299
26492
  registerSchema({
26300
26493
  command: "scheduled-actions.list",
26301
26494
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
26302
26495
  args: {}
26303
26496
  });
26304
- var listCommand7 = defineCommand146({
26497
+ var listCommand7 = defineCommand147({
26305
26498
  meta: {
26306
26499
  name: "list",
26307
26500
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -26322,7 +26515,7 @@ var listCommand7 = defineCommand146({
26322
26515
  });
26323
26516
 
26324
26517
  // src/commands/scheduled-actions/trigger.ts
26325
- import { defineCommand as defineCommand147 } from "citty";
26518
+ import { defineCommand as defineCommand148 } from "citty";
26326
26519
  registerSchema({
26327
26520
  command: "scheduled-actions.trigger",
26328
26521
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -26330,7 +26523,7 @@ registerSchema({
26330
26523
  id: { type: "string", description: "Published scheduled action ID", required: true }
26331
26524
  }
26332
26525
  });
26333
- var triggerCommand = defineCommand147({
26526
+ var triggerCommand = defineCommand148({
26334
26527
  meta: {
26335
26528
  name: "trigger",
26336
26529
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -26367,7 +26560,7 @@ var triggerCommand = defineCommand147({
26367
26560
  });
26368
26561
 
26369
26562
  // src/commands/scheduled-actions/update.ts
26370
- import { defineCommand as defineCommand148 } from "citty";
26563
+ import { defineCommand as defineCommand149 } from "citty";
26371
26564
  registerSchema({
26372
26565
  command: "scheduled-actions.update",
26373
26566
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -26392,7 +26585,7 @@ registerSchema({
26392
26585
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
26393
26586
  }
26394
26587
  });
26395
- var updateCommand2 = defineCommand148({
26588
+ var updateCommand2 = defineCommand149({
26396
26589
  meta: {
26397
26590
  name: "update",
26398
26591
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -26463,7 +26656,7 @@ var updateCommand2 = defineCommand148({
26463
26656
  });
26464
26657
 
26465
26658
  // src/commands/scheduled-actions/index.ts
26466
- var scheduledActionsCommand = defineCommand149({
26659
+ var scheduledActionsCommand = defineCommand150({
26467
26660
  meta: {
26468
26661
  name: "scheduled-actions",
26469
26662
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -26489,8 +26682,8 @@ Examples:
26489
26682
  });
26490
26683
 
26491
26684
  // src/commands/schema.ts
26492
- import { defineCommand as defineCommand150 } from "citty";
26493
- var schemaCommand = defineCommand150({
26685
+ import { defineCommand as defineCommand151 } from "citty";
26686
+ var schemaCommand = defineCommand151({
26494
26687
  meta: {
26495
26688
  name: "schema",
26496
26689
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -26526,7 +26719,7 @@ var schemaCommand = defineCommand150({
26526
26719
  });
26527
26720
 
26528
26721
  // src/commands/tags/index.ts
26529
- import { defineCommand as defineCommand151 } from "citty";
26722
+ import { defineCommand as defineCommand152 } from "citty";
26530
26723
 
26531
26724
  // src/commands/tags/shared.ts
26532
26725
  function failApi3(err) {
@@ -26592,7 +26785,7 @@ async function listTags(json) {
26592
26785
  failApi3(err);
26593
26786
  }
26594
26787
  }
26595
- var listCommand8 = defineCommand151({
26788
+ var listCommand8 = defineCommand152({
26596
26789
  meta: {
26597
26790
  name: "list",
26598
26791
  description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
@@ -26611,7 +26804,7 @@ async function listDraft3() {
26611
26804
  failApi3(err);
26612
26805
  }
26613
26806
  }
26614
- var draftCommand3 = defineCommand151({
26807
+ var draftCommand3 = defineCommand152({
26615
26808
  meta: {
26616
26809
  name: "draft",
26617
26810
  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)."
@@ -26620,7 +26813,7 @@ var draftCommand3 = defineCommand151({
26620
26813
  await listDraft3();
26621
26814
  }
26622
26815
  });
26623
- var tagsCommand3 = defineCommand151({
26816
+ var tagsCommand3 = defineCommand152({
26624
26817
  meta: {
26625
26818
  name: "tags",
26626
26819
  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.
@@ -26645,10 +26838,10 @@ Examples:
26645
26838
  });
26646
26839
 
26647
26840
  // src/commands/testimonials/index.ts
26648
- import { defineCommand as defineCommand155 } from "citty";
26841
+ import { defineCommand as defineCommand156 } from "citty";
26649
26842
 
26650
26843
  // src/commands/testimonials/get.ts
26651
- import { defineCommand as defineCommand152 } from "citty";
26844
+ import { defineCommand as defineCommand153 } from "citty";
26652
26845
  registerSchema({
26653
26846
  command: "testimonials.get",
26654
26847
  description: "Get a single testimonial by ID",
@@ -26656,7 +26849,7 @@ registerSchema({
26656
26849
  id: { type: "string", description: "Testimonial ID", required: true }
26657
26850
  }
26658
26851
  });
26659
- var getCommand4 = defineCommand152({
26852
+ var getCommand4 = defineCommand153({
26660
26853
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
26661
26854
  args: {
26662
26855
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -26693,7 +26886,7 @@ var getCommand4 = defineCommand152({
26693
26886
  });
26694
26887
 
26695
26888
  // src/commands/testimonials/list.ts
26696
- import { defineCommand as defineCommand153 } from "citty";
26889
+ import { defineCommand as defineCommand154 } from "citty";
26697
26890
  registerSchema({
26698
26891
  command: "testimonials.list",
26699
26892
  description: "List testimonials with optional filters.",
@@ -26723,7 +26916,7 @@ registerSchema({
26723
26916
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
26724
26917
  }
26725
26918
  });
26726
- var listCommand9 = defineCommand153({
26919
+ var listCommand9 = defineCommand154({
26727
26920
  meta: {
26728
26921
  name: "list",
26729
26922
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -26772,7 +26965,7 @@ var listCommand9 = defineCommand153({
26772
26965
  });
26773
26966
 
26774
26967
  // src/commands/testimonials/search.ts
26775
- import { defineCommand as defineCommand154 } from "citty";
26968
+ import { defineCommand as defineCommand155 } from "citty";
26776
26969
  registerSchema({
26777
26970
  command: "testimonials.search",
26778
26971
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -26803,7 +26996,7 @@ registerSchema({
26803
26996
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
26804
26997
  }
26805
26998
  });
26806
- var searchCommand2 = defineCommand154({
26999
+ var searchCommand2 = defineCommand155({
26807
27000
  meta: {
26808
27001
  name: "search",
26809
27002
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -26877,7 +27070,7 @@ var searchCommand2 = defineCommand154({
26877
27070
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
26878
27071
 
26879
27072
  // src/commands/testimonials/index.ts
26880
- var testimonialsCommand = defineCommand155({
27073
+ var testimonialsCommand = defineCommand156({
26881
27074
  meta: {
26882
27075
  name: "testimonials",
26883
27076
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -26898,10 +27091,10 @@ Examples:
26898
27091
  });
26899
27092
 
26900
27093
  // src/commands/videos/index.ts
26901
- import { defineCommand as defineCommand160 } from "citty";
27094
+ import { defineCommand as defineCommand161 } from "citty";
26902
27095
 
26903
27096
  // src/commands/videos/delete.ts
26904
- import { defineCommand as defineCommand156 } from "citty";
27097
+ import { defineCommand as defineCommand157 } from "citty";
26905
27098
  registerSchema({
26906
27099
  command: "videos.delete",
26907
27100
  description: "Delete a video by ID",
@@ -26915,7 +27108,7 @@ registerSchema({
26915
27108
  }
26916
27109
  }
26917
27110
  });
26918
- var deleteCommand3 = defineCommand156({
27111
+ var deleteCommand3 = defineCommand157({
26919
27112
  meta: {
26920
27113
  name: "delete",
26921
27114
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -26956,7 +27149,7 @@ var deleteCommand3 = defineCommand156({
26956
27149
  });
26957
27150
 
26958
27151
  // src/commands/videos/get.ts
26959
- import { defineCommand as defineCommand157 } from "citty";
27152
+ import { defineCommand as defineCommand158 } from "citty";
26960
27153
  registerSchema({
26961
27154
  command: "videos.get",
26962
27155
  description: "Get a single video by ID",
@@ -26964,7 +27157,7 @@ registerSchema({
26964
27157
  id: { type: "string", description: "Video ID", required: true }
26965
27158
  }
26966
27159
  });
26967
- var getCommand5 = defineCommand157({
27160
+ var getCommand5 = defineCommand158({
26968
27161
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
26969
27162
  args: {
26970
27163
  id: { type: "positional", description: "Video ID", required: false },
@@ -27001,7 +27194,7 @@ var getCommand5 = defineCommand157({
27001
27194
  });
27002
27195
 
27003
27196
  // src/commands/videos/search.ts
27004
- import { defineCommand as defineCommand158 } from "citty";
27197
+ import { defineCommand as defineCommand159 } from "citty";
27005
27198
  registerSchema({
27006
27199
  command: "videos.search",
27007
27200
  description: "Search videos by text query. Only returns ready videos.",
@@ -27011,7 +27204,7 @@ registerSchema({
27011
27204
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
27012
27205
  }
27013
27206
  });
27014
- var searchCommand3 = defineCommand158({
27207
+ var searchCommand3 = defineCommand159({
27015
27208
  meta: {
27016
27209
  name: "search",
27017
27210
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -27063,7 +27256,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
27063
27256
  // src/commands/videos/upload.ts
27064
27257
  import { readFile as readFile20, stat as stat5 } from "fs/promises";
27065
27258
  import { extname as extname3 } from "path";
27066
- import { defineCommand as defineCommand159 } from "citty";
27259
+ import { defineCommand as defineCommand160 } from "citty";
27067
27260
  var MIME_MAP = {
27068
27261
  ".mp4": "video/mp4",
27069
27262
  ".mov": "video/quicktime",
@@ -27097,7 +27290,7 @@ function detectContentType(filePath) {
27097
27290
  }
27098
27291
  return mime;
27099
27292
  }
27100
- var uploadCommand2 = defineCommand159({
27293
+ var uploadCommand2 = defineCommand160({
27101
27294
  meta: {
27102
27295
  name: "upload",
27103
27296
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -27151,7 +27344,7 @@ var uploadCommand2 = defineCommand159({
27151
27344
  });
27152
27345
 
27153
27346
  // src/commands/videos/index.ts
27154
- var videosCommand = defineCommand160({
27347
+ var videosCommand = defineCommand161({
27155
27348
  meta: {
27156
27349
  name: "videos",
27157
27350
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -27174,28 +27367,10 @@ Examples:
27174
27367
  });
27175
27368
 
27176
27369
  // src/commands/winning-ads/index.ts
27177
- import { defineCommand as defineCommand170 } from "citty";
27178
-
27179
- // src/commands/winning-ads/advertisers.ts
27180
- import { defineCommand as defineCommand161 } from "citty";
27181
-
27182
- // src/commands/winning-ads/shared.ts
27183
- function splitList(value) {
27184
- if (!value) {
27185
- return [];
27186
- }
27187
- return value.split(",").map((v) => v.trim()).filter(Boolean);
27188
- }
27189
- function reportError(err) {
27190
- if (err instanceof ApiError) {
27191
- writeJson({ ok: false, error: { code: err.code, message: err.message } });
27192
- process.exit(1);
27193
- }
27194
- writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
27195
- process.exit(1);
27196
- }
27370
+ import { defineCommand as defineCommand171 } from "citty";
27197
27371
 
27198
27372
  // src/commands/winning-ads/advertisers.ts
27373
+ import { defineCommand as defineCommand162 } from "citty";
27199
27374
  registerSchema({
27200
27375
  command: "winning-ads.advertisers",
27201
27376
  description: "List brands in the shared ad-dna corpus by name or domain. Use it to find your OWN advertiser (to --exclude-advertiser on search) or a competitor (to --advertiser-id on search / winners).",
@@ -27230,7 +27405,7 @@ function advertiserNormalizer(record, full) {
27230
27405
  last_synced_at: record.last_synced_at ?? null
27231
27406
  };
27232
27407
  }
27233
- var advertisersCommand2 = defineCommand161({
27408
+ var advertisersCommand2 = defineCommand162({
27234
27409
  meta: {
27235
27410
  name: "advertisers",
27236
27411
  description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
@@ -27288,7 +27463,7 @@ var advertisersCommand2 = defineCommand161({
27288
27463
  });
27289
27464
 
27290
27465
  // src/commands/winning-ads/brief.ts
27291
- import { defineCommand as defineCommand162 } from "citty";
27466
+ import { defineCommand as defineCommand163 } from "citty";
27292
27467
  registerSchema({
27293
27468
  command: "winning-ads.brief",
27294
27469
  description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
@@ -27334,7 +27509,7 @@ function parseDna(raw) {
27334
27509
  }
27335
27510
  return parsed;
27336
27511
  }
27337
- var briefCommand = defineCommand162({
27512
+ var briefCommand = defineCommand163({
27338
27513
  meta: {
27339
27514
  name: "brief",
27340
27515
  description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
@@ -27370,7 +27545,7 @@ var briefCommand = defineCommand162({
27370
27545
  });
27371
27546
 
27372
27547
  // src/commands/winning-ads/follow.ts
27373
- import { defineCommand as defineCommand163 } from "citty";
27548
+ import { defineCommand as defineCommand164 } from "citty";
27374
27549
  var PLATFORMS = ["meta", "linkedin"];
27375
27550
  registerSchema({
27376
27551
  command: "winning-ads.follow",
@@ -27385,7 +27560,7 @@ registerSchema({
27385
27560
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
27386
27561
  }
27387
27562
  });
27388
- var followCommand = defineCommand163({
27563
+ var followCommand = defineCommand164({
27389
27564
  meta: {
27390
27565
  name: "follow",
27391
27566
  description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
@@ -27432,7 +27607,7 @@ var followCommand = defineCommand163({
27432
27607
  });
27433
27608
 
27434
27609
  // src/commands/winning-ads/following.ts
27435
- import { defineCommand as defineCommand164 } from "citty";
27610
+ import { defineCommand as defineCommand165 } from "citty";
27436
27611
  registerSchema({
27437
27612
  command: "winning-ads.following",
27438
27613
  description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
@@ -27465,7 +27640,7 @@ function followingNormalizer(record, full) {
27465
27640
  platforms: Array.isArray(record.platforms) ? record.platforms : []
27466
27641
  };
27467
27642
  }
27468
- var followingCommand = defineCommand164({
27643
+ var followingCommand = defineCommand165({
27469
27644
  meta: {
27470
27645
  name: "following",
27471
27646
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -27500,7 +27675,7 @@ var followingCommand = defineCommand164({
27500
27675
  });
27501
27676
 
27502
27677
  // src/commands/winning-ads/patterns.ts
27503
- import { defineCommand as defineCommand165 } from "citty";
27678
+ import { defineCommand as defineCommand166 } from "citty";
27504
27679
  registerSchema({
27505
27680
  command: "winning-ads.patterns",
27506
27681
  description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
@@ -27539,7 +27714,7 @@ function discriminatorRow(record) {
27539
27714
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
27540
27715
  };
27541
27716
  }
27542
- var patternsCommand = defineCommand165({
27717
+ var patternsCommand = defineCommand166({
27543
27718
  meta: {
27544
27719
  name: "patterns",
27545
27720
  description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
@@ -27595,7 +27770,7 @@ var patternsCommand = defineCommand165({
27595
27770
  });
27596
27771
 
27597
27772
  // src/commands/winning-ads/search.ts
27598
- import { defineCommand as defineCommand166 } from "citty";
27773
+ import { defineCommand as defineCommand167 } from "citty";
27599
27774
  registerSchema({
27600
27775
  command: "winning-ads.search",
27601
27776
  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.",
@@ -27703,7 +27878,7 @@ function buildSearchBody(args) {
27703
27878
  }
27704
27879
  return body;
27705
27880
  }
27706
- var searchCommand4 = defineCommand166({
27881
+ var searchCommand4 = defineCommand167({
27707
27882
  meta: {
27708
27883
  name: "search",
27709
27884
  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"
@@ -27818,7 +27993,7 @@ var searchCommand4 = defineCommand166({
27818
27993
  });
27819
27994
 
27820
27995
  // src/commands/winning-ads/seeds.ts
27821
- import { defineCommand as defineCommand167 } from "citty";
27996
+ import { defineCommand as defineCommand168 } from "citty";
27822
27997
  function leanRow(r) {
27823
27998
  return {
27824
27999
  key: r.key,
@@ -27846,7 +28021,7 @@ function makeSeedCommand(opts) {
27846
28021
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
27847
28022
  }
27848
28023
  });
27849
- return defineCommand167({
28024
+ return defineCommand168({
27850
28025
  meta: { name: opts.name, description: opts.description },
27851
28026
  args: {
27852
28027
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -27895,7 +28070,7 @@ var formatsCommand = makeSeedCommand({
27895
28070
  });
27896
28071
 
27897
28072
  // src/commands/winning-ads/unfollow.ts
27898
- import { defineCommand as defineCommand168 } from "citty";
28073
+ import { defineCommand as defineCommand169 } from "citty";
27899
28074
  registerSchema({
27900
28075
  command: "winning-ads.unfollow",
27901
28076
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -27903,7 +28078,7 @@ registerSchema({
27903
28078
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
27904
28079
  }
27905
28080
  });
27906
- var unfollowCommand = defineCommand168({
28081
+ var unfollowCommand = defineCommand169({
27907
28082
  meta: {
27908
28083
  name: "unfollow",
27909
28084
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -27924,7 +28099,7 @@ var unfollowCommand = defineCommand168({
27924
28099
  });
27925
28100
 
27926
28101
  // src/commands/winning-ads/winners.ts
27927
- import { defineCommand as defineCommand169 } from "citty";
28102
+ import { defineCommand as defineCommand170 } from "citty";
27928
28103
  registerSchema({
27929
28104
  command: "winning-ads.winners",
27930
28105
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -27934,7 +28109,7 @@ registerSchema({
27934
28109
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
27935
28110
  }
27936
28111
  });
27937
- var winnersCommand = defineCommand169({
28112
+ var winnersCommand = defineCommand170({
27938
28113
  meta: {
27939
28114
  name: "winners",
27940
28115
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -27984,7 +28159,7 @@ var winnersCommand = defineCommand169({
27984
28159
  });
27985
28160
 
27986
28161
  // src/commands/winning-ads/index.ts
27987
- var winningAdsCommand = defineCommand170({
28162
+ var winningAdsCommand = defineCommand171({
27988
28163
  meta: {
27989
28164
  name: "winning-ads",
27990
28165
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -28045,7 +28220,7 @@ function getCliVersion() {
28045
28220
  }
28046
28221
 
28047
28222
  // src/cli.ts
28048
- var main = defineCommand171({
28223
+ var main = defineCommand172({
28049
28224
  meta: {
28050
28225
  name: "baker",
28051
28226
  version: getCliVersion(),
@@ -28061,6 +28236,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28061
28236
  actions: actionsCommand,
28062
28237
  "scheduled-actions": scheduledActionsCommand,
28063
28238
  ads: adsCommand2,
28239
+ analytics: analyticsCommand2,
28064
28240
  ga4: ga4Command,
28065
28241
  gsc: gscCommand,
28066
28242
  research: researchCommand,
@@ -28076,5 +28252,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
28076
28252
  schema: schemaCommand
28077
28253
  }
28078
28254
  });
28255
+ installStreamTaps();
28256
+ logInvocation(process.argv.slice(2));
28079
28257
  runMain(main);
28080
28258
  //# sourceMappingURL=cli.js.map