@koda-sl/baker-cli 0.122.0-dev.fff192e73 → 0.122.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  generateCatalog,
14
14
  resolveConcurrency,
15
15
  validateCanvasDeep
16
- } from "./chunk-MWFJ5NOP.js";
16
+ } from "./chunk-IWPAXJC3.js";
17
17
  import {
18
18
  csvOrJson,
19
19
  daysAgoIso,
@@ -49,7 +49,7 @@ import {
49
49
  import "./chunk-5WRI5ZAA.js";
50
50
 
51
51
  // src/cli.ts
52
- import { defineCommand as defineCommand162, runMain } from "citty";
52
+ import { defineCommand as defineCommand161, runMain } from "citty";
53
53
 
54
54
  // src/commands/actions/index.ts
55
55
  import { defineCommand as defineCommand18 } from "citty";
@@ -1613,134 +1613,9 @@ var linkedinDraftErrorResponseSchema = z3.object({
1613
1613
  fields: z3.array(linkedinFieldErrorSchema).optional()
1614
1614
  });
1615
1615
 
1616
- // ../api/src/flows.ts
1617
- import { z as z4 } from "zod";
1618
- var FLOW_SECRET_SIDE_EFFECT_TYPES = [
1619
- "email",
1620
- "zapier",
1621
- "httpWebhook",
1622
- "pipedrive",
1623
- "googleSpreadsheet",
1624
- "hubspotForm",
1625
- "crmble",
1626
- "goHighlevelContact"
1627
- ];
1628
- var flowSideEffectTypeSchema = z4.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
1629
- var FLOW_SECRET_FIELDS = {
1630
- email: [],
1631
- zapier: ["zapUrl"],
1632
- httpWebhook: ["bearerToken", "apiKeyValue", "password"],
1633
- pipedrive: [],
1634
- googleSpreadsheet: [],
1635
- hubspotForm: [],
1636
- crmble: ["apiToken"],
1637
- goHighlevelContact: []
1638
- };
1639
- var FLOW_OAUTH_SIDE_EFFECT_TYPES = [
1640
- "pipedrive",
1641
- "googleSpreadsheet",
1642
- "hubspotForm",
1643
- "goHighlevelContact"
1644
- ];
1645
- function isFlowOauthSideEffect(type) {
1646
- return FLOW_OAUTH_SIDE_EFFECT_TYPES.includes(type);
1647
- }
1648
- var FLOW_RESOURCE_NODE_TYPES = [
1649
- "calendly",
1650
- "savvycal",
1651
- "hubspot",
1652
- "hubspotMeeting",
1653
- "highlevel",
1654
- "highlevelForm"
1655
- ];
1656
- var flowResourceNodeTypeSchema = z4.enum(FLOW_RESOURCE_NODE_TYPES);
1657
- var flowInputRequestSchema = z4.discriminatedUnion("target", [
1658
- z4.object({
1659
- /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
1660
- target: z4.literal("sideEffect"),
1661
- flowSlug: z4.string(),
1662
- /** `id` of the FlowNode holding the side effect. */
1663
- nodeId: z4.string(),
1664
- /** `id` of the side effect within that node's `sideEffects[]`. */
1665
- sideEffectId: z4.string(),
1666
- sideEffectType: flowSideEffectTypeSchema,
1667
- /** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
1668
- prefilledConfig: z4.record(z4.string(), z4.string()).optional(),
1669
- /** Secret credential field names the agent asks the user to provide. */
1670
- requestedSecretFields: z4.array(z4.string()).optional(),
1671
- message: z4.string().optional()
1672
- }),
1673
- z4.object({
1674
- /** Configure a widget node's third-party `form.external` (+ `providerId`). */
1675
- target: z4.literal("node"),
1676
- flowSlug: z4.string(),
1677
- /** `id` of the widget FlowNode. */
1678
- nodeId: z4.string(),
1679
- nodeType: flowResourceNodeTypeSchema,
1680
- message: z4.string().optional()
1681
- })
1682
- ]);
1683
- var flowInputToolInputSchema = z4.object({
1684
- requests: z4.array(flowInputRequestSchema).min(1).max(8)
1685
- });
1686
- var flowInputResultSchema = z4.discriminatedUnion("status", [
1687
- z4.object({
1688
- status: z4.literal("submitted"),
1689
- /** Echoes which piece this result resolves. */
1690
- nodeId: z4.string(),
1691
- sideEffectId: z4.string().optional(),
1692
- /** Names of secret fields the user provided. Never values. */
1693
- secretFieldsSet: z4.array(z4.string()),
1694
- /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
1695
- note: z4.string().optional()
1696
- }),
1697
- z4.object({
1698
- status: z4.literal("declined"),
1699
- nodeId: z4.string(),
1700
- sideEffectId: z4.string().optional(),
1701
- reason: z4.string().optional()
1702
- })
1703
- ]);
1704
- var flowInputToolResultSchema = z4.object({
1705
- results: z4.array(flowInputResultSchema)
1706
- });
1707
- var flowsListRequestSchema = z4.object({ chatId: z4.string() });
1708
- var flowSummarySchema = z4.object({
1709
- slug: z4.string(),
1710
- name: z4.string(),
1711
- /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
1712
- needsConfig: z4.number()
1713
- });
1714
- var flowsListResponseSchema = z4.object({ flows: z4.array(flowSummarySchema) });
1715
- var flowsShowRequestSchema = z4.object({
1716
- chatId: z4.string(),
1717
- slug: z4.string(),
1718
- full: z4.boolean().optional()
1719
- });
1720
- var flowConfigStatusSchema = z4.object({
1721
- nodeId: z4.string(),
1722
- nodeName: z4.string().optional(),
1723
- /** "sideEffect" credential/connection, or "node" widget resource. */
1724
- target: z4.enum(["sideEffect", "node"]),
1725
- sideEffectId: z4.string().optional(),
1726
- kind: z4.string(),
1727
- /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
1728
- status: z4.string(),
1729
- /** True when a `request_flow_input` call is still needed for this piece. */
1730
- needsInput: z4.boolean()
1731
- });
1732
- var flowsShowResponseSchema = z4.object({
1733
- slug: z4.string(),
1734
- name: z4.string(),
1735
- /** Confidential fields and whether each is configured. */
1736
- config: z4.array(flowConfigStatusSchema),
1737
- /** Present only with `--full`: the whole flow tree, secret values redacted. */
1738
- tree: z4.unknown().optional()
1739
- });
1740
-
1741
1616
  // ../api/src/images.ts
1742
- import { z as z5 } from "zod";
1743
- var imageSourceSchema = z5.enum([
1617
+ import { z as z4 } from "zod";
1618
+ var imageSourceSchema = z4.enum([
1744
1619
  "uploaded",
1745
1620
  "website",
1746
1621
  "google_testimonial",
@@ -1756,49 +1631,49 @@ var imageSourceSchema = z5.enum([
1756
1631
  "pinterest",
1757
1632
  "ai_generated"
1758
1633
  ]);
1759
- var imageStatusSchema = z5.enum(["uploading", "processing", "ready", "error"]);
1760
- var upscaleConfigSchema = z5.object({
1761
- model: z5.literal("philz1337x/crystal-upscaler"),
1762
- input: z5.object({
1763
- scale_factor: z5.number(),
1764
- creativity: z5.number(),
1765
- output_format: z5.string()
1634
+ var imageStatusSchema = z4.enum(["uploading", "processing", "ready", "error"]);
1635
+ var upscaleConfigSchema = z4.object({
1636
+ model: z4.literal("philz1337x/crystal-upscaler"),
1637
+ input: z4.object({
1638
+ scale_factor: z4.number(),
1639
+ creativity: z4.number(),
1640
+ output_format: z4.string()
1766
1641
  }),
1767
- status: z5.enum(["pending", "completed"])
1642
+ status: z4.enum(["pending", "completed"])
1768
1643
  });
1769
- var imageDocSchema = z5.object({
1770
- _id: z5.string(),
1771
- _creationTime: z5.number(),
1772
- companyId: z5.string(),
1773
- storageKey: z5.string(),
1644
+ var imageDocSchema = z4.object({
1645
+ _id: z4.string(),
1646
+ _creationTime: z4.number(),
1647
+ companyId: z4.string(),
1648
+ storageKey: z4.string(),
1774
1649
  upscaleConfig: upscaleConfigSchema.optional(),
1775
- upscaledStorageKey: z5.string().optional(),
1776
- name: z5.string(),
1777
- description: z5.string(),
1778
- tags: z5.array(z5.string()),
1779
- source: z5.string(),
1780
- externalId: z5.string().optional(),
1781
- externalUrl: z5.string().optional(),
1782
- contentHash: z5.string().optional(),
1783
- sourceId: z5.string().optional(),
1784
- descriptionContext: z5.string().optional(),
1785
- width: z5.number().optional(),
1786
- height: z5.number().optional(),
1787
- aspectRatio: z5.number().optional(),
1788
- dominantColor: z5.string().optional(),
1789
- imagePalette: z5.array(z5.string()).optional(),
1790
- thumbhashDataUri: z5.string().optional(),
1791
- isLightImage: z5.boolean().optional(),
1792
- descriptionEmbedding: z5.array(z5.number()).optional(),
1793
- imageEmbedding: z5.array(z5.number()).optional(),
1794
- searchText: z5.string().optional(),
1650
+ upscaledStorageKey: z4.string().optional(),
1651
+ name: z4.string(),
1652
+ description: z4.string(),
1653
+ tags: z4.array(z4.string()),
1654
+ source: z4.string(),
1655
+ externalId: z4.string().optional(),
1656
+ externalUrl: z4.string().optional(),
1657
+ contentHash: z4.string().optional(),
1658
+ sourceId: z4.string().optional(),
1659
+ descriptionContext: z4.string().optional(),
1660
+ width: z4.number().optional(),
1661
+ height: z4.number().optional(),
1662
+ aspectRatio: z4.number().optional(),
1663
+ dominantColor: z4.string().optional(),
1664
+ imagePalette: z4.array(z4.string()).optional(),
1665
+ thumbhashDataUri: z4.string().optional(),
1666
+ isLightImage: z4.boolean().optional(),
1667
+ descriptionEmbedding: z4.array(z4.number()).optional(),
1668
+ imageEmbedding: z4.array(z4.number()).optional(),
1669
+ searchText: z4.string().optional(),
1795
1670
  status: imageStatusSchema,
1796
- errorMessage: z5.string().optional(),
1797
- createdAt: z5.number(),
1798
- updatedAt: z5.number(),
1799
- imageUrl: z5.string()
1671
+ errorMessage: z4.string().optional(),
1672
+ createdAt: z4.number(),
1673
+ updatedAt: z4.number(),
1674
+ imageUrl: z4.string()
1800
1675
  });
1801
- var imageHitSourceSchema = z5.enum([
1676
+ var imageHitSourceSchema = z4.enum([
1802
1677
  "library",
1803
1678
  "magnific",
1804
1679
  "google_images",
@@ -1809,240 +1684,240 @@ var imageHitSourceSchema = z5.enum([
1809
1684
  "giphy",
1810
1685
  "pinterest"
1811
1686
  ]);
1812
- var imageHitSchema = z5.object({
1687
+ var imageHitSchema = z4.object({
1813
1688
  source: imageHitSourceSchema,
1814
- url: z5.string(),
1815
- thumbnailUrl: z5.string().optional(),
1816
- width: z5.number().optional(),
1817
- height: z5.number().optional(),
1818
- aspectRatio: z5.number().optional(),
1819
- dominantColor: z5.string().optional(),
1820
- externalId: z5.string().optional(),
1821
- externalUrl: z5.string().optional(),
1822
- providerMeta: z5.record(z5.string(), z5.unknown()).optional(),
1823
- descriptionContext: z5.string().optional(),
1824
- _id: z5.string().optional(),
1825
- name: z5.string().optional(),
1826
- description: z5.string().optional(),
1827
- tags: z5.array(z5.string()).optional(),
1828
- score: z5.number().optional(),
1829
- alsoInLibrary: z5.string().optional(),
1830
- prefetchedBytes: z5.string().optional(),
1831
- prefetchedContentType: z5.string().optional()
1689
+ url: z4.string(),
1690
+ thumbnailUrl: z4.string().optional(),
1691
+ width: z4.number().optional(),
1692
+ height: z4.number().optional(),
1693
+ aspectRatio: z4.number().optional(),
1694
+ dominantColor: z4.string().optional(),
1695
+ externalId: z4.string().optional(),
1696
+ externalUrl: z4.string().optional(),
1697
+ providerMeta: z4.record(z4.string(), z4.unknown()).optional(),
1698
+ descriptionContext: z4.string().optional(),
1699
+ _id: z4.string().optional(),
1700
+ name: z4.string().optional(),
1701
+ description: z4.string().optional(),
1702
+ tags: z4.array(z4.string()).optional(),
1703
+ score: z4.number().optional(),
1704
+ alsoInLibrary: z4.string().optional(),
1705
+ prefetchedBytes: z4.string().optional(),
1706
+ prefetchedContentType: z4.string().optional()
1832
1707
  });
1833
1708
  var ingestedImageHitSchema = imageHitSchema.extend({
1834
- imageId: z5.string().optional(),
1835
- imageUrl: z5.string().optional(),
1836
- deduped: z5.boolean().optional(),
1837
- sourceUrl: z5.string().optional()
1838
- });
1839
- var autoIngestItemSchema = z5.object({
1840
- imageId: z5.string(),
1841
- deduped: z5.boolean(),
1842
- imageUrl: z5.string(),
1843
- sourceUrl: z5.string(),
1844
- externalUrl: z5.string().optional()
1709
+ imageId: z4.string().optional(),
1710
+ imageUrl: z4.string().optional(),
1711
+ deduped: z4.boolean().optional(),
1712
+ sourceUrl: z4.string().optional()
1713
+ });
1714
+ var autoIngestItemSchema = z4.object({
1715
+ imageId: z4.string(),
1716
+ deduped: z4.boolean(),
1717
+ imageUrl: z4.string(),
1718
+ sourceUrl: z4.string(),
1719
+ externalUrl: z4.string().optional()
1845
1720
  });
1846
1721
  function providerHitsResponseSchema() {
1847
- return z5.object({
1848
- hits: z5.array(ingestedImageHitSchema),
1849
- ingested: z5.array(autoIngestItemSchema)
1722
+ return z4.object({
1723
+ hits: z4.array(ingestedImageHitSchema),
1724
+ ingested: z4.array(autoIngestItemSchema)
1850
1725
  });
1851
1726
  }
1852
- var imagesGetRequestSchema = z5.object({ id: z5.string().min(1, "Missing id parameter") });
1853
- var imagesSearchRequestSchema = z5.object({
1854
- query: z5.string().min(1),
1855
- limit: z5.coerce.number().int().positive().max(100).optional(),
1856
- aspectRatio: z5.string().optional(),
1857
- tags: z5.array(z5.string()).optional(),
1858
- source: z5.string().optional(),
1859
- externalUrlHost: z5.string().optional()
1860
- });
1861
- var imageSearchResultSchema = z5.object({
1862
- _id: z5.string(),
1863
- imageUrl: z5.string(),
1864
- name: z5.string(),
1865
- description: z5.string(),
1866
- tags: z5.array(z5.string()),
1867
- width: z5.number().optional(),
1868
- height: z5.number().optional(),
1869
- aspectRatio: z5.number().optional(),
1870
- dominantColor: z5.string().optional(),
1871
- imagePalette: z5.array(z5.string()).optional(),
1872
- source: z5.string(),
1873
- externalUrl: z5.string().optional(),
1874
- score: z5.number()
1875
- });
1876
- var imagesSearchResponseSchema = z5.array(imageSearchResultSchema);
1877
- var imagesUploadRequestSchema = z5.object({
1878
- base64: z5.string().min(1),
1879
- contentType: z5.string().min(1),
1880
- source: z5.string().optional(),
1881
- descriptionContext: z5.string().optional()
1882
- });
1883
- var imagesUploadResponseSchema = z5.object({ imageId: z5.string() });
1884
- var imagesDeleteRequestSchema = z5.object({ id: z5.string().min(1, "Missing image ID") });
1885
- var imagesDeleteResponseSchema = z5.object({ ok: z5.literal(true) });
1886
- var imagesUpscaleRequestSchema = z5.object({ imageId: z5.string().min(1, "Missing image ID") });
1887
- var imagesUpscaleResponseSchema = z5.object({
1888
- imageId: z5.string(),
1889
- status: z5.literal("processing")
1727
+ var imagesGetRequestSchema = z4.object({ id: z4.string().min(1, "Missing id parameter") });
1728
+ var imagesSearchRequestSchema = z4.object({
1729
+ query: z4.string().min(1),
1730
+ limit: z4.coerce.number().int().positive().max(100).optional(),
1731
+ aspectRatio: z4.string().optional(),
1732
+ tags: z4.array(z4.string()).optional(),
1733
+ source: z4.string().optional(),
1734
+ externalUrlHost: z4.string().optional()
1735
+ });
1736
+ var imageSearchResultSchema = z4.object({
1737
+ _id: z4.string(),
1738
+ imageUrl: z4.string(),
1739
+ name: z4.string(),
1740
+ description: z4.string(),
1741
+ tags: z4.array(z4.string()),
1742
+ width: z4.number().optional(),
1743
+ height: z4.number().optional(),
1744
+ aspectRatio: z4.number().optional(),
1745
+ dominantColor: z4.string().optional(),
1746
+ imagePalette: z4.array(z4.string()).optional(),
1747
+ source: z4.string(),
1748
+ externalUrl: z4.string().optional(),
1749
+ score: z4.number()
1750
+ });
1751
+ var imagesSearchResponseSchema = z4.array(imageSearchResultSchema);
1752
+ var imagesUploadRequestSchema = z4.object({
1753
+ base64: z4.string().min(1),
1754
+ contentType: z4.string().min(1),
1755
+ source: z4.string().optional(),
1756
+ descriptionContext: z4.string().optional()
1757
+ });
1758
+ var imagesUploadResponseSchema = z4.object({ imageId: z4.string() });
1759
+ var imagesDeleteRequestSchema = z4.object({ id: z4.string().min(1, "Missing image ID") });
1760
+ var imagesDeleteResponseSchema = z4.object({ ok: z4.literal(true) });
1761
+ var imagesUpscaleRequestSchema = z4.object({ imageId: z4.string().min(1, "Missing image ID") });
1762
+ var imagesUpscaleResponseSchema = z4.object({
1763
+ imageId: z4.string(),
1764
+ status: z4.literal("processing")
1890
1765
  });
1891
1766
  var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
1892
- var imagesFindRequestSchema = z5.object({
1893
- query: z5.string().min(1),
1894
- sources: z5.array(z5.enum(IMAGES_FIND_SOURCES)).optional(),
1895
- limit: z5.coerce.number().int().positive().max(50).optional(),
1896
- fallback: z5.boolean().optional(),
1897
- threshold: z5.number().min(0).max(1).optional(),
1898
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
1899
- descriptionContext: z5.string().optional()
1900
- });
1901
- var imagesFindResponseSchema = z5.object({
1902
- groups: z5.object({
1903
- library: z5.array(imageHitSchema),
1904
- external: z5.array(ingestedImageHitSchema)
1767
+ var imagesFindRequestSchema = z4.object({
1768
+ query: z4.string().min(1),
1769
+ sources: z4.array(z4.enum(IMAGES_FIND_SOURCES)).optional(),
1770
+ limit: z4.coerce.number().int().positive().max(50).optional(),
1771
+ fallback: z4.boolean().optional(),
1772
+ threshold: z4.number().min(0).max(1).optional(),
1773
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1774
+ descriptionContext: z4.string().optional()
1775
+ });
1776
+ var imagesFindResponseSchema = z4.object({
1777
+ groups: z4.object({
1778
+ library: z4.array(imageHitSchema),
1779
+ external: z4.array(ingestedImageHitSchema)
1905
1780
  }),
1906
- meta: z5.object({
1907
- counts: z5.record(z5.string(), z5.number()),
1908
- errors: z5.array(z5.object({ source: imageHitSourceSchema, message: z5.string() }))
1781
+ meta: z4.object({
1782
+ counts: z4.record(z4.string(), z4.number()),
1783
+ errors: z4.array(z4.object({ source: imageHitSourceSchema, message: z4.string() }))
1909
1784
  }),
1910
- ingested: z5.array(autoIngestItemSchema)
1911
- });
1912
- var imagesStockRequestSchema = z5.object({
1913
- query: z5.string().min(1),
1914
- orientation: z5.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
1915
- contentType: z5.enum(["photo", "vector", "psd"]).optional(),
1916
- license: z5.enum(["freemium", "premium"]).optional(),
1917
- color: z5.string().optional(),
1918
- aiGenerated: z5.enum(["exclude", "only"]).optional(),
1919
- people: z5.enum(["include", "exclude", "only"]).optional(),
1920
- order: z5.enum(["relevance", "recent"]).optional(),
1921
- limit: z5.coerce.number().int().positive().max(50).optional(),
1922
- page: z5.coerce.number().int().positive().optional(),
1923
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
1924
- descriptionContext: z5.string().optional()
1785
+ ingested: z4.array(autoIngestItemSchema)
1786
+ });
1787
+ var imagesStockRequestSchema = z4.object({
1788
+ query: z4.string().min(1),
1789
+ orientation: z4.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
1790
+ contentType: z4.enum(["photo", "vector", "psd"]).optional(),
1791
+ license: z4.enum(["freemium", "premium"]).optional(),
1792
+ color: z4.string().optional(),
1793
+ aiGenerated: z4.enum(["exclude", "only"]).optional(),
1794
+ people: z4.enum(["include", "exclude", "only"]).optional(),
1795
+ order: z4.enum(["relevance", "recent"]).optional(),
1796
+ limit: z4.coerce.number().int().positive().max(50).optional(),
1797
+ page: z4.coerce.number().int().positive().optional(),
1798
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1799
+ descriptionContext: z4.string().optional()
1925
1800
  });
1926
1801
  var imagesStockResponseSchema = providerHitsResponseSchema();
1927
- var imagesGoogleRequestSchema = z5.object({
1928
- query: z5.string().min(1),
1929
- type: z5.string().optional(),
1930
- size: z5.string().optional(),
1931
- color: z5.string().optional(),
1932
- safe: z5.enum(["off", "active"]).optional(),
1933
- limit: z5.coerce.number().int().positive().max(50).optional(),
1934
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
1935
- descriptionContext: z5.string().optional()
1802
+ var imagesGoogleRequestSchema = z4.object({
1803
+ query: z4.string().min(1),
1804
+ type: z4.string().optional(),
1805
+ size: z4.string().optional(),
1806
+ color: z4.string().optional(),
1807
+ safe: z4.enum(["off", "active"]).optional(),
1808
+ limit: z4.coerce.number().int().positive().max(50).optional(),
1809
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1810
+ descriptionContext: z4.string().optional()
1936
1811
  });
1937
1812
  var imagesGoogleResponseSchema = providerHitsResponseSchema();
1938
- var imagesPinterestRequestSchema = z5.object({
1939
- query: z5.string().min(1),
1940
- limit: z5.coerce.number().int().positive().max(20).optional(),
1941
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
1942
- descriptionContext: z5.string().optional()
1813
+ var imagesPinterestRequestSchema = z4.object({
1814
+ query: z4.string().min(1),
1815
+ limit: z4.coerce.number().int().positive().max(20).optional(),
1816
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1817
+ descriptionContext: z4.string().optional()
1943
1818
  });
1944
1819
  var imagesPinterestResponseSchema = providerHitsResponseSchema();
1945
- var rgbTriple = z5.tuple([
1946
- z5.number().int().min(0).max(255),
1947
- z5.number().int().min(0).max(255),
1948
- z5.number().int().min(0).max(255)
1820
+ var rgbTriple = z4.tuple([
1821
+ z4.number().int().min(0).max(255),
1822
+ z4.number().int().min(0).max(255),
1823
+ z4.number().int().min(0).max(255)
1949
1824
  ]);
1950
- var imageGenerateModelSchema = z5.enum([
1825
+ var imageGenerateModelSchema = z4.enum([
1951
1826
  "openai/gpt-5.4-image-2",
1952
1827
  "google/gemini-3.5-flash",
1953
1828
  "google/gemini-3.1-flash-image-preview",
1954
1829
  "google/gemini-3-pro-image-preview",
1955
1830
  "recraft/recraft-v4.1-pro-vector"
1956
1831
  ]);
1957
- var imagesGenerateRequestSchema = z5.object({
1958
- prompt: z5.string().min(1),
1832
+ var imagesGenerateRequestSchema = z4.object({
1833
+ prompt: z4.string().min(1),
1959
1834
  model: imageGenerateModelSchema.optional(),
1960
1835
  // Aspect ratio + size are validated loosely as strings; the per-model enum
1961
1836
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
1962
- aspectRatio: z5.string().optional(),
1963
- imageSize: z5.string().optional(),
1837
+ aspectRatio: z4.string().optional(),
1838
+ imageSize: z4.string().optional(),
1964
1839
  // Recraft v4.1 Pro Vector levers (ignored by other models).
1965
- strength: z5.coerce.number().min(0).max(1).optional(),
1966
- rgbColors: z5.array(rgbTriple).optional(),
1840
+ strength: z4.coerce.number().min(0).max(1).optional(),
1841
+ rgbColors: z4.array(rgbTriple).optional(),
1967
1842
  backgroundRgbColor: rgbTriple.optional(),
1968
1843
  // Public image URLs used as visual references (multi-reference, in order).
1969
- referenceUrls: z5.array(z5.string().url()).optional(),
1970
- descriptionContext: z5.string().optional()
1971
- });
1972
- var generatedImageSchema = z5.object({
1973
- imageId: z5.string(),
1974
- deduped: z5.boolean(),
1975
- imageUrl: z5.string(),
1976
- width: z5.number().optional(),
1977
- height: z5.number().optional()
1978
- });
1979
- var imagesGenerateResponseSchema = z5.object({
1980
- model: z5.string(),
1981
- costUsd: z5.number(),
1982
- images: z5.array(generatedImageSchema)
1983
- });
1984
- var imagesLogoRequestSchema = z5.object({
1985
- domain: z5.string().min(1),
1986
- variant: z5.enum(["icon", "logo", "symbol"]).optional(),
1987
- autoIngest: z5.coerce.number().int().min(0).max(5).optional(),
1988
- descriptionContext: z5.string().optional()
1844
+ referenceUrls: z4.array(z4.string().url()).optional(),
1845
+ descriptionContext: z4.string().optional()
1846
+ });
1847
+ var generatedImageSchema = z4.object({
1848
+ imageId: z4.string(),
1849
+ deduped: z4.boolean(),
1850
+ imageUrl: z4.string(),
1851
+ width: z4.number().optional(),
1852
+ height: z4.number().optional()
1853
+ });
1854
+ var imagesGenerateResponseSchema = z4.object({
1855
+ model: z4.string(),
1856
+ costUsd: z4.number(),
1857
+ images: z4.array(generatedImageSchema)
1858
+ });
1859
+ var imagesLogoRequestSchema = z4.object({
1860
+ domain: z4.string().min(1),
1861
+ variant: z4.enum(["icon", "logo", "symbol"]).optional(),
1862
+ autoIngest: z4.coerce.number().int().min(0).max(5).optional(),
1863
+ descriptionContext: z4.string().optional()
1989
1864
  });
1990
1865
  var imagesLogoResponseSchema = providerHitsResponseSchema();
1991
- var imagesIconRequestSchema = z5.object({
1992
- name: z5.string().min(1),
1993
- set: z5.string().optional(),
1994
- color: z5.string().optional(),
1995
- width: z5.coerce.number().int().positive().optional(),
1996
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
1997
- descriptionContext: z5.string().optional()
1866
+ var imagesIconRequestSchema = z4.object({
1867
+ name: z4.string().min(1),
1868
+ set: z4.string().optional(),
1869
+ color: z4.string().optional(),
1870
+ width: z4.coerce.number().int().positive().optional(),
1871
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1872
+ descriptionContext: z4.string().optional()
1998
1873
  });
1999
1874
  var imagesIconResponseSchema = providerHitsResponseSchema();
2000
- var imagesExtractRequestSchema = z5.object({
2001
- url: z5.string().url(),
2002
- waitFor: z5.coerce.number().int().min(0).max(3e4).optional(),
2003
- limit: z5.coerce.number().int().positive().max(50).optional(),
2004
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
2005
- descriptionContext: z5.string().optional()
1875
+ var imagesExtractRequestSchema = z4.object({
1876
+ url: z4.string().url(),
1877
+ waitFor: z4.coerce.number().int().min(0).max(3e4).optional(),
1878
+ limit: z4.coerce.number().int().positive().max(50).optional(),
1879
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1880
+ descriptionContext: z4.string().optional()
2006
1881
  });
2007
1882
  var imagesExtractResponseSchema = providerHitsResponseSchema();
2008
- var imagesScreenshotRequestSchema = z5.object({
2009
- url: z5.string().url(),
2010
- fullPage: z5.boolean().optional(),
2011
- viewportWidth: z5.coerce.number().int().positive().max(3840).optional(),
2012
- viewportHeight: z5.coerce.number().int().positive().max(2160).optional(),
2013
- format: z5.enum(["webp", "png", "jpg"]).optional(),
2014
- descriptionContext: z5.string().optional()
1883
+ var imagesScreenshotRequestSchema = z4.object({
1884
+ url: z4.string().url(),
1885
+ fullPage: z4.boolean().optional(),
1886
+ viewportWidth: z4.coerce.number().int().positive().max(3840).optional(),
1887
+ viewportHeight: z4.coerce.number().int().positive().max(2160).optional(),
1888
+ format: z4.enum(["webp", "png", "jpg"]).optional(),
1889
+ descriptionContext: z4.string().optional()
2015
1890
  });
2016
1891
  var imagesScreenshotResponseSchema = providerHitsResponseSchema();
2017
- var imagesGiphyRequestSchema = z5.object({
2018
- query: z5.string().min(1).optional(),
2019
- trending: z5.coerce.boolean().optional(),
2020
- limit: z5.coerce.number().int().positive().max(50).optional(),
2021
- rating: z5.enum(["g", "pg", "pg-13", "r"]).optional(),
2022
- lang: z5.string().optional(),
2023
- autoIngest: z5.coerce.number().int().min(0).max(20).optional(),
2024
- descriptionContext: z5.string().optional()
1892
+ var imagesGiphyRequestSchema = z4.object({
1893
+ query: z4.string().min(1).optional(),
1894
+ trending: z4.coerce.boolean().optional(),
1895
+ limit: z4.coerce.number().int().positive().max(50).optional(),
1896
+ rating: z4.enum(["g", "pg", "pg-13", "r"]).optional(),
1897
+ lang: z4.string().optional(),
1898
+ autoIngest: z4.coerce.number().int().min(0).max(20).optional(),
1899
+ descriptionContext: z4.string().optional()
2025
1900
  });
2026
1901
  var imagesGifResponseSchema = providerHitsResponseSchema();
2027
1902
  var imagesStickerResponseSchema = providerHitsResponseSchema();
2028
- var imagesIngestRequestSchema = z5.object({
2029
- url: z5.string().url(),
1903
+ var imagesIngestRequestSchema = z4.object({
1904
+ url: z4.string().url(),
2030
1905
  // Validate source at the HTTP boundary so unknown values produce the standard
2031
1906
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
2032
1907
  // `assertImageSource` inside the action.
2033
1908
  source: imageSourceSchema,
2034
- externalId: z5.string().optional(),
2035
- externalUrl: z5.string().optional(),
2036
- descriptionContext: z5.string().optional()
1909
+ externalId: z4.string().optional(),
1910
+ externalUrl: z4.string().optional(),
1911
+ descriptionContext: z4.string().optional()
2037
1912
  });
2038
- var imagesIngestResponseSchema = z5.object({
2039
- imageId: z5.string(),
2040
- deduped: z5.boolean(),
2041
- contentHash: z5.string()
1913
+ var imagesIngestResponseSchema = z4.object({
1914
+ imageId: z4.string(),
1915
+ deduped: z4.boolean(),
1916
+ contentHash: z4.string()
2042
1917
  });
2043
1918
 
2044
1919
  // ../api/src/tags.ts
2045
- import { z as z6 } from "zod";
1920
+ import { z as z5 } from "zod";
2046
1921
  var TAG_TYPES = [
2047
1922
  "meta",
2048
1923
  "amplitude",
@@ -2063,219 +1938,239 @@ var TAG_TYPES = [
2063
1938
  "recaptcha",
2064
1939
  "twitterAds"
2065
1940
  ];
2066
- var tagTypeSchema = z6.enum(TAG_TYPES);
2067
- var tagDraftOpKindSchema = z6.enum(["create", "update", "delete"]);
2068
- var tagDraftOpViewSchema = z6.object({
1941
+ var tagTypeSchema = z5.enum(TAG_TYPES);
1942
+ var TAG_IDENTIFYING_FIELD = {
1943
+ meta: "pixelId",
1944
+ googleAds: "conversionID",
1945
+ tiktok: "pixelCode",
1946
+ pinterest: "tagId",
1947
+ linkedinInsightTag: "partnerId",
1948
+ googleAnalytics: "measurementId",
1949
+ googleTagManager: "containerID",
1950
+ amplitude: "apiKey",
1951
+ hotjar: "siteID",
1952
+ clarity: "projectId",
1953
+ hubspot: "hubID",
1954
+ vwo: "accountId",
1955
+ code: null,
1956
+ onetrust: "domainId",
1957
+ posthog: "projectToken",
1958
+ datafast: "websiteId",
1959
+ recaptcha: "siteKey",
1960
+ twitterAds: "pixelId"
1961
+ };
1962
+ var tagDraftOpKindSchema = z5.enum(["create", "update", "delete"]);
1963
+ var tagDraftOpViewSchema = z5.object({
2069
1964
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
2070
- ref: z6.string(),
1965
+ ref: z5.string(),
2071
1966
  kind: tagDraftOpKindSchema,
2072
1967
  type: tagTypeSchema,
2073
1968
  /** Present on update/delete ops — the real tag this op targets. */
2074
- tagId: z6.string().optional(),
1969
+ tagId: z5.string().optional(),
2075
1970
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
2076
- config: z6.record(z6.string(), z6.string()),
1971
+ config: z5.record(z5.string(), z5.string()),
2077
1972
  /** Update only — fields the op explicitly clears. */
2078
- clearFields: z6.array(z6.string()).optional(),
1973
+ clearFields: z5.array(z5.string()).optional(),
2079
1974
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
2080
- secretsSet: z6.array(z6.string()),
1975
+ secretsSet: z5.array(z5.string()),
2081
1976
  /** Names of secret fields still awaiting user input. */
2082
- secretsPending: z6.array(z6.string()),
2083
- summary: z6.string(),
2084
- stagedAt: z6.number()
1977
+ secretsPending: z5.array(z5.string()),
1978
+ summary: z5.string(),
1979
+ stagedAt: z5.number()
2085
1980
  });
2086
- var tagsEffectiveEntrySchema = z6.object({
1981
+ var tagsEffectiveEntrySchema = z5.object({
2087
1982
  /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
2088
- ref: z6.string(),
2089
- tagId: z6.string().optional(),
1983
+ ref: z5.string(),
1984
+ tagId: z5.string().optional(),
2090
1985
  type: tagTypeSchema,
2091
1986
  /** Value of the type's identifying field, when set. */
2092
- identifier: z6.string().optional(),
1987
+ identifier: z5.string().optional(),
2093
1988
  /** Redacted config; for staged updates, production config with the patch merged. */
2094
- config: z6.record(z6.string(), z6.string()),
1989
+ config: z5.record(z5.string(), z5.string()),
2095
1990
  /** Absent = live production tag with no staged changes in this chat. */
2096
1991
  staged: tagDraftOpKindSchema.optional(),
2097
- secretsSet: z6.array(z6.string()),
2098
- secretsPending: z6.array(z6.string())
1992
+ secretsSet: z5.array(z5.string()),
1993
+ secretsPending: z5.array(z5.string())
2099
1994
  });
2100
- var tagsListRequestSchema = z6.object({ chatId: z6.string() });
2101
- var tagsListResponseSchema = z6.object({ tags: z6.array(tagsEffectiveEntrySchema) });
2102
- var tagsDraftListRequestSchema = z6.object({ chatId: z6.string() });
2103
- var tagsDraftListResponseSchema = z6.object({
2104
- status: z6.enum(["active", "publishing", "applied", "discarded", "none"]),
2105
- ops: z6.array(tagDraftOpViewSchema)
1995
+ var tagsListRequestSchema = z5.object({ chatId: z5.string() });
1996
+ var tagsListResponseSchema = z5.object({ tags: z5.array(tagsEffectiveEntrySchema) });
1997
+ var tagsDraftListRequestSchema = z5.object({ chatId: z5.string() });
1998
+ var tagsDraftListResponseSchema = z5.object({
1999
+ status: z5.enum(["active", "publishing", "applied", "discarded", "none"]),
2000
+ ops: z5.array(tagDraftOpViewSchema)
2106
2001
  });
2107
- var tagInputRequestSchema = z6.object({
2002
+ var tagInputRequestSchema = z5.object({
2108
2003
  // Every tag change is a tab in the approval form: create/edit show the full
2109
2004
  // body; delete shows a confirm. No tag change bypasses this approval.
2110
- mode: z6.enum(["create", "edit", "delete"]),
2005
+ mode: z5.enum(["create", "edit", "delete"]),
2111
2006
  tagType: tagTypeSchema,
2112
2007
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
2113
- ref: z6.string().optional(),
2008
+ ref: z5.string().optional(),
2114
2009
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
2115
- prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
2010
+ prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
2116
2011
  /** Secret field names the agent asks the user to provide. */
2117
- requestedSecretFields: z6.array(z6.string()).optional(),
2012
+ requestedSecretFields: z5.array(z5.string()).optional(),
2118
2013
  /** Short message shown above the form explaining why the input is needed. */
2119
- message: z6.string().optional()
2014
+ message: z5.string().optional()
2120
2015
  });
2121
- var tagChangeToolInputSchema = z6.object({
2122
- changes: z6.array(tagInputRequestSchema).min(1).max(8)
2016
+ var tagChangeToolInputSchema = z5.object({
2017
+ changes: z5.array(tagInputRequestSchema).min(1).max(8)
2123
2018
  });
2124
- var tagInputResultSchema = z6.discriminatedUnion("status", [
2125
- z6.object({
2126
- status: z6.literal("submitted"),
2127
- ref: z6.string(),
2019
+ var tagInputResultSchema = z5.discriminatedUnion("status", [
2020
+ z5.object({
2021
+ status: z5.literal("submitted"),
2022
+ ref: z5.string(),
2128
2023
  type: tagTypeSchema,
2129
2024
  /** Identifying field name → value (non-secret), when the type has one. */
2130
- identifier: z6.record(z6.string(), z6.string()).optional(),
2131
- secretFieldsSet: z6.array(z6.string()),
2132
- note: z6.string().optional()
2025
+ identifier: z5.record(z5.string(), z5.string()).optional(),
2026
+ secretFieldsSet: z5.array(z5.string()),
2027
+ note: z5.string().optional()
2133
2028
  }),
2134
- z6.object({
2135
- status: z6.literal("declined"),
2136
- reason: z6.string().optional()
2029
+ z5.object({
2030
+ status: z5.literal("declined"),
2031
+ reason: z5.string().optional()
2137
2032
  })
2138
2033
  ]);
2139
- var tagChangeToolResultSchema = z6.object({
2140
- results: z6.array(tagInputResultSchema)
2034
+ var tagChangeToolResultSchema = z5.object({
2035
+ results: z5.array(tagInputResultSchema)
2141
2036
  });
2142
2037
 
2143
2038
  // ../api/src/testimonials.ts
2144
- import { z as z7 } from "zod";
2145
- var testimonialSourceTypeSchema = z7.enum(["google", "trustpilot"]);
2146
- var testimonialStatusSchema = z7.enum(["pending", "processing", "ready", "error"]);
2147
- var testimonialSentimentSchema = z7.enum(["positive", "neutral", "negative"]);
2148
- var testimonialDocSchema = z7.object({
2149
- _id: z7.string(),
2150
- _creationTime: z7.number(),
2151
- companyId: z7.string(),
2152
- sourceId: z7.string(),
2039
+ import { z as z6 } from "zod";
2040
+ var testimonialSourceTypeSchema = z6.enum(["google", "trustpilot"]);
2041
+ var testimonialStatusSchema = z6.enum(["pending", "processing", "ready", "error"]);
2042
+ var testimonialSentimentSchema = z6.enum(["positive", "neutral", "negative"]);
2043
+ var testimonialDocSchema = z6.object({
2044
+ _id: z6.string(),
2045
+ _creationTime: z6.number(),
2046
+ companyId: z6.string(),
2047
+ sourceId: z6.string(),
2153
2048
  sourceType: testimonialSourceTypeSchema,
2154
- reviewText: z7.string(),
2155
- reviewTitle: z7.string().optional(),
2156
- searchText: z7.string().optional(),
2157
- reviewerName: z7.string().optional(),
2158
- reviewerImageUrl: z7.string().optional(),
2159
- reviewerImageId: z7.string().optional(),
2160
- reviewerLocation: z7.string().optional(),
2161
- rating: z7.number().optional(),
2162
- reviewDate: z7.number().optional(),
2163
- ownerAnswer: z7.string().optional(),
2164
- mediaUrls: z7.array(z7.string()).optional(),
2165
- imageIds: z7.array(z7.string()).optional(),
2166
- videoIds: z7.array(z7.string()).optional(),
2167
- sourceUrl: z7.string().optional(),
2168
- rawData: z7.unknown().optional(),
2169
- tags: z7.array(z7.string()),
2170
- highlight: z7.string().optional(),
2171
- language: z7.string().optional(),
2172
- summary: z7.string().optional(),
2049
+ reviewText: z6.string(),
2050
+ reviewTitle: z6.string().optional(),
2051
+ searchText: z6.string().optional(),
2052
+ reviewerName: z6.string().optional(),
2053
+ reviewerImageUrl: z6.string().optional(),
2054
+ reviewerImageId: z6.string().optional(),
2055
+ reviewerLocation: z6.string().optional(),
2056
+ rating: z6.number().optional(),
2057
+ reviewDate: z6.number().optional(),
2058
+ ownerAnswer: z6.string().optional(),
2059
+ mediaUrls: z6.array(z6.string()).optional(),
2060
+ imageIds: z6.array(z6.string()).optional(),
2061
+ videoIds: z6.array(z6.string()).optional(),
2062
+ sourceUrl: z6.string().optional(),
2063
+ rawData: z6.unknown().optional(),
2064
+ tags: z6.array(z6.string()),
2065
+ highlight: z6.string().optional(),
2066
+ language: z6.string().optional(),
2067
+ summary: z6.string().optional(),
2173
2068
  sentiment: testimonialSentimentSchema.optional(),
2174
- textEmbedding: z7.array(z7.number()).optional(),
2175
- externalId: z7.string().optional(),
2176
- contentHash: z7.string().optional(),
2069
+ textEmbedding: z6.array(z6.number()).optional(),
2070
+ externalId: z6.string().optional(),
2071
+ contentHash: z6.string().optional(),
2177
2072
  status: testimonialStatusSchema,
2178
- errorMessage: z7.string().optional(),
2179
- createdAt: z7.number(),
2180
- updatedAt: z7.number()
2073
+ errorMessage: z6.string().optional(),
2074
+ createdAt: z6.number(),
2075
+ updatedAt: z6.number()
2181
2076
  });
2182
- var testimonialsListRequestSchema = z7.object({
2077
+ var testimonialsListRequestSchema = z6.object({
2183
2078
  source: testimonialSourceTypeSchema.optional(),
2184
- rating_min: z7.coerce.number().int().min(1).max(5).optional(),
2185
- rating_max: z7.coerce.number().int().min(1).max(5).optional(),
2186
- tags: z7.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2079
+ rating_min: z6.coerce.number().int().min(1).max(5).optional(),
2080
+ rating_max: z6.coerce.number().int().min(1).max(5).optional(),
2081
+ tags: z6.string().transform((s) => s.split(",").filter(Boolean)).optional(),
2187
2082
  status: testimonialStatusSchema.optional(),
2188
2083
  sentiment: testimonialSentimentSchema.optional(),
2189
- language: z7.string().min(2).max(5).optional(),
2190
- limit: z7.coerce.number().int().positive().max(200).optional()
2191
- });
2192
- var testimonialsListResponseSchema = z7.array(testimonialDocSchema);
2193
- var testimonialsGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2194
- var testimonialsSearchRequestSchema = z7.object({
2195
- query: z7.string().min(1),
2196
- limit: z7.coerce.number().int().positive().max(100).optional(),
2084
+ language: z6.string().min(2).max(5).optional(),
2085
+ limit: z6.coerce.number().int().positive().max(200).optional()
2086
+ });
2087
+ var testimonialsListResponseSchema = z6.array(testimonialDocSchema);
2088
+ var testimonialsGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
2089
+ var testimonialsSearchRequestSchema = z6.object({
2090
+ query: z6.string().min(1),
2091
+ limit: z6.coerce.number().int().positive().max(100).optional(),
2197
2092
  source: testimonialSourceTypeSchema.optional(),
2198
- rating_min: z7.coerce.number().int().min(1).max(5).optional(),
2199
- rating_max: z7.coerce.number().int().min(1).max(5).optional(),
2200
- tags: z7.array(z7.string()).optional(),
2093
+ rating_min: z6.coerce.number().int().min(1).max(5).optional(),
2094
+ rating_max: z6.coerce.number().int().min(1).max(5).optional(),
2095
+ tags: z6.array(z6.string()).optional(),
2201
2096
  status: testimonialStatusSchema.optional(),
2202
2097
  sentiment: testimonialSentimentSchema.optional(),
2203
- language: z7.string().min(2).max(5).optional()
2098
+ language: z6.string().min(2).max(5).optional()
2204
2099
  }).refine(
2205
2100
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
2206
2101
  { message: "rating_min must be less than or equal to rating_max" }
2207
2102
  );
2208
- var testimonialsSearchResponseSchema = z7.array(testimonialDocSchema);
2209
- var testimonialsOutscraperWebhookResponseSchema = z7.object({
2210
- ok: z7.literal(true),
2211
- note: z7.string().optional()
2103
+ var testimonialsSearchResponseSchema = z6.array(testimonialDocSchema);
2104
+ var testimonialsOutscraperWebhookResponseSchema = z6.object({
2105
+ ok: z6.literal(true),
2106
+ note: z6.string().optional()
2212
2107
  });
2213
2108
 
2214
2109
  // ../api/src/videos.ts
2215
- import { z as z8 } from "zod";
2216
- var videoStatusSchema = z8.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2217
- var videoTranscriptSegmentSchema = z8.object({
2218
- text: z8.string(),
2219
- startSecond: z8.number(),
2220
- endSecond: z8.number()
2221
- });
2222
- var videoSceneSchema = z8.object({
2223
- title: z8.string(),
2224
- description: z8.string(),
2225
- startSecond: z8.number(),
2226
- endSecond: z8.number(),
2227
- thumbnailTime: z8.number()
2228
- });
2229
- var videoDocSchema = z8.object({
2230
- _id: z8.string(),
2231
- _creationTime: z8.number(),
2232
- companyId: z8.string(),
2233
- muxAssetId: z8.string(),
2234
- muxPlaybackId: z8.string(),
2235
- muxUploadId: z8.string(),
2236
- name: z8.string(),
2237
- description: z8.string(),
2238
- tags: z8.array(z8.string()),
2239
- source: z8.string(),
2240
- externalId: z8.string().optional(),
2241
- sourceId: z8.string().optional(),
2242
- width: z8.number().optional(),
2243
- height: z8.number().optional(),
2244
- aspectRatio: z8.number().optional(),
2245
- duration: z8.number().optional(),
2246
- transcript: z8.string().optional(),
2247
- transcriptSegments: z8.array(videoTranscriptSegmentSchema).optional(),
2248
- scenes: z8.array(videoSceneSchema).optional(),
2249
- descriptionEmbedding: z8.array(z8.number()).optional(),
2250
- searchText: z8.string().optional(),
2110
+ import { z as z7 } from "zod";
2111
+ var videoStatusSchema = z7.enum(["uploading", "uploaded", "processing", "ready", "error"]);
2112
+ var videoTranscriptSegmentSchema = z7.object({
2113
+ text: z7.string(),
2114
+ startSecond: z7.number(),
2115
+ endSecond: z7.number()
2116
+ });
2117
+ var videoSceneSchema = z7.object({
2118
+ title: z7.string(),
2119
+ description: z7.string(),
2120
+ startSecond: z7.number(),
2121
+ endSecond: z7.number(),
2122
+ thumbnailTime: z7.number()
2123
+ });
2124
+ var videoDocSchema = z7.object({
2125
+ _id: z7.string(),
2126
+ _creationTime: z7.number(),
2127
+ companyId: z7.string(),
2128
+ muxAssetId: z7.string(),
2129
+ muxPlaybackId: z7.string(),
2130
+ muxUploadId: z7.string(),
2131
+ name: z7.string(),
2132
+ description: z7.string(),
2133
+ tags: z7.array(z7.string()),
2134
+ source: z7.string(),
2135
+ externalId: z7.string().optional(),
2136
+ sourceId: z7.string().optional(),
2137
+ width: z7.number().optional(),
2138
+ height: z7.number().optional(),
2139
+ aspectRatio: z7.number().optional(),
2140
+ duration: z7.number().optional(),
2141
+ transcript: z7.string().optional(),
2142
+ transcriptSegments: z7.array(videoTranscriptSegmentSchema).optional(),
2143
+ scenes: z7.array(videoSceneSchema).optional(),
2144
+ descriptionEmbedding: z7.array(z7.number()).optional(),
2145
+ searchText: z7.string().optional(),
2251
2146
  status: videoStatusSchema,
2252
- errorMessage: z8.string().optional(),
2253
- createdAt: z8.number(),
2254
- updatedAt: z8.number(),
2255
- thumbnailUrl: z8.string()
2256
- });
2257
- var videosWebhookResponseSchema = z8.object({ ok: z8.literal(true) });
2258
- var videosGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
2259
- var videosSearchRequestSchema = z8.object({
2260
- query: z8.string().min(1),
2261
- limit: z8.coerce.number().int().positive().max(100).optional(),
2262
- tags: z8.array(z8.string()).optional()
2263
- });
2264
- var videoSearchResultSchema = z8.object({
2265
- _id: z8.string(),
2266
- thumbnailUrl: z8.string(),
2267
- name: z8.string(),
2268
- description: z8.string(),
2269
- tags: z8.array(z8.string()),
2270
- status: z8.string(),
2271
- duration: z8.number().optional(),
2272
- muxPlaybackId: z8.string(),
2273
- createdAt: z8.number()
2274
- });
2275
- var videosSearchResponseSchema = z8.array(videoSearchResultSchema);
2276
- var videosUploadResponseSchema = z8.object({ uploadUrl: z8.string(), videoId: z8.string() });
2277
- var videosDeleteRequestSchema = z8.object({ id: z8.string().min(1, "Missing video ID") });
2278
- var videosDeleteResponseSchema = z8.object({ ok: z8.literal(true) });
2147
+ errorMessage: z7.string().optional(),
2148
+ createdAt: z7.number(),
2149
+ updatedAt: z7.number(),
2150
+ thumbnailUrl: z7.string()
2151
+ });
2152
+ var videosWebhookResponseSchema = z7.object({ ok: z7.literal(true) });
2153
+ var videosGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
2154
+ var videosSearchRequestSchema = z7.object({
2155
+ query: z7.string().min(1),
2156
+ limit: z7.coerce.number().int().positive().max(100).optional(),
2157
+ tags: z7.array(z7.string()).optional()
2158
+ });
2159
+ var videoSearchResultSchema = z7.object({
2160
+ _id: z7.string(),
2161
+ thumbnailUrl: z7.string(),
2162
+ name: z7.string(),
2163
+ description: z7.string(),
2164
+ tags: z7.array(z7.string()),
2165
+ status: z7.string(),
2166
+ duration: z7.number().optional(),
2167
+ muxPlaybackId: z7.string(),
2168
+ createdAt: z7.number()
2169
+ });
2170
+ var videosSearchResponseSchema = z7.array(videoSearchResultSchema);
2171
+ var videosUploadResponseSchema = z7.object({ uploadUrl: z7.string(), videoId: z7.string() });
2172
+ var videosDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing video ID") });
2173
+ var videosDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
2279
2174
 
2280
2175
  // src/commands/actions/complete.ts
2281
2176
  import { defineCommand as defineCommand2 } from "citty";
@@ -4088,37 +3983,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4088
3983
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4089
3984
 
4090
3985
  // ../api/src/ads-google/ops.ts
4091
- import { z as z9 } from "zod";
4092
- var tempRefSchema2 = z9.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4093
- var refSchema = z9.union([
4094
- z9.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4095
- z9.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
3986
+ import { z as z8 } from "zod";
3987
+ var tempRefSchema2 = z8.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
3988
+ var refSchema = z8.union([
3989
+ z8.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
3990
+ z8.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4096
3991
  tempRefSchema2
4097
3992
  ]);
4098
3993
  var targetRefSchema = refSchema;
4099
- var microsSchema = z9.number().int().positive("expected a positive micros amount");
4100
- var httpsUrlSchema2 = z9.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4101
- var customerIdSchema = z9.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4102
- var stageableStatusSchema2 = z9.enum(STAGEABLE_CREATE_STATUSES2);
4103
- var matchTypeSchema = z9.enum(KEYWORD_MATCH_TYPES);
4104
- var keywordTextSchema = z9.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");
4105
- var budgetCreateSchema = z9.object({
4106
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
3994
+ var microsSchema = z8.number().int().positive("expected a positive micros amount");
3995
+ var httpsUrlSchema2 = z8.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
3996
+ var customerIdSchema = z8.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
3997
+ var stageableStatusSchema2 = z8.enum(STAGEABLE_CREATE_STATUSES2);
3998
+ var matchTypeSchema = z8.enum(KEYWORD_MATCH_TYPES);
3999
+ var keywordTextSchema = z8.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4000
+ var budgetCreateSchema = z8.object({
4001
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4107
4002
  amountMicros: microsSchema,
4108
- deliveryMethod: z9.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4109
- explicitlyShared: z9.boolean().default(false)
4003
+ deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4004
+ explicitlyShared: z8.boolean().default(false)
4110
4005
  });
4111
- var budgetUpdateSchema = z9.object({
4112
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4006
+ var budgetUpdateSchema = z8.object({
4007
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4113
4008
  amountMicros: microsSchema.optional(),
4114
- deliveryMethod: z9.enum(BUDGET_DELIVERY_METHODS).optional()
4009
+ deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).optional()
4115
4010
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4116
- var biddingConfigSchema = z9.object({
4117
- type: z9.enum(BIDDING_STRATEGY_TYPES),
4011
+ var biddingConfigSchema = z8.object({
4012
+ type: z8.enum(BIDDING_STRATEGY_TYPES),
4118
4013
  targetCpaMicros: microsSchema.optional(),
4119
- targetRoas: z9.number().positive().optional(),
4014
+ targetRoas: z8.number().positive().optional(),
4120
4015
  cpcBidCeilingMicros: microsSchema.optional(),
4121
- enhancedCpcEnabled: z9.boolean().optional()
4016
+ enhancedCpcEnabled: z8.boolean().optional()
4122
4017
  }).superRefine((p, ctx) => {
4123
4018
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4124
4019
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4127,17 +4022,17 @@ var biddingConfigSchema = z9.object({
4127
4022
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4128
4023
  }
4129
4024
  });
4130
- var networkSettingsSchema = z9.object({
4131
- targetGoogleSearch: z9.boolean().optional(),
4132
- targetSearchNetwork: z9.boolean().optional(),
4133
- targetContentNetwork: z9.boolean().optional(),
4134
- targetPartnerSearchNetwork: z9.boolean().optional()
4025
+ var networkSettingsSchema = z8.object({
4026
+ targetGoogleSearch: z8.boolean().optional(),
4027
+ targetSearchNetwork: z8.boolean().optional(),
4028
+ targetContentNetwork: z8.boolean().optional(),
4029
+ targetPartnerSearchNetwork: z8.boolean().optional()
4135
4030
  });
4136
- var dateSchema = z9.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4137
- var campaignCreateSchema2 = z9.object({
4138
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4139
- channelType: z9.enum(ADVERTISING_CHANNEL_TYPES),
4140
- channelSubType: z9.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4031
+ var dateSchema = z8.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4032
+ var campaignCreateSchema2 = z8.object({
4033
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4034
+ channelType: z8.enum(ADVERTISING_CHANNEL_TYPES),
4035
+ channelSubType: z8.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4141
4036
  budget: refSchema,
4142
4037
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4143
4038
  bidding: biddingConfigSchema.optional(),
@@ -4146,7 +4041,7 @@ var campaignCreateSchema2 = z9.object({
4146
4041
  startDate: dateSchema.optional(),
4147
4042
  endDate: dateSchema.optional(),
4148
4043
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4149
- objective: z9.enum(CAMPAIGN_OBJECTIVES).optional(),
4044
+ objective: z8.enum(CAMPAIGN_OBJECTIVES).optional(),
4150
4045
  status: stageableStatusSchema2.default("PAUSED")
4151
4046
  }).superRefine((p, ctx) => {
4152
4047
  if (!p.bidding && !p.biddingStrategy) {
@@ -4170,129 +4065,129 @@ var campaignCreateSchema2 = z9.object({
4170
4065
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4171
4066
  }
4172
4067
  });
4173
- var campaignUpdateSchema2 = z9.object({
4174
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4068
+ var campaignUpdateSchema2 = z8.object({
4069
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4175
4070
  budget: refSchema.optional(),
4176
4071
  bidding: biddingConfigSchema.optional(),
4177
4072
  networkSettings: networkSettingsSchema.optional(),
4178
4073
  startDate: dateSchema.optional(),
4179
4074
  endDate: dateSchema.optional(),
4180
- status: z9.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4075
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4181
4076
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4182
- var adGroupCreateSchema = z9.object({
4183
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4077
+ var adGroupCreateSchema = z8.object({
4078
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4184
4079
  campaign: refSchema,
4185
- type: z9.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4080
+ type: z8.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4186
4081
  cpcBidMicros: microsSchema.optional(),
4187
4082
  status: stageableStatusSchema2.default("PAUSED")
4188
4083
  });
4189
- var adGroupUpdateSchema = z9.object({
4190
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4084
+ var adGroupUpdateSchema = z8.object({
4085
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4191
4086
  cpcBidMicros: microsSchema.optional(),
4192
- status: z9.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4087
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4193
4088
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4194
- var keywordAddSchema = z9.object({
4089
+ var keywordAddSchema = z8.object({
4195
4090
  adGroup: refSchema,
4196
4091
  text: keywordTextSchema,
4197
4092
  matchType: matchTypeSchema,
4198
4093
  cpcBidMicros: microsSchema.optional(),
4199
- finalUrls: z9.array(httpsUrlSchema2).optional(),
4094
+ finalUrls: z8.array(httpsUrlSchema2).optional(),
4200
4095
  status: stageableStatusSchema2.default("ENABLED")
4201
4096
  });
4202
- var keywordUpdateSchema = z9.object({
4097
+ var keywordUpdateSchema = z8.object({
4203
4098
  cpcBidMicros: microsSchema.optional(),
4204
- finalUrls: z9.array(httpsUrlSchema2).optional(),
4205
- status: z9.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4099
+ finalUrls: z8.array(httpsUrlSchema2).optional(),
4100
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4206
4101
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4207
- var negativeKeywordAddSchema = z9.object({
4208
- level: z9.enum(["adGroup", "campaign"]),
4102
+ var negativeKeywordAddSchema = z8.object({
4103
+ level: z8.enum(["adGroup", "campaign"]),
4209
4104
  parent: refSchema,
4210
4105
  text: keywordTextSchema,
4211
4106
  matchType: matchTypeSchema
4212
4107
  });
4213
- var sharedSetCreateSchema = z9.object({
4214
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4215
- type: z9.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4108
+ var sharedSetCreateSchema = z8.object({
4109
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4110
+ type: z8.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4216
4111
  });
4217
- var sharedSetMemberAddSchema = z9.object({
4112
+ var sharedSetMemberAddSchema = z8.object({
4218
4113
  sharedSet: refSchema,
4219
4114
  text: keywordTextSchema,
4220
4115
  matchType: matchTypeSchema
4221
4116
  });
4222
- var campaignSharedSetAttachSchema = z9.object({
4117
+ var campaignSharedSetAttachSchema = z8.object({
4223
4118
  campaign: refSchema,
4224
4119
  sharedSet: refSchema
4225
4120
  });
4226
- var adTextAssetSchema = z9.object({
4227
- text: z9.string().min(1),
4228
- pinnedField: z9.enum(PINNED_FIELDS).optional()
4121
+ var adTextAssetSchema = z8.object({
4122
+ text: z8.string().min(1),
4123
+ pinnedField: z8.enum(PINNED_FIELDS).optional()
4229
4124
  });
4230
- var responsiveSearchAdSchema = z9.object({
4231
- format: z9.literal("responsiveSearch"),
4232
- headlines: z9.array(
4125
+ var responsiveSearchAdSchema = z8.object({
4126
+ format: z8.literal("responsiveSearch"),
4127
+ headlines: z8.array(
4233
4128
  adTextAssetSchema.refine(
4234
4129
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4235
4130
  "headline exceeds 30 chars"
4236
4131
  )
4237
4132
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4238
- descriptions: z9.array(
4133
+ descriptions: z8.array(
4239
4134
  adTextAssetSchema.refine(
4240
4135
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4241
4136
  "description exceeds 90 chars"
4242
4137
  )
4243
4138
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4244
- path1: z9.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4245
- path2: z9.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4246
- finalUrls: z9.array(httpsUrlSchema2).min(1)
4247
- });
4248
- var responsiveDisplayAdSchema = z9.object({
4249
- format: z9.literal("responsiveDisplay"),
4250
- headlines: z9.array(z9.object({ text: z9.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4251
- longHeadline: z9.object({ text: z9.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4252
- descriptions: z9.array(z9.object({ text: z9.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4253
- businessName: z9.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4139
+ path1: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4140
+ path2: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4141
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4142
+ });
4143
+ var responsiveDisplayAdSchema = z8.object({
4144
+ format: z8.literal("responsiveDisplay"),
4145
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4146
+ longHeadline: z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4147
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4148
+ businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4254
4149
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4255
4150
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4256
4151
  // image (1:1) to serve; the logo images are optional.
4257
- marketingImageAssets: z9.array(refSchema).optional(),
4258
- squareMarketingImageAssets: z9.array(refSchema).optional(),
4259
- logoImageAssets: z9.array(refSchema).optional(),
4260
- finalUrls: z9.array(httpsUrlSchema2).min(1)
4261
- });
4262
- var callAdSchema = z9.object({
4263
- format: z9.literal("call"),
4264
- countryCode: z9.string().length(2),
4265
- phoneNumber: z9.string().min(3),
4266
- headline1: z9.string().min(1).max(30),
4267
- headline2: z9.string().min(1).max(30),
4268
- description1: z9.string().min(1).max(90),
4269
- description2: z9.string().min(1).max(90),
4270
- businessName: z9.string().min(1).max(25),
4271
- finalUrls: z9.array(httpsUrlSchema2).min(1)
4272
- });
4273
- var appAdSchema = z9.object({
4274
- format: z9.literal("app"),
4275
- headlines: z9.array(z9.object({ text: z9.string().min(1).max(30) })).min(1),
4276
- descriptions: z9.array(z9.object({ text: z9.string().min(1).max(90) })).min(1)
4277
- });
4278
- var videoAdSchema = z9.object({
4279
- format: z9.literal("video"),
4152
+ marketingImageAssets: z8.array(refSchema).optional(),
4153
+ squareMarketingImageAssets: z8.array(refSchema).optional(),
4154
+ logoImageAssets: z8.array(refSchema).optional(),
4155
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4156
+ });
4157
+ var callAdSchema = z8.object({
4158
+ format: z8.literal("call"),
4159
+ countryCode: z8.string().length(2),
4160
+ phoneNumber: z8.string().min(3),
4161
+ headline1: z8.string().min(1).max(30),
4162
+ headline2: z8.string().min(1).max(30),
4163
+ description1: z8.string().min(1).max(90),
4164
+ description2: z8.string().min(1).max(90),
4165
+ businessName: z8.string().min(1).max(25),
4166
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4167
+ });
4168
+ var appAdSchema = z8.object({
4169
+ format: z8.literal("app"),
4170
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(1),
4171
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1)
4172
+ });
4173
+ var videoAdSchema = z8.object({
4174
+ format: z8.literal("video"),
4280
4175
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4281
4176
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4282
- videoAssets: z9.array(refSchema).min(1),
4283
- finalUrls: z9.array(httpsUrlSchema2).min(1)
4284
- });
4285
- var demandGenAdSchema = z9.object({
4286
- format: z9.literal("demandGen"),
4287
- headlines: z9.array(z9.object({ text: z9.string().min(1).max(40) })).min(1).max(5),
4288
- descriptions: z9.array(z9.object({ text: z9.string().min(1).max(90) })).min(1).max(5),
4289
- businessName: z9.string().min(1).max(25),
4290
- finalUrls: z9.array(httpsUrlSchema2).min(1),
4291
- imageAssets: z9.array(refSchema).optional(),
4292
- squareImageAssets: z9.array(refSchema).optional(),
4293
- logoImageAssets: z9.array(refSchema).optional()
4294
- });
4295
- var adContentSchema = z9.discriminatedUnion("format", [
4177
+ videoAssets: z8.array(refSchema).min(1),
4178
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4179
+ });
4180
+ var demandGenAdSchema = z8.object({
4181
+ format: z8.literal("demandGen"),
4182
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(40) })).min(1).max(5),
4183
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1).max(5),
4184
+ businessName: z8.string().min(1).max(25),
4185
+ finalUrls: z8.array(httpsUrlSchema2).min(1),
4186
+ imageAssets: z8.array(refSchema).optional(),
4187
+ squareImageAssets: z8.array(refSchema).optional(),
4188
+ logoImageAssets: z8.array(refSchema).optional()
4189
+ });
4190
+ var adContentSchema = z8.discriminatedUnion("format", [
4296
4191
  responsiveSearchAdSchema,
4297
4192
  responsiveDisplayAdSchema,
4298
4193
  callAdSchema,
@@ -4300,45 +4195,45 @@ var adContentSchema = z9.discriminatedUnion("format", [
4300
4195
  videoAdSchema,
4301
4196
  demandGenAdSchema
4302
4197
  ]);
4303
- var adCreateSchema = z9.object({
4198
+ var adCreateSchema = z8.object({
4304
4199
  adGroup: refSchema,
4305
4200
  status: stageableStatusSchema2.default("PAUSED"),
4306
4201
  content: adContentSchema
4307
4202
  });
4308
- var adUpdateSchema = z9.object({
4309
- status: z9.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4203
+ var adUpdateSchema = z8.object({
4204
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4310
4205
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4311
- content: z9.record(z9.string(), z9.unknown()).optional()
4206
+ content: z8.record(z8.string(), z8.unknown()).optional()
4312
4207
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4313
- var textAssetSchema = z9.object({ type: z9.literal("text"), text: z9.string().min(1) });
4314
- var imageAssetSchema = z9.object({
4315
- type: z9.literal("image"),
4316
- imageId: z9.string().min(1),
4317
- name: z9.string().optional()
4318
- });
4319
- var youtubeVideoAssetSchema = z9.object({
4320
- type: z9.literal("youtubeVideo"),
4321
- youtubeVideoId: z9.string().min(1),
4322
- name: z9.string().optional()
4323
- });
4324
- var sitelinkAssetSchema = z9.object({
4325
- type: z9.literal("sitelink"),
4326
- linkText: z9.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4327
- description1: z9.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4328
- description2: z9.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4329
- finalUrls: z9.array(httpsUrlSchema2).min(1)
4330
- });
4331
- var calloutAssetSchema = z9.object({
4332
- type: z9.literal("callout"),
4333
- calloutText: z9.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4334
- });
4335
- var structuredSnippetAssetSchema = z9.object({
4336
- type: z9.literal("structuredSnippet"),
4337
- header: z9.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4338
- values: z9.array(z9.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4339
- });
4340
- var callToActionAssetSchema = z9.object({ type: z9.literal("callToAction"), callToAction: z9.string().min(1) });
4341
- var assetCreateSchema = z9.discriminatedUnion("type", [
4208
+ var textAssetSchema = z8.object({ type: z8.literal("text"), text: z8.string().min(1) });
4209
+ var imageAssetSchema = z8.object({
4210
+ type: z8.literal("image"),
4211
+ imageId: z8.string().min(1),
4212
+ name: z8.string().optional()
4213
+ });
4214
+ var youtubeVideoAssetSchema = z8.object({
4215
+ type: z8.literal("youtubeVideo"),
4216
+ youtubeVideoId: z8.string().min(1),
4217
+ name: z8.string().optional()
4218
+ });
4219
+ var sitelinkAssetSchema = z8.object({
4220
+ type: z8.literal("sitelink"),
4221
+ linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4222
+ description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4223
+ description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4224
+ finalUrls: z8.array(httpsUrlSchema2).min(1)
4225
+ });
4226
+ var calloutAssetSchema = z8.object({
4227
+ type: z8.literal("callout"),
4228
+ calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4229
+ });
4230
+ var structuredSnippetAssetSchema = z8.object({
4231
+ type: z8.literal("structuredSnippet"),
4232
+ header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4233
+ values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4234
+ });
4235
+ var callToActionAssetSchema = z8.object({ type: z8.literal("callToAction"), callToAction: z8.string().min(1) });
4236
+ var assetCreateSchema = z8.discriminatedUnion("type", [
4342
4237
  textAssetSchema,
4343
4238
  imageAssetSchema,
4344
4239
  youtubeVideoAssetSchema,
@@ -4347,136 +4242,136 @@ var assetCreateSchema = z9.discriminatedUnion("type", [
4347
4242
  structuredSnippetAssetSchema,
4348
4243
  callToActionAssetSchema
4349
4244
  ]);
4350
- var assetUpdateSchema = z9.object({
4351
- name: z9.string().min(1).optional(),
4352
- linkText: z9.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4353
- description1: z9.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4354
- description2: z9.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4355
- finalUrls: z9.array(httpsUrlSchema2).min(1).optional(),
4356
- calloutText: z9.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4357
- header: z9.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4358
- values: z9.array(z9.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4359
- callToAction: z9.string().min(1).optional(),
4360
- text: z9.string().min(1).optional()
4245
+ var assetUpdateSchema = z8.object({
4246
+ name: z8.string().min(1).optional(),
4247
+ linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4248
+ description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4249
+ description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4250
+ finalUrls: z8.array(httpsUrlSchema2).min(1).optional(),
4251
+ calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4252
+ header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4253
+ values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4254
+ callToAction: z8.string().min(1).optional(),
4255
+ text: z8.string().min(1).optional()
4361
4256
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4362
- var assetLinkAttachSchema = z9.object({
4363
- level: z9.enum(["campaign", "adGroup", "customer"]),
4257
+ var assetLinkAttachSchema = z8.object({
4258
+ level: z8.enum(["campaign", "adGroup", "customer"]),
4364
4259
  parent: refSchema.optional(),
4365
4260
  asset: refSchema,
4366
- fieldType: z9.enum(ASSET_FIELD_TYPES)
4261
+ fieldType: z8.enum(ASSET_FIELD_TYPES)
4367
4262
  }).superRefine((value, ctx) => {
4368
4263
  if (value.level !== "customer" && !value.parent) {
4369
4264
  ctx.addIssue({
4370
- code: z9.ZodIssueCode.custom,
4265
+ code: z8.ZodIssueCode.custom,
4371
4266
  path: ["parent"],
4372
4267
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4373
4268
  });
4374
4269
  }
4375
4270
  });
4376
- var assetGroupCreateSchema = z9.object({
4271
+ var assetGroupCreateSchema = z8.object({
4377
4272
  campaign: refSchema,
4378
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4379
- finalUrls: z9.array(httpsUrlSchema2).min(1),
4380
- headlines: z9.array(z9.object({ text: z9.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4381
- longHeadlines: z9.array(z9.object({ text: z9.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4382
- descriptions: z9.array(z9.object({ text: z9.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4383
- businessName: z9.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4384
- imageAssets: z9.array(refSchema).optional(),
4385
- squareImageAssets: z9.array(refSchema).optional(),
4386
- logoAssets: z9.array(refSchema).optional(),
4387
- status: z9.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4388
- });
4389
- var assetGroupUpdateSchema = z9.object({
4390
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4391
- finalUrls: z9.array(httpsUrlSchema2).min(1).optional(),
4392
- status: z9.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4273
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
4274
+ finalUrls: z8.array(httpsUrlSchema2).min(1),
4275
+ headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
4276
+ longHeadlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
4277
+ descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
4278
+ businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
4279
+ imageAssets: z8.array(refSchema).optional(),
4280
+ squareImageAssets: z8.array(refSchema).optional(),
4281
+ logoAssets: z8.array(refSchema).optional(),
4282
+ status: z8.enum(["ENABLED", "PAUSED"]).default("PAUSED")
4283
+ });
4284
+ var assetGroupUpdateSchema = z8.object({
4285
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
4286
+ finalUrls: z8.array(httpsUrlSchema2).min(1).optional(),
4287
+ status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4393
4288
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4394
- var audienceCreateSchema2 = z9.object({
4395
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4396
- type: z9.enum(USER_LIST_TYPES).default("BASIC"),
4397
- description: z9.string().optional(),
4289
+ var audienceCreateSchema2 = z8.object({
4290
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
4291
+ type: z8.enum(USER_LIST_TYPES).default("BASIC"),
4292
+ description: z8.string().optional(),
4398
4293
  /** Customer-match members (crm-based) — file-first for large lists. */
4399
- members: z9.array(z9.record(z9.string(), z9.string())).optional(),
4400
- sourceFileRef: z9.string().optional()
4294
+ members: z8.array(z8.record(z8.string(), z8.string())).optional(),
4295
+ sourceFileRef: z8.string().optional()
4401
4296
  });
4402
- var audienceCriterionAttachSchema = z9.object({
4403
- level: z9.enum(["campaign", "adGroup"]),
4297
+ var audienceCriterionAttachSchema = z8.object({
4298
+ level: z8.enum(["campaign", "adGroup"]),
4404
4299
  parent: refSchema,
4405
4300
  userList: refSchema,
4406
- negative: z9.boolean().default(false)
4301
+ negative: z8.boolean().default(false)
4407
4302
  });
4408
- var conversionActionCreateSchema = z9.object({
4409
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4410
- type: z9.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4411
- category: z9.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4412
- countingType: z9.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4303
+ var conversionActionCreateSchema = z8.object({
4304
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
4305
+ type: z8.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
4306
+ category: z8.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
4307
+ countingType: z8.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
4413
4308
  defaultValueMicros: microsSchema.optional(),
4414
- defaultCurrencyCode: z9.string().length(3).optional(),
4415
- clickThroughLookbackWindowDays: z9.number().int().positive().optional(),
4416
- viewThroughLookbackWindowDays: z9.number().int().positive().optional(),
4417
- status: z9.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4418
- });
4419
- var conversionActionUpdateSchema = z9.object({
4420
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4421
- category: z9.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4422
- countingType: z9.enum(CONVERSION_COUNTING_TYPES).optional(),
4309
+ defaultCurrencyCode: z8.string().length(3).optional(),
4310
+ clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
4311
+ viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
4312
+ status: z8.enum(["ENABLED", "PAUSED"]).default("ENABLED")
4313
+ });
4314
+ var conversionActionUpdateSchema = z8.object({
4315
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
4316
+ category: z8.enum(CONVERSION_ACTION_CATEGORIES).optional(),
4317
+ countingType: z8.enum(CONVERSION_COUNTING_TYPES).optional(),
4423
4318
  defaultValueMicros: microsSchema.optional(),
4424
- defaultCurrencyCode: z9.string().length(3).optional(),
4425
- clickThroughLookbackWindowDays: z9.number().int().positive().optional(),
4426
- viewThroughLookbackWindowDays: z9.number().int().positive().optional(),
4427
- status: z9.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4319
+ defaultCurrencyCode: z8.string().length(3).optional(),
4320
+ clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
4321
+ viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
4322
+ status: z8.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
4428
4323
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4429
- var biddingStrategyCreateSchema = z9.object({
4430
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4324
+ var biddingStrategyCreateSchema = z8.object({
4325
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
4431
4326
  config: biddingConfigSchema
4432
4327
  }).superRefine((p, ctx) => {
4433
4328
  if (p.config.type === "MANUAL_CPC") {
4434
4329
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
4435
4330
  }
4436
4331
  });
4437
- var biddingStrategyUpdateSchema = z9.object({
4438
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4332
+ var biddingStrategyUpdateSchema = z8.object({
4333
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
4439
4334
  config: biddingConfigSchema.optional()
4440
4335
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4441
- var labelCreateSchema = z9.object({
4442
- name: z9.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4443
- backgroundColor: z9.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4444
- description: z9.string().optional()
4336
+ var labelCreateSchema = z8.object({
4337
+ name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
4338
+ backgroundColor: z8.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
4339
+ description: z8.string().optional()
4445
4340
  });
4446
- var labelAttachSchema = z9.object({
4447
- level: z9.enum(["campaign", "adGroup", "ad"]),
4341
+ var labelAttachSchema = z8.object({
4342
+ level: z8.enum(["campaign", "adGroup", "ad"]),
4448
4343
  parent: refSchema,
4449
4344
  label: refSchema
4450
4345
  });
4451
- var locationCriterionSchema = z9.object({
4452
- criterionType: z9.literal("location"),
4453
- geoTargetConstant: z9.union([z9.string().regex(GEO_TARGET_CONSTANT_REGEX), z9.string().regex(NUMERIC_ID_REGEX2)])
4454
- });
4455
- var languageCriterionSchema = z9.object({
4456
- criterionType: z9.literal("language"),
4457
- languageConstant: z9.union([z9.string().regex(LANGUAGE_CONSTANT_REGEX), z9.string().regex(NUMERIC_ID_REGEX2)])
4458
- });
4459
- var adScheduleCriterionSchema = z9.object({
4460
- criterionType: z9.literal("adSchedule"),
4461
- dayOfWeek: z9.enum(DAYS_OF_WEEK),
4462
- startHour: z9.number().int().min(0).max(23),
4463
- startMinute: z9.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4464
- endHour: z9.number().int().min(0).max(24),
4465
- endMinute: z9.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4466
- });
4467
- var deviceCriterionSchema = z9.object({
4468
- criterionType: z9.literal("device"),
4469
- device: z9.enum(DEVICE_TYPES),
4346
+ var locationCriterionSchema = z8.object({
4347
+ criterionType: z8.literal("location"),
4348
+ geoTargetConstant: z8.union([z8.string().regex(GEO_TARGET_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
4349
+ });
4350
+ var languageCriterionSchema = z8.object({
4351
+ criterionType: z8.literal("language"),
4352
+ languageConstant: z8.union([z8.string().regex(LANGUAGE_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
4353
+ });
4354
+ var adScheduleCriterionSchema = z8.object({
4355
+ criterionType: z8.literal("adSchedule"),
4356
+ dayOfWeek: z8.enum(DAYS_OF_WEEK),
4357
+ startHour: z8.number().int().min(0).max(23),
4358
+ startMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
4359
+ endHour: z8.number().int().min(0).max(24),
4360
+ endMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
4361
+ });
4362
+ var deviceCriterionSchema = z8.object({
4363
+ criterionType: z8.literal("device"),
4364
+ device: z8.enum(DEVICE_TYPES),
4470
4365
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
4471
4366
  // 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.
4472
- bidModifier: z9.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4367
+ bidModifier: z8.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
4473
4368
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
4474
4369
  })
4475
4370
  });
4476
- var campaignCriterionAddSchema = z9.object({
4371
+ var campaignCriterionAddSchema = z8.object({
4477
4372
  campaign: refSchema,
4478
- negative: z9.boolean().default(false),
4479
- criterion: z9.discriminatedUnion("criterionType", [
4373
+ negative: z8.boolean().default(false),
4374
+ criterion: z8.discriminatedUnion("criterionType", [
4480
4375
  locationCriterionSchema,
4481
4376
  languageCriterionSchema,
4482
4377
  adScheduleCriterionSchema,
@@ -4486,7 +4381,7 @@ var campaignCriterionAddSchema = z9.object({
4486
4381
  const c = val.criterion;
4487
4382
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
4488
4383
  ctx.addIssue({
4489
- code: z9.ZodIssueCode.custom,
4384
+ code: z8.ZodIssueCode.custom,
4490
4385
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
4491
4386
  path: ["criterion", "endMinute"]
4492
4387
  });
@@ -4538,17 +4433,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
4538
4433
  "google.campaignCriterion.add",
4539
4434
  "google.campaignCriterion.remove"
4540
4435
  ];
4541
- var googleDraftOpKindSchema = z9.enum(GOOGLE_DRAFT_OP_KINDS);
4436
+ var googleDraftOpKindSchema = z8.enum(GOOGLE_DRAFT_OP_KINDS);
4542
4437
  function createOp2(kind, payload) {
4543
- return z9.object({ kind: z9.literal(kind), customerId: customerIdSchema, payload });
4438
+ return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, payload });
4544
4439
  }
4545
4440
  function updateOp2(kind, payload) {
4546
- return z9.object({ kind: z9.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4441
+ return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
4547
4442
  }
4548
4443
  function targetOp(kind) {
4549
- return z9.object({ kind: z9.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4444
+ return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
4550
4445
  }
4551
- var googleDraftOpInputSchema = z9.discriminatedUnion("kind", [
4446
+ var googleDraftOpInputSchema = z8.discriminatedUnion("kind", [
4552
4447
  createOp2("google.budget.create", budgetCreateSchema),
4553
4448
  updateOp2("google.budget.update", budgetUpdateSchema),
4554
4449
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -4596,132 +4491,132 @@ var googleDraftOpInputSchema = z9.discriminatedUnion("kind", [
4596
4491
  ]);
4597
4492
 
4598
4493
  // ../api/src/ads-google/wire.ts
4599
- import { z as z10 } from "zod";
4600
- var googleWriteModeSchema = z10.enum(["live", "simulated"]);
4601
- var googleDraftOpResultSchema = z10.object({
4602
- status: z10.enum(["applied", "simulated", "failed", "skipped"]),
4603
- resourceName: z10.string().optional(),
4604
- error: z10.string().optional(),
4605
- skippedBecause: z10.string().optional(),
4606
- executedAt: z10.number().optional()
4607
- });
4608
- var googleDraftStageRequestSchema = z10.object({
4609
- chatId: z10.string(),
4494
+ import { z as z9 } from "zod";
4495
+ var googleWriteModeSchema = z9.enum(["live", "simulated"]);
4496
+ var googleDraftOpResultSchema = z9.object({
4497
+ status: z9.enum(["applied", "simulated", "failed", "skipped"]),
4498
+ resourceName: z9.string().optional(),
4499
+ error: z9.string().optional(),
4500
+ skippedBecause: z9.string().optional(),
4501
+ executedAt: z9.number().optional()
4502
+ });
4503
+ var googleDraftStageRequestSchema = z9.object({
4504
+ chatId: z9.string(),
4610
4505
  op: googleDraftOpInputSchema
4611
4506
  });
4612
- var googleDraftStageResponseSchema = z10.object({
4613
- staged: z10.literal(true),
4614
- ref: z10.string(),
4507
+ var googleDraftStageResponseSchema = z9.object({
4508
+ staged: z9.literal(true),
4509
+ ref: z9.string(),
4615
4510
  kind: googleDraftOpKindSchema,
4616
4511
  mode: googleWriteModeSchema,
4617
- dependsOn: z10.array(z10.string()),
4618
- summary: z10.string(),
4619
- warnings: z10.array(z10.string()),
4512
+ dependsOn: z9.array(z9.string()),
4513
+ summary: z9.string(),
4514
+ warnings: z9.array(z9.string()),
4620
4515
  /** True when the op amended an already-staged op in place instead of appending a new one. */
4621
- amended: z10.boolean().optional()
4516
+ amended: z9.boolean().optional()
4622
4517
  });
4623
- var googleDraftAmendRequestSchema = z10.object({
4624
- chatId: z10.string(),
4625
- ref: z10.string(),
4626
- patch: z10.record(z10.string(), z10.unknown())
4518
+ var googleDraftAmendRequestSchema = z9.object({
4519
+ chatId: z9.string(),
4520
+ ref: z9.string(),
4521
+ patch: z9.record(z9.string(), z9.unknown())
4627
4522
  });
4628
- var googleDraftShowRequestSchema = z10.object({
4629
- chatId: z10.string(),
4630
- ref: z10.string()
4523
+ var googleDraftShowRequestSchema = z9.object({
4524
+ chatId: z9.string(),
4525
+ ref: z9.string()
4631
4526
  });
4632
4527
  var GOOGLE_DRAFT_BATCH_MAX = 500;
4633
- var googleDraftStageBatchRequestSchema = z10.object({
4634
- chatId: z10.string(),
4635
- ops: z10.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4528
+ var googleDraftStageBatchRequestSchema = z9.object({
4529
+ chatId: z9.string(),
4530
+ ops: z9.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
4636
4531
  });
4637
- var googleDraftStageBatchResponseSchema = z10.object({
4638
- staged: z10.literal(true),
4532
+ var googleDraftStageBatchResponseSchema = z9.object({
4533
+ staged: z9.literal(true),
4639
4534
  mode: googleWriteModeSchema,
4640
- count: z10.number(),
4641
- ops: z10.array(
4642
- z10.object({
4643
- ref: z10.string(),
4535
+ count: z9.number(),
4536
+ ops: z9.array(
4537
+ z9.object({
4538
+ ref: z9.string(),
4644
4539
  kind: googleDraftOpKindSchema,
4645
- dependsOn: z10.array(z10.string()),
4646
- summary: z10.string(),
4647
- warnings: z10.array(z10.string())
4540
+ dependsOn: z9.array(z9.string()),
4541
+ summary: z9.string(),
4542
+ warnings: z9.array(z9.string())
4648
4543
  })
4649
4544
  )
4650
4545
  });
4651
- var googleDraftOpViewSchema = z10.object({
4652
- ref: z10.string(),
4546
+ var googleDraftOpViewSchema = z9.object({
4547
+ ref: z9.string(),
4653
4548
  kind: googleDraftOpKindSchema,
4654
- customerId: z10.string(),
4655
- target: z10.string().optional(),
4656
- dependsOn: z10.array(z10.string()),
4657
- summary: z10.string(),
4658
- stagedAt: z10.number(),
4549
+ customerId: z9.string(),
4550
+ target: z9.string().optional(),
4551
+ dependsOn: z9.array(z9.string()),
4552
+ summary: z9.string(),
4553
+ stagedAt: z9.number(),
4659
4554
  result: googleDraftOpResultSchema.optional()
4660
4555
  });
4661
- var googleDraftShowResponseSchema = z10.object({
4556
+ var googleDraftShowResponseSchema = z9.object({
4662
4557
  op: googleDraftOpViewSchema.extend({
4663
- payload: z10.unknown().optional(),
4664
- warnings: z10.array(z10.string()).optional(),
4665
- annotations: z10.unknown().optional()
4558
+ payload: z9.unknown().optional(),
4559
+ warnings: z9.array(z9.string()).optional(),
4560
+ annotations: z9.unknown().optional()
4666
4561
  })
4667
4562
  });
4668
- var googleDraftListRequestSchema = z10.object({
4669
- chatId: z10.string()
4563
+ var googleDraftListRequestSchema = z9.object({
4564
+ chatId: z9.string()
4670
4565
  });
4671
- var googleDraftAdvisorySchema = z10.object({
4672
- scope: z10.enum(["campaign", "adGroup"]),
4673
- message: z10.string()
4566
+ var googleDraftAdvisorySchema = z9.object({
4567
+ scope: z9.enum(["campaign", "adGroup"]),
4568
+ message: z9.string()
4674
4569
  });
4675
- var googleDraftStatusCollectionSchema = z10.object({
4676
- label: z10.string(),
4677
- added: z10.number(),
4678
- removed: z10.number(),
4679
- existing: z10.number()
4570
+ var googleDraftStatusCollectionSchema = z9.object({
4571
+ label: z9.string(),
4572
+ added: z9.number(),
4573
+ removed: z9.number(),
4574
+ existing: z9.number()
4680
4575
  });
4681
- var googleDraftChangeOperationSchema = z10.enum(["create", "update", "pause", "resume", "remove"]);
4682
- var googleDraftStatusNodeSchema = z10.lazy(
4683
- () => z10.object({
4684
- entity: z10.string(),
4685
- name: z10.string(),
4576
+ var googleDraftChangeOperationSchema = z9.enum(["create", "update", "pause", "resume", "remove"]);
4577
+ var googleDraftStatusNodeSchema = z9.lazy(
4578
+ () => z9.object({
4579
+ entity: z9.string(),
4580
+ name: z9.string(),
4686
4581
  operation: googleDraftChangeOperationSchema.optional(),
4687
- existing: z10.boolean(),
4688
- collections: z10.array(googleDraftStatusCollectionSchema),
4689
- children: z10.array(googleDraftStatusNodeSchema),
4690
- warnings: z10.array(z10.string()).optional()
4582
+ existing: z9.boolean(),
4583
+ collections: z9.array(googleDraftStatusCollectionSchema),
4584
+ children: z9.array(googleDraftStatusNodeSchema),
4585
+ warnings: z9.array(z9.string()).optional()
4691
4586
  })
4692
4587
  );
4693
- var googleDraftListResponseSchema = z10.object({
4694
- status: z10.enum(["active", "publishing", "applied", "discarded", "none"]),
4588
+ var googleDraftListResponseSchema = z9.object({
4589
+ status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
4695
4590
  mode: googleWriteModeSchema,
4696
- count: z10.number(),
4697
- ops: z10.array(googleDraftOpViewSchema),
4591
+ count: z9.number(),
4592
+ ops: z9.array(googleDraftOpViewSchema),
4698
4593
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
4699
- tree: z10.array(googleDraftStatusNodeSchema).optional(),
4594
+ tree: z9.array(googleDraftStatusNodeSchema).optional(),
4700
4595
  /** Non-blocking completeness advisories for the whole draft. */
4701
- advisories: z10.array(googleDraftAdvisorySchema).optional()
4596
+ advisories: z9.array(googleDraftAdvisorySchema).optional()
4702
4597
  });
4703
- var googleDraftRemoveRequestSchema = z10.object({
4704
- chatId: z10.string(),
4705
- ref: z10.string()
4598
+ var googleDraftRemoveRequestSchema = z9.object({
4599
+ chatId: z9.string(),
4600
+ ref: z9.string()
4706
4601
  });
4707
- var googleDraftRemoveResponseSchema = z10.object({
4602
+ var googleDraftRemoveResponseSchema = z9.object({
4708
4603
  /** The requested ref plus any dependents removed by cascade. */
4709
- removed: z10.array(z10.string())
4604
+ removed: z9.array(z9.string())
4710
4605
  });
4711
- var googleDraftClearRequestSchema = z10.object({
4712
- chatId: z10.string()
4606
+ var googleDraftClearRequestSchema = z9.object({
4607
+ chatId: z9.string()
4713
4608
  });
4714
- var googleDraftClearResponseSchema = z10.object({
4715
- cleared: z10.number()
4609
+ var googleDraftClearResponseSchema = z9.object({
4610
+ cleared: z9.number()
4716
4611
  });
4717
- var googleFieldErrorSchema = z10.object({
4718
- path: z10.string(),
4719
- message: z10.string()
4612
+ var googleFieldErrorSchema = z9.object({
4613
+ path: z9.string(),
4614
+ message: z9.string()
4720
4615
  });
4721
- var googleDraftErrorResponseSchema = z10.object({
4722
- code: z10.string(),
4723
- error: z10.string(),
4724
- fields: z10.array(googleFieldErrorSchema).optional()
4616
+ var googleDraftErrorResponseSchema = z9.object({
4617
+ code: z9.string(),
4618
+ error: z9.string(),
4619
+ fields: z9.array(googleFieldErrorSchema).optional()
4725
4620
  });
4726
4621
 
4727
4622
  // src/commands/ads/google/draft-status.ts
@@ -11029,17 +10924,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
11029
10924
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
11030
10925
 
11031
10926
  // ../api/src/ads-meta/ops.ts
11032
- import { z as z11 } from "zod";
11033
- var tempRefSchema3 = z11.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
11034
- var parentRefSchema2 = z11.union([z11.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
11035
- var moneySchema2 = z11.object({
11036
- amount: z11.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"),
11037
- currencyCode: z11.string().length(3).optional()
11038
- });
11039
- var httpsUrlSchema3 = z11.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
11040
- var bakerMediaIdSchema2 = z11.string().min(1);
11041
- var stageableStatusSchema3 = z11.enum(STAGEABLE_CREATE_STATUSES3);
11042
- var updateStatusSchema = z11.enum(UPDATE_STATUSES);
10927
+ import { z as z10 } from "zod";
10928
+ var tempRefSchema3 = z10.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
10929
+ var parentRefSchema2 = z10.union([z10.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
10930
+ var moneySchema2 = z10.object({
10931
+ amount: z10.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
10932
+ currencyCode: z10.string().length(3).optional()
10933
+ });
10934
+ var httpsUrlSchema3 = z10.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
10935
+ var bakerMediaIdSchema2 = z10.string().min(1);
10936
+ var stageableStatusSchema3 = z10.enum(STAGEABLE_CREATE_STATUSES3);
10937
+ var updateStatusSchema = z10.enum(UPDATE_STATUSES);
11043
10938
  function currencyMinimums2(currencyCode) {
11044
10939
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
11045
10940
  }
@@ -11051,50 +10946,50 @@ function validateDailyBudgetFloor(money, ctx, path12) {
11051
10946
  }
11052
10947
  }
11053
10948
  }
11054
- var geoLocationsSchema = z11.object({
11055
- countries: z11.array(z11.string().length(2)).optional(),
11056
- regions: z11.array(z11.object({ key: z11.string() })).optional(),
11057
- cities: z11.array(z11.object({ key: z11.string(), radius: z11.number().optional(), distance_unit: z11.string().optional() })).optional(),
11058
- zips: z11.array(z11.object({ key: z11.string() })).optional(),
11059
- location_types: z11.array(z11.string()).optional()
11060
- }).catchall(z11.unknown());
11061
- var idNameSchema = z11.object({ id: z11.string(), name: z11.string().optional() });
11062
- var metaTargetingSchema = z11.object({
10949
+ var geoLocationsSchema = z10.object({
10950
+ countries: z10.array(z10.string().length(2)).optional(),
10951
+ regions: z10.array(z10.object({ key: z10.string() })).optional(),
10952
+ cities: z10.array(z10.object({ key: z10.string(), radius: z10.number().optional(), distance_unit: z10.string().optional() })).optional(),
10953
+ zips: z10.array(z10.object({ key: z10.string() })).optional(),
10954
+ location_types: z10.array(z10.string()).optional()
10955
+ }).catchall(z10.unknown());
10956
+ var idNameSchema = z10.object({ id: z10.string(), name: z10.string().optional() });
10957
+ var metaTargetingSchema = z10.object({
11063
10958
  geo_locations: geoLocationsSchema.optional(),
11064
10959
  excluded_geo_locations: geoLocationsSchema.optional(),
11065
- age_min: z11.number().int().min(13).max(65).optional(),
11066
- age_max: z11.number().int().min(13).max(65).optional(),
11067
- genders: z11.array(z11.union([z11.literal(1), z11.literal(2)])).optional(),
11068
- locales: z11.array(z11.number().int()).optional(),
11069
- interests: z11.array(idNameSchema).optional(),
11070
- behaviors: z11.array(idNameSchema).optional(),
11071
- custom_audiences: z11.array(z11.object({ id: parentRefSchema2 })).optional(),
11072
- excluded_custom_audiences: z11.array(z11.object({ id: parentRefSchema2 })).optional(),
11073
- flexible_spec: z11.array(z11.record(z11.string(), z11.unknown())).optional(),
11074
- exclusions: z11.record(z11.string(), z11.unknown()).optional(),
11075
- publisher_platforms: z11.array(z11.string()).optional(),
11076
- facebook_positions: z11.array(z11.string()).optional(),
11077
- instagram_positions: z11.array(z11.string()).optional(),
11078
- audience_network_positions: z11.array(z11.string()).optional(),
11079
- messenger_positions: z11.array(z11.string()).optional(),
11080
- device_platforms: z11.array(z11.string()).optional(),
11081
- targeting_automation: z11.object({ advantage_audience: z11.union([z11.literal(0), z11.literal(1)]) }).partial().optional()
11082
- }).catchall(z11.unknown());
11083
- var specialAdCategoriesSchema = z11.array(z11.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
11084
- var campaignCreateSchema3 = z11.object({
11085
- name: z11.string().min(1).max(META_LIMITS.campaign.nameMax),
11086
- objective: z11.enum(OBJECTIVES),
10960
+ age_min: z10.number().int().min(13).max(65).optional(),
10961
+ age_max: z10.number().int().min(13).max(65).optional(),
10962
+ genders: z10.array(z10.union([z10.literal(1), z10.literal(2)])).optional(),
10963
+ locales: z10.array(z10.number().int()).optional(),
10964
+ interests: z10.array(idNameSchema).optional(),
10965
+ behaviors: z10.array(idNameSchema).optional(),
10966
+ custom_audiences: z10.array(z10.object({ id: parentRefSchema2 })).optional(),
10967
+ excluded_custom_audiences: z10.array(z10.object({ id: parentRefSchema2 })).optional(),
10968
+ flexible_spec: z10.array(z10.record(z10.string(), z10.unknown())).optional(),
10969
+ exclusions: z10.record(z10.string(), z10.unknown()).optional(),
10970
+ publisher_platforms: z10.array(z10.string()).optional(),
10971
+ facebook_positions: z10.array(z10.string()).optional(),
10972
+ instagram_positions: z10.array(z10.string()).optional(),
10973
+ audience_network_positions: z10.array(z10.string()).optional(),
10974
+ messenger_positions: z10.array(z10.string()).optional(),
10975
+ device_platforms: z10.array(z10.string()).optional(),
10976
+ targeting_automation: z10.object({ advantage_audience: z10.union([z10.literal(0), z10.literal(1)]) }).partial().optional()
10977
+ }).catchall(z10.unknown());
10978
+ var specialAdCategoriesSchema = z10.array(z10.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
10979
+ var campaignCreateSchema3 = z10.object({
10980
+ name: z10.string().min(1).max(META_LIMITS.campaign.nameMax),
10981
+ objective: z10.enum(OBJECTIVES),
11087
10982
  status: stageableStatusSchema3.default("PAUSED"),
11088
10983
  special_ad_categories: specialAdCategoriesSchema,
11089
- special_ad_category_country: z11.array(z11.string().length(2)).optional(),
11090
- buying_type: z11.enum(BUYING_TYPES).default("AUCTION"),
11091
- bid_strategy: z11.enum(BID_STRATEGIES).optional(),
10984
+ special_ad_category_country: z10.array(z10.string().length(2)).optional(),
10985
+ buying_type: z10.enum(BUYING_TYPES).default("AUCTION"),
10986
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
11092
10987
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
11093
10988
  dailyBudget: moneySchema2.optional(),
11094
10989
  lifetimeBudget: moneySchema2.optional(),
11095
10990
  spendCap: moneySchema2.optional(),
11096
- start_time: z11.number().int().positive().optional(),
11097
- stop_time: z11.number().int().positive().optional()
10991
+ start_time: z10.number().int().positive().optional(),
10992
+ stop_time: z10.number().int().positive().optional()
11098
10993
  }).superRefine((p, ctx) => {
11099
10994
  if (p.dailyBudget && p.lifetimeBudget) {
11100
10995
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -11104,15 +10999,15 @@ var campaignCreateSchema3 = z11.object({
11104
10999
  ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
11105
11000
  }
11106
11001
  });
11107
- var campaignUpdateSchema3 = z11.object({
11108
- name: z11.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11002
+ var campaignUpdateSchema3 = z10.object({
11003
+ name: z10.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
11109
11004
  status: updateStatusSchema.optional(),
11110
- bid_strategy: z11.enum(BID_STRATEGIES).optional(),
11005
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
11111
11006
  dailyBudget: moneySchema2.optional(),
11112
11007
  lifetimeBudget: moneySchema2.optional(),
11113
11008
  spendCap: moneySchema2.optional(),
11114
- start_time: z11.number().int().positive().optional(),
11115
- stop_time: z11.number().int().positive().optional()
11009
+ start_time: z10.number().int().positive().optional(),
11010
+ stop_time: z10.number().int().positive().optional()
11116
11011
  }).superRefine((p, ctx) => {
11117
11012
  if (!Object.values(p).some((val) => val !== void 0)) {
11118
11013
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -11122,38 +11017,38 @@ var campaignUpdateSchema3 = z11.object({
11122
11017
  }
11123
11018
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
11124
11019
  });
11125
- var promotedObjectSchema = z11.object({
11020
+ var promotedObjectSchema = z10.object({
11126
11021
  page_id: parentRefSchema2.optional(),
11127
- pixel_id: z11.string().regex(NUMERIC_ID_REGEX3).optional(),
11128
- custom_event_type: z11.enum(CUSTOM_EVENT_TYPES).optional(),
11129
- application_id: z11.string().regex(NUMERIC_ID_REGEX3).optional(),
11130
- object_store_url: z11.string().url().optional(),
11131
- product_catalog_id: z11.string().regex(NUMERIC_ID_REGEX3).optional(),
11132
- product_set_id: z11.string().regex(NUMERIC_ID_REGEX3).optional(),
11133
- whatsapp_phone_number: z11.string().optional(),
11134
- offline_conversion_data_set_id: z11.string().regex(NUMERIC_ID_REGEX3).optional()
11022
+ pixel_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11023
+ custom_event_type: z10.enum(CUSTOM_EVENT_TYPES).optional(),
11024
+ application_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11025
+ object_store_url: z10.string().url().optional(),
11026
+ product_catalog_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11027
+ product_set_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11028
+ whatsapp_phone_number: z10.string().optional(),
11029
+ offline_conversion_data_set_id: z10.string().regex(NUMERIC_ID_REGEX3).optional()
11135
11030
  }).partial();
11136
- var attributionSpecSchema = z11.array(
11137
- z11.object({
11138
- event_type: z11.enum(ATTRIBUTION_EVENT_TYPES),
11139
- window_days: z11.union([z11.literal(1), z11.literal(7), z11.literal(28)])
11031
+ var attributionSpecSchema = z10.array(
11032
+ z10.object({
11033
+ event_type: z10.enum(ATTRIBUTION_EVENT_TYPES),
11034
+ window_days: z10.union([z10.literal(1), z10.literal(7), z10.literal(28)])
11140
11035
  })
11141
11036
  );
11142
11037
  var adSetFields = {
11143
- name: z11.string().min(1).max(META_LIMITS.adSet.nameMax),
11038
+ name: z10.string().min(1).max(META_LIMITS.adSet.nameMax),
11144
11039
  campaign_id: parentRefSchema2,
11145
11040
  status: stageableStatusSchema3.default("PAUSED"),
11146
11041
  dailyBudget: moneySchema2.optional(),
11147
11042
  lifetimeBudget: moneySchema2.optional(),
11148
11043
  bidAmount: moneySchema2.optional(),
11149
- bid_strategy: z11.enum(BID_STRATEGIES).optional(),
11150
- billing_event: z11.enum(BILLING_EVENTS),
11151
- optimization_goal: z11.enum(OPTIMIZATION_GOALS),
11152
- destination_type: z11.enum(DESTINATION_TYPES).optional(),
11044
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
11045
+ billing_event: z10.enum(BILLING_EVENTS),
11046
+ optimization_goal: z10.enum(OPTIMIZATION_GOALS),
11047
+ destination_type: z10.enum(DESTINATION_TYPES).optional(),
11153
11048
  promoted_object: promotedObjectSchema.optional(),
11154
11049
  attribution_spec: attributionSpecSchema.optional(),
11155
- start_time: z11.number().int().positive().optional(),
11156
- end_time: z11.number().int().positive().optional(),
11050
+ start_time: z10.number().int().positive().optional(),
11051
+ end_time: z10.number().int().positive().optional(),
11157
11052
  targeting: metaTargetingSchema
11158
11053
  };
11159
11054
  function validateAdSetBudgetAndBid(p, ctx) {
@@ -11171,22 +11066,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
11171
11066
  ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
11172
11067
  }
11173
11068
  }
11174
- var adSetCreateSchema = z11.object(adSetFields).superRefine((p, ctx) => {
11069
+ var adSetCreateSchema = z10.object(adSetFields).superRefine((p, ctx) => {
11175
11070
  validateAdSetBudgetAndBid(p, ctx);
11176
11071
  });
11177
- var adSetUpdateSchema = z11.object({
11072
+ var adSetUpdateSchema = z10.object({
11178
11073
  name: adSetFields.name.optional(),
11179
11074
  status: updateStatusSchema.optional(),
11180
11075
  dailyBudget: moneySchema2.optional(),
11181
11076
  lifetimeBudget: moneySchema2.optional(),
11182
11077
  bidAmount: moneySchema2.optional(),
11183
- bid_strategy: z11.enum(BID_STRATEGIES).optional(),
11184
- optimization_goal: z11.enum(OPTIMIZATION_GOALS).optional(),
11185
- destination_type: z11.enum(DESTINATION_TYPES).optional(),
11078
+ bid_strategy: z10.enum(BID_STRATEGIES).optional(),
11079
+ optimization_goal: z10.enum(OPTIMIZATION_GOALS).optional(),
11080
+ destination_type: z10.enum(DESTINATION_TYPES).optional(),
11186
11081
  promoted_object: promotedObjectSchema.optional(),
11187
11082
  attribution_spec: attributionSpecSchema.optional(),
11188
- start_time: z11.number().int().positive().optional(),
11189
- end_time: z11.number().int().positive().optional(),
11083
+ start_time: z10.number().int().positive().optional(),
11084
+ end_time: z10.number().int().positive().optional(),
11190
11085
  targeting: metaTargetingSchema.optional()
11191
11086
  }).superRefine((p, ctx) => {
11192
11087
  if (!Object.values(p).some((val) => val !== void 0)) {
@@ -11194,38 +11089,38 @@ var adSetUpdateSchema = z11.object({
11194
11089
  }
11195
11090
  validateAdSetBudgetAndBid(p, ctx);
11196
11091
  });
11197
- var messageSchema = z11.string().min(1).max(META_LIMITS.creative.messageHardMax);
11198
- var headlineSchema2 = z11.string().min(1).max(META_LIMITS.creative.headlineMax);
11199
- var descriptionSchema = z11.string().min(1).max(META_LIMITS.creative.descriptionMax);
11200
- var callToActionSchema = z11.object({
11201
- type: z11.enum(CTA_TYPES2),
11092
+ var messageSchema = z10.string().min(1).max(META_LIMITS.creative.messageHardMax);
11093
+ var headlineSchema2 = z10.string().min(1).max(META_LIMITS.creative.headlineMax);
11094
+ var descriptionSchema = z10.string().min(1).max(META_LIMITS.creative.descriptionMax);
11095
+ var callToActionSchema = z10.object({
11096
+ type: z10.enum(CTA_TYPES2),
11202
11097
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
11203
11098
  link: httpsUrlSchema3.optional()
11204
11099
  });
11205
- var creativeEnhancementsSchema = z11.object({
11206
- standardEnhancements: z11.enum(ENROLL_STATUSES).optional(),
11207
- features: z11.record(z11.string(), z11.enum(ENROLL_STATUSES)).optional()
11100
+ var creativeEnhancementsSchema = z10.object({
11101
+ standardEnhancements: z10.enum(ENROLL_STATUSES).optional(),
11102
+ features: z10.record(z10.string(), z10.enum(ENROLL_STATUSES)).optional()
11208
11103
  });
11209
11104
  var creativeSharedFields = {
11210
- name: z11.string().max(META_LIMITS.creative.nameMax).optional(),
11105
+ name: z10.string().max(META_LIMITS.creative.nameMax).optional(),
11211
11106
  /** Facebook Page id backing the ad's identity. */
11212
11107
  page_id: parentRefSchema2,
11213
11108
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
11214
- instagram_user_id: z11.string().regex(NUMERIC_ID_REGEX3).optional(),
11109
+ instagram_user_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11215
11110
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
11216
- url_tags: z11.string().max(1e3).optional(),
11111
+ url_tags: z10.string().max(1e3).optional(),
11217
11112
  enhancements: creativeEnhancementsSchema.optional()
11218
11113
  };
11219
11114
  var imageMediaFields = {
11220
- imageHash: z11.string().regex(IMAGE_HASH_REGEX).optional(),
11115
+ imageHash: z10.string().regex(IMAGE_HASH_REGEX).optional(),
11221
11116
  imageRef: tempRefSchema3.optional()
11222
11117
  };
11223
11118
  var videoMediaFields = {
11224
- videoId: z11.string().regex(NUMERIC_ID_REGEX3).optional(),
11119
+ videoId: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
11225
11120
  videoRef: tempRefSchema3.optional(),
11226
11121
  /** Thumbnail for a video creative — image hash, ref, or public url. */
11227
- thumbnailHash: z11.string().regex(IMAGE_HASH_REGEX).optional(),
11228
- imageUrl: z11.string().url().optional()
11122
+ thumbnailHash: z10.string().regex(IMAGE_HASH_REGEX).optional(),
11123
+ imageUrl: z10.string().url().optional()
11229
11124
  };
11230
11125
  function countImageRefs(p) {
11231
11126
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -11233,8 +11128,8 @@ function countImageRefs(p) {
11233
11128
  function countVideoRefs(p) {
11234
11129
  return [p.videoId, p.videoRef].filter(Boolean).length;
11235
11130
  }
11236
- var singleCreativeSchema = z11.object({
11237
- creativeType: z11.literal("single"),
11131
+ var singleCreativeSchema = z10.object({
11132
+ creativeType: z10.literal("single"),
11238
11133
  ...creativeSharedFields,
11239
11134
  /** Primary text. */
11240
11135
  message: messageSchema,
@@ -11243,7 +11138,7 @@ var singleCreativeSchema = z11.object({
11243
11138
  headline: headlineSchema2.optional(),
11244
11139
  description: descriptionSchema.optional(),
11245
11140
  /** Display URL / caption shown under the headline. */
11246
- caption: z11.string().max(255).optional(),
11141
+ caption: z10.string().max(255).optional(),
11247
11142
  call_to_action: callToActionSchema.optional(),
11248
11143
  ...imageMediaFields,
11249
11144
  ...videoMediaFields
@@ -11267,10 +11162,10 @@ var singleCreativeSchema = z11.object({
11267
11162
  });
11268
11163
  }
11269
11164
  });
11270
- var carouselCardSchema = z11.object({
11165
+ var carouselCardSchema = z10.object({
11271
11166
  link: httpsUrlSchema3,
11272
- headline: z11.string().max(META_LIMITS.creative.headlineMax).optional(),
11273
- description: z11.string().max(META_LIMITS.creative.descriptionMax).optional(),
11167
+ headline: z10.string().max(META_LIMITS.creative.headlineMax).optional(),
11168
+ description: z10.string().max(META_LIMITS.creative.descriptionMax).optional(),
11274
11169
  call_to_action: callToActionSchema.optional(),
11275
11170
  ...imageMediaFields,
11276
11171
  ...videoMediaFields
@@ -11290,35 +11185,35 @@ var carouselCardSchema = z11.object({
11290
11185
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
11291
11186
  }
11292
11187
  });
11293
- var carouselCreativeSchema2 = z11.object({
11294
- creativeType: z11.literal("carousel"),
11188
+ var carouselCreativeSchema2 = z10.object({
11189
+ creativeType: z10.literal("carousel"),
11295
11190
  ...creativeSharedFields,
11296
11191
  message: messageSchema,
11297
11192
  /** Optional "see more" card destination applied when a card has no own link. */
11298
11193
  link: httpsUrlSchema3.optional(),
11299
11194
  call_to_action: callToActionSchema.optional(),
11300
- cards: z11.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11195
+ cards: z10.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
11301
11196
  });
11302
- var dynamicImageSchema = z11.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11303
- var dynamicVideoSchema = z11.object({
11197
+ var dynamicImageSchema = z10.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
11198
+ var dynamicVideoSchema = z10.object({
11304
11199
  videoId: videoMediaFields.videoId,
11305
11200
  videoRef: videoMediaFields.videoRef,
11306
11201
  thumbnailHash: videoMediaFields.thumbnailHash
11307
11202
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
11308
11203
  var DYN = META_LIMITS.creative;
11309
- var dynamicCreativeSchema = z11.object({
11310
- creativeType: z11.literal("dynamic"),
11204
+ var dynamicCreativeSchema = z10.object({
11205
+ creativeType: z10.literal("dynamic"),
11311
11206
  ...creativeSharedFields,
11312
- bodies: z11.array(z11.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11313
- titles: z11.array(z11.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11314
- descriptions: z11.array(z11.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11315
- images: z11.array(dynamicImageSchema).optional(),
11316
- videos: z11.array(dynamicVideoSchema).optional(),
11317
- ad_formats: z11.array(z11.enum(AD_FORMATS2)).min(1),
11318
- call_to_action_types: z11.array(z11.enum(CTA_TYPES2)).optional(),
11319
- link_urls: z11.array(z11.object({ website_url: httpsUrlSchema3, display_url: z11.string().optional() })).min(1),
11207
+ bodies: z10.array(z10.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11208
+ titles: z10.array(z10.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
11209
+ descriptions: z10.array(z10.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
11210
+ images: z10.array(dynamicImageSchema).optional(),
11211
+ videos: z10.array(dynamicVideoSchema).optional(),
11212
+ ad_formats: z10.array(z10.enum(AD_FORMATS2)).min(1),
11213
+ call_to_action_types: z10.array(z10.enum(CTA_TYPES2)).optional(),
11214
+ link_urls: z10.array(z10.object({ website_url: httpsUrlSchema3, display_url: z10.string().optional() })).min(1),
11320
11215
  /** Multi-language / placement customization — structural passthrough for v1. */
11321
- asset_customization_rules: z11.array(z11.record(z11.string(), z11.unknown())).optional()
11216
+ asset_customization_rules: z10.array(z10.record(z10.string(), z10.unknown())).optional()
11322
11217
  }).superRefine((p, ctx) => {
11323
11218
  if (!(p.images?.length || p.videos?.length)) {
11324
11219
  ctx.addIssue({
@@ -11328,57 +11223,57 @@ var dynamicCreativeSchema = z11.object({
11328
11223
  });
11329
11224
  }
11330
11225
  });
11331
- var existingPostCreativeSchema = z11.object({
11332
- creativeType: z11.literal("existing_post"),
11226
+ var existingPostCreativeSchema = z10.object({
11227
+ creativeType: z10.literal("existing_post"),
11333
11228
  name: creativeSharedFields.name,
11334
11229
  /** "<page_id>_<post_id>" object story id of the post to promote. */
11335
- object_story_id: z11.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11230
+ object_story_id: z10.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
11336
11231
  instagram_user_id: creativeSharedFields.instagram_user_id,
11337
11232
  url_tags: creativeSharedFields.url_tags,
11338
11233
  enhancements: creativeSharedFields.enhancements
11339
11234
  });
11340
- var creativeContentSchema2 = z11.discriminatedUnion("creativeType", [
11235
+ var creativeContentSchema2 = z10.discriminatedUnion("creativeType", [
11341
11236
  singleCreativeSchema,
11342
11237
  carouselCreativeSchema2,
11343
11238
  dynamicCreativeSchema,
11344
11239
  existingPostCreativeSchema
11345
11240
  ]);
11346
11241
  var adCreativeCreateSchema = creativeContentSchema2;
11347
- var adCreativeUpdateSchema = z11.object({
11348
- name: z11.string().max(META_LIMITS.creative.nameMax).optional(),
11242
+ var adCreativeUpdateSchema = z10.object({
11243
+ name: z10.string().max(META_LIMITS.creative.nameMax).optional(),
11349
11244
  status: updateStatusSchema.optional(),
11350
11245
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
11351
- content: z11.record(z11.string(), z11.unknown()).optional()
11246
+ content: z10.record(z10.string(), z10.unknown()).optional()
11352
11247
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11353
- var adCreateSchema2 = z11.object({
11354
- name: z11.string().min(1).max(META_LIMITS.ad.nameMax),
11248
+ var adCreateSchema2 = z10.object({
11249
+ name: z10.string().min(1).max(META_LIMITS.ad.nameMax),
11355
11250
  adset_id: parentRefSchema2,
11356
11251
  status: stageableStatusSchema3.default("PAUSED"),
11357
- creative: z11.object({ creative_id: parentRefSchema2 }),
11252
+ creative: z10.object({ creative_id: parentRefSchema2 }),
11358
11253
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
11359
- tracking_specs: z11.array(z11.record(z11.string(), z11.unknown())).optional()
11254
+ tracking_specs: z10.array(z10.record(z10.string(), z10.unknown())).optional()
11360
11255
  });
11361
- var adUpdateSchema2 = z11.object({
11362
- name: z11.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11256
+ var adUpdateSchema2 = z10.object({
11257
+ name: z10.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
11363
11258
  status: updateStatusSchema.optional(),
11364
11259
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
11365
- creative: z11.object({ creative_id: parentRefSchema2 }).optional(),
11366
- tracking_specs: z11.array(z11.record(z11.string(), z11.unknown())).optional()
11260
+ creative: z10.object({ creative_id: parentRefSchema2 }).optional(),
11261
+ tracking_specs: z10.array(z10.record(z10.string(), z10.unknown())).optional()
11367
11262
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11368
- var lookalikeSpecSchema = z11.object({
11369
- origin: z11.array(z11.object({ id: parentRefSchema2 })).min(1),
11370
- ratio: z11.number().min(0.01).max(0.2).optional(),
11371
- country: z11.string().length(2).optional()
11372
- });
11373
- var customAudienceCreateSchema = z11.object({
11374
- name: z11.string().min(1).max(META_LIMITS.audience.nameMax),
11375
- subtype: z11.enum(CUSTOM_AUDIENCE_SUBTYPES),
11376
- description: z11.string().max(500).optional(),
11377
- customer_file_source: z11.string().optional(),
11378
- retention_days: z11.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11263
+ var lookalikeSpecSchema = z10.object({
11264
+ origin: z10.array(z10.object({ id: parentRefSchema2 })).min(1),
11265
+ ratio: z10.number().min(0.01).max(0.2).optional(),
11266
+ country: z10.string().length(2).optional()
11267
+ });
11268
+ var customAudienceCreateSchema = z10.object({
11269
+ name: z10.string().min(1).max(META_LIMITS.audience.nameMax),
11270
+ subtype: z10.enum(CUSTOM_AUDIENCE_SUBTYPES),
11271
+ description: z10.string().max(500).optional(),
11272
+ customer_file_source: z10.string().optional(),
11273
+ retention_days: z10.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
11379
11274
  lookalike_spec: lookalikeSpecSchema.optional(),
11380
11275
  /** Website/engagement rule — structural passthrough validated by Meta. */
11381
- rule: z11.record(z11.string(), z11.unknown()).optional()
11276
+ rule: z10.record(z10.string(), z10.unknown()).optional()
11382
11277
  }).superRefine((p, ctx) => {
11383
11278
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
11384
11279
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -11387,16 +11282,16 @@ var customAudienceCreateSchema = z11.object({
11387
11282
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
11388
11283
  }
11389
11284
  });
11390
- var customAudienceUpdateSchema = z11.object({
11391
- name: z11.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11392
- description: z11.string().max(500).optional()
11285
+ var customAudienceUpdateSchema = z10.object({
11286
+ name: z10.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
11287
+ description: z10.string().max(500).optional()
11393
11288
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
11394
- var mediaUploadSchema = z11.object({
11395
- kind: z11.enum(MEDIA_KINDS),
11289
+ var mediaUploadSchema = z10.object({
11290
+ kind: z10.enum(MEDIA_KINDS),
11396
11291
  bakerImageId: bakerMediaIdSchema2.optional(),
11397
11292
  bakerVideoId: bakerMediaIdSchema2.optional(),
11398
11293
  /** Optional display name / filename hint. */
11399
- name: z11.string().max(255).optional()
11294
+ name: z10.string().max(255).optional()
11400
11295
  }).superRefine((p, ctx) => {
11401
11296
  if (p.kind === "image" && !p.bakerImageId) {
11402
11297
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -11418,16 +11313,16 @@ var META_DRAFT_OP_KINDS = [
11418
11313
  "customAudience.update",
11419
11314
  "media.upload"
11420
11315
  ];
11421
- var metaDraftOpKindSchema = z11.enum(META_DRAFT_OP_KINDS);
11422
- var accountIdSchema2 = z11.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11423
- var updateTargetSchema2 = z11.union([z11.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11316
+ var metaDraftOpKindSchema = z10.enum(META_DRAFT_OP_KINDS);
11317
+ var accountIdSchema2 = z10.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
11318
+ var updateTargetSchema2 = z10.union([z10.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
11424
11319
  function createOp3(kind, payload) {
11425
- return z11.object({ kind: z11.literal(kind), accountId: accountIdSchema2, payload });
11320
+ return z10.object({ kind: z10.literal(kind), accountId: accountIdSchema2, payload });
11426
11321
  }
11427
11322
  function updateOp3(kind, payload) {
11428
- return z11.object({ kind: z11.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11323
+ return z10.object({ kind: z10.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
11429
11324
  }
11430
- var metaDraftOpInputSchema = z11.discriminatedUnion("kind", [
11325
+ var metaDraftOpInputSchema = z10.discriminatedUnion("kind", [
11431
11326
  createOp3("campaign.create", campaignCreateSchema3),
11432
11327
  updateOp3("campaign.update", campaignUpdateSchema3),
11433
11328
  createOp3("adSet.create", adSetCreateSchema),
@@ -11442,89 +11337,89 @@ var metaDraftOpInputSchema = z11.discriminatedUnion("kind", [
11442
11337
  ]);
11443
11338
 
11444
11339
  // ../api/src/ads-meta/wire.ts
11445
- import { z as z12 } from "zod";
11446
- var metaWriteModeSchema = z12.enum(["live", "simulated"]);
11447
- var metaDraftOpResultSchema = z12.object({
11448
- status: z12.enum(["applied", "simulated", "failed", "skipped"]),
11340
+ import { z as z11 } from "zod";
11341
+ var metaWriteModeSchema = z11.enum(["live", "simulated"]);
11342
+ var metaDraftOpResultSchema = z11.object({
11343
+ status: z11.enum(["applied", "simulated", "failed", "skipped"]),
11449
11344
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
11450
- id: z12.string().optional(),
11345
+ id: z11.string().optional(),
11451
11346
  /** For media.upload ops: the resulting image hash. */
11452
- hash: z12.string().optional(),
11453
- error: z12.string().optional(),
11454
- skippedBecause: z12.string().optional(),
11455
- executedAt: z12.number().optional()
11347
+ hash: z11.string().optional(),
11348
+ error: z11.string().optional(),
11349
+ skippedBecause: z11.string().optional(),
11350
+ executedAt: z11.number().optional()
11456
11351
  });
11457
- var metaDraftStageRequestSchema = z12.object({
11458
- chatId: z12.string(),
11352
+ var metaDraftStageRequestSchema = z11.object({
11353
+ chatId: z11.string(),
11459
11354
  op: metaDraftOpInputSchema
11460
11355
  });
11461
- var metaDraftStageResponseSchema = z12.object({
11462
- staged: z12.literal(true),
11463
- ref: z12.string(),
11356
+ var metaDraftStageResponseSchema = z11.object({
11357
+ staged: z11.literal(true),
11358
+ ref: z11.string(),
11464
11359
  kind: metaDraftOpKindSchema,
11465
11360
  mode: metaWriteModeSchema,
11466
- dependsOn: z12.array(z12.string()),
11467
- summary: z12.string(),
11468
- warnings: z12.array(z12.string()),
11361
+ dependsOn: z11.array(z11.string()),
11362
+ summary: z11.string(),
11363
+ warnings: z11.array(z11.string()),
11469
11364
  /** True when the op amended an already-staged op in place instead of appending a new one. */
11470
- amended: z12.boolean().optional()
11471
- });
11472
- var metaDraftDuplicateRequestSchema = z12.object({
11473
- chatId: z12.string(),
11474
- accountId: z12.string(),
11475
- entity: z12.enum(["campaign", "adSet", "ad"]),
11476
- sourceId: z12.string(),
11477
- overrides: z12.record(z12.string(), z12.unknown()).optional(),
11365
+ amended: z11.boolean().optional()
11366
+ });
11367
+ var metaDraftDuplicateRequestSchema = z11.object({
11368
+ chatId: z11.string(),
11369
+ accountId: z11.string(),
11370
+ entity: z11.enum(["campaign", "adSet", "ad"]),
11371
+ sourceId: z11.string(),
11372
+ overrides: z11.record(z11.string(), z11.unknown()).optional(),
11478
11373
  /** Pause the original after the copy publishes. */
11479
- replace: z12.boolean().optional()
11374
+ replace: z11.boolean().optional()
11480
11375
  });
11481
- var metaDraftOpViewSchema = z12.object({
11482
- ref: z12.string(),
11376
+ var metaDraftOpViewSchema = z11.object({
11377
+ ref: z11.string(),
11483
11378
  kind: metaDraftOpKindSchema,
11484
- accountId: z12.string(),
11485
- target: z12.string().optional(),
11486
- dependsOn: z12.array(z12.string()),
11487
- summary: z12.string(),
11488
- stagedAt: z12.number(),
11379
+ accountId: z11.string(),
11380
+ target: z11.string().optional(),
11381
+ dependsOn: z11.array(z11.string()),
11382
+ summary: z11.string(),
11383
+ stagedAt: z11.number(),
11489
11384
  result: metaDraftOpResultSchema.optional()
11490
11385
  });
11491
- var metaDraftListRequestSchema = z12.object({
11492
- chatId: z12.string()
11386
+ var metaDraftListRequestSchema = z11.object({
11387
+ chatId: z11.string()
11493
11388
  });
11494
- var metaDraftAdvisorySchema = z12.object({
11495
- ref: z12.string(),
11496
- message: z12.string()
11389
+ var metaDraftAdvisorySchema = z11.object({
11390
+ ref: z11.string(),
11391
+ message: z11.string()
11497
11392
  });
11498
- var metaDraftListResponseSchema = z12.object({
11499
- status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
11393
+ var metaDraftListResponseSchema = z11.object({
11394
+ status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
11500
11395
  mode: metaWriteModeSchema,
11501
- count: z12.number(),
11502
- ops: z12.array(metaDraftOpViewSchema),
11396
+ count: z11.number(),
11397
+ ops: z11.array(metaDraftOpViewSchema),
11503
11398
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
11504
- advisories: z12.array(metaDraftAdvisorySchema)
11399
+ advisories: z11.array(metaDraftAdvisorySchema)
11505
11400
  });
11506
- var metaDraftRemoveRequestSchema = z12.object({
11507
- chatId: z12.string(),
11508
- ref: z12.string()
11401
+ var metaDraftRemoveRequestSchema = z11.object({
11402
+ chatId: z11.string(),
11403
+ ref: z11.string()
11509
11404
  });
11510
- var metaDraftRemoveResponseSchema = z12.object({
11405
+ var metaDraftRemoveResponseSchema = z11.object({
11511
11406
  /** The requested ref plus any dependents removed by cascade. */
11512
- removed: z12.array(z12.string())
11407
+ removed: z11.array(z11.string())
11513
11408
  });
11514
- var metaDraftClearRequestSchema = z12.object({
11515
- chatId: z12.string()
11409
+ var metaDraftClearRequestSchema = z11.object({
11410
+ chatId: z11.string()
11516
11411
  });
11517
- var metaDraftClearResponseSchema = z12.object({
11518
- cleared: z12.number()
11412
+ var metaDraftClearResponseSchema = z11.object({
11413
+ cleared: z11.number()
11519
11414
  });
11520
- var metaFieldErrorSchema = z12.object({
11521
- path: z12.string(),
11522
- message: z12.string()
11415
+ var metaFieldErrorSchema = z11.object({
11416
+ path: z11.string(),
11417
+ message: z11.string()
11523
11418
  });
11524
- var metaDraftErrorResponseSchema = z12.object({
11525
- code: z12.string(),
11526
- error: z12.string(),
11527
- fields: z12.array(metaFieldErrorSchema).optional()
11419
+ var metaDraftErrorResponseSchema = z11.object({
11420
+ code: z11.string(),
11421
+ error: z11.string(),
11422
+ fields: z11.array(metaFieldErrorSchema).optional()
11528
11423
  });
11529
11424
 
11530
11425
  // src/commands/ads/meta/write-shared.ts
@@ -14801,27 +14696,27 @@ import path6 from "path";
14801
14696
  import { defineCommand as defineCommand89 } from "citty";
14802
14697
 
14803
14698
  // src/engine/scaffold/staticAd.ts
14804
- import { z as z13 } from "zod";
14699
+ import { z as z12 } from "zod";
14805
14700
  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"]);
14806
14701
  var DEFAULT_ASPECT_RATIO = "9:16";
14807
- var Blueprint = z13.object({
14808
- meta: z13.object({ estimated_aspect_ratio: z13.string().optional() }).loose().optional(),
14809
- text_content: z13.array(z13.object({ text: z13.string().optional() }).loose()).optional()
14702
+ var Blueprint = z12.object({
14703
+ meta: z12.object({ estimated_aspect_ratio: z12.string().optional() }).loose().optional(),
14704
+ text_content: z12.array(z12.object({ text: z12.string().optional() }).loose()).optional()
14810
14705
  }).loose();
14811
- var ElementLocator = z13.object({
14812
- collection: z13.enum(["subjects", "people", "brands_logos"]),
14813
- index: z13.number().int().nonnegative()
14706
+ var ElementLocator = z12.object({
14707
+ collection: z12.enum(["subjects", "people", "brands_logos"]),
14708
+ index: z12.number().int().nonnegative()
14814
14709
  }).loose();
14815
- var MainElement = z13.object({
14710
+ var MainElement = z12.object({
14816
14711
  // logo | product | person | animal | badge | other
14817
- type: z13.string(),
14818
- label: z13.string().optional(),
14819
- description: z13.string().optional(),
14820
- expression: z13.string().nullable().optional(),
14821
- reason: z13.string().optional(),
14712
+ type: z12.string(),
14713
+ label: z12.string().optional(),
14714
+ description: z12.string().optional(),
14715
+ expression: z12.string().nullable().optional(),
14716
+ reason: z12.string().optional(),
14822
14717
  locator: ElementLocator.optional()
14823
14718
  }).loose();
14824
- var MainElements = z13.array(MainElement);
14719
+ var MainElements = z12.array(MainElement);
14825
14720
  function sanitizeId(raw, fallback) {
14826
14721
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
14827
14722
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -15357,7 +15252,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
15357
15252
  import { toCardinal as nwNl } from "n2words/nl-NL";
15358
15253
  import { toCardinal as nwPl } from "n2words/pl-PL";
15359
15254
  import { toCardinal as nwPt } from "n2words/pt-PT";
15360
- import { z as z14 } from "zod";
15255
+ import { z as z13 } from "zod";
15361
15256
 
15362
15257
  // src/engine/scaffold/lib/shoot-modes.ts
15363
15258
  var SHOOT_MODES = [
@@ -15670,71 +15565,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
15670
15565
  "{{out.video}}"
15671
15566
  ];
15672
15567
  }
15673
- var FrameAsset = z14.object({ url: z14.string().optional() }).loose().optional();
15674
- var DialogueLine = z14.object({
15675
- speaker: z14.string().optional(),
15676
- line: z14.string().optional(),
15568
+ var FrameAsset = z13.object({ url: z13.string().optional() }).loose().optional();
15569
+ var DialogueLine = z13.object({
15570
+ speaker: z13.string().optional(),
15571
+ line: z13.string().optional(),
15677
15572
  // Absolute seconds on the source timeline (the deconstruct emits both).
15678
- start_s: z14.number().optional(),
15679
- end_s: z14.number().optional(),
15680
- delivery: z14.string().optional(),
15681
- voice_description: z14.string().optional(),
15573
+ start_s: z13.number().optional(),
15574
+ end_s: z13.number().optional(),
15575
+ delivery: z13.string().optional(),
15576
+ voice_description: z13.string().optional(),
15682
15577
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
15683
15578
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
15684
15579
  // "present" yet the line is voiceover, and treating it as on-camera produced a
15685
15580
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
15686
15581
  // the VO path; absent keeps the presence-based decision (old blueprints).
15687
- on_camera: z14.boolean().optional()
15582
+ on_camera: z13.boolean().optional()
15688
15583
  }).loose();
15689
- var Sfx = z14.object({
15690
- at_s: z14.number().optional(),
15691
- duration_s: z14.number().optional(),
15692
- sound_effect_prompt: z14.string().optional(),
15693
- description: z14.string().optional()
15584
+ var Sfx = z13.object({
15585
+ at_s: z13.number().optional(),
15586
+ duration_s: z13.number().optional(),
15587
+ sound_effect_prompt: z13.string().optional(),
15588
+ description: z13.string().optional()
15694
15589
  }).loose();
15695
- var CompositionRegion = z14.object({
15590
+ var CompositionRegion = z13.object({
15696
15591
  // full | top | bottom | left | right | inset
15697
- panel: z14.string().optional(),
15592
+ panel: z13.string().optional(),
15698
15593
  // 9-grid anchor for an `inset` presenter box.
15699
- position: z14.string().optional(),
15700
- is_presenter: z14.boolean().optional(),
15594
+ position: z13.string().optional(),
15595
+ is_presenter: z13.boolean().optional(),
15701
15596
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
15702
- cast_ref: z14.string().optional(),
15597
+ cast_ref: z13.string().optional(),
15703
15598
  // What the region's content IS: camera | screen_capture | static_graphic |
15704
15599
  // generated. Authoritative for routing when present (regex-over-prose fallback
15705
15600
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
15706
15601
  // overlay layer, never AI-generated.
15707
- kind: z14.string().optional(),
15602
+ kind: z13.string().optional(),
15708
15603
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
15709
15604
  // screen_capture region shows. Two scenes share it only when they show the SAME
15710
15605
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
15711
15606
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
15712
15607
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
15713
15608
  // instead of asking the operator for one screenshot that can't cover both.
15714
- surface_id: z14.string().optional(),
15609
+ surface_id: z13.string().optional(),
15715
15610
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
15716
15611
  // presenter bubble inside a screen recording) — video-in-video the reproduction
15717
15612
  // must re-composite, not paint into the surface.
15718
- nested: z14.array(z14.object({}).loose()).optional(),
15719
- summary: z14.string().optional(),
15720
- frame_prompt: z14.string().optional(),
15721
- motion_prompt: z14.string().optional()
15613
+ nested: z13.array(z13.object({}).loose()).optional(),
15614
+ summary: z13.string().optional(),
15615
+ frame_prompt: z13.string().optional(),
15616
+ motion_prompt: z13.string().optional()
15722
15617
  }).loose();
15723
- var SceneComposition = z14.object({
15618
+ var SceneComposition = z13.object({
15724
15619
  // full_frame (default) | split_screen | pip | keyed_overlay
15725
- layout: z14.string().optional(),
15620
+ layout: z13.string().optional(),
15726
15621
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
15727
- split_axis: z14.string().optional(),
15728
- regions: z14.array(CompositionRegion).optional()
15622
+ split_axis: z13.string().optional(),
15623
+ regions: z13.array(CompositionRegion).optional()
15729
15624
  }).loose();
15730
- var CameraMotion = z14.object({ movement: z14.string().optional(), detail: z14.string().optional() }).loose();
15731
- var TranscriptWord = z14.object({ text: z14.string().optional() }).loose();
15732
- var Scene = z14.object({
15733
- start_s: z14.number().optional(),
15734
- end_s: z14.number().optional(),
15735
- duration_s: z14.number().optional(),
15736
- summary: z14.string().optional(),
15737
- action_detail: z14.string().optional(),
15625
+ var CameraMotion = z13.object({ movement: z13.string().optional(), detail: z13.string().optional() }).loose();
15626
+ var TranscriptWord = z13.object({ text: z13.string().optional() }).loose();
15627
+ var Scene = z13.object({
15628
+ start_s: z13.number().optional(),
15629
+ end_s: z13.number().optional(),
15630
+ duration_s: z13.number().optional(),
15631
+ summary: z13.string().optional(),
15632
+ action_detail: z13.string().optional(),
15738
15633
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
15739
15634
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
15740
15635
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -15742,82 +15637,82 @@ var Scene = z14.object({
15742
15637
  // The capture "look" for this scene — selected from the ad-native shoot-mode
15743
15638
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
15744
15639
  // UGC/product mode; a human can override per scene by setting this.
15745
- shoot_mode: z14.string().optional(),
15640
+ shoot_mode: z13.string().optional(),
15746
15641
  // Diegetic ambient the clip's native audio should carry (no music). When
15747
15642
  // absent the scene falls back to its shoot mode's default ambience.
15748
- ambient: z14.string().optional(),
15643
+ ambient: z13.string().optional(),
15749
15644
  camera_motion: CameraMotion.optional(),
15750
- start_frame_prompt: z14.string().optional(),
15751
- end_frame_prompt: z14.string().optional(),
15752
- motion_prompt: z14.string().optional(),
15645
+ start_frame_prompt: z13.string().optional(),
15646
+ end_frame_prompt: z13.string().optional(),
15647
+ motion_prompt: z13.string().optional(),
15753
15648
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
15754
15649
  // script re-craft checklist. Inferred from position when absent.
15755
- narrative_role: z14.string().optional(),
15650
+ narrative_role: z13.string().optional(),
15756
15651
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
15757
15652
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
15758
15653
  // into the hook's start-frame description so the generator renders that state,
15759
15654
  // not a calm influencer (CCA-11).
15760
- hook_mechanic: z14.object({ mechanic: z14.string().optional(), why_it_stops_scroll: z14.string().optional() }).loose().optional(),
15655
+ hook_mechanic: z13.object({ mechanic: z13.string().optional(), why_it_stops_scroll: z13.string().optional() }).loose().optional(),
15761
15656
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
15762
- scene_setting: z14.string().optional(),
15657
+ scene_setting: z13.string().optional(),
15763
15658
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
15764
15659
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
15765
15660
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
15766
15661
  // ignored (nothing follows it).
15767
- transition_out: z14.object({ type: z14.string().optional(), description: z14.string().optional() }).loose().optional(),
15768
- dialogue: z14.array(DialogueLine).optional(),
15769
- sfx: z14.array(Sfx).optional(),
15770
- overlays: z14.array(z14.unknown()).optional(),
15771
- floating_elements: z14.array(z14.unknown()).optional(),
15662
+ transition_out: z13.object({ type: z13.string().optional(), description: z13.string().optional() }).loose().optional(),
15663
+ dialogue: z13.array(DialogueLine).optional(),
15664
+ sfx: z13.array(Sfx).optional(),
15665
+ overlays: z13.array(z13.unknown()).optional(),
15666
+ floating_elements: z13.array(z13.unknown()).optional(),
15772
15667
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
15773
15668
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
15774
15669
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
15775
15670
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
15776
- motion_level: z14.enum(["static", "subtle", "dynamic"]).optional(),
15777
- transcript_slice: z14.array(TranscriptWord).optional(),
15671
+ motion_level: z13.enum(["static", "subtle", "dynamic"]).optional(),
15672
+ transcript_slice: z13.array(TranscriptWord).optional(),
15778
15673
  start_frame_asset: FrameAsset,
15779
15674
  end_frame_asset: FrameAsset,
15780
15675
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
15781
15676
  // previous one (the SAME physical shot, broken up only because it exceeded the
15782
15677
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
15783
15678
  // start frame IS the previous scene's end frame — so the join is seamless.
15784
- continues_previous: z14.boolean().optional()
15679
+ continues_previous: z13.boolean().optional()
15785
15680
  }).loose();
15786
- var VideoBlueprint = z14.object({
15787
- source: z14.object({ aspect_ratio: z14.string().optional(), duration_s: z14.number().optional() }).loose().optional(),
15788
- global: z14.object({
15789
- music: z14.object({
15790
- present: z14.boolean().optional(),
15791
- music_prompt: z14.string().optional(),
15681
+ var VideoBlueprint = z13.object({
15682
+ source: z13.object({ aspect_ratio: z13.string().optional(), duration_s: z13.number().optional() }).loose().optional(),
15683
+ global: z13.object({
15684
+ music: z13.object({
15685
+ present: z13.boolean().optional(),
15686
+ music_prompt: z13.string().optional(),
15792
15687
  // Absolute second the music enters in the reference (the bed often
15793
15688
  // kicks in mid-ad, after the hook). We start the regenerated track here
15794
15689
  // instead of at 0 so the timing matches.
15795
- starts_at_s: z14.number().optional(),
15690
+ starts_at_s: z13.number().optional(),
15796
15691
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
15797
15692
  // reference track. We never reuse it — only style the regenerated bed.
15798
- identified_track: z14.object({ title: z14.string().optional(), artist: z14.string().optional() }).loose().nullish()
15693
+ identified_track: z13.object({ title: z13.string().optional(), artist: z13.string().optional() }).loose().nullish()
15799
15694
  }).loose().optional(),
15800
- cast: z14.array(
15801
- z14.object({
15802
- id: z14.string().optional(),
15803
- description: z14.string().optional(),
15695
+ cast: z13.array(
15696
+ z13.object({
15697
+ id: z13.string().optional(),
15698
+ description: z13.string().optional(),
15804
15699
  // The deconstruct's note on the target-market localization (e.g. "native
15805
15700
  // French speaker") — read to derive the spoken-track language code.
15806
- market_localization_note: z14.string().optional()
15701
+ market_localization_note: z13.string().optional()
15807
15702
  }).loose()
15808
15703
  ).optional(),
15809
- voiceover: z14.object({
15704
+ voiceover: z13.object({
15810
15705
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
15811
15706
  // voiceover | none → narration over the picture (no lip-sync).
15812
- mode: z14.string().optional(),
15813
- voice_description: z14.string().optional(),
15814
- persona: z14.string().optional()
15707
+ mode: z13.string().optional(),
15708
+ voice_description: z13.string().optional(),
15709
+ persona: z13.string().optional()
15815
15710
  }).loose().optional(),
15816
15711
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
15817
15712
  // first hex is the dominant brand colour); never to drive frame generation.
15818
- style: z14.object({ palette: z14.array(z14.object({ hex: z14.string().optional() }).loose()).optional() }).loose().optional()
15713
+ style: z13.object({ palette: z13.array(z13.object({ hex: z13.string().optional() }).loose()).optional() }).loose().optional()
15819
15714
  }).loose().optional(),
15820
- scenes: z14.array(Scene).min(1)
15715
+ scenes: z13.array(Scene).min(1)
15821
15716
  }).loose();
15822
15717
  function injectHookPhysicality(blueprint) {
15823
15718
  for (const scene of blueprint.scenes) {
@@ -15827,26 +15722,26 @@ function injectHookPhysicality(blueprint) {
15827
15722
  scene.start_frame_prompt = `${prompt} The subject's physical state IS the scroll-stopper \u2014 render it explicitly, not a calm pose: ${why}.`;
15828
15723
  }
15829
15724
  }
15830
- var AppearsItem = z14.union([z14.number(), z14.object({ scene: z14.number(), edge: z14.string().optional() }).loose()]);
15831
- var RecurringElement = z14.object({
15725
+ var AppearsItem = z13.union([z13.number(), z13.object({ scene: z13.number(), edge: z13.string().optional() }).loose()]);
15726
+ var RecurringElement = z13.object({
15832
15727
  // person | animal | product | logo | badge | other
15833
- type: z14.string(),
15834
- label: z14.string().optional(),
15835
- description: z14.string().optional(),
15836
- expression: z14.string().nullable().optional(),
15728
+ type: z13.string(),
15729
+ label: z13.string().optional(),
15730
+ description: z13.string().optional(),
15731
+ expression: z13.string().nullable().optional(),
15837
15732
  // When the element maps to a global cast entry, its stable id (for annotation).
15838
- cast_id: z14.string().nullable().optional(),
15733
+ cast_id: z13.string().nullable().optional(),
15839
15734
  // The label of another element that is the SAME individual as this one, shown
15840
15735
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
15841
15736
  // pink shirt and believer in a white shirt). Each look gets its own reference
15842
15737
  // slot, but the face/identity must stay identical across them.
15843
- same_as: z14.string().nullable().optional(),
15738
+ same_as: z13.string().nullable().optional(),
15844
15739
  // Scenes the element appears in. Either a bare list of scene indices (both
15845
15740
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
15846
- scenes: z14.array(z14.number()).optional(),
15847
- appears_in: z14.array(AppearsItem).optional()
15741
+ scenes: z13.array(z13.number()).optional(),
15742
+ appears_in: z13.array(AppearsItem).optional()
15848
15743
  }).loose();
15849
- var RecurringElements = z14.array(RecurringElement);
15744
+ var RecurringElements = z13.array(RecurringElement);
15850
15745
  function sanitizeId2(raw, fallback) {
15851
15746
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
15852
15747
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -16264,7 +16159,7 @@ function scrubFloatSentences(text, floatDescs) {
16264
16159
  return kept;
16265
16160
  }
16266
16161
  function sceneFloatDescs(scene) {
16267
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16162
+ const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
16268
16163
  if (!floats.success) return [];
16269
16164
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
16270
16165
  }
@@ -17604,25 +17499,25 @@ function buildSfxMusic(blueprint, nodes) {
17604
17499
  }
17605
17500
  return tracks;
17606
17501
  }
17607
- var OverlayStyle = z14.object({ color_hex: z14.string().optional(), background: z14.string().optional(), size: z14.string().optional() }).loose();
17608
- var Overlay = z14.object({
17609
- text: z14.string().optional(),
17610
- appears_at_s: z14.number().optional(),
17611
- duration_s: z14.number().optional(),
17612
- position: z14.string().optional(),
17613
- role: z14.string().optional(),
17614
- animation: z14.string().optional(),
17615
- animation_detail: z14.string().optional(),
17502
+ var OverlayStyle = z13.object({ color_hex: z13.string().optional(), background: z13.string().optional(), size: z13.string().optional() }).loose();
17503
+ var Overlay = z13.object({
17504
+ text: z13.string().optional(),
17505
+ appears_at_s: z13.number().optional(),
17506
+ duration_s: z13.number().optional(),
17507
+ position: z13.string().optional(),
17508
+ role: z13.string().optional(),
17509
+ animation: z13.string().optional(),
17510
+ animation_detail: z13.string().optional(),
17616
17511
  style: OverlayStyle.optional()
17617
17512
  }).loose();
17618
- var FloatingElement = z14.object({
17619
- kind: z14.string().optional(),
17620
- description: z14.string().optional(),
17621
- brand_name: z14.string().nullish(),
17622
- what_it_represents: z14.string().optional(),
17623
- appears_at_s: z14.number().optional(),
17624
- duration_s: z14.number().optional(),
17625
- position: z14.string().optional()
17513
+ var FloatingElement = z13.object({
17514
+ kind: z13.string().optional(),
17515
+ description: z13.string().optional(),
17516
+ brand_name: z13.string().nullish(),
17517
+ what_it_represents: z13.string().optional(),
17518
+ appears_at_s: z13.number().optional(),
17519
+ duration_s: z13.number().optional(),
17520
+ position: z13.string().optional()
17626
17521
  }).loose();
17627
17522
  function escapeHtml(s) {
17628
17523
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -17654,7 +17549,7 @@ function positionClass(position) {
17654
17549
  function collectCaptions(blueprint) {
17655
17550
  return blueprint.scenes.flatMap((scene) => {
17656
17551
  const sceneStart = scene.start_s ?? 0;
17657
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
17552
+ const overlays = z13.array(Overlay).safeParse(scene.overlays ?? []);
17658
17553
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
17659
17554
  const at = ov.appears_at_s ?? sceneStart;
17660
17555
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -17734,7 +17629,7 @@ function collectFloatWindows(blueprint, uiRouted) {
17734
17629
  const windows = /* @__PURE__ */ new Map();
17735
17630
  blueprint.scenes.forEach((scene, i) => {
17736
17631
  const sceneStart = scene.start_s ?? 0;
17737
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17632
+ const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
17738
17633
  if (!floats.success) return;
17739
17634
  for (const fe of floats.data) {
17740
17635
  const at = fe.appears_at_s ?? sceneStart;
@@ -17856,15 +17751,15 @@ function xfadeSpineArgs(clips) {
17856
17751
  let cur = "c0";
17857
17752
  let accLen = clipInputLen(clips[0]);
17858
17753
  for (let k = 0; k < n - 1; k++) {
17859
- const join5 = clips[k].out;
17754
+ const join4 = clips[k].out;
17860
17755
  const next = `c${k + 1}`;
17861
17756
  const out = k === n - 2 ? "v" : `j${k + 1}`;
17862
- if (join5) {
17863
- const offset = Math.max(0, accLen - join5.dur);
17757
+ if (join4) {
17758
+ const offset = Math.max(0, accLen - join4.dur);
17864
17759
  filt.push(
17865
- `[${cur}][${next}]xfade=transition=${join5.xfade}:duration=${join5.dur.toFixed(3)}:offset=${offset.toFixed(3)}[${out}]`
17760
+ `[${cur}][${next}]xfade=transition=${join4.xfade}:duration=${join4.dur.toFixed(3)}:offset=${offset.toFixed(3)}[${out}]`
17866
17761
  );
17867
- accLen = accLen - join5.dur + clipInputLen(clips[k + 1]);
17762
+ accLen = accLen - join4.dur + clipInputLen(clips[k + 1]);
17868
17763
  } else {
17869
17764
  filt.push(`[${cur}][${next}]concat=n=2:v=1[${out}]`);
17870
17765
  accLen += clipInputLen(clips[k + 1]);
@@ -18120,8 +18015,8 @@ function buildMotionBoard(blueprint) {
18120
18015
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
18121
18016
  cursor = end_s;
18122
18017
  const spoken = sceneSpokenText(scene);
18123
- const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
18124
- const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18018
+ const overlays = z13.array(Overlay).safeParse(scene.overlays ?? []);
18019
+ const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
18125
18020
  const graphics = [
18126
18021
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
18127
18022
  kind: "text",
@@ -19105,228 +19000,11 @@ Publishing uploads the image to the Company image library, applies the official
19105
19000
  }
19106
19001
  });
19107
19002
 
19108
- // src/commands/flows/index.ts
19109
- import { defineCommand as defineCommand96 } from "citty";
19110
-
19111
- // src/commands/flows/shared.ts
19112
- import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
19113
- import { join as join3 } from "path";
19114
- var FLOWS_DIR = "src/lib/flow-engine/flows";
19115
- function flowsDir() {
19116
- let dir = process.cwd();
19117
- for (let i = 0; i < 6; i++) {
19118
- const candidate = join3(dir, FLOWS_DIR);
19119
- if (existsSync4(candidate)) {
19120
- return candidate;
19121
- }
19122
- const parent = join3(dir, "..");
19123
- if (parent === dir) {
19124
- break;
19125
- }
19126
- dir = parent;
19127
- }
19128
- return join3(process.cwd(), FLOWS_DIR);
19129
- }
19130
- function failLocal(message) {
19131
- writeJson({ ok: false, error: { code: "NOT_FOUND", message } });
19132
- process.exit(1);
19133
- }
19134
- function listFlowSlugs() {
19135
- const dir = flowsDir();
19136
- if (!existsSync4(dir)) {
19137
- return [];
19138
- }
19139
- return readdirSync2(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith("_") && entry.name !== ".gitkeep").map((entry) => entry.name).sort();
19140
- }
19141
- function readFlowTree(slug) {
19142
- const path12 = join3(flowsDir(), slug, "_data.json");
19143
- if (!existsSync4(path12)) {
19144
- failLocal(`No form "${slug}". Run "baker flows list" to see the forms in this workspace.`);
19145
- }
19146
- try {
19147
- return JSON.parse(readFileSync9(path12, "utf-8"));
19148
- } catch (error) {
19149
- failLocal(`Could not read form "${slug}": ${error instanceof Error ? error.message : String(error)}`);
19150
- }
19151
- }
19152
- function isConfigured(value) {
19153
- return typeof value === "string" && value.length > 0;
19154
- }
19155
- function nodeMeta(record) {
19156
- const nodeId = typeof record.id === "string" ? record.id : "";
19157
- const nodeName = typeof record.name === "string" ? record.name : void 0;
19158
- return { nodeId, ...nodeName ? { nodeName } : {} };
19159
- }
19160
- function widgetNodeStatus(record, meta) {
19161
- const nodeData = record.nodeData;
19162
- const nodeType = nodeData?.type;
19163
- if (typeof nodeType !== "string" || !FLOW_RESOURCE_NODE_TYPES.includes(nodeType)) {
19164
- return null;
19165
- }
19166
- const external = nodeData?.form?.external;
19167
- const selected = external != null && typeof external === "object";
19168
- const name = selected ? external.name : void 0;
19169
- return {
19170
- ...meta,
19171
- target: "node",
19172
- kind: nodeType,
19173
- status: selected ? `${nodeType} \u2014 selected${typeof name === "string" ? ` "${name}"` : ""}` : `${nodeType} \u2014 not selected`,
19174
- needsInput: !selected
19175
- };
19176
- }
19177
- function sideEffectStatus(raw, meta) {
19178
- const effect = raw;
19179
- const type = effect?.type;
19180
- if (typeof type !== "string" || !FLOW_SECRET_SIDE_EFFECT_TYPES.includes(type)) {
19181
- return null;
19182
- }
19183
- const configured = isConfigured(effect?.encryptedConfig);
19184
- const oauth = isFlowOauthSideEffect(type);
19185
- const connected = isConfigured(effect?.oauthProviderId);
19186
- const needs = FLOW_SECRET_FIELDS[type];
19187
- const status = oauth ? `${type} \u2014 connection ${connected ? "[connected]" : "[needs connection]"}, config ${configured ? "[set]" : "[missing]"}` : configured ? `${type} \u2014 [configured]` : `${type} \u2014 [missing]${needs.length > 0 ? ` (needs: ${needs.join(", ")})` : ""}`;
19188
- return {
19189
- ...meta,
19190
- target: "sideEffect",
19191
- ...typeof effect?.id === "string" ? { sideEffectId: effect.id } : {},
19192
- kind: type,
19193
- status,
19194
- needsInput: oauth ? !connected || !configured : !configured
19195
- };
19196
- }
19197
- function collectConfigStatus(node, acc) {
19198
- if (!node || typeof node !== "object") {
19199
- return;
19200
- }
19201
- const record = node;
19202
- const meta = nodeMeta(record);
19203
- const widget = widgetNodeStatus(record, meta);
19204
- if (widget) {
19205
- acc.push(widget);
19206
- }
19207
- if (Array.isArray(record.sideEffects)) {
19208
- for (const raw of record.sideEffects) {
19209
- const status = sideEffectStatus(raw, meta);
19210
- if (status) {
19211
- acc.push(status);
19212
- }
19213
- }
19214
- }
19215
- if (Array.isArray(record.children)) {
19216
- for (const child of record.children) {
19217
- collectConfigStatus(child, acc);
19218
- }
19219
- }
19220
- }
19221
- function redactTree(node) {
19222
- if (Array.isArray(node)) {
19223
- return node.map(redactTree);
19224
- }
19225
- if (!node || typeof node !== "object") {
19226
- return node;
19227
- }
19228
- const out = {};
19229
- for (const [key, value] of Object.entries(node)) {
19230
- if (key === "encryptedConfig") {
19231
- out[key] = isConfigured(value) ? "[configured]" : value;
19232
- } else {
19233
- out[key] = redactTree(value);
19234
- }
19235
- }
19236
- return out;
19237
- }
19238
-
19239
- // src/commands/flows/index.ts
19240
- registerSchema({
19241
- command: "flows.list",
19242
- description: "List the Forms (flows) in this workspace and how many confidential fields each still needs configured. Read-only.",
19243
- args: {}
19244
- });
19245
- registerSchema({
19246
- command: "flows.show",
19247
- description: "Show a Form's confidential fields and whether each is configured (secrets/connections/third-party resources) \u2014 never reveals secret values. Author structure by editing the flow's _data.json; configure confidential fields with the request_flow_input tool.",
19248
- args: {
19249
- slug: { type: "positional", description: "Form slug (folder under flows/)", required: true },
19250
- full: { type: "boolean", description: "Include the full flow tree (secret values redacted)", required: false }
19251
- }
19252
- });
19253
- function statusFor(slug) {
19254
- const tree = readFlowTree(slug);
19255
- const config = [];
19256
- collectConfigStatus(tree, config);
19257
- return config;
19258
- }
19259
- function displayName(slug) {
19260
- const tree = readFlowTree(slug);
19261
- const name = tree.displayName;
19262
- return typeof name === "string" && name.trim() ? name.trim() : slug;
19263
- }
19264
- var listCommand5 = defineCommand96({
19265
- meta: {
19266
- name: "list",
19267
- description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
19268
- },
19269
- run: () => {
19270
- const flows = listFlowSlugs().map((slug) => ({
19271
- slug,
19272
- name: displayName(slug),
19273
- needsConfig: statusFor(slug).filter((c) => c.needsInput).length
19274
- }));
19275
- writeJson({ ok: true, data: { flows } });
19276
- }
19277
- });
19278
- var showCommand2 = defineCommand96({
19279
- meta: {
19280
- name: "show",
19281
- description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
19282
- },
19283
- args: {
19284
- slug: { type: "positional", description: "Form slug", required: true },
19285
- full: { type: "boolean", description: "Include the full flow tree (secret values redacted)" }
19286
- },
19287
- run: ({ args }) => {
19288
- const slug = String(args.slug);
19289
- const config = statusFor(slug);
19290
- const response = {
19291
- slug,
19292
- name: displayName(slug),
19293
- config,
19294
- ...args.full === true ? { tree: redactTree(readFlowTree(slug)) } : {}
19295
- };
19296
- writeJson({ ok: true, data: response });
19297
- }
19298
- });
19299
- var flowsCommand = defineCommand96({
19300
- meta: {
19301
- name: "flows",
19302
- 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).
19303
-
19304
- This command is READ-ONLY and never reveals secret values. Author a Form's structure (nodes, conditions, side effects, field mappings) by editing its _data.json with the flow-builder skill. Configure the confidential fields it reports as [missing] / [needs connection] / not selected through the request_flow_input tool (baker_ui MCP server): the user enters secrets, connects/picks OAuth accounts, and picks third-party forms in the dashboard \u2014 those values are written into your Form and never pass through chat or this CLI.
19305
-
19306
- Examples:
19307
- baker flows list # every Form + how many confidential fields still need setup
19308
- baker flows show contact # one Form's confidential fields and their status
19309
- baker flows show contact --full`
19310
- },
19311
- subCommands: {
19312
- list: listCommand5,
19313
- show: showCommand2
19314
- },
19315
- run: () => {
19316
- const flows = listFlowSlugs().map((slug) => ({
19317
- slug,
19318
- name: displayName(slug),
19319
- needsConfig: statusFor(slug).filter((c) => c.needsInput).length
19320
- }));
19321
- writeJson({ ok: true, data: { flows } });
19322
- }
19323
- });
19324
-
19325
19003
  // src/commands/ga4/index.ts
19326
- import { defineCommand as defineCommand100 } from "citty";
19004
+ import { defineCommand as defineCommand99 } from "citty";
19327
19005
 
19328
19006
  // src/commands/ga4/audit.ts
19329
- import { defineCommand as defineCommand97 } from "citty";
19007
+ import { defineCommand as defineCommand96 } from "citty";
19330
19008
 
19331
19009
  // src/commands/ga4/resolve.ts
19332
19010
  async function fetchProperties(useCache = true) {
@@ -19389,7 +19067,7 @@ registerSchema({
19389
19067
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
19390
19068
  }
19391
19069
  });
19392
- var auditCommand2 = defineCommand97({
19070
+ var auditCommand2 = defineCommand96({
19393
19071
  meta: {
19394
19072
  name: "audit",
19395
19073
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -19441,7 +19119,7 @@ Examples:
19441
19119
  });
19442
19120
 
19443
19121
  // src/commands/ga4/properties.ts
19444
- import { defineCommand as defineCommand98 } from "citty";
19122
+ import { defineCommand as defineCommand97 } from "citty";
19445
19123
  registerSchema({
19446
19124
  command: "ga4.properties",
19447
19125
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -19449,7 +19127,7 @@ registerSchema({
19449
19127
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
19450
19128
  }
19451
19129
  });
19452
- var propertiesCommand = defineCommand98({
19130
+ var propertiesCommand = defineCommand97({
19453
19131
  meta: {
19454
19132
  name: "properties",
19455
19133
  description: `List accessible GA4 properties.
@@ -19497,9 +19175,9 @@ Examples:
19497
19175
  });
19498
19176
 
19499
19177
  // src/commands/ga4/query.ts
19500
- import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
19178
+ import { appendFileSync as appendFileSync2, existsSync as existsSync4, readFileSync as readFileSync9, writeFileSync as writeFileSync3 } from "fs";
19501
19179
  import { resolve as resolve2 } from "path";
19502
- import { defineCommand as defineCommand99 } from "citty";
19180
+ import { defineCommand as defineCommand98 } from "citty";
19503
19181
 
19504
19182
  // src/commands/ga4/presets.ts
19505
19183
  var GA4_PRESETS = [
@@ -19571,7 +19249,7 @@ function writeRowsToFile2(filePath, rows, append) {
19571
19249
  const fields = extractFields2(rows);
19572
19250
  const ext = filePath.split(".").pop()?.toLowerCase();
19573
19251
  if (ext === "csv") {
19574
- if (!append || !existsSync5(filePath)) {
19252
+ if (!append || !existsSync4(filePath)) {
19575
19253
  writeFileSync3(filePath, `${toCsvRow(fields)}
19576
19254
  `, "utf-8");
19577
19255
  }
@@ -19582,13 +19260,13 @@ function writeRowsToFile2(filePath, rows, append) {
19582
19260
  const lines = rows.map((row) => JSON.stringify(row));
19583
19261
  const content = `${lines.join("\n")}
19584
19262
  `;
19585
- if (append && existsSync5(filePath)) {
19263
+ if (append && existsSync4(filePath)) {
19586
19264
  appendFileSync2(filePath, content, "utf-8");
19587
19265
  } else {
19588
19266
  writeFileSync3(filePath, content, "utf-8");
19589
19267
  }
19590
- } else if (append && existsSync5(filePath)) {
19591
- const existing = JSON.parse(readFileSync10(filePath, "utf-8"));
19268
+ } else if (append && existsSync4(filePath)) {
19269
+ const existing = JSON.parse(readFileSync9(filePath, "utf-8"));
19592
19270
  writeFileSync3(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
19593
19271
  } else {
19594
19272
  writeFileSync3(filePath, JSON.stringify(rows, null, 2), "utf-8");
@@ -19631,7 +19309,7 @@ function handleError(err) {
19631
19309
  });
19632
19310
  process.exit(1);
19633
19311
  }
19634
- var queryCommand2 = defineCommand99({
19312
+ var queryCommand2 = defineCommand98({
19635
19313
  meta: {
19636
19314
  name: "query",
19637
19315
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -19702,7 +19380,7 @@ Free-form (escape hatch):
19702
19380
  });
19703
19381
 
19704
19382
  // src/commands/ga4/index.ts
19705
- var ga4Command = defineCommand100({
19383
+ var ga4Command = defineCommand99({
19706
19384
  meta: {
19707
19385
  name: "ga4",
19708
19386
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -19725,12 +19403,12 @@ Examples:
19725
19403
  });
19726
19404
 
19727
19405
  // src/commands/gsc/index.ts
19728
- import { defineCommand as defineCommand104 } from "citty";
19406
+ import { defineCommand as defineCommand103 } from "citty";
19729
19407
 
19730
19408
  // src/commands/gsc/query.ts
19731
- import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
19409
+ import { appendFileSync as appendFileSync3, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs";
19732
19410
  import { resolve as resolve3 } from "path";
19733
- import { defineCommand as defineCommand101 } from "citty";
19411
+ import { defineCommand as defineCommand100 } from "citty";
19734
19412
 
19735
19413
  // src/commands/gsc/presets.ts
19736
19414
  var GSC_PRESETS = [
@@ -19857,7 +19535,7 @@ function writeRowsToFile3(filePath, rows, append) {
19857
19535
  const fields = extractFields3(rows);
19858
19536
  const ext = filePath.split(".").pop()?.toLowerCase();
19859
19537
  if (ext === "csv") {
19860
- if (!append || !existsSync6(filePath)) {
19538
+ if (!append || !existsSync5(filePath)) {
19861
19539
  writeFileSync4(filePath, `${toCsvRow(fields)}
19862
19540
  `, "utf-8");
19863
19541
  }
@@ -19867,13 +19545,13 @@ function writeRowsToFile3(filePath, rows, append) {
19867
19545
  } else if (ext === "jsonl") {
19868
19546
  const content = `${rows.map((row) => JSON.stringify(row)).join("\n")}
19869
19547
  `;
19870
- if (append && existsSync6(filePath)) {
19548
+ if (append && existsSync5(filePath)) {
19871
19549
  appendFileSync3(filePath, content, "utf-8");
19872
19550
  } else {
19873
19551
  writeFileSync4(filePath, content, "utf-8");
19874
19552
  }
19875
- } else if (append && existsSync6(filePath)) {
19876
- const existing = JSON.parse(readFileSync11(filePath, "utf-8"));
19553
+ } else if (append && existsSync5(filePath)) {
19554
+ const existing = JSON.parse(readFileSync10(filePath, "utf-8"));
19877
19555
  writeFileSync4(filePath, JSON.stringify([...existing, ...rows], null, 2), "utf-8");
19878
19556
  } else {
19879
19557
  writeFileSync4(filePath, JSON.stringify(rows, null, 2), "utf-8");
@@ -19918,7 +19596,7 @@ function handleError2(err) {
19918
19596
  });
19919
19597
  process.exit(1);
19920
19598
  }
19921
- var queryCommand3 = defineCommand101({
19599
+ var queryCommand3 = defineCommand100({
19922
19600
  meta: {
19923
19601
  name: "query",
19924
19602
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -19996,7 +19674,7 @@ Free-form (escape hatch):
19996
19674
  });
19997
19675
 
19998
19676
  // src/commands/gsc/sitemaps.ts
19999
- import { defineCommand as defineCommand102 } from "citty";
19677
+ import { defineCommand as defineCommand101 } from "citty";
20000
19678
  registerSchema({
20001
19679
  command: "gsc.sitemaps",
20002
19680
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -20005,7 +19683,7 @@ registerSchema({
20005
19683
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
20006
19684
  }
20007
19685
  });
20008
- var sitemapsCommand = defineCommand102({
19686
+ var sitemapsCommand = defineCommand101({
20009
19687
  meta: {
20010
19688
  name: "sitemaps",
20011
19689
  description: `List sitemaps for a site. Check health and errors.
@@ -20055,7 +19733,7 @@ Examples:
20055
19733
  });
20056
19734
 
20057
19735
  // src/commands/gsc/sites.ts
20058
- import { defineCommand as defineCommand103 } from "citty";
19736
+ import { defineCommand as defineCommand102 } from "citty";
20059
19737
  registerSchema({
20060
19738
  command: "gsc.sites",
20061
19739
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -20063,7 +19741,7 @@ registerSchema({
20063
19741
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
20064
19742
  }
20065
19743
  });
20066
- var sitesCommand = defineCommand103({
19744
+ var sitesCommand = defineCommand102({
20067
19745
  meta: {
20068
19746
  name: "sites",
20069
19747
  description: `List verified Search Console sites.
@@ -20111,7 +19789,7 @@ Examples:
20111
19789
  });
20112
19790
 
20113
19791
  // src/commands/gsc/index.ts
20114
- var gscCommand = defineCommand104({
19792
+ var gscCommand = defineCommand103({
20115
19793
  meta: {
20116
19794
  name: "gsc",
20117
19795
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -20134,10 +19812,10 @@ Examples:
20134
19812
  });
20135
19813
 
20136
19814
  // src/commands/images/index.ts
20137
- import { defineCommand as defineCommand128 } from "citty";
19815
+ import { defineCommand as defineCommand127 } from "citty";
20138
19816
 
20139
19817
  // src/commands/images/crop.ts
20140
- import { defineCommand as defineCommand105 } from "citty";
19818
+ import { defineCommand as defineCommand104 } from "citty";
20141
19819
 
20142
19820
  // src/lib/image/crop-sprite.ts
20143
19821
  import sharp from "sharp";
@@ -20153,7 +19831,7 @@ function cropSprite(input, region) {
20153
19831
  // src/lib/image/io.ts
20154
19832
  import { randomBytes } from "crypto";
20155
19833
  import { glob as fsGlob, readFile as readFile10, rename, stat as stat2, writeFile as writeFile4 } from "fs/promises";
20156
- import { dirname as dirname2, extname as extname2, join as join4, resolve as resolve4 } from "path";
19834
+ import { dirname as dirname2, extname as extname2, join as join3, resolve as resolve4 } from "path";
20157
19835
  var REMOTE_RE = /^https?:\/\//i;
20158
19836
  var GLOB_RE = /[*?[\]{}]/;
20159
19837
  function isRemoteUrl(value) {
@@ -20203,14 +19881,14 @@ async function resolveOutputPath(inputPath, outputArg, options) {
20203
19881
  if (!outputArg) return base;
20204
19882
  if (options.multipleInputs || await isDirectory(outputArg)) {
20205
19883
  const filename = base.split("/").pop() ?? "out.png";
20206
- return join4(outputArg, filename);
19884
+ return join3(outputArg, filename);
20207
19885
  }
20208
19886
  return outputArg;
20209
19887
  }
20210
19888
  async function atomicWrite(targetPath, data) {
20211
19889
  const absolute = resolve4(targetPath);
20212
19890
  const dir = dirname2(absolute);
20213
- const tmp = join4(dir, `.baker-image-${randomBytes(8).toString("hex")}.tmp`);
19891
+ const tmp = join3(dir, `.baker-image-${randomBytes(8).toString("hex")}.tmp`);
20214
19892
  await writeFile4(tmp, data);
20215
19893
  await rename(tmp, absolute);
20216
19894
  }
@@ -20262,7 +19940,7 @@ function emitError2(err) {
20262
19940
  }
20263
19941
  process.exit(1);
20264
19942
  }
20265
- var cropCommand = defineCommand105({
19943
+ var cropCommand = defineCommand104({
20266
19944
  meta: {
20267
19945
  name: "crop",
20268
19946
  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"
@@ -20298,7 +19976,7 @@ var cropCommand = defineCommand105({
20298
19976
  });
20299
19977
 
20300
19978
  // src/commands/images/delete.ts
20301
- import { defineCommand as defineCommand106 } from "citty";
19979
+ import { defineCommand as defineCommand105 } from "citty";
20302
19980
  registerSchema({
20303
19981
  command: "images.delete",
20304
19982
  description: "Delete an image by ID",
@@ -20312,7 +19990,7 @@ registerSchema({
20312
19990
  }
20313
19991
  }
20314
19992
  });
20315
- var deleteCommand = defineCommand106({
19993
+ var deleteCommand = defineCommand105({
20316
19994
  meta: {
20317
19995
  name: "delete",
20318
19996
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -20353,7 +20031,7 @@ var deleteCommand = defineCommand106({
20353
20031
  });
20354
20032
 
20355
20033
  // src/commands/images/dimensions.ts
20356
- import { defineCommand as defineCommand107 } from "citty";
20034
+ import { defineCommand as defineCommand106 } from "citty";
20357
20035
 
20358
20036
  // src/lib/image/dimensions.ts
20359
20037
  import { imageSize } from "image-size";
@@ -20376,7 +20054,7 @@ registerSchema({
20376
20054
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
20377
20055
  }
20378
20056
  });
20379
- var dimensionsCommand = defineCommand107({
20057
+ var dimensionsCommand = defineCommand106({
20380
20058
  meta: {
20381
20059
  name: "dimensions",
20382
20060
  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"
@@ -20420,7 +20098,7 @@ var dimensionsCommand = defineCommand107({
20420
20098
  });
20421
20099
 
20422
20100
  // src/commands/images/extract.ts
20423
- import { defineCommand as defineCommand108 } from "citty";
20101
+ import { defineCommand as defineCommand107 } from "citty";
20424
20102
  registerSchema({
20425
20103
  command: "images.extract",
20426
20104
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -20436,7 +20114,7 @@ registerSchema({
20436
20114
  }
20437
20115
  }
20438
20116
  });
20439
- var extractCommand = defineCommand108({
20117
+ var extractCommand = defineCommand107({
20440
20118
  meta: {
20441
20119
  name: "extract",
20442
20120
  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"
@@ -20474,7 +20152,7 @@ var extractCommand = defineCommand108({
20474
20152
  });
20475
20153
 
20476
20154
  // src/commands/images/find.ts
20477
- import { defineCommand as defineCommand109 } from "citty";
20155
+ import { defineCommand as defineCommand108 } from "citty";
20478
20156
  registerSchema({
20479
20157
  command: "images.find",
20480
20158
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -20506,7 +20184,7 @@ registerSchema({
20506
20184
  }
20507
20185
  }
20508
20186
  });
20509
- var findCommand = defineCommand109({
20187
+ var findCommand = defineCommand108({
20510
20188
  meta: {
20511
20189
  name: "find",
20512
20190
  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"
@@ -20555,7 +20233,7 @@ var findCommand = defineCommand109({
20555
20233
 
20556
20234
  // src/commands/images/generate.ts
20557
20235
  import { readFile as readFile11 } from "fs/promises";
20558
- import { defineCommand as defineCommand110 } from "citty";
20236
+ import { defineCommand as defineCommand109 } from "citty";
20559
20237
  import sharp2 from "sharp";
20560
20238
  var GENERATE_TIMEOUT_MS = 18e4;
20561
20239
  var REFERENCE_MAX_EDGE = 1536;
@@ -20658,7 +20336,7 @@ async function resolveReferences(spec) {
20658
20336
  }
20659
20337
  return out;
20660
20338
  }
20661
- var generateCommand = defineCommand110({
20339
+ var generateCommand = defineCommand109({
20662
20340
  meta: {
20663
20341
  name: "generate",
20664
20342
  description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: openai/gpt-5.4-image-2 (default \u2014 photoreal, cleanest text, best for ad/landing reproduction), google/gemini-3-pro-image-preview (Nano Banana Pro), google/gemini-3.5-flash & google/gemini-3.1-flash-image-preview (fast, extreme aspect ratios), 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 google/gemini-3-pro-image-preview --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]]'"
@@ -20710,7 +20388,7 @@ var generateCommand = defineCommand110({
20710
20388
  });
20711
20389
 
20712
20390
  // src/commands/images/get.ts
20713
- import { defineCommand as defineCommand111 } from "citty";
20391
+ import { defineCommand as defineCommand110 } from "citty";
20714
20392
  registerSchema({
20715
20393
  command: "images.get",
20716
20394
  description: "Get a single image by ID",
@@ -20718,7 +20396,7 @@ registerSchema({
20718
20396
  id: { type: "string", description: "Image ID", required: true }
20719
20397
  }
20720
20398
  });
20721
- var getCommand2 = defineCommand111({
20399
+ var getCommand2 = defineCommand110({
20722
20400
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
20723
20401
  args: {
20724
20402
  id: { type: "positional", description: "Image ID", required: false },
@@ -20754,7 +20432,7 @@ var getCommand2 = defineCommand111({
20754
20432
  });
20755
20433
 
20756
20434
  // src/commands/images/gif.ts
20757
- import { defineCommand as defineCommand112 } from "citty";
20435
+ import { defineCommand as defineCommand111 } from "citty";
20758
20436
  registerSchema({
20759
20437
  command: "images.gif",
20760
20438
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -20786,7 +20464,7 @@ registerSchema({
20786
20464
  }
20787
20465
  }
20788
20466
  });
20789
- var gifCommand = defineCommand112({
20467
+ var gifCommand = defineCommand111({
20790
20468
  meta: {
20791
20469
  name: "gif",
20792
20470
  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"
@@ -20833,7 +20511,7 @@ var gifCommand = defineCommand112({
20833
20511
  });
20834
20512
 
20835
20513
  // src/commands/images/google.ts
20836
- import { defineCommand as defineCommand113 } from "citty";
20514
+ import { defineCommand as defineCommand112 } from "citty";
20837
20515
  registerSchema({
20838
20516
  command: "images.google",
20839
20517
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -20869,7 +20547,7 @@ registerSchema({
20869
20547
  }
20870
20548
  }
20871
20549
  });
20872
- var googleCommand2 = defineCommand113({
20550
+ var googleCommand2 = defineCommand112({
20873
20551
  meta: {
20874
20552
  name: "google",
20875
20553
  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"
@@ -20917,7 +20595,7 @@ var googleCommand2 = defineCommand113({
20917
20595
  });
20918
20596
 
20919
20597
  // src/commands/images/icon.ts
20920
- import { defineCommand as defineCommand114 } from "citty";
20598
+ import { defineCommand as defineCommand113 } from "citty";
20921
20599
  registerSchema({
20922
20600
  command: "images.icon",
20923
20601
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -20943,7 +20621,7 @@ registerSchema({
20943
20621
  }
20944
20622
  }
20945
20623
  });
20946
- var iconCommand = defineCommand114({
20624
+ var iconCommand = defineCommand113({
20947
20625
  meta: {
20948
20626
  name: "icon",
20949
20627
  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'"
@@ -20983,7 +20661,7 @@ var iconCommand = defineCommand114({
20983
20661
  });
20984
20662
 
20985
20663
  // src/commands/images/ingest.ts
20986
- import { defineCommand as defineCommand115 } from "citty";
20664
+ import { defineCommand as defineCommand114 } from "citty";
20987
20665
  registerSchema({
20988
20666
  command: "images.ingest",
20989
20667
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -20995,7 +20673,7 @@ registerSchema({
20995
20673
  context: { type: "string", description: "Description context hint", required: false }
20996
20674
  }
20997
20675
  });
20998
- var ingestCommand = defineCommand115({
20676
+ var ingestCommand = defineCommand114({
20999
20677
  meta: {
21000
20678
  name: "ingest",
21001
20679
  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"
@@ -21037,7 +20715,7 @@ var ingestCommand = defineCommand115({
21037
20715
  });
21038
20716
 
21039
20717
  // src/commands/images/library.ts
21040
- import { defineCommand as defineCommand116 } from "citty";
20718
+ import { defineCommand as defineCommand115 } from "citty";
21041
20719
  registerSchema({
21042
20720
  command: "images.library",
21043
20721
  description: "Search the company image library. Returns only ready images.",
@@ -21063,7 +20741,7 @@ registerSchema({
21063
20741
  }
21064
20742
  }
21065
20743
  });
21066
- var libraryCommand = defineCommand116({
20744
+ var libraryCommand = defineCommand115({
21067
20745
  meta: {
21068
20746
  name: "library",
21069
20747
  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"
@@ -21120,7 +20798,7 @@ var libraryCommand = defineCommand116({
21120
20798
  });
21121
20799
 
21122
20800
  // src/commands/images/logo.ts
21123
- import { defineCommand as defineCommand117 } from "citty";
20801
+ import { defineCommand as defineCommand116 } from "citty";
21124
20802
  registerSchema({
21125
20803
  command: "images.logo",
21126
20804
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -21145,7 +20823,7 @@ registerSchema({
21145
20823
  }
21146
20824
  }
21147
20825
  });
21148
- var logoCommand = defineCommand117({
20826
+ var logoCommand = defineCommand116({
21149
20827
  meta: {
21150
20828
  name: "logo",
21151
20829
  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"
@@ -21183,7 +20861,7 @@ var logoCommand = defineCommand117({
21183
20861
  });
21184
20862
 
21185
20863
  // src/commands/images/normalize.ts
21186
- import { defineCommand as defineCommand118 } from "citty";
20864
+ import { defineCommand as defineCommand117 } from "citty";
21187
20865
 
21188
20866
  // src/lib/image/color-changer.ts
21189
20867
  import quantize from "quantize";
@@ -21915,7 +21593,7 @@ function coerceRawArgs(args) {
21915
21593
  "dry-run": bool(args["dry-run"])
21916
21594
  };
21917
21595
  }
21918
- var normalizeCommand = defineCommand118({
21596
+ var normalizeCommand = defineCommand117({
21919
21597
  meta: {
21920
21598
  name: "normalize",
21921
21599
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -21970,7 +21648,7 @@ Examples:
21970
21648
  });
21971
21649
 
21972
21650
  // src/commands/images/pinterest.ts
21973
- import { defineCommand as defineCommand119 } from "citty";
21651
+ import { defineCommand as defineCommand118 } from "citty";
21974
21652
  registerSchema({
21975
21653
  command: "images.pinterest",
21976
21654
  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.",
@@ -21990,7 +21668,7 @@ registerSchema({
21990
21668
  }
21991
21669
  }
21992
21670
  });
21993
- var pinterestCommand = defineCommand119({
21671
+ var pinterestCommand = defineCommand118({
21994
21672
  meta: {
21995
21673
  name: "pinterest",
21996
21674
  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'"
@@ -22030,7 +21708,7 @@ var pinterestCommand = defineCommand119({
22030
21708
  });
22031
21709
 
22032
21710
  // src/commands/images/screenshot.ts
22033
- import { defineCommand as defineCommand120 } from "citty";
21711
+ import { defineCommand as defineCommand119 } from "citty";
22034
21712
  registerSchema({
22035
21713
  command: "images.screenshot",
22036
21714
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -22046,7 +21724,7 @@ registerSchema({
22046
21724
  }
22047
21725
  }
22048
21726
  });
22049
- var screenshotCommand = defineCommand120({
21727
+ var screenshotCommand = defineCommand119({
22050
21728
  meta: {
22051
21729
  name: "screenshot",
22052
21730
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -22096,7 +21774,7 @@ var screenshotCommand = defineCommand120({
22096
21774
  });
22097
21775
 
22098
21776
  // src/commands/images/search.ts
22099
- import { defineCommand as defineCommand121 } from "citty";
21777
+ import { defineCommand as defineCommand120 } from "citty";
22100
21778
  registerSchema({
22101
21779
  command: "images.search",
22102
21780
  description: "Search images by text query. Only returns ready images.",
@@ -22112,7 +21790,7 @@ registerSchema({
22112
21790
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
22113
21791
  }
22114
21792
  });
22115
- var searchCommand = defineCommand121({
21793
+ var searchCommand = defineCommand120({
22116
21794
  meta: {
22117
21795
  name: "search",
22118
21796
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -22172,7 +21850,7 @@ var searchCommand = defineCommand121({
22172
21850
  });
22173
21851
 
22174
21852
  // src/commands/images/sticker.ts
22175
- import { defineCommand as defineCommand122 } from "citty";
21853
+ import { defineCommand as defineCommand121 } from "citty";
22176
21854
  registerSchema({
22177
21855
  command: "images.sticker",
22178
21856
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -22204,7 +21882,7 @@ registerSchema({
22204
21882
  }
22205
21883
  }
22206
21884
  });
22207
- var stickerCommand = defineCommand122({
21885
+ var stickerCommand = defineCommand121({
22208
21886
  meta: {
22209
21887
  name: "sticker",
22210
21888
  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"
@@ -22251,7 +21929,7 @@ var stickerCommand = defineCommand122({
22251
21929
  });
22252
21930
 
22253
21931
  // src/commands/images/stock.ts
22254
- import { defineCommand as defineCommand123 } from "citty";
21932
+ import { defineCommand as defineCommand122 } from "citty";
22255
21933
  registerSchema({
22256
21934
  command: "images.stock",
22257
21935
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -22309,7 +21987,7 @@ registerSchema({
22309
21987
  }
22310
21988
  }
22311
21989
  });
22312
- var stockCommand = defineCommand123({
21990
+ var stockCommand = defineCommand122({
22313
21991
  meta: {
22314
21992
  name: "stock",
22315
21993
  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"
@@ -22365,7 +22043,7 @@ var stockCommand = defineCommand123({
22365
22043
  });
22366
22044
 
22367
22045
  // src/lib/tags-command.ts
22368
- import { defineCommand as defineCommand124 } from "citty";
22046
+ import { defineCommand as defineCommand123 } from "citty";
22369
22047
  function makeTagsCommand(command, label, endpoint) {
22370
22048
  registerSchema({
22371
22049
  command: `${command}.tags`,
@@ -22374,7 +22052,7 @@ function makeTagsCommand(command, label, endpoint) {
22374
22052
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
22375
22053
  }
22376
22054
  });
22377
- return defineCommand124({
22055
+ return defineCommand123({
22378
22056
  meta: {
22379
22057
  name: "tags",
22380
22058
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -22410,7 +22088,7 @@ function makeTagsCommand(command, label, endpoint) {
22410
22088
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
22411
22089
 
22412
22090
  // src/commands/images/upload.ts
22413
- import { defineCommand as defineCommand125 } from "citty";
22091
+ import { defineCommand as defineCommand124 } from "citty";
22414
22092
  registerSchema({
22415
22093
  command: "images.upload",
22416
22094
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -22448,7 +22126,7 @@ registerSchema({
22448
22126
  function isRemoteUrl2(value) {
22449
22127
  return /^https?:\/\//i.test(value);
22450
22128
  }
22451
- var uploadCommand = defineCommand125({
22129
+ var uploadCommand = defineCommand124({
22452
22130
  meta: {
22453
22131
  name: "upload",
22454
22132
  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'"
@@ -22541,7 +22219,7 @@ async function uploadLocal(target, args) {
22541
22219
  }
22542
22220
 
22543
22221
  // src/commands/images/upscale.ts
22544
- import { defineCommand as defineCommand126 } from "citty";
22222
+ import { defineCommand as defineCommand125 } from "citty";
22545
22223
  registerSchema({
22546
22224
  command: "images.upscale",
22547
22225
  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).",
@@ -22556,7 +22234,7 @@ registerSchema({
22556
22234
  }
22557
22235
  });
22558
22236
  var POLL_INTERVAL_MS3 = 1500;
22559
- var upscaleCommand = defineCommand126({
22237
+ var upscaleCommand = defineCommand125({
22560
22238
  meta: {
22561
22239
  name: "upscale",
22562
22240
  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"
@@ -22611,7 +22289,7 @@ var upscaleCommand = defineCommand126({
22611
22289
  });
22612
22290
 
22613
22291
  // src/commands/images/use.ts
22614
- import { defineCommand as defineCommand127 } from "citty";
22292
+ import { defineCommand as defineCommand126 } from "citty";
22615
22293
  registerSchema({
22616
22294
  command: "images.use",
22617
22295
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -22627,7 +22305,7 @@ registerSchema({
22627
22305
  }
22628
22306
  });
22629
22307
  var POLL_INTERVAL_MS4 = 1500;
22630
- var useCommand = defineCommand127({
22308
+ var useCommand = defineCommand126({
22631
22309
  meta: {
22632
22310
  name: "use",
22633
22311
  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"
@@ -22673,7 +22351,7 @@ var useCommand = defineCommand127({
22673
22351
  });
22674
22352
 
22675
22353
  // src/commands/images/index.ts
22676
- var imagesCommand = defineCommand128({
22354
+ var imagesCommand = defineCommand127({
22677
22355
  meta: {
22678
22356
  name: "images",
22679
22357
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -22743,7 +22421,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
22743
22421
  });
22744
22422
 
22745
22423
  // src/commands/mcp/index.ts
22746
- import { defineCommand as defineCommand129 } from "citty";
22424
+ import { defineCommand as defineCommand128 } from "citty";
22747
22425
  var SCOPES = ["user", "user_org", "company", "org"];
22748
22426
  function parseScope(raw) {
22749
22427
  const scope = raw === void 0 ? "company" : String(raw);
@@ -22782,7 +22460,7 @@ registerSchema({
22782
22460
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
22783
22461
  args: {}
22784
22462
  });
22785
- var listCommand6 = defineCommand129({
22463
+ var listCommand5 = defineCommand128({
22786
22464
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
22787
22465
  run: async () => {
22788
22466
  try {
@@ -22807,7 +22485,7 @@ registerSchema({
22807
22485
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
22808
22486
  }
22809
22487
  });
22810
- var addCommand = defineCommand129({
22488
+ var addCommand = defineCommand128({
22811
22489
  meta: {
22812
22490
  name: "add",
22813
22491
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -22848,7 +22526,7 @@ registerSchema({
22848
22526
  description: "Remove a company custom MCP server by name.",
22849
22527
  args: { name: { type: "string", description: "Server name to remove", required: true } }
22850
22528
  });
22851
- var removeCommand4 = defineCommand129({
22529
+ var removeCommand4 = defineCommand128({
22852
22530
  meta: {
22853
22531
  name: "remove",
22854
22532
  description: `Remove a company custom MCP server by name.
@@ -22870,7 +22548,7 @@ Example:
22870
22548
  }
22871
22549
  }
22872
22550
  });
22873
- var mcpCommand = defineCommand129({
22551
+ var mcpCommand = defineCommand128({
22874
22552
  meta: {
22875
22553
  name: "mcp",
22876
22554
  description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
@@ -22887,17 +22565,17 @@ Examples:
22887
22565
  baker mcp remove --name weather`
22888
22566
  },
22889
22567
  subCommands: {
22890
- list: listCommand6,
22568
+ list: listCommand5,
22891
22569
  add: addCommand,
22892
22570
  remove: removeCommand4
22893
22571
  }
22894
22572
  });
22895
22573
 
22896
22574
  // src/commands/research/index.ts
22897
- import { defineCommand as defineCommand140 } from "citty";
22575
+ import { defineCommand as defineCommand139 } from "citty";
22898
22576
 
22899
22577
  // src/commands/research/advertisers.ts
22900
- import { defineCommand as defineCommand130 } from "citty";
22578
+ import { defineCommand as defineCommand129 } from "citty";
22901
22579
 
22902
22580
  // src/commands/research/output.ts
22903
22581
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -23010,7 +22688,7 @@ var FIELDS3 = {
23010
22688
  etv: "Estimated traffic value (USD)",
23011
22689
  visibility: "SERP visibility score (0-1)"
23012
22690
  };
23013
- var advertisersCommand = defineCommand130({
22691
+ var advertisersCommand = defineCommand129({
23014
22692
  meta: {
23015
22693
  name: "advertisers",
23016
22694
  description: `Find domains competing for a keyword in Google SERPs.
@@ -23057,7 +22735,7 @@ Examples:
23057
22735
  });
23058
22736
 
23059
22737
  // src/commands/research/autocomplete.ts
23060
- import { defineCommand as defineCommand131 } from "citty";
22738
+ import { defineCommand as defineCommand130 } from "citty";
23061
22739
  registerSchema({
23062
22740
  command: "research.autocomplete",
23063
22741
  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).",
@@ -23080,7 +22758,7 @@ registerSchema({
23080
22758
  var FIELDS4 = {
23081
22759
  suggestion: "Autocomplete suggestion from Google"
23082
22760
  };
23083
- var autocompleteCommand = defineCommand131({
22761
+ var autocompleteCommand = defineCommand130({
23084
22762
  meta: {
23085
22763
  name: "autocomplete",
23086
22764
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -23126,7 +22804,7 @@ Examples:
23126
22804
  });
23127
22805
 
23128
22806
  // src/commands/research/countries.ts
23129
- import { defineCommand as defineCommand132 } from "citty";
22807
+ import { defineCommand as defineCommand131 } from "citty";
23130
22808
  registerSchema({
23131
22809
  command: "research.countries",
23132
22810
  description: "List all supported country codes for --location flag in research commands.",
@@ -23183,7 +22861,7 @@ var FIELDS5 = {
23183
22861
  code: "Country code to pass as --location",
23184
22862
  name: "Country name"
23185
22863
  };
23186
- var countriesCommand = defineCommand132({
22864
+ var countriesCommand = defineCommand131({
23187
22865
  meta: {
23188
22866
  name: "countries",
23189
22867
  description: "List all supported country codes for --location flag."
@@ -23194,7 +22872,7 @@ var countriesCommand = defineCommand132({
23194
22872
  });
23195
22873
 
23196
22874
  // src/commands/research/intent.ts
23197
- import { defineCommand as defineCommand133 } from "citty";
22875
+ import { defineCommand as defineCommand132 } from "citty";
23198
22876
  registerSchema({
23199
22877
  command: "research.intent",
23200
22878
  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.",
@@ -23217,7 +22895,7 @@ var FIELDS6 = {
23217
22895
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
23218
22896
  probability: "Confidence score 0.0-1.0"
23219
22897
  };
23220
- var intentCommand = defineCommand133({
22898
+ var intentCommand = defineCommand132({
23221
22899
  meta: {
23222
22900
  name: "intent",
23223
22901
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -23265,7 +22943,7 @@ Examples:
23265
22943
  });
23266
22944
 
23267
22945
  // src/commands/research/keyword-gap.ts
23268
- import { defineCommand as defineCommand134 } from "citty";
22946
+ import { defineCommand as defineCommand133 } from "citty";
23269
22947
  registerSchema({
23270
22948
  command: "research.keyword-gap",
23271
22949
  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.",
@@ -23294,7 +22972,7 @@ var FIELDS7 = {
23294
22972
  cpc: "Cost per click USD",
23295
22973
  their_position: "Competitor's ranking position"
23296
22974
  };
23297
- var keywordGapCommand = defineCommand134({
22975
+ var keywordGapCommand = defineCommand133({
23298
22976
  meta: {
23299
22977
  name: "keyword-gap",
23300
22978
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -23368,7 +23046,7 @@ Examples:
23368
23046
  });
23369
23047
 
23370
23048
  // src/commands/research/keywords-for-site.ts
23371
- import { defineCommand as defineCommand135 } from "citty";
23049
+ import { defineCommand as defineCommand134 } from "citty";
23372
23050
  registerSchema({
23373
23051
  command: "research.keywords-for-site",
23374
23052
  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.",
@@ -23401,7 +23079,7 @@ var FIELDS8 = {
23401
23079
  competition: "LOW, MEDIUM, or HIGH",
23402
23080
  competition_index: "Competition score 0-100"
23403
23081
  };
23404
- var keywordsForSiteCommand = defineCommand135({
23082
+ var keywordsForSiteCommand = defineCommand134({
23405
23083
  meta: {
23406
23084
  name: "keywords-for-site",
23407
23085
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -23454,7 +23132,7 @@ Examples:
23454
23132
  });
23455
23133
 
23456
23134
  // src/commands/research/languages.ts
23457
- import { defineCommand as defineCommand136 } from "citty";
23135
+ import { defineCommand as defineCommand135 } from "citty";
23458
23136
  registerSchema({
23459
23137
  command: "research.languages",
23460
23138
  description: "List all supported language codes for --language flag in research commands.",
@@ -23484,7 +23162,7 @@ var FIELDS9 = {
23484
23162
  code: "Language code to pass as --language",
23485
23163
  name: "Language name (also accepted by --language)"
23486
23164
  };
23487
- var languagesCommand2 = defineCommand136({
23165
+ var languagesCommand2 = defineCommand135({
23488
23166
  meta: {
23489
23167
  name: "languages",
23490
23168
  description: "List all supported language codes for --language flag."
@@ -23495,7 +23173,7 @@ var languagesCommand2 = defineCommand136({
23495
23173
  });
23496
23174
 
23497
23175
  // src/commands/research/lighthouse.ts
23498
- import { defineCommand as defineCommand137 } from "citty";
23176
+ import { defineCommand as defineCommand136 } from "citty";
23499
23177
  registerSchema({
23500
23178
  command: "research.lighthouse",
23501
23179
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -23514,7 +23192,7 @@ var FIELDS10 = {
23514
23192
  speed_index_ms: "Speed Index in ms (good: < 3400)",
23515
23193
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
23516
23194
  };
23517
- var lighthouseCommand = defineCommand137({
23195
+ var lighthouseCommand = defineCommand136({
23518
23196
  meta: {
23519
23197
  name: "lighthouse",
23520
23198
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -23552,7 +23230,7 @@ Examples:
23552
23230
  });
23553
23231
 
23554
23232
  // src/commands/research/relevant-pages.ts
23555
- import { defineCommand as defineCommand138 } from "citty";
23233
+ import { defineCommand as defineCommand137 } from "citty";
23556
23234
  registerSchema({
23557
23235
  command: "research.relevant-pages",
23558
23236
  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).",
@@ -23578,7 +23256,7 @@ var FIELDS11 = {
23578
23256
  keywords: "Total organic keywords the page ranks for",
23579
23257
  top_10: "Keywords in positions 1-10"
23580
23258
  };
23581
- var relevantPagesCommand = defineCommand138({
23259
+ var relevantPagesCommand = defineCommand137({
23582
23260
  meta: {
23583
23261
  name: "relevant-pages",
23584
23262
  description: `Get the top pages of a competitor domain with traffic data.
@@ -23624,7 +23302,7 @@ Examples:
23624
23302
  });
23625
23303
 
23626
23304
  // src/commands/research/web.ts
23627
- import { defineCommand as defineCommand139 } from "citty";
23305
+ import { defineCommand as defineCommand138 } from "citty";
23628
23306
  registerSchema({
23629
23307
  command: "research.web",
23630
23308
  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).",
@@ -23675,7 +23353,7 @@ async function runDeepResearch(question) {
23675
23353
  }
23676
23354
  throw new Error("Deep research timed out");
23677
23355
  }
23678
- var webCommand = defineCommand139({
23356
+ var webCommand = defineCommand138({
23679
23357
  meta: {
23680
23358
  name: "web",
23681
23359
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -23735,7 +23413,7 @@ Examples:
23735
23413
  });
23736
23414
 
23737
23415
  // src/commands/research/index.ts
23738
- var researchCommand = defineCommand140({
23416
+ var researchCommand = defineCommand139({
23739
23417
  meta: {
23740
23418
  name: "research",
23741
23419
  description: `Competitive intelligence and AI-powered research commands.
@@ -23775,10 +23453,10 @@ Examples:
23775
23453
  });
23776
23454
 
23777
23455
  // src/commands/scheduled-actions/index.ts
23778
- import { defineCommand as defineCommand147 } from "citty";
23456
+ import { defineCommand as defineCommand146 } from "citty";
23779
23457
 
23780
23458
  // src/commands/scheduled-actions/create.ts
23781
- import { defineCommand as defineCommand141 } from "citty";
23459
+ import { defineCommand as defineCommand140 } from "citty";
23782
23460
 
23783
23461
  // src/commands/scheduled-actions/shared.ts
23784
23462
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -23893,7 +23571,7 @@ registerSchema({
23893
23571
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
23894
23572
  }
23895
23573
  });
23896
- var createCommand2 = defineCommand141({
23574
+ var createCommand2 = defineCommand140({
23897
23575
  meta: {
23898
23576
  name: "create",
23899
23577
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -23942,7 +23620,7 @@ var createCommand2 = defineCommand141({
23942
23620
  });
23943
23621
 
23944
23622
  // src/commands/scheduled-actions/delete.ts
23945
- import { defineCommand as defineCommand142 } from "citty";
23623
+ import { defineCommand as defineCommand141 } from "citty";
23946
23624
  registerSchema({
23947
23625
  command: "scheduled-actions.delete",
23948
23626
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -23950,7 +23628,7 @@ registerSchema({
23950
23628
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
23951
23629
  }
23952
23630
  });
23953
- var deleteCommand2 = defineCommand142({
23631
+ var deleteCommand2 = defineCommand141({
23954
23632
  meta: {
23955
23633
  name: "delete",
23956
23634
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -23979,7 +23657,7 @@ var deleteCommand2 = defineCommand142({
23979
23657
  });
23980
23658
 
23981
23659
  // src/commands/scheduled-actions/get.ts
23982
- import { defineCommand as defineCommand143 } from "citty";
23660
+ import { defineCommand as defineCommand142 } from "citty";
23983
23661
  registerSchema({
23984
23662
  command: "scheduled-actions.get",
23985
23663
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -23987,7 +23665,7 @@ registerSchema({
23987
23665
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
23988
23666
  }
23989
23667
  });
23990
- var getCommand3 = defineCommand143({
23668
+ var getCommand3 = defineCommand142({
23991
23669
  meta: {
23992
23670
  name: "get",
23993
23671
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -24024,13 +23702,13 @@ var getCommand3 = defineCommand143({
24024
23702
  });
24025
23703
 
24026
23704
  // src/commands/scheduled-actions/list.ts
24027
- import { defineCommand as defineCommand144 } from "citty";
23705
+ import { defineCommand as defineCommand143 } from "citty";
24028
23706
  registerSchema({
24029
23707
  command: "scheduled-actions.list",
24030
23708
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
24031
23709
  args: {}
24032
23710
  });
24033
- var listCommand7 = defineCommand144({
23711
+ var listCommand6 = defineCommand143({
24034
23712
  meta: {
24035
23713
  name: "list",
24036
23714
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -24051,7 +23729,7 @@ var listCommand7 = defineCommand144({
24051
23729
  });
24052
23730
 
24053
23731
  // src/commands/scheduled-actions/trigger.ts
24054
- import { defineCommand as defineCommand145 } from "citty";
23732
+ import { defineCommand as defineCommand144 } from "citty";
24055
23733
  registerSchema({
24056
23734
  command: "scheduled-actions.trigger",
24057
23735
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -24059,7 +23737,7 @@ registerSchema({
24059
23737
  id: { type: "string", description: "Published scheduled action ID", required: true }
24060
23738
  }
24061
23739
  });
24062
- var triggerCommand = defineCommand145({
23740
+ var triggerCommand = defineCommand144({
24063
23741
  meta: {
24064
23742
  name: "trigger",
24065
23743
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -24096,7 +23774,7 @@ var triggerCommand = defineCommand145({
24096
23774
  });
24097
23775
 
24098
23776
  // src/commands/scheduled-actions/update.ts
24099
- import { defineCommand as defineCommand146 } from "citty";
23777
+ import { defineCommand as defineCommand145 } from "citty";
24100
23778
  registerSchema({
24101
23779
  command: "scheduled-actions.update",
24102
23780
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -24121,7 +23799,7 @@ registerSchema({
24121
23799
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
24122
23800
  }
24123
23801
  });
24124
- var updateCommand2 = defineCommand146({
23802
+ var updateCommand2 = defineCommand145({
24125
23803
  meta: {
24126
23804
  name: "update",
24127
23805
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -24192,7 +23870,7 @@ var updateCommand2 = defineCommand146({
24192
23870
  });
24193
23871
 
24194
23872
  // src/commands/scheduled-actions/index.ts
24195
- var scheduledActionsCommand = defineCommand147({
23873
+ var scheduledActionsCommand = defineCommand146({
24196
23874
  meta: {
24197
23875
  name: "scheduled-actions",
24198
23876
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -24208,7 +23886,7 @@ Examples:
24208
23886
  baker scheduled-actions trigger <id>`
24209
23887
  },
24210
23888
  subCommands: {
24211
- list: listCommand7,
23889
+ list: listCommand6,
24212
23890
  get: getCommand3,
24213
23891
  create: createCommand2,
24214
23892
  update: updateCommand2,
@@ -24218,8 +23896,8 @@ Examples:
24218
23896
  });
24219
23897
 
24220
23898
  // src/commands/schema.ts
24221
- import { defineCommand as defineCommand148 } from "citty";
24222
- var schemaCommand = defineCommand148({
23899
+ import { defineCommand as defineCommand147 } from "citty";
23900
+ var schemaCommand = defineCommand147({
24223
23901
  meta: {
24224
23902
  name: "schema",
24225
23903
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -24255,7 +23933,7 @@ var schemaCommand = defineCommand148({
24255
23933
  });
24256
23934
 
24257
23935
  // src/commands/tags/index.ts
24258
- import { defineCommand as defineCommand149 } from "citty";
23936
+ import { defineCommand as defineCommand148 } from "citty";
24259
23937
 
24260
23938
  // src/commands/tags/shared.ts
24261
23939
  function failApi3(err) {
@@ -24270,6 +23948,9 @@ function failApi3(err) {
24270
23948
  writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
24271
23949
  process.exit(1);
24272
23950
  }
23951
+ function renderConfigValue(value) {
23952
+ return value.includes("\n") ? value.replace(/\n/g, "\n ") : value;
23953
+ }
24273
23954
  function renderEffectiveEntry(entry) {
24274
23955
  const parts = [entry.ref, entry.type];
24275
23956
  if (entry.identifier !== void 0) {
@@ -24285,13 +23966,17 @@ function renderEffectiveEntry(entry) {
24285
23966
  if (secretBits.length > 0) {
24286
23967
  parts.push(`[secrets: ${secretBits.join(", ")}]`);
24287
23968
  }
24288
- return parts.join(" ");
23969
+ const header = parts.join(" ");
23970
+ const identifyingField = TAG_IDENTIFYING_FIELD[entry.type];
23971
+ const configLines = Object.entries(entry.config).filter(([key]) => key !== identifyingField).map(([key, value]) => ` ${key}: ${renderConfigValue(value)}`);
23972
+ return configLines.length > 0 ? `${header}
23973
+ ${configLines.join("\n")}` : header;
24289
23974
  }
24290
23975
 
24291
23976
  // src/commands/tags/index.ts
24292
23977
  registerSchema({
24293
23978
  command: "tags.list",
24294
- description: "Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only \u2014 every tag change (create, edit, delete) goes through the request_tag_input approval tool.",
23979
+ description: "Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat. Prints each tag's readable config in full (secrets are never included) \u2014 e.g. the Clarity projectId, GA4 measurementId, or the entire custom `code` snippet \u2014 so reuse a stored value to pre-fill a follow-up change instead of asking the user for something we already have. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only \u2014 every tag change (create, edit, delete) goes through the request_tag_input approval tool.",
24295
23980
  args: {
24296
23981
  json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false }
24297
23982
  }
@@ -24314,10 +23999,10 @@ async function listTags(json) {
24314
23999
  failApi3(err);
24315
24000
  }
24316
24001
  }
24317
- var listCommand8 = defineCommand149({
24002
+ var listCommand7 = defineCommand148({
24318
24003
  meta: {
24319
24004
  name: "list",
24320
- description: "Effective tags for this chat (production + staged). Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
24005
+ 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"
24321
24006
  },
24322
24007
  args: { json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" } },
24323
24008
  run: async ({ args }) => {
@@ -24333,7 +24018,7 @@ async function listDraft3() {
24333
24018
  failApi3(err);
24334
24019
  }
24335
24020
  }
24336
- var draftCommand3 = defineCommand149({
24021
+ var draftCommand3 = defineCommand148({
24337
24022
  meta: {
24338
24023
  name: "draft",
24339
24024
  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)."
@@ -24342,7 +24027,7 @@ var draftCommand3 = defineCommand149({
24342
24027
  await listDraft3();
24343
24028
  }
24344
24029
  });
24345
- var tagsCommand3 = defineCommand149({
24030
+ var tagsCommand3 = defineCommand148({
24346
24031
  meta: {
24347
24032
  name: "tags",
24348
24033
  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.
@@ -24351,12 +24036,14 @@ This command is READ-ONLY. Every tag change \u2014 create, edit, or delete \u201
24351
24036
 
24352
24037
  Refs: \`baker tags list\` prints each tag's ref \u2014 a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.
24353
24038
 
24039
+ \`baker tags list\` prints each tag's readable config in full (secrets excluded) \u2014 the Clarity projectId, GA4 measurementId, the whole custom \`code\` snippet, etc. Reuse a stored value to pre-fill a follow-up change instead of asking the user for something already installed.
24040
+
24354
24041
  Examples:
24355
- baker tags list # production + staged, with secret status
24042
+ baker tags list # production + staged, full readable config + secret status
24356
24043
  baker tags draft # review the staged changes awaiting publish`
24357
24044
  },
24358
24045
  subCommands: {
24359
- list: listCommand8,
24046
+ list: listCommand7,
24360
24047
  draft: draftCommand3
24361
24048
  },
24362
24049
  run: async () => {
@@ -24365,10 +24052,10 @@ Examples:
24365
24052
  });
24366
24053
 
24367
24054
  // src/commands/testimonials/index.ts
24368
- import { defineCommand as defineCommand153 } from "citty";
24055
+ import { defineCommand as defineCommand152 } from "citty";
24369
24056
 
24370
24057
  // src/commands/testimonials/get.ts
24371
- import { defineCommand as defineCommand150 } from "citty";
24058
+ import { defineCommand as defineCommand149 } from "citty";
24372
24059
  registerSchema({
24373
24060
  command: "testimonials.get",
24374
24061
  description: "Get a single testimonial by ID",
@@ -24376,7 +24063,7 @@ registerSchema({
24376
24063
  id: { type: "string", description: "Testimonial ID", required: true }
24377
24064
  }
24378
24065
  });
24379
- var getCommand4 = defineCommand150({
24066
+ var getCommand4 = defineCommand149({
24380
24067
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
24381
24068
  args: {
24382
24069
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -24413,7 +24100,7 @@ var getCommand4 = defineCommand150({
24413
24100
  });
24414
24101
 
24415
24102
  // src/commands/testimonials/list.ts
24416
- import { defineCommand as defineCommand151 } from "citty";
24103
+ import { defineCommand as defineCommand150 } from "citty";
24417
24104
  registerSchema({
24418
24105
  command: "testimonials.list",
24419
24106
  description: "List testimonials with optional filters.",
@@ -24443,7 +24130,7 @@ registerSchema({
24443
24130
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
24444
24131
  }
24445
24132
  });
24446
- var listCommand9 = defineCommand151({
24133
+ var listCommand8 = defineCommand150({
24447
24134
  meta: {
24448
24135
  name: "list",
24449
24136
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -24492,7 +24179,7 @@ var listCommand9 = defineCommand151({
24492
24179
  });
24493
24180
 
24494
24181
  // src/commands/testimonials/search.ts
24495
- import { defineCommand as defineCommand152 } from "citty";
24182
+ import { defineCommand as defineCommand151 } from "citty";
24496
24183
  registerSchema({
24497
24184
  command: "testimonials.search",
24498
24185
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -24523,7 +24210,7 @@ registerSchema({
24523
24210
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24524
24211
  }
24525
24212
  });
24526
- var searchCommand2 = defineCommand152({
24213
+ var searchCommand2 = defineCommand151({
24527
24214
  meta: {
24528
24215
  name: "search",
24529
24216
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -24597,7 +24284,7 @@ var searchCommand2 = defineCommand152({
24597
24284
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
24598
24285
 
24599
24286
  // src/commands/testimonials/index.ts
24600
- var testimonialsCommand = defineCommand153({
24287
+ var testimonialsCommand = defineCommand152({
24601
24288
  meta: {
24602
24289
  name: "testimonials",
24603
24290
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -24612,16 +24299,16 @@ Examples:
24612
24299
  subCommands: {
24613
24300
  get: getCommand4,
24614
24301
  search: searchCommand2,
24615
- list: listCommand9,
24302
+ list: listCommand8,
24616
24303
  tags: tagsCommand4
24617
24304
  }
24618
24305
  });
24619
24306
 
24620
24307
  // src/commands/videos/index.ts
24621
- import { defineCommand as defineCommand158 } from "citty";
24308
+ import { defineCommand as defineCommand157 } from "citty";
24622
24309
 
24623
24310
  // src/commands/videos/delete.ts
24624
- import { defineCommand as defineCommand154 } from "citty";
24311
+ import { defineCommand as defineCommand153 } from "citty";
24625
24312
  registerSchema({
24626
24313
  command: "videos.delete",
24627
24314
  description: "Delete a video by ID",
@@ -24635,7 +24322,7 @@ registerSchema({
24635
24322
  }
24636
24323
  }
24637
24324
  });
24638
- var deleteCommand3 = defineCommand154({
24325
+ var deleteCommand3 = defineCommand153({
24639
24326
  meta: {
24640
24327
  name: "delete",
24641
24328
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -24676,7 +24363,7 @@ var deleteCommand3 = defineCommand154({
24676
24363
  });
24677
24364
 
24678
24365
  // src/commands/videos/get.ts
24679
- import { defineCommand as defineCommand155 } from "citty";
24366
+ import { defineCommand as defineCommand154 } from "citty";
24680
24367
  registerSchema({
24681
24368
  command: "videos.get",
24682
24369
  description: "Get a single video by ID",
@@ -24684,7 +24371,7 @@ registerSchema({
24684
24371
  id: { type: "string", description: "Video ID", required: true }
24685
24372
  }
24686
24373
  });
24687
- var getCommand5 = defineCommand155({
24374
+ var getCommand5 = defineCommand154({
24688
24375
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
24689
24376
  args: {
24690
24377
  id: { type: "positional", description: "Video ID", required: false },
@@ -24721,7 +24408,7 @@ var getCommand5 = defineCommand155({
24721
24408
  });
24722
24409
 
24723
24410
  // src/commands/videos/search.ts
24724
- import { defineCommand as defineCommand156 } from "citty";
24411
+ import { defineCommand as defineCommand155 } from "citty";
24725
24412
  registerSchema({
24726
24413
  command: "videos.search",
24727
24414
  description: "Search videos by text query. Only returns ready videos.",
@@ -24731,7 +24418,7 @@ registerSchema({
24731
24418
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
24732
24419
  }
24733
24420
  });
24734
- var searchCommand3 = defineCommand156({
24421
+ var searchCommand3 = defineCommand155({
24735
24422
  meta: {
24736
24423
  name: "search",
24737
24424
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -24783,7 +24470,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
24783
24470
  // src/commands/videos/upload.ts
24784
24471
  import { readFile as readFile12, stat as stat3 } from "fs/promises";
24785
24472
  import { extname as extname3 } from "path";
24786
- import { defineCommand as defineCommand157 } from "citty";
24473
+ import { defineCommand as defineCommand156 } from "citty";
24787
24474
  var MIME_MAP = {
24788
24475
  ".mp4": "video/mp4",
24789
24476
  ".mov": "video/quicktime",
@@ -24817,7 +24504,7 @@ function detectContentType(filePath) {
24817
24504
  }
24818
24505
  return mime;
24819
24506
  }
24820
- var uploadCommand2 = defineCommand157({
24507
+ var uploadCommand2 = defineCommand156({
24821
24508
  meta: {
24822
24509
  name: "upload",
24823
24510
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -24871,7 +24558,7 @@ var uploadCommand2 = defineCommand157({
24871
24558
  });
24872
24559
 
24873
24560
  // src/commands/videos/index.ts
24874
- var videosCommand = defineCommand158({
24561
+ var videosCommand = defineCommand157({
24875
24562
  meta: {
24876
24563
  name: "videos",
24877
24564
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -24894,10 +24581,10 @@ Examples:
24894
24581
  });
24895
24582
 
24896
24583
  // src/commands/winning-ads/index.ts
24897
- import { defineCommand as defineCommand161 } from "citty";
24584
+ import { defineCommand as defineCommand160 } from "citty";
24898
24585
 
24899
24586
  // src/commands/winning-ads/advertisers.ts
24900
- import { defineCommand as defineCommand159 } from "citty";
24587
+ import { defineCommand as defineCommand158 } from "citty";
24901
24588
  registerSchema({
24902
24589
  command: "winning-ads.advertisers",
24903
24590
  description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
@@ -24910,7 +24597,7 @@ registerSchema({
24910
24597
  function identity(record) {
24911
24598
  return record;
24912
24599
  }
24913
- var advertisersCommand2 = defineCommand159({
24600
+ var advertisersCommand2 = defineCommand158({
24914
24601
  meta: {
24915
24602
  name: "advertisers",
24916
24603
  description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
@@ -24961,7 +24648,7 @@ var advertisersCommand2 = defineCommand159({
24961
24648
  });
24962
24649
 
24963
24650
  // src/commands/winning-ads/search.ts
24964
- import { defineCommand as defineCommand160 } from "citty";
24651
+ import { defineCommand as defineCommand159 } from "citty";
24965
24652
  registerSchema({
24966
24653
  command: "winning-ads.search",
24967
24654
  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.",
@@ -25069,7 +24756,7 @@ function buildSearchBody(args) {
25069
24756
  }
25070
24757
  return body;
25071
24758
  }
25072
- var searchCommand4 = defineCommand160({
24759
+ var searchCommand4 = defineCommand159({
25073
24760
  meta: {
25074
24761
  name: "search",
25075
24762
  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"
@@ -25181,7 +24868,7 @@ var searchCommand4 = defineCommand160({
25181
24868
  });
25182
24869
 
25183
24870
  // src/commands/winning-ads/index.ts
25184
- var winningAdsCommand = defineCommand161({
24871
+ var winningAdsCommand = defineCommand160({
25185
24872
  meta: {
25186
24873
  name: "winning-ads",
25187
24874
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -25205,7 +24892,7 @@ Examples:
25205
24892
  });
25206
24893
 
25207
24894
  // src/version.ts
25208
- import { readFileSync as readFileSync12 } from "fs";
24895
+ import { readFileSync as readFileSync11 } from "fs";
25209
24896
  function packageJsonUrl() {
25210
24897
  return new URL("../package.json", import.meta.url);
25211
24898
  }
@@ -25217,11 +24904,11 @@ function parsePackageVersion(raw) {
25217
24904
  throw new Error("Invalid CLI package.json: missing version");
25218
24905
  }
25219
24906
  function getCliVersion() {
25220
- return parsePackageVersion(readFileSync12(packageJsonUrl(), "utf8"));
24907
+ return parsePackageVersion(readFileSync11(packageJsonUrl(), "utf8"));
25221
24908
  }
25222
24909
 
25223
24910
  // src/cli.ts
25224
- var main = defineCommand162({
24911
+ var main = defineCommand161({
25225
24912
  meta: {
25226
24913
  name: "baker",
25227
24914
  version: getCliVersion(),
@@ -25241,7 +24928,6 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
25241
24928
  gsc: gscCommand,
25242
24929
  research: researchCommand,
25243
24930
  creatives: creativesCommand3,
25244
- flows: flowsCommand,
25245
24931
  images: imagesCommand,
25246
24932
  videos: videosCommand,
25247
24933
  testimonials: testimonialsCommand,