@koda-sl/baker-cli 0.133.0-dev.42a8955b3 → 0.133.1
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/README.md +10 -31
- package/dist/{chunk-O3TH7JW5.js → chunk-Q4UI5JZN.js} +107 -28
- package/dist/chunk-Q4UI5JZN.js.map +1 -0
- package/dist/cli.js +1388 -1476
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-O3TH7JW5.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
AD_FORMAT_PLATFORMS,
|
|
3
4
|
BackendClient,
|
|
4
5
|
BackendClient2,
|
|
5
6
|
DEFAULT_VIDEO_GENERATE_MODEL,
|
|
@@ -22,7 +23,9 @@ import {
|
|
|
22
23
|
generateCatalog,
|
|
23
24
|
imageProfileFor,
|
|
24
25
|
isPersistedAssetRef,
|
|
26
|
+
looksLikeHttpUrl,
|
|
25
27
|
parseRefExpr,
|
|
28
|
+
platformFormats,
|
|
26
29
|
requireCredentialsFromEnv,
|
|
27
30
|
resolveConcurrency,
|
|
28
31
|
sha256Hex,
|
|
@@ -31,7 +34,7 @@ import {
|
|
|
31
34
|
toModelSafeImage,
|
|
32
35
|
ulid,
|
|
33
36
|
validateCanvasDeep
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-Q4UI5JZN.js";
|
|
35
38
|
import {
|
|
36
39
|
csvOrJson,
|
|
37
40
|
daysAgoIso,
|
|
@@ -70,7 +73,7 @@ import {
|
|
|
70
73
|
} from "./chunk-RK67WL4O.js";
|
|
71
74
|
|
|
72
75
|
// src/cli.ts
|
|
73
|
-
import { defineCommand as
|
|
76
|
+
import { defineCommand as defineCommand171, runMain } from "citty";
|
|
74
77
|
|
|
75
78
|
// src/commands/actions/index.ts
|
|
76
79
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -1901,29 +1904,8 @@ var linkedinDraftErrorResponseSchema = z4.object({
|
|
|
1901
1904
|
fields: z4.array(linkedinFieldErrorSchema).optional()
|
|
1902
1905
|
});
|
|
1903
1906
|
|
|
1904
|
-
// ../api/src/analytics/wire.ts
|
|
1905
|
-
import { z as z5 } from "zod";
|
|
1906
|
-
var ANALYTICS_REPORTS = ["overview", "timeseries", "pages", "sources", "events"];
|
|
1907
|
-
var analyticsReportSchema = z5.enum(ANALYTICS_REPORTS);
|
|
1908
|
-
var ANALYTICS_PERIODS = ["today", "7d", "28d", "90d"];
|
|
1909
|
-
var analyticsPeriodSchema = z5.enum(ANALYTICS_PERIODS);
|
|
1910
|
-
var analyticsQueryRequestSchema = z5.object({
|
|
1911
|
-
report: analyticsReportSchema,
|
|
1912
|
-
period: analyticsPeriodSchema.default("28d"),
|
|
1913
|
-
limit: z5.number().int().min(1).max(100).optional()
|
|
1914
|
-
});
|
|
1915
|
-
var analyticsRowSchema = z5.record(z5.string(), z5.union([z5.string(), z5.number(), z5.null()]));
|
|
1916
|
-
var analyticsQueryResponseSchema = z5.object({
|
|
1917
|
-
report: analyticsReportSchema,
|
|
1918
|
-
/** Inclusive UTC start of the window, `YYYY-MM-DD HH:mm:ss`. */
|
|
1919
|
-
from: z5.string(),
|
|
1920
|
-
/** Exclusive UTC end of the window, `YYYY-MM-DD HH:mm:ss`. */
|
|
1921
|
-
to: z5.string(),
|
|
1922
|
-
rows: z5.array(analyticsRowSchema)
|
|
1923
|
-
});
|
|
1924
|
-
|
|
1925
1907
|
// ../api/src/flows.ts
|
|
1926
|
-
import { z as
|
|
1908
|
+
import { z as z5 } from "zod";
|
|
1927
1909
|
var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
1928
1910
|
"email",
|
|
1929
1911
|
"zapier",
|
|
@@ -1934,7 +1916,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
|
1934
1916
|
"crmble",
|
|
1935
1917
|
"goHighlevelContact"
|
|
1936
1918
|
];
|
|
1937
|
-
var flowSideEffectTypeSchema =
|
|
1919
|
+
var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
|
|
1938
1920
|
var FLOW_SECRET_FIELDS = {
|
|
1939
1921
|
email: [],
|
|
1940
1922
|
zapier: ["zapUrl"],
|
|
@@ -1962,94 +1944,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
|
|
|
1962
1944
|
"highlevel",
|
|
1963
1945
|
"highlevelForm"
|
|
1964
1946
|
];
|
|
1965
|
-
var flowResourceNodeTypeSchema =
|
|
1966
|
-
var flowInputRequestSchema =
|
|
1967
|
-
|
|
1947
|
+
var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
|
|
1948
|
+
var flowInputRequestSchema = z5.discriminatedUnion("target", [
|
|
1949
|
+
z5.object({
|
|
1968
1950
|
/** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
|
|
1969
|
-
target:
|
|
1970
|
-
flowSlug:
|
|
1951
|
+
target: z5.literal("sideEffect"),
|
|
1952
|
+
flowSlug: z5.string(),
|
|
1971
1953
|
/** `id` of the FlowNode holding the side effect. */
|
|
1972
|
-
nodeId:
|
|
1954
|
+
nodeId: z5.string(),
|
|
1973
1955
|
/** `id` of the side effect within that node's `sideEffects[]`. */
|
|
1974
|
-
sideEffectId:
|
|
1956
|
+
sideEffectId: z5.string(),
|
|
1975
1957
|
sideEffectType: flowSideEffectTypeSchema,
|
|
1976
1958
|
/** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
|
|
1977
|
-
prefilledConfig:
|
|
1959
|
+
prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
|
|
1978
1960
|
/** Secret credential field names the agent asks the user to provide. */
|
|
1979
|
-
requestedSecretFields:
|
|
1980
|
-
message:
|
|
1961
|
+
requestedSecretFields: z5.array(z5.string()).optional(),
|
|
1962
|
+
message: z5.string().optional()
|
|
1981
1963
|
}),
|
|
1982
|
-
|
|
1964
|
+
z5.object({
|
|
1983
1965
|
/** Configure a widget node's third-party `form.external` (+ `providerId`). */
|
|
1984
|
-
target:
|
|
1985
|
-
flowSlug:
|
|
1966
|
+
target: z5.literal("node"),
|
|
1967
|
+
flowSlug: z5.string(),
|
|
1986
1968
|
/** `id` of the widget FlowNode. */
|
|
1987
|
-
nodeId:
|
|
1969
|
+
nodeId: z5.string(),
|
|
1988
1970
|
nodeType: flowResourceNodeTypeSchema,
|
|
1989
|
-
message:
|
|
1971
|
+
message: z5.string().optional()
|
|
1990
1972
|
})
|
|
1991
1973
|
]);
|
|
1992
|
-
var flowInputToolInputSchema =
|
|
1993
|
-
requests:
|
|
1974
|
+
var flowInputToolInputSchema = z5.object({
|
|
1975
|
+
requests: z5.array(flowInputRequestSchema).min(1).max(8)
|
|
1994
1976
|
});
|
|
1995
|
-
var flowInputResultSchema =
|
|
1996
|
-
|
|
1997
|
-
status:
|
|
1977
|
+
var flowInputResultSchema = z5.discriminatedUnion("status", [
|
|
1978
|
+
z5.object({
|
|
1979
|
+
status: z5.literal("submitted"),
|
|
1998
1980
|
/** Echoes which piece this result resolves. */
|
|
1999
|
-
nodeId:
|
|
2000
|
-
sideEffectId:
|
|
1981
|
+
nodeId: z5.string(),
|
|
1982
|
+
sideEffectId: z5.string().optional(),
|
|
2001
1983
|
/** Names of secret fields the user provided. Never values. */
|
|
2002
|
-
secretFieldsSet:
|
|
1984
|
+
secretFieldsSet: z5.array(z5.string()),
|
|
2003
1985
|
/** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
|
|
2004
|
-
note:
|
|
1986
|
+
note: z5.string().optional()
|
|
2005
1987
|
}),
|
|
2006
|
-
|
|
2007
|
-
status:
|
|
2008
|
-
nodeId:
|
|
2009
|
-
sideEffectId:
|
|
2010
|
-
reason:
|
|
1988
|
+
z5.object({
|
|
1989
|
+
status: z5.literal("declined"),
|
|
1990
|
+
nodeId: z5.string(),
|
|
1991
|
+
sideEffectId: z5.string().optional(),
|
|
1992
|
+
reason: z5.string().optional()
|
|
2011
1993
|
})
|
|
2012
1994
|
]);
|
|
2013
|
-
var flowInputToolResultSchema =
|
|
2014
|
-
results:
|
|
1995
|
+
var flowInputToolResultSchema = z5.object({
|
|
1996
|
+
results: z5.array(flowInputResultSchema)
|
|
2015
1997
|
});
|
|
2016
|
-
var flowsListRequestSchema =
|
|
2017
|
-
var flowSummarySchema =
|
|
2018
|
-
slug:
|
|
2019
|
-
name:
|
|
1998
|
+
var flowsListRequestSchema = z5.object({ chatId: z5.string() });
|
|
1999
|
+
var flowSummarySchema = z5.object({
|
|
2000
|
+
slug: z5.string(),
|
|
2001
|
+
name: z5.string(),
|
|
2020
2002
|
/** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
|
|
2021
|
-
needsConfig:
|
|
2003
|
+
needsConfig: z5.number()
|
|
2022
2004
|
});
|
|
2023
|
-
var flowsListResponseSchema =
|
|
2024
|
-
var flowsShowRequestSchema =
|
|
2025
|
-
chatId:
|
|
2026
|
-
slug:
|
|
2027
|
-
full:
|
|
2005
|
+
var flowsListResponseSchema = z5.object({ flows: z5.array(flowSummarySchema) });
|
|
2006
|
+
var flowsShowRequestSchema = z5.object({
|
|
2007
|
+
chatId: z5.string(),
|
|
2008
|
+
slug: z5.string(),
|
|
2009
|
+
full: z5.boolean().optional()
|
|
2028
2010
|
});
|
|
2029
|
-
var flowConfigStatusSchema =
|
|
2030
|
-
nodeId:
|
|
2031
|
-
nodeName:
|
|
2011
|
+
var flowConfigStatusSchema = z5.object({
|
|
2012
|
+
nodeId: z5.string(),
|
|
2013
|
+
nodeName: z5.string().optional(),
|
|
2032
2014
|
/** "sideEffect" credential/connection, or "node" widget resource. */
|
|
2033
|
-
target:
|
|
2034
|
-
sideEffectId:
|
|
2035
|
-
kind:
|
|
2015
|
+
target: z5.enum(["sideEffect", "node"]),
|
|
2016
|
+
sideEffectId: z5.string().optional(),
|
|
2017
|
+
kind: z5.string(),
|
|
2036
2018
|
/** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
|
|
2037
|
-
status:
|
|
2019
|
+
status: z5.string(),
|
|
2038
2020
|
/** True when a `request_flow_input` call is still needed for this piece. */
|
|
2039
|
-
needsInput:
|
|
2021
|
+
needsInput: z5.boolean()
|
|
2040
2022
|
});
|
|
2041
|
-
var flowsShowResponseSchema =
|
|
2042
|
-
slug:
|
|
2043
|
-
name:
|
|
2023
|
+
var flowsShowResponseSchema = z5.object({
|
|
2024
|
+
slug: z5.string(),
|
|
2025
|
+
name: z5.string(),
|
|
2044
2026
|
/** Confidential fields and whether each is configured. */
|
|
2045
|
-
config:
|
|
2027
|
+
config: z5.array(flowConfigStatusSchema),
|
|
2046
2028
|
/** Present only with `--full`: the whole flow tree, secret values redacted. */
|
|
2047
|
-
tree:
|
|
2029
|
+
tree: z5.unknown().optional()
|
|
2048
2030
|
});
|
|
2049
2031
|
|
|
2050
2032
|
// ../api/src/images.ts
|
|
2051
|
-
import { z as
|
|
2052
|
-
var imageSourceSchema =
|
|
2033
|
+
import { z as z6 } from "zod";
|
|
2034
|
+
var imageSourceSchema = z6.enum([
|
|
2053
2035
|
"uploaded",
|
|
2054
2036
|
"website",
|
|
2055
2037
|
"google_testimonial",
|
|
@@ -2065,49 +2047,49 @@ var imageSourceSchema = z7.enum([
|
|
|
2065
2047
|
"pinterest",
|
|
2066
2048
|
"ai_generated"
|
|
2067
2049
|
]);
|
|
2068
|
-
var imageStatusSchema =
|
|
2069
|
-
var upscaleConfigSchema =
|
|
2070
|
-
model:
|
|
2071
|
-
input:
|
|
2072
|
-
scale_factor:
|
|
2073
|
-
creativity:
|
|
2074
|
-
output_format:
|
|
2050
|
+
var imageStatusSchema = z6.enum(["uploading", "processing", "ready", "error"]);
|
|
2051
|
+
var upscaleConfigSchema = z6.object({
|
|
2052
|
+
model: z6.literal("philz1337x/crystal-upscaler"),
|
|
2053
|
+
input: z6.object({
|
|
2054
|
+
scale_factor: z6.number(),
|
|
2055
|
+
creativity: z6.number(),
|
|
2056
|
+
output_format: z6.string()
|
|
2075
2057
|
}),
|
|
2076
|
-
status:
|
|
2058
|
+
status: z6.enum(["pending", "completed"])
|
|
2077
2059
|
});
|
|
2078
|
-
var imageDocSchema =
|
|
2079
|
-
_id:
|
|
2080
|
-
_creationTime:
|
|
2081
|
-
companyId:
|
|
2082
|
-
storageKey:
|
|
2060
|
+
var imageDocSchema = z6.object({
|
|
2061
|
+
_id: z6.string(),
|
|
2062
|
+
_creationTime: z6.number(),
|
|
2063
|
+
companyId: z6.string(),
|
|
2064
|
+
storageKey: z6.string(),
|
|
2083
2065
|
upscaleConfig: upscaleConfigSchema.optional(),
|
|
2084
|
-
upscaledStorageKey:
|
|
2085
|
-
name:
|
|
2086
|
-
description:
|
|
2087
|
-
tags:
|
|
2088
|
-
source:
|
|
2089
|
-
externalId:
|
|
2090
|
-
externalUrl:
|
|
2091
|
-
contentHash:
|
|
2092
|
-
sourceId:
|
|
2093
|
-
descriptionContext:
|
|
2094
|
-
width:
|
|
2095
|
-
height:
|
|
2096
|
-
aspectRatio:
|
|
2097
|
-
dominantColor:
|
|
2098
|
-
imagePalette:
|
|
2099
|
-
thumbhashDataUri:
|
|
2100
|
-
isLightImage:
|
|
2101
|
-
descriptionEmbedding:
|
|
2102
|
-
imageEmbedding:
|
|
2103
|
-
searchText:
|
|
2066
|
+
upscaledStorageKey: z6.string().optional(),
|
|
2067
|
+
name: z6.string(),
|
|
2068
|
+
description: z6.string(),
|
|
2069
|
+
tags: z6.array(z6.string()),
|
|
2070
|
+
source: z6.string(),
|
|
2071
|
+
externalId: z6.string().optional(),
|
|
2072
|
+
externalUrl: z6.string().optional(),
|
|
2073
|
+
contentHash: z6.string().optional(),
|
|
2074
|
+
sourceId: z6.string().optional(),
|
|
2075
|
+
descriptionContext: z6.string().optional(),
|
|
2076
|
+
width: z6.number().optional(),
|
|
2077
|
+
height: z6.number().optional(),
|
|
2078
|
+
aspectRatio: z6.number().optional(),
|
|
2079
|
+
dominantColor: z6.string().optional(),
|
|
2080
|
+
imagePalette: z6.array(z6.string()).optional(),
|
|
2081
|
+
thumbhashDataUri: z6.string().optional(),
|
|
2082
|
+
isLightImage: z6.boolean().optional(),
|
|
2083
|
+
descriptionEmbedding: z6.array(z6.number()).optional(),
|
|
2084
|
+
imageEmbedding: z6.array(z6.number()).optional(),
|
|
2085
|
+
searchText: z6.string().optional(),
|
|
2104
2086
|
status: imageStatusSchema,
|
|
2105
|
-
errorMessage:
|
|
2106
|
-
createdAt:
|
|
2107
|
-
updatedAt:
|
|
2108
|
-
imageUrl:
|
|
2087
|
+
errorMessage: z6.string().optional(),
|
|
2088
|
+
createdAt: z6.number(),
|
|
2089
|
+
updatedAt: z6.number(),
|
|
2090
|
+
imageUrl: z6.string()
|
|
2109
2091
|
});
|
|
2110
|
-
var imageHitSourceSchema =
|
|
2092
|
+
var imageHitSourceSchema = z6.enum([
|
|
2111
2093
|
"library",
|
|
2112
2094
|
"magnific",
|
|
2113
2095
|
"google_images",
|
|
@@ -2118,242 +2100,242 @@ var imageHitSourceSchema = z7.enum([
|
|
|
2118
2100
|
"giphy",
|
|
2119
2101
|
"pinterest"
|
|
2120
2102
|
]);
|
|
2121
|
-
var imageHitSchema =
|
|
2103
|
+
var imageHitSchema = z6.object({
|
|
2122
2104
|
source: imageHitSourceSchema,
|
|
2123
|
-
url:
|
|
2124
|
-
thumbnailUrl:
|
|
2125
|
-
width:
|
|
2126
|
-
height:
|
|
2127
|
-
aspectRatio:
|
|
2128
|
-
dominantColor:
|
|
2129
|
-
externalId:
|
|
2130
|
-
externalUrl:
|
|
2131
|
-
providerMeta:
|
|
2132
|
-
descriptionContext:
|
|
2133
|
-
_id:
|
|
2134
|
-
name:
|
|
2135
|
-
description:
|
|
2136
|
-
tags:
|
|
2137
|
-
score:
|
|
2138
|
-
alsoInLibrary:
|
|
2139
|
-
prefetchedBytes:
|
|
2140
|
-
prefetchedContentType:
|
|
2105
|
+
url: z6.string(),
|
|
2106
|
+
thumbnailUrl: z6.string().optional(),
|
|
2107
|
+
width: z6.number().optional(),
|
|
2108
|
+
height: z6.number().optional(),
|
|
2109
|
+
aspectRatio: z6.number().optional(),
|
|
2110
|
+
dominantColor: z6.string().optional(),
|
|
2111
|
+
externalId: z6.string().optional(),
|
|
2112
|
+
externalUrl: z6.string().optional(),
|
|
2113
|
+
providerMeta: z6.record(z6.string(), z6.unknown()).optional(),
|
|
2114
|
+
descriptionContext: z6.string().optional(),
|
|
2115
|
+
_id: z6.string().optional(),
|
|
2116
|
+
name: z6.string().optional(),
|
|
2117
|
+
description: z6.string().optional(),
|
|
2118
|
+
tags: z6.array(z6.string()).optional(),
|
|
2119
|
+
score: z6.number().optional(),
|
|
2120
|
+
alsoInLibrary: z6.string().optional(),
|
|
2121
|
+
prefetchedBytes: z6.string().optional(),
|
|
2122
|
+
prefetchedContentType: z6.string().optional()
|
|
2141
2123
|
});
|
|
2142
2124
|
var ingestedImageHitSchema = imageHitSchema.extend({
|
|
2143
|
-
imageId:
|
|
2144
|
-
imageUrl:
|
|
2145
|
-
deduped:
|
|
2146
|
-
sourceUrl:
|
|
2147
|
-
});
|
|
2148
|
-
var autoIngestItemSchema =
|
|
2149
|
-
imageId:
|
|
2150
|
-
deduped:
|
|
2151
|
-
imageUrl:
|
|
2152
|
-
sourceUrl:
|
|
2153
|
-
externalUrl:
|
|
2125
|
+
imageId: z6.string().optional(),
|
|
2126
|
+
imageUrl: z6.string().optional(),
|
|
2127
|
+
deduped: z6.boolean().optional(),
|
|
2128
|
+
sourceUrl: z6.string().optional()
|
|
2129
|
+
});
|
|
2130
|
+
var autoIngestItemSchema = z6.object({
|
|
2131
|
+
imageId: z6.string(),
|
|
2132
|
+
deduped: z6.boolean(),
|
|
2133
|
+
imageUrl: z6.string(),
|
|
2134
|
+
sourceUrl: z6.string(),
|
|
2135
|
+
externalUrl: z6.string().optional()
|
|
2154
2136
|
});
|
|
2155
2137
|
function providerHitsResponseSchema() {
|
|
2156
|
-
return
|
|
2157
|
-
hits:
|
|
2158
|
-
ingested:
|
|
2138
|
+
return z6.object({
|
|
2139
|
+
hits: z6.array(ingestedImageHitSchema),
|
|
2140
|
+
ingested: z6.array(autoIngestItemSchema)
|
|
2159
2141
|
});
|
|
2160
2142
|
}
|
|
2161
|
-
var imagesGetRequestSchema =
|
|
2162
|
-
var imagesSearchRequestSchema =
|
|
2163
|
-
query:
|
|
2164
|
-
limit:
|
|
2165
|
-
aspectRatio:
|
|
2166
|
-
tags:
|
|
2167
|
-
source:
|
|
2168
|
-
externalUrlHost:
|
|
2169
|
-
});
|
|
2170
|
-
var imageSearchResultSchema =
|
|
2171
|
-
_id:
|
|
2172
|
-
imageUrl:
|
|
2173
|
-
name:
|
|
2174
|
-
description:
|
|
2175
|
-
tags:
|
|
2176
|
-
width:
|
|
2177
|
-
height:
|
|
2178
|
-
aspectRatio:
|
|
2179
|
-
dominantColor:
|
|
2180
|
-
imagePalette:
|
|
2181
|
-
source:
|
|
2182
|
-
externalUrl:
|
|
2183
|
-
score:
|
|
2184
|
-
});
|
|
2185
|
-
var imagesSearchResponseSchema =
|
|
2186
|
-
var imagesUploadRequestSchema =
|
|
2187
|
-
base64:
|
|
2188
|
-
contentType:
|
|
2189
|
-
source:
|
|
2190
|
-
descriptionContext:
|
|
2191
|
-
});
|
|
2192
|
-
var imagesUploadResponseSchema =
|
|
2193
|
-
var imagesDeleteRequestSchema =
|
|
2194
|
-
var imagesDeleteResponseSchema =
|
|
2195
|
-
var imagesUpscaleRequestSchema =
|
|
2196
|
-
var imagesUpscaleResponseSchema =
|
|
2197
|
-
imageId:
|
|
2198
|
-
status:
|
|
2143
|
+
var imagesGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
|
|
2144
|
+
var imagesSearchRequestSchema = z6.object({
|
|
2145
|
+
query: z6.string().min(1),
|
|
2146
|
+
limit: z6.coerce.number().int().positive().max(100).optional(),
|
|
2147
|
+
aspectRatio: z6.string().optional(),
|
|
2148
|
+
tags: z6.array(z6.string()).optional(),
|
|
2149
|
+
source: z6.string().optional(),
|
|
2150
|
+
externalUrlHost: z6.string().optional()
|
|
2151
|
+
});
|
|
2152
|
+
var imageSearchResultSchema = z6.object({
|
|
2153
|
+
_id: z6.string(),
|
|
2154
|
+
imageUrl: z6.string(),
|
|
2155
|
+
name: z6.string(),
|
|
2156
|
+
description: z6.string(),
|
|
2157
|
+
tags: z6.array(z6.string()),
|
|
2158
|
+
width: z6.number().optional(),
|
|
2159
|
+
height: z6.number().optional(),
|
|
2160
|
+
aspectRatio: z6.number().optional(),
|
|
2161
|
+
dominantColor: z6.string().optional(),
|
|
2162
|
+
imagePalette: z6.array(z6.string()).optional(),
|
|
2163
|
+
source: z6.string(),
|
|
2164
|
+
externalUrl: z6.string().optional(),
|
|
2165
|
+
score: z6.number()
|
|
2166
|
+
});
|
|
2167
|
+
var imagesSearchResponseSchema = z6.array(imageSearchResultSchema);
|
|
2168
|
+
var imagesUploadRequestSchema = z6.object({
|
|
2169
|
+
base64: z6.string().min(1),
|
|
2170
|
+
contentType: z6.string().min(1),
|
|
2171
|
+
source: z6.string().optional(),
|
|
2172
|
+
descriptionContext: z6.string().optional()
|
|
2173
|
+
});
|
|
2174
|
+
var imagesUploadResponseSchema = z6.object({ imageId: z6.string() });
|
|
2175
|
+
var imagesDeleteRequestSchema = z6.object({ id: z6.string().min(1, "Missing image ID") });
|
|
2176
|
+
var imagesDeleteResponseSchema = z6.object({ ok: z6.literal(true) });
|
|
2177
|
+
var imagesUpscaleRequestSchema = z6.object({ imageId: z6.string().min(1, "Missing image ID") });
|
|
2178
|
+
var imagesUpscaleResponseSchema = z6.object({
|
|
2179
|
+
imageId: z6.string(),
|
|
2180
|
+
status: z6.literal("processing")
|
|
2199
2181
|
});
|
|
2200
2182
|
var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
|
|
2201
|
-
var imagesFindRequestSchema =
|
|
2202
|
-
query:
|
|
2203
|
-
sources:
|
|
2204
|
-
limit:
|
|
2205
|
-
fallback:
|
|
2206
|
-
threshold:
|
|
2207
|
-
autoIngest:
|
|
2208
|
-
descriptionContext:
|
|
2209
|
-
});
|
|
2210
|
-
var imagesFindResponseSchema =
|
|
2211
|
-
groups:
|
|
2212
|
-
library:
|
|
2213
|
-
external:
|
|
2183
|
+
var imagesFindRequestSchema = z6.object({
|
|
2184
|
+
query: z6.string().min(1),
|
|
2185
|
+
sources: z6.array(z6.enum(IMAGES_FIND_SOURCES)).optional(),
|
|
2186
|
+
limit: z6.coerce.number().int().positive().max(50).optional(),
|
|
2187
|
+
fallback: z6.boolean().optional(),
|
|
2188
|
+
threshold: z6.number().min(0).max(1).optional(),
|
|
2189
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2190
|
+
descriptionContext: z6.string().optional()
|
|
2191
|
+
});
|
|
2192
|
+
var imagesFindResponseSchema = z6.object({
|
|
2193
|
+
groups: z6.object({
|
|
2194
|
+
library: z6.array(imageHitSchema),
|
|
2195
|
+
external: z6.array(ingestedImageHitSchema)
|
|
2214
2196
|
}),
|
|
2215
|
-
meta:
|
|
2216
|
-
counts:
|
|
2217
|
-
errors:
|
|
2197
|
+
meta: z6.object({
|
|
2198
|
+
counts: z6.record(z6.string(), z6.number()),
|
|
2199
|
+
errors: z6.array(z6.object({ source: imageHitSourceSchema, message: z6.string() }))
|
|
2218
2200
|
}),
|
|
2219
|
-
ingested:
|
|
2220
|
-
});
|
|
2221
|
-
var imagesStockRequestSchema =
|
|
2222
|
-
query:
|
|
2223
|
-
orientation:
|
|
2224
|
-
contentType:
|
|
2225
|
-
license:
|
|
2226
|
-
color:
|
|
2227
|
-
aiGenerated:
|
|
2228
|
-
people:
|
|
2229
|
-
order:
|
|
2230
|
-
limit:
|
|
2231
|
-
page:
|
|
2232
|
-
autoIngest:
|
|
2233
|
-
descriptionContext:
|
|
2201
|
+
ingested: z6.array(autoIngestItemSchema)
|
|
2202
|
+
});
|
|
2203
|
+
var imagesStockRequestSchema = z6.object({
|
|
2204
|
+
query: z6.string().min(1),
|
|
2205
|
+
orientation: z6.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
|
|
2206
|
+
contentType: z6.enum(["photo", "vector", "psd"]).optional(),
|
|
2207
|
+
license: z6.enum(["freemium", "premium"]).optional(),
|
|
2208
|
+
color: z6.string().optional(),
|
|
2209
|
+
aiGenerated: z6.enum(["exclude", "only"]).optional(),
|
|
2210
|
+
people: z6.enum(["include", "exclude", "only"]).optional(),
|
|
2211
|
+
order: z6.enum(["relevance", "recent"]).optional(),
|
|
2212
|
+
limit: z6.coerce.number().int().positive().max(50).optional(),
|
|
2213
|
+
page: z6.coerce.number().int().positive().optional(),
|
|
2214
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2215
|
+
descriptionContext: z6.string().optional()
|
|
2234
2216
|
});
|
|
2235
2217
|
var imagesStockResponseSchema = providerHitsResponseSchema();
|
|
2236
|
-
var imagesGoogleRequestSchema =
|
|
2237
|
-
query:
|
|
2238
|
-
type:
|
|
2239
|
-
size:
|
|
2240
|
-
color:
|
|
2241
|
-
safe:
|
|
2242
|
-
limit:
|
|
2243
|
-
autoIngest:
|
|
2244
|
-
descriptionContext:
|
|
2218
|
+
var imagesGoogleRequestSchema = z6.object({
|
|
2219
|
+
query: z6.string().min(1),
|
|
2220
|
+
type: z6.string().optional(),
|
|
2221
|
+
size: z6.string().optional(),
|
|
2222
|
+
color: z6.string().optional(),
|
|
2223
|
+
safe: z6.enum(["off", "active"]).optional(),
|
|
2224
|
+
limit: z6.coerce.number().int().positive().max(50).optional(),
|
|
2225
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2226
|
+
descriptionContext: z6.string().optional()
|
|
2245
2227
|
});
|
|
2246
2228
|
var imagesGoogleResponseSchema = providerHitsResponseSchema();
|
|
2247
|
-
var imagesPinterestRequestSchema =
|
|
2248
|
-
query:
|
|
2249
|
-
limit:
|
|
2250
|
-
autoIngest:
|
|
2251
|
-
descriptionContext:
|
|
2229
|
+
var imagesPinterestRequestSchema = z6.object({
|
|
2230
|
+
query: z6.string().min(1),
|
|
2231
|
+
limit: z6.coerce.number().int().positive().max(20).optional(),
|
|
2232
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2233
|
+
descriptionContext: z6.string().optional()
|
|
2252
2234
|
});
|
|
2253
2235
|
var imagesPinterestResponseSchema = providerHitsResponseSchema();
|
|
2254
|
-
var rgbTriple =
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2236
|
+
var rgbTriple = z6.tuple([
|
|
2237
|
+
z6.number().int().min(0).max(255),
|
|
2238
|
+
z6.number().int().min(0).max(255),
|
|
2239
|
+
z6.number().int().min(0).max(255)
|
|
2258
2240
|
]);
|
|
2259
|
-
var imageGenerateModelSchema =
|
|
2241
|
+
var imageGenerateModelSchema = z6.enum([
|
|
2260
2242
|
"openai/gpt-5.4-image-2",
|
|
2261
2243
|
"google/gemini-3.5-flash",
|
|
2262
2244
|
"google/gemini-3.1-flash-image-preview",
|
|
2263
2245
|
"google/gemini-3-pro-image-preview",
|
|
2264
2246
|
"recraft/recraft-v4.1-pro-vector"
|
|
2265
2247
|
]);
|
|
2266
|
-
var imagesGenerateRequestSchema =
|
|
2267
|
-
prompt:
|
|
2248
|
+
var imagesGenerateRequestSchema = z6.object({
|
|
2249
|
+
prompt: z6.string().min(1),
|
|
2268
2250
|
model: imageGenerateModelSchema.optional(),
|
|
2269
2251
|
// Aspect ratio + size are validated loosely as strings; the per-model enum
|
|
2270
2252
|
// lives in canvas-contract and OpenRouter rejects unsupported combinations.
|
|
2271
|
-
aspectRatio:
|
|
2272
|
-
imageSize:
|
|
2253
|
+
aspectRatio: z6.string().optional(),
|
|
2254
|
+
imageSize: z6.string().optional(),
|
|
2273
2255
|
// Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
|
|
2274
|
-
quality:
|
|
2256
|
+
quality: z6.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2275
2257
|
// Recraft v4.1 Pro Vector levers (ignored by other models).
|
|
2276
|
-
strength:
|
|
2277
|
-
rgbColors:
|
|
2258
|
+
strength: z6.coerce.number().min(0).max(1).optional(),
|
|
2259
|
+
rgbColors: z6.array(rgbTriple).optional(),
|
|
2278
2260
|
backgroundRgbColor: rgbTriple.optional(),
|
|
2279
2261
|
// Public image URLs used as visual references (multi-reference, in order).
|
|
2280
|
-
referenceUrls:
|
|
2281
|
-
descriptionContext:
|
|
2282
|
-
});
|
|
2283
|
-
var generatedImageSchema =
|
|
2284
|
-
imageId:
|
|
2285
|
-
deduped:
|
|
2286
|
-
imageUrl:
|
|
2287
|
-
width:
|
|
2288
|
-
height:
|
|
2289
|
-
});
|
|
2290
|
-
var imagesGenerateResponseSchema =
|
|
2291
|
-
model:
|
|
2292
|
-
costUsd:
|
|
2293
|
-
images:
|
|
2294
|
-
});
|
|
2295
|
-
var imagesLogoRequestSchema =
|
|
2296
|
-
domain:
|
|
2297
|
-
variant:
|
|
2298
|
-
autoIngest:
|
|
2299
|
-
descriptionContext:
|
|
2262
|
+
referenceUrls: z6.array(z6.string().url()).optional(),
|
|
2263
|
+
descriptionContext: z6.string().optional()
|
|
2264
|
+
});
|
|
2265
|
+
var generatedImageSchema = z6.object({
|
|
2266
|
+
imageId: z6.string(),
|
|
2267
|
+
deduped: z6.boolean(),
|
|
2268
|
+
imageUrl: z6.string(),
|
|
2269
|
+
width: z6.number().optional(),
|
|
2270
|
+
height: z6.number().optional()
|
|
2271
|
+
});
|
|
2272
|
+
var imagesGenerateResponseSchema = z6.object({
|
|
2273
|
+
model: z6.string(),
|
|
2274
|
+
costUsd: z6.number(),
|
|
2275
|
+
images: z6.array(generatedImageSchema)
|
|
2276
|
+
});
|
|
2277
|
+
var imagesLogoRequestSchema = z6.object({
|
|
2278
|
+
domain: z6.string().min(1),
|
|
2279
|
+
variant: z6.enum(["icon", "logo", "symbol"]).optional(),
|
|
2280
|
+
autoIngest: z6.coerce.number().int().min(0).max(5).optional(),
|
|
2281
|
+
descriptionContext: z6.string().optional()
|
|
2300
2282
|
});
|
|
2301
2283
|
var imagesLogoResponseSchema = providerHitsResponseSchema();
|
|
2302
|
-
var imagesIconRequestSchema =
|
|
2303
|
-
name:
|
|
2304
|
-
set:
|
|
2305
|
-
color:
|
|
2306
|
-
width:
|
|
2307
|
-
autoIngest:
|
|
2308
|
-
descriptionContext:
|
|
2284
|
+
var imagesIconRequestSchema = z6.object({
|
|
2285
|
+
name: z6.string().min(1),
|
|
2286
|
+
set: z6.string().optional(),
|
|
2287
|
+
color: z6.string().optional(),
|
|
2288
|
+
width: z6.coerce.number().int().positive().optional(),
|
|
2289
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2290
|
+
descriptionContext: z6.string().optional()
|
|
2309
2291
|
});
|
|
2310
2292
|
var imagesIconResponseSchema = providerHitsResponseSchema();
|
|
2311
|
-
var imagesExtractRequestSchema =
|
|
2312
|
-
url:
|
|
2313
|
-
waitFor:
|
|
2314
|
-
limit:
|
|
2315
|
-
autoIngest:
|
|
2316
|
-
descriptionContext:
|
|
2293
|
+
var imagesExtractRequestSchema = z6.object({
|
|
2294
|
+
url: z6.string().url(),
|
|
2295
|
+
waitFor: z6.coerce.number().int().min(0).max(3e4).optional(),
|
|
2296
|
+
limit: z6.coerce.number().int().positive().max(50).optional(),
|
|
2297
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2298
|
+
descriptionContext: z6.string().optional()
|
|
2317
2299
|
});
|
|
2318
2300
|
var imagesExtractResponseSchema = providerHitsResponseSchema();
|
|
2319
|
-
var imagesScreenshotRequestSchema =
|
|
2320
|
-
url:
|
|
2321
|
-
fullPage:
|
|
2322
|
-
viewportWidth:
|
|
2323
|
-
viewportHeight:
|
|
2324
|
-
format:
|
|
2325
|
-
descriptionContext:
|
|
2301
|
+
var imagesScreenshotRequestSchema = z6.object({
|
|
2302
|
+
url: z6.string().url(),
|
|
2303
|
+
fullPage: z6.boolean().optional(),
|
|
2304
|
+
viewportWidth: z6.coerce.number().int().positive().max(3840).optional(),
|
|
2305
|
+
viewportHeight: z6.coerce.number().int().positive().max(2160).optional(),
|
|
2306
|
+
format: z6.enum(["webp", "png", "jpg"]).optional(),
|
|
2307
|
+
descriptionContext: z6.string().optional()
|
|
2326
2308
|
});
|
|
2327
2309
|
var imagesScreenshotResponseSchema = providerHitsResponseSchema();
|
|
2328
|
-
var imagesGiphyRequestSchema =
|
|
2329
|
-
query:
|
|
2330
|
-
trending:
|
|
2331
|
-
limit:
|
|
2332
|
-
rating:
|
|
2333
|
-
lang:
|
|
2334
|
-
autoIngest:
|
|
2335
|
-
descriptionContext:
|
|
2310
|
+
var imagesGiphyRequestSchema = z6.object({
|
|
2311
|
+
query: z6.string().min(1).optional(),
|
|
2312
|
+
trending: z6.coerce.boolean().optional(),
|
|
2313
|
+
limit: z6.coerce.number().int().positive().max(50).optional(),
|
|
2314
|
+
rating: z6.enum(["g", "pg", "pg-13", "r"]).optional(),
|
|
2315
|
+
lang: z6.string().optional(),
|
|
2316
|
+
autoIngest: z6.coerce.number().int().min(0).max(20).optional(),
|
|
2317
|
+
descriptionContext: z6.string().optional()
|
|
2336
2318
|
});
|
|
2337
2319
|
var imagesGifResponseSchema = providerHitsResponseSchema();
|
|
2338
2320
|
var imagesStickerResponseSchema = providerHitsResponseSchema();
|
|
2339
|
-
var imagesIngestRequestSchema =
|
|
2340
|
-
url:
|
|
2321
|
+
var imagesIngestRequestSchema = z6.object({
|
|
2322
|
+
url: z6.string().url(),
|
|
2341
2323
|
// Validate source at the HTTP boundary so unknown values produce the standard
|
|
2342
2324
|
// `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
|
|
2343
2325
|
// `assertImageSource` inside the action.
|
|
2344
2326
|
source: imageSourceSchema,
|
|
2345
|
-
externalId:
|
|
2346
|
-
externalUrl:
|
|
2347
|
-
descriptionContext:
|
|
2327
|
+
externalId: z6.string().optional(),
|
|
2328
|
+
externalUrl: z6.string().optional(),
|
|
2329
|
+
descriptionContext: z6.string().optional()
|
|
2348
2330
|
});
|
|
2349
|
-
var imagesIngestResponseSchema =
|
|
2350
|
-
imageId:
|
|
2351
|
-
deduped:
|
|
2352
|
-
contentHash:
|
|
2331
|
+
var imagesIngestResponseSchema = z6.object({
|
|
2332
|
+
imageId: z6.string(),
|
|
2333
|
+
deduped: z6.boolean(),
|
|
2334
|
+
contentHash: z6.string()
|
|
2353
2335
|
});
|
|
2354
2336
|
|
|
2355
2337
|
// ../api/src/tags.ts
|
|
2356
|
-
import { z as
|
|
2338
|
+
import { z as z7 } from "zod";
|
|
2357
2339
|
var TAG_TYPES = [
|
|
2358
2340
|
"meta",
|
|
2359
2341
|
"amplitude",
|
|
@@ -2374,7 +2356,7 @@ var TAG_TYPES = [
|
|
|
2374
2356
|
"recaptcha",
|
|
2375
2357
|
"twitterAds"
|
|
2376
2358
|
];
|
|
2377
|
-
var tagTypeSchema =
|
|
2359
|
+
var tagTypeSchema = z7.enum(TAG_TYPES);
|
|
2378
2360
|
var TAG_IDENTIFYING_FIELD = {
|
|
2379
2361
|
meta: "pixelId",
|
|
2380
2362
|
googleAds: "conversionID",
|
|
@@ -2395,218 +2377,218 @@ var TAG_IDENTIFYING_FIELD = {
|
|
|
2395
2377
|
recaptcha: "siteKey",
|
|
2396
2378
|
twitterAds: "pixelId"
|
|
2397
2379
|
};
|
|
2398
|
-
var tagDraftOpKindSchema =
|
|
2399
|
-
var tagDraftOpViewSchema =
|
|
2380
|
+
var tagDraftOpKindSchema = z7.enum(["create", "update", "delete"]);
|
|
2381
|
+
var tagDraftOpViewSchema = z7.object({
|
|
2400
2382
|
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
2401
|
-
ref:
|
|
2383
|
+
ref: z7.string(),
|
|
2402
2384
|
kind: tagDraftOpKindSchema,
|
|
2403
2385
|
type: tagTypeSchema,
|
|
2404
2386
|
/** Present on update/delete ops — the real tag this op targets. */
|
|
2405
|
-
tagId:
|
|
2387
|
+
tagId: z7.string().optional(),
|
|
2406
2388
|
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
2407
|
-
config:
|
|
2389
|
+
config: z7.record(z7.string(), z7.string()),
|
|
2408
2390
|
/** Update only — fields the op explicitly clears. */
|
|
2409
|
-
clearFields:
|
|
2391
|
+
clearFields: z7.array(z7.string()).optional(),
|
|
2410
2392
|
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
2411
|
-
secretsSet:
|
|
2393
|
+
secretsSet: z7.array(z7.string()),
|
|
2412
2394
|
/** Names of secret fields still awaiting user input. */
|
|
2413
|
-
secretsPending:
|
|
2414
|
-
summary:
|
|
2415
|
-
stagedAt:
|
|
2395
|
+
secretsPending: z7.array(z7.string()),
|
|
2396
|
+
summary: z7.string(),
|
|
2397
|
+
stagedAt: z7.number()
|
|
2416
2398
|
});
|
|
2417
|
-
var tagsEffectiveEntrySchema =
|
|
2399
|
+
var tagsEffectiveEntrySchema = z7.object({
|
|
2418
2400
|
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
2419
|
-
ref:
|
|
2420
|
-
tagId:
|
|
2401
|
+
ref: z7.string(),
|
|
2402
|
+
tagId: z7.string().optional(),
|
|
2421
2403
|
type: tagTypeSchema,
|
|
2422
2404
|
/** Value of the type's identifying field, when set. */
|
|
2423
|
-
identifier:
|
|
2405
|
+
identifier: z7.string().optional(),
|
|
2424
2406
|
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
2425
|
-
config:
|
|
2407
|
+
config: z7.record(z7.string(), z7.string()),
|
|
2426
2408
|
/** Absent = live production tag with no staged changes in this chat. */
|
|
2427
2409
|
staged: tagDraftOpKindSchema.optional(),
|
|
2428
|
-
secretsSet:
|
|
2429
|
-
secretsPending:
|
|
2410
|
+
secretsSet: z7.array(z7.string()),
|
|
2411
|
+
secretsPending: z7.array(z7.string())
|
|
2430
2412
|
});
|
|
2431
|
-
var tagsListRequestSchema =
|
|
2432
|
-
var tagsListResponseSchema =
|
|
2433
|
-
var tagsDraftListRequestSchema =
|
|
2434
|
-
var tagsDraftListResponseSchema =
|
|
2435
|
-
status:
|
|
2436
|
-
ops:
|
|
2413
|
+
var tagsListRequestSchema = z7.object({ chatId: z7.string() });
|
|
2414
|
+
var tagsListResponseSchema = z7.object({ tags: z7.array(tagsEffectiveEntrySchema) });
|
|
2415
|
+
var tagsDraftListRequestSchema = z7.object({ chatId: z7.string() });
|
|
2416
|
+
var tagsDraftListResponseSchema = z7.object({
|
|
2417
|
+
status: z7.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
2418
|
+
ops: z7.array(tagDraftOpViewSchema)
|
|
2437
2419
|
});
|
|
2438
|
-
var tagInputRequestSchema =
|
|
2420
|
+
var tagInputRequestSchema = z7.object({
|
|
2439
2421
|
// Every tag change is a tab in the approval form: create/edit show the full
|
|
2440
2422
|
// body; delete shows a confirm. No tag change bypasses this approval.
|
|
2441
|
-
mode:
|
|
2423
|
+
mode: z7.enum(["create", "edit", "delete"]),
|
|
2442
2424
|
tagType: tagTypeSchema,
|
|
2443
2425
|
/** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
|
|
2444
|
-
ref:
|
|
2426
|
+
ref: z7.string().optional(),
|
|
2445
2427
|
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
2446
|
-
prefilledConfig:
|
|
2428
|
+
prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
|
|
2447
2429
|
/** Secret field names the agent asks the user to provide. */
|
|
2448
|
-
requestedSecretFields:
|
|
2430
|
+
requestedSecretFields: z7.array(z7.string()).optional(),
|
|
2449
2431
|
/** Short message shown above the form explaining why the input is needed. */
|
|
2450
|
-
message:
|
|
2432
|
+
message: z7.string().optional()
|
|
2451
2433
|
});
|
|
2452
|
-
var tagChangeToolInputSchema =
|
|
2453
|
-
changes:
|
|
2434
|
+
var tagChangeToolInputSchema = z7.object({
|
|
2435
|
+
changes: z7.array(tagInputRequestSchema).min(1).max(8)
|
|
2454
2436
|
});
|
|
2455
|
-
var tagInputResultSchema =
|
|
2456
|
-
|
|
2457
|
-
status:
|
|
2458
|
-
ref:
|
|
2437
|
+
var tagInputResultSchema = z7.discriminatedUnion("status", [
|
|
2438
|
+
z7.object({
|
|
2439
|
+
status: z7.literal("submitted"),
|
|
2440
|
+
ref: z7.string(),
|
|
2459
2441
|
type: tagTypeSchema,
|
|
2460
2442
|
/** Identifying field name → value (non-secret), when the type has one. */
|
|
2461
|
-
identifier:
|
|
2462
|
-
secretFieldsSet:
|
|
2463
|
-
note:
|
|
2443
|
+
identifier: z7.record(z7.string(), z7.string()).optional(),
|
|
2444
|
+
secretFieldsSet: z7.array(z7.string()),
|
|
2445
|
+
note: z7.string().optional()
|
|
2464
2446
|
}),
|
|
2465
|
-
|
|
2466
|
-
status:
|
|
2467
|
-
reason:
|
|
2447
|
+
z7.object({
|
|
2448
|
+
status: z7.literal("declined"),
|
|
2449
|
+
reason: z7.string().optional()
|
|
2468
2450
|
})
|
|
2469
2451
|
]);
|
|
2470
|
-
var tagChangeToolResultSchema =
|
|
2471
|
-
results:
|
|
2452
|
+
var tagChangeToolResultSchema = z7.object({
|
|
2453
|
+
results: z7.array(tagInputResultSchema)
|
|
2472
2454
|
});
|
|
2473
2455
|
|
|
2474
2456
|
// ../api/src/testimonials.ts
|
|
2475
|
-
import { z as
|
|
2476
|
-
var testimonialSourceTypeSchema =
|
|
2477
|
-
var testimonialStatusSchema =
|
|
2478
|
-
var testimonialSentimentSchema =
|
|
2479
|
-
var testimonialDocSchema =
|
|
2480
|
-
_id:
|
|
2481
|
-
_creationTime:
|
|
2482
|
-
companyId:
|
|
2483
|
-
sourceId:
|
|
2457
|
+
import { z as z8 } from "zod";
|
|
2458
|
+
var testimonialSourceTypeSchema = z8.enum(["google", "trustpilot"]);
|
|
2459
|
+
var testimonialStatusSchema = z8.enum(["pending", "processing", "ready", "error"]);
|
|
2460
|
+
var testimonialSentimentSchema = z8.enum(["positive", "neutral", "negative"]);
|
|
2461
|
+
var testimonialDocSchema = z8.object({
|
|
2462
|
+
_id: z8.string(),
|
|
2463
|
+
_creationTime: z8.number(),
|
|
2464
|
+
companyId: z8.string(),
|
|
2465
|
+
sourceId: z8.string(),
|
|
2484
2466
|
sourceType: testimonialSourceTypeSchema,
|
|
2485
|
-
reviewText:
|
|
2486
|
-
reviewTitle:
|
|
2487
|
-
searchText:
|
|
2488
|
-
reviewerName:
|
|
2489
|
-
reviewerImageUrl:
|
|
2490
|
-
reviewerImageId:
|
|
2491
|
-
reviewerLocation:
|
|
2492
|
-
rating:
|
|
2493
|
-
reviewDate:
|
|
2494
|
-
ownerAnswer:
|
|
2495
|
-
mediaUrls:
|
|
2496
|
-
imageIds:
|
|
2497
|
-
videoIds:
|
|
2498
|
-
sourceUrl:
|
|
2499
|
-
rawData:
|
|
2500
|
-
tags:
|
|
2501
|
-
highlight:
|
|
2502
|
-
language:
|
|
2503
|
-
summary:
|
|
2467
|
+
reviewText: z8.string(),
|
|
2468
|
+
reviewTitle: z8.string().optional(),
|
|
2469
|
+
searchText: z8.string().optional(),
|
|
2470
|
+
reviewerName: z8.string().optional(),
|
|
2471
|
+
reviewerImageUrl: z8.string().optional(),
|
|
2472
|
+
reviewerImageId: z8.string().optional(),
|
|
2473
|
+
reviewerLocation: z8.string().optional(),
|
|
2474
|
+
rating: z8.number().optional(),
|
|
2475
|
+
reviewDate: z8.number().optional(),
|
|
2476
|
+
ownerAnswer: z8.string().optional(),
|
|
2477
|
+
mediaUrls: z8.array(z8.string()).optional(),
|
|
2478
|
+
imageIds: z8.array(z8.string()).optional(),
|
|
2479
|
+
videoIds: z8.array(z8.string()).optional(),
|
|
2480
|
+
sourceUrl: z8.string().optional(),
|
|
2481
|
+
rawData: z8.unknown().optional(),
|
|
2482
|
+
tags: z8.array(z8.string()),
|
|
2483
|
+
highlight: z8.string().optional(),
|
|
2484
|
+
language: z8.string().optional(),
|
|
2485
|
+
summary: z8.string().optional(),
|
|
2504
2486
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2505
|
-
textEmbedding:
|
|
2506
|
-
externalId:
|
|
2507
|
-
contentHash:
|
|
2487
|
+
textEmbedding: z8.array(z8.number()).optional(),
|
|
2488
|
+
externalId: z8.string().optional(),
|
|
2489
|
+
contentHash: z8.string().optional(),
|
|
2508
2490
|
status: testimonialStatusSchema,
|
|
2509
|
-
errorMessage:
|
|
2510
|
-
createdAt:
|
|
2511
|
-
updatedAt:
|
|
2491
|
+
errorMessage: z8.string().optional(),
|
|
2492
|
+
createdAt: z8.number(),
|
|
2493
|
+
updatedAt: z8.number()
|
|
2512
2494
|
});
|
|
2513
|
-
var testimonialsListRequestSchema =
|
|
2495
|
+
var testimonialsListRequestSchema = z8.object({
|
|
2514
2496
|
source: testimonialSourceTypeSchema.optional(),
|
|
2515
|
-
rating_min:
|
|
2516
|
-
rating_max:
|
|
2517
|
-
tags:
|
|
2497
|
+
rating_min: z8.coerce.number().int().min(1).max(5).optional(),
|
|
2498
|
+
rating_max: z8.coerce.number().int().min(1).max(5).optional(),
|
|
2499
|
+
tags: z8.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
2518
2500
|
status: testimonialStatusSchema.optional(),
|
|
2519
2501
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2520
|
-
language:
|
|
2521
|
-
limit:
|
|
2522
|
-
});
|
|
2523
|
-
var testimonialsListResponseSchema =
|
|
2524
|
-
var testimonialsGetRequestSchema =
|
|
2525
|
-
var testimonialsSearchRequestSchema =
|
|
2526
|
-
query:
|
|
2527
|
-
limit:
|
|
2502
|
+
language: z8.string().min(2).max(5).optional(),
|
|
2503
|
+
limit: z8.coerce.number().int().positive().max(200).optional()
|
|
2504
|
+
});
|
|
2505
|
+
var testimonialsListResponseSchema = z8.array(testimonialDocSchema);
|
|
2506
|
+
var testimonialsGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
|
|
2507
|
+
var testimonialsSearchRequestSchema = z8.object({
|
|
2508
|
+
query: z8.string().min(1),
|
|
2509
|
+
limit: z8.coerce.number().int().positive().max(100).optional(),
|
|
2528
2510
|
source: testimonialSourceTypeSchema.optional(),
|
|
2529
|
-
rating_min:
|
|
2530
|
-
rating_max:
|
|
2531
|
-
tags:
|
|
2511
|
+
rating_min: z8.coerce.number().int().min(1).max(5).optional(),
|
|
2512
|
+
rating_max: z8.coerce.number().int().min(1).max(5).optional(),
|
|
2513
|
+
tags: z8.array(z8.string()).optional(),
|
|
2532
2514
|
status: testimonialStatusSchema.optional(),
|
|
2533
2515
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2534
|
-
language:
|
|
2516
|
+
language: z8.string().min(2).max(5).optional()
|
|
2535
2517
|
}).refine(
|
|
2536
2518
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
2537
2519
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
2538
2520
|
);
|
|
2539
|
-
var testimonialsSearchResponseSchema =
|
|
2540
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
2541
|
-
ok:
|
|
2542
|
-
note:
|
|
2521
|
+
var testimonialsSearchResponseSchema = z8.array(testimonialDocSchema);
|
|
2522
|
+
var testimonialsOutscraperWebhookResponseSchema = z8.object({
|
|
2523
|
+
ok: z8.literal(true),
|
|
2524
|
+
note: z8.string().optional()
|
|
2543
2525
|
});
|
|
2544
2526
|
|
|
2545
2527
|
// ../api/src/videos.ts
|
|
2546
|
-
import { z as
|
|
2547
|
-
var videoStatusSchema =
|
|
2548
|
-
var videoTranscriptSegmentSchema =
|
|
2549
|
-
text:
|
|
2550
|
-
startSecond:
|
|
2551
|
-
endSecond:
|
|
2552
|
-
});
|
|
2553
|
-
var videoSceneSchema =
|
|
2554
|
-
title:
|
|
2555
|
-
description:
|
|
2556
|
-
startSecond:
|
|
2557
|
-
endSecond:
|
|
2558
|
-
thumbnailTime:
|
|
2559
|
-
});
|
|
2560
|
-
var videoDocSchema =
|
|
2561
|
-
_id:
|
|
2562
|
-
_creationTime:
|
|
2563
|
-
companyId:
|
|
2564
|
-
muxAssetId:
|
|
2565
|
-
muxPlaybackId:
|
|
2566
|
-
muxUploadId:
|
|
2567
|
-
name:
|
|
2568
|
-
description:
|
|
2569
|
-
tags:
|
|
2570
|
-
source:
|
|
2571
|
-
externalId:
|
|
2572
|
-
sourceId:
|
|
2573
|
-
width:
|
|
2574
|
-
height:
|
|
2575
|
-
aspectRatio:
|
|
2576
|
-
duration:
|
|
2577
|
-
transcript:
|
|
2578
|
-
transcriptSegments:
|
|
2579
|
-
scenes:
|
|
2580
|
-
descriptionEmbedding:
|
|
2581
|
-
searchText:
|
|
2528
|
+
import { z as z9 } from "zod";
|
|
2529
|
+
var videoStatusSchema = z9.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
2530
|
+
var videoTranscriptSegmentSchema = z9.object({
|
|
2531
|
+
text: z9.string(),
|
|
2532
|
+
startSecond: z9.number(),
|
|
2533
|
+
endSecond: z9.number()
|
|
2534
|
+
});
|
|
2535
|
+
var videoSceneSchema = z9.object({
|
|
2536
|
+
title: z9.string(),
|
|
2537
|
+
description: z9.string(),
|
|
2538
|
+
startSecond: z9.number(),
|
|
2539
|
+
endSecond: z9.number(),
|
|
2540
|
+
thumbnailTime: z9.number()
|
|
2541
|
+
});
|
|
2542
|
+
var videoDocSchema = z9.object({
|
|
2543
|
+
_id: z9.string(),
|
|
2544
|
+
_creationTime: z9.number(),
|
|
2545
|
+
companyId: z9.string(),
|
|
2546
|
+
muxAssetId: z9.string(),
|
|
2547
|
+
muxPlaybackId: z9.string(),
|
|
2548
|
+
muxUploadId: z9.string(),
|
|
2549
|
+
name: z9.string(),
|
|
2550
|
+
description: z9.string(),
|
|
2551
|
+
tags: z9.array(z9.string()),
|
|
2552
|
+
source: z9.string(),
|
|
2553
|
+
externalId: z9.string().optional(),
|
|
2554
|
+
sourceId: z9.string().optional(),
|
|
2555
|
+
width: z9.number().optional(),
|
|
2556
|
+
height: z9.number().optional(),
|
|
2557
|
+
aspectRatio: z9.number().optional(),
|
|
2558
|
+
duration: z9.number().optional(),
|
|
2559
|
+
transcript: z9.string().optional(),
|
|
2560
|
+
transcriptSegments: z9.array(videoTranscriptSegmentSchema).optional(),
|
|
2561
|
+
scenes: z9.array(videoSceneSchema).optional(),
|
|
2562
|
+
descriptionEmbedding: z9.array(z9.number()).optional(),
|
|
2563
|
+
searchText: z9.string().optional(),
|
|
2582
2564
|
status: videoStatusSchema,
|
|
2583
|
-
errorMessage:
|
|
2584
|
-
createdAt:
|
|
2585
|
-
updatedAt:
|
|
2586
|
-
thumbnailUrl:
|
|
2587
|
-
});
|
|
2588
|
-
var videosWebhookResponseSchema =
|
|
2589
|
-
var videosGetRequestSchema =
|
|
2590
|
-
var videosSearchRequestSchema =
|
|
2591
|
-
query:
|
|
2592
|
-
limit:
|
|
2593
|
-
tags:
|
|
2594
|
-
});
|
|
2595
|
-
var videoSearchResultSchema =
|
|
2596
|
-
_id:
|
|
2597
|
-
thumbnailUrl:
|
|
2598
|
-
name:
|
|
2599
|
-
description:
|
|
2600
|
-
tags:
|
|
2601
|
-
status:
|
|
2602
|
-
duration:
|
|
2603
|
-
muxPlaybackId:
|
|
2604
|
-
createdAt:
|
|
2605
|
-
});
|
|
2606
|
-
var videosSearchResponseSchema =
|
|
2607
|
-
var videosUploadResponseSchema =
|
|
2608
|
-
var videosDeleteRequestSchema =
|
|
2609
|
-
var videosDeleteResponseSchema =
|
|
2565
|
+
errorMessage: z9.string().optional(),
|
|
2566
|
+
createdAt: z9.number(),
|
|
2567
|
+
updatedAt: z9.number(),
|
|
2568
|
+
thumbnailUrl: z9.string()
|
|
2569
|
+
});
|
|
2570
|
+
var videosWebhookResponseSchema = z9.object({ ok: z9.literal(true) });
|
|
2571
|
+
var videosGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
|
|
2572
|
+
var videosSearchRequestSchema = z9.object({
|
|
2573
|
+
query: z9.string().min(1),
|
|
2574
|
+
limit: z9.coerce.number().int().positive().max(100).optional(),
|
|
2575
|
+
tags: z9.array(z9.string()).optional()
|
|
2576
|
+
});
|
|
2577
|
+
var videoSearchResultSchema = z9.object({
|
|
2578
|
+
_id: z9.string(),
|
|
2579
|
+
thumbnailUrl: z9.string(),
|
|
2580
|
+
name: z9.string(),
|
|
2581
|
+
description: z9.string(),
|
|
2582
|
+
tags: z9.array(z9.string()),
|
|
2583
|
+
status: z9.string(),
|
|
2584
|
+
duration: z9.number().optional(),
|
|
2585
|
+
muxPlaybackId: z9.string(),
|
|
2586
|
+
createdAt: z9.number()
|
|
2587
|
+
});
|
|
2588
|
+
var videosSearchResponseSchema = z9.array(videoSearchResultSchema);
|
|
2589
|
+
var videosUploadResponseSchema = z9.object({ uploadUrl: z9.string(), videoId: z9.string() });
|
|
2590
|
+
var videosDeleteRequestSchema = z9.object({ id: z9.string().min(1, "Missing video ID") });
|
|
2591
|
+
var videosDeleteResponseSchema = z9.object({ ok: z9.literal(true) });
|
|
2610
2592
|
|
|
2611
2593
|
// src/commands/actions/complete.ts
|
|
2612
2594
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -4419,37 +4401,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
4419
4401
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4420
4402
|
|
|
4421
4403
|
// ../api/src/ads-google/ops.ts
|
|
4422
|
-
import { z as
|
|
4423
|
-
var tempRefSchema2 =
|
|
4424
|
-
var refSchema =
|
|
4425
|
-
|
|
4426
|
-
|
|
4404
|
+
import { z as z10 } from "zod";
|
|
4405
|
+
var tempRefSchema2 = z10.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
4406
|
+
var refSchema = z10.union([
|
|
4407
|
+
z10.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
4408
|
+
z10.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4427
4409
|
tempRefSchema2
|
|
4428
4410
|
]);
|
|
4429
4411
|
var targetRefSchema = refSchema;
|
|
4430
|
-
var microsSchema =
|
|
4431
|
-
var httpsUrlSchema2 =
|
|
4432
|
-
var customerIdSchema =
|
|
4433
|
-
var stageableStatusSchema2 =
|
|
4434
|
-
var matchTypeSchema =
|
|
4435
|
-
var keywordTextSchema =
|
|
4436
|
-
var budgetCreateSchema =
|
|
4437
|
-
name:
|
|
4412
|
+
var microsSchema = z10.number().int().positive("expected a positive micros amount");
|
|
4413
|
+
var httpsUrlSchema2 = z10.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
4414
|
+
var customerIdSchema = z10.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
4415
|
+
var stageableStatusSchema2 = z10.enum(STAGEABLE_CREATE_STATUSES2);
|
|
4416
|
+
var matchTypeSchema = z10.enum(KEYWORD_MATCH_TYPES);
|
|
4417
|
+
var keywordTextSchema = z10.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
|
|
4418
|
+
var budgetCreateSchema = z10.object({
|
|
4419
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4438
4420
|
amountMicros: microsSchema,
|
|
4439
|
-
deliveryMethod:
|
|
4440
|
-
explicitlyShared:
|
|
4421
|
+
deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
4422
|
+
explicitlyShared: z10.boolean().default(false)
|
|
4441
4423
|
});
|
|
4442
|
-
var budgetUpdateSchema =
|
|
4443
|
-
name:
|
|
4424
|
+
var budgetUpdateSchema = z10.object({
|
|
4425
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4444
4426
|
amountMicros: microsSchema.optional(),
|
|
4445
|
-
deliveryMethod:
|
|
4427
|
+
deliveryMethod: z10.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4446
4428
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4447
|
-
var biddingConfigSchema =
|
|
4448
|
-
type:
|
|
4429
|
+
var biddingConfigSchema = z10.object({
|
|
4430
|
+
type: z10.enum(BIDDING_STRATEGY_TYPES),
|
|
4449
4431
|
targetCpaMicros: microsSchema.optional(),
|
|
4450
|
-
targetRoas:
|
|
4432
|
+
targetRoas: z10.number().positive().optional(),
|
|
4451
4433
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4452
|
-
enhancedCpcEnabled:
|
|
4434
|
+
enhancedCpcEnabled: z10.boolean().optional()
|
|
4453
4435
|
}).superRefine((p, ctx) => {
|
|
4454
4436
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4455
4437
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -4458,17 +4440,17 @@ var biddingConfigSchema = z11.object({
|
|
|
4458
4440
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4459
4441
|
}
|
|
4460
4442
|
});
|
|
4461
|
-
var networkSettingsSchema =
|
|
4462
|
-
targetGoogleSearch:
|
|
4463
|
-
targetSearchNetwork:
|
|
4464
|
-
targetContentNetwork:
|
|
4465
|
-
targetPartnerSearchNetwork:
|
|
4443
|
+
var networkSettingsSchema = z10.object({
|
|
4444
|
+
targetGoogleSearch: z10.boolean().optional(),
|
|
4445
|
+
targetSearchNetwork: z10.boolean().optional(),
|
|
4446
|
+
targetContentNetwork: z10.boolean().optional(),
|
|
4447
|
+
targetPartnerSearchNetwork: z10.boolean().optional()
|
|
4466
4448
|
});
|
|
4467
|
-
var dateSchema =
|
|
4468
|
-
var campaignCreateSchema2 =
|
|
4469
|
-
name:
|
|
4470
|
-
channelType:
|
|
4471
|
-
channelSubType:
|
|
4449
|
+
var dateSchema = z10.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4450
|
+
var campaignCreateSchema2 = z10.object({
|
|
4451
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4452
|
+
channelType: z10.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4453
|
+
channelSubType: z10.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4472
4454
|
budget: refSchema,
|
|
4473
4455
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4474
4456
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -4477,7 +4459,7 @@ var campaignCreateSchema2 = z11.object({
|
|
|
4477
4459
|
startDate: dateSchema.optional(),
|
|
4478
4460
|
endDate: dateSchema.optional(),
|
|
4479
4461
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4480
|
-
objective:
|
|
4462
|
+
objective: z10.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4481
4463
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4482
4464
|
}).superRefine((p, ctx) => {
|
|
4483
4465
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -4501,129 +4483,129 @@ var campaignCreateSchema2 = z11.object({
|
|
|
4501
4483
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4502
4484
|
}
|
|
4503
4485
|
});
|
|
4504
|
-
var campaignUpdateSchema2 =
|
|
4505
|
-
name:
|
|
4486
|
+
var campaignUpdateSchema2 = z10.object({
|
|
4487
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4506
4488
|
budget: refSchema.optional(),
|
|
4507
4489
|
bidding: biddingConfigSchema.optional(),
|
|
4508
4490
|
networkSettings: networkSettingsSchema.optional(),
|
|
4509
4491
|
startDate: dateSchema.optional(),
|
|
4510
4492
|
endDate: dateSchema.optional(),
|
|
4511
|
-
status:
|
|
4493
|
+
status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4512
4494
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4513
|
-
var adGroupCreateSchema =
|
|
4514
|
-
name:
|
|
4495
|
+
var adGroupCreateSchema = z10.object({
|
|
4496
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4515
4497
|
campaign: refSchema,
|
|
4516
|
-
type:
|
|
4498
|
+
type: z10.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4517
4499
|
cpcBidMicros: microsSchema.optional(),
|
|
4518
4500
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4519
4501
|
});
|
|
4520
|
-
var adGroupUpdateSchema =
|
|
4521
|
-
name:
|
|
4502
|
+
var adGroupUpdateSchema = z10.object({
|
|
4503
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4522
4504
|
cpcBidMicros: microsSchema.optional(),
|
|
4523
|
-
status:
|
|
4505
|
+
status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4524
4506
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4525
|
-
var keywordAddSchema =
|
|
4507
|
+
var keywordAddSchema = z10.object({
|
|
4526
4508
|
adGroup: refSchema,
|
|
4527
4509
|
text: keywordTextSchema,
|
|
4528
4510
|
matchType: matchTypeSchema,
|
|
4529
4511
|
cpcBidMicros: microsSchema.optional(),
|
|
4530
|
-
finalUrls:
|
|
4512
|
+
finalUrls: z10.array(httpsUrlSchema2).optional(),
|
|
4531
4513
|
status: stageableStatusSchema2.default("ENABLED")
|
|
4532
4514
|
});
|
|
4533
|
-
var keywordUpdateSchema =
|
|
4515
|
+
var keywordUpdateSchema = z10.object({
|
|
4534
4516
|
cpcBidMicros: microsSchema.optional(),
|
|
4535
|
-
finalUrls:
|
|
4536
|
-
status:
|
|
4517
|
+
finalUrls: z10.array(httpsUrlSchema2).optional(),
|
|
4518
|
+
status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4537
4519
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4538
|
-
var negativeKeywordAddSchema =
|
|
4539
|
-
level:
|
|
4520
|
+
var negativeKeywordAddSchema = z10.object({
|
|
4521
|
+
level: z10.enum(["adGroup", "campaign"]),
|
|
4540
4522
|
parent: refSchema,
|
|
4541
4523
|
text: keywordTextSchema,
|
|
4542
4524
|
matchType: matchTypeSchema
|
|
4543
4525
|
});
|
|
4544
|
-
var sharedSetCreateSchema =
|
|
4545
|
-
name:
|
|
4546
|
-
type:
|
|
4526
|
+
var sharedSetCreateSchema = z10.object({
|
|
4527
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4528
|
+
type: z10.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4547
4529
|
});
|
|
4548
|
-
var sharedSetMemberAddSchema =
|
|
4530
|
+
var sharedSetMemberAddSchema = z10.object({
|
|
4549
4531
|
sharedSet: refSchema,
|
|
4550
4532
|
text: keywordTextSchema,
|
|
4551
4533
|
matchType: matchTypeSchema
|
|
4552
4534
|
});
|
|
4553
|
-
var campaignSharedSetAttachSchema =
|
|
4535
|
+
var campaignSharedSetAttachSchema = z10.object({
|
|
4554
4536
|
campaign: refSchema,
|
|
4555
4537
|
sharedSet: refSchema
|
|
4556
4538
|
});
|
|
4557
|
-
var adTextAssetSchema =
|
|
4558
|
-
text:
|
|
4559
|
-
pinnedField:
|
|
4539
|
+
var adTextAssetSchema = z10.object({
|
|
4540
|
+
text: z10.string().min(1),
|
|
4541
|
+
pinnedField: z10.enum(PINNED_FIELDS).optional()
|
|
4560
4542
|
});
|
|
4561
|
-
var responsiveSearchAdSchema =
|
|
4562
|
-
format:
|
|
4563
|
-
headlines:
|
|
4543
|
+
var responsiveSearchAdSchema = z10.object({
|
|
4544
|
+
format: z10.literal("responsiveSearch"),
|
|
4545
|
+
headlines: z10.array(
|
|
4564
4546
|
adTextAssetSchema.refine(
|
|
4565
4547
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4566
4548
|
"headline exceeds 30 chars"
|
|
4567
4549
|
)
|
|
4568
4550
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4569
|
-
descriptions:
|
|
4551
|
+
descriptions: z10.array(
|
|
4570
4552
|
adTextAssetSchema.refine(
|
|
4571
4553
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4572
4554
|
"description exceeds 90 chars"
|
|
4573
4555
|
)
|
|
4574
4556
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4575
|
-
path1:
|
|
4576
|
-
path2:
|
|
4577
|
-
finalUrls:
|
|
4578
|
-
});
|
|
4579
|
-
var responsiveDisplayAdSchema =
|
|
4580
|
-
format:
|
|
4581
|
-
headlines:
|
|
4582
|
-
longHeadline:
|
|
4583
|
-
descriptions:
|
|
4584
|
-
businessName:
|
|
4557
|
+
path1: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4558
|
+
path2: z10.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4559
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1)
|
|
4560
|
+
});
|
|
4561
|
+
var responsiveDisplayAdSchema = z10.object({
|
|
4562
|
+
format: z10.literal("responsiveDisplay"),
|
|
4563
|
+
headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4564
|
+
longHeadline: z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4565
|
+
descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4566
|
+
businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4585
4567
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
4586
4568
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
4587
4569
|
// image (1:1) to serve; the logo images are optional.
|
|
4588
|
-
marketingImageAssets:
|
|
4589
|
-
squareMarketingImageAssets:
|
|
4590
|
-
logoImageAssets:
|
|
4591
|
-
finalUrls:
|
|
4592
|
-
});
|
|
4593
|
-
var callAdSchema =
|
|
4594
|
-
format:
|
|
4595
|
-
countryCode:
|
|
4596
|
-
phoneNumber:
|
|
4597
|
-
headline1:
|
|
4598
|
-
headline2:
|
|
4599
|
-
description1:
|
|
4600
|
-
description2:
|
|
4601
|
-
businessName:
|
|
4602
|
-
finalUrls:
|
|
4603
|
-
});
|
|
4604
|
-
var appAdSchema =
|
|
4605
|
-
format:
|
|
4606
|
-
headlines:
|
|
4607
|
-
descriptions:
|
|
4608
|
-
});
|
|
4609
|
-
var videoAdSchema =
|
|
4610
|
-
format:
|
|
4570
|
+
marketingImageAssets: z10.array(refSchema).optional(),
|
|
4571
|
+
squareMarketingImageAssets: z10.array(refSchema).optional(),
|
|
4572
|
+
logoImageAssets: z10.array(refSchema).optional(),
|
|
4573
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1)
|
|
4574
|
+
});
|
|
4575
|
+
var callAdSchema = z10.object({
|
|
4576
|
+
format: z10.literal("call"),
|
|
4577
|
+
countryCode: z10.string().length(2),
|
|
4578
|
+
phoneNumber: z10.string().min(3),
|
|
4579
|
+
headline1: z10.string().min(1).max(30),
|
|
4580
|
+
headline2: z10.string().min(1).max(30),
|
|
4581
|
+
description1: z10.string().min(1).max(90),
|
|
4582
|
+
description2: z10.string().min(1).max(90),
|
|
4583
|
+
businessName: z10.string().min(1).max(25),
|
|
4584
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1)
|
|
4585
|
+
});
|
|
4586
|
+
var appAdSchema = z10.object({
|
|
4587
|
+
format: z10.literal("app"),
|
|
4588
|
+
headlines: z10.array(z10.object({ text: z10.string().min(1).max(30) })).min(1),
|
|
4589
|
+
descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1)
|
|
4590
|
+
});
|
|
4591
|
+
var videoAdSchema = z10.object({
|
|
4592
|
+
format: z10.literal("video"),
|
|
4611
4593
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
4612
4594
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
4613
|
-
videoAssets:
|
|
4614
|
-
finalUrls:
|
|
4615
|
-
});
|
|
4616
|
-
var demandGenAdSchema =
|
|
4617
|
-
format:
|
|
4618
|
-
headlines:
|
|
4619
|
-
descriptions:
|
|
4620
|
-
businessName:
|
|
4621
|
-
finalUrls:
|
|
4622
|
-
imageAssets:
|
|
4623
|
-
squareImageAssets:
|
|
4624
|
-
logoImageAssets:
|
|
4625
|
-
});
|
|
4626
|
-
var adContentSchema =
|
|
4595
|
+
videoAssets: z10.array(refSchema).min(1),
|
|
4596
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1)
|
|
4597
|
+
});
|
|
4598
|
+
var demandGenAdSchema = z10.object({
|
|
4599
|
+
format: z10.literal("demandGen"),
|
|
4600
|
+
headlines: z10.array(z10.object({ text: z10.string().min(1).max(40) })).min(1).max(5),
|
|
4601
|
+
descriptions: z10.array(z10.object({ text: z10.string().min(1).max(90) })).min(1).max(5),
|
|
4602
|
+
businessName: z10.string().min(1).max(25),
|
|
4603
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1),
|
|
4604
|
+
imageAssets: z10.array(refSchema).optional(),
|
|
4605
|
+
squareImageAssets: z10.array(refSchema).optional(),
|
|
4606
|
+
logoImageAssets: z10.array(refSchema).optional()
|
|
4607
|
+
});
|
|
4608
|
+
var adContentSchema = z10.discriminatedUnion("format", [
|
|
4627
4609
|
responsiveSearchAdSchema,
|
|
4628
4610
|
responsiveDisplayAdSchema,
|
|
4629
4611
|
callAdSchema,
|
|
@@ -4631,45 +4613,45 @@ var adContentSchema = z11.discriminatedUnion("format", [
|
|
|
4631
4613
|
videoAdSchema,
|
|
4632
4614
|
demandGenAdSchema
|
|
4633
4615
|
]);
|
|
4634
|
-
var adCreateSchema =
|
|
4616
|
+
var adCreateSchema = z10.object({
|
|
4635
4617
|
adGroup: refSchema,
|
|
4636
4618
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
4637
4619
|
content: adContentSchema
|
|
4638
4620
|
});
|
|
4639
|
-
var adUpdateSchema =
|
|
4640
|
-
status:
|
|
4621
|
+
var adUpdateSchema = z10.object({
|
|
4622
|
+
status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4641
4623
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4642
|
-
content:
|
|
4624
|
+
content: z10.record(z10.string(), z10.unknown()).optional()
|
|
4643
4625
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4644
|
-
var textAssetSchema =
|
|
4645
|
-
var imageAssetSchema =
|
|
4646
|
-
type:
|
|
4647
|
-
imageId:
|
|
4648
|
-
name:
|
|
4649
|
-
});
|
|
4650
|
-
var youtubeVideoAssetSchema =
|
|
4651
|
-
type:
|
|
4652
|
-
youtubeVideoId:
|
|
4653
|
-
name:
|
|
4654
|
-
});
|
|
4655
|
-
var sitelinkAssetSchema =
|
|
4656
|
-
type:
|
|
4657
|
-
linkText:
|
|
4658
|
-
description1:
|
|
4659
|
-
description2:
|
|
4660
|
-
finalUrls:
|
|
4661
|
-
});
|
|
4662
|
-
var calloutAssetSchema =
|
|
4663
|
-
type:
|
|
4664
|
-
calloutText:
|
|
4665
|
-
});
|
|
4666
|
-
var structuredSnippetAssetSchema =
|
|
4667
|
-
type:
|
|
4668
|
-
header:
|
|
4669
|
-
values:
|
|
4670
|
-
});
|
|
4671
|
-
var callToActionAssetSchema =
|
|
4672
|
-
var assetCreateSchema =
|
|
4626
|
+
var textAssetSchema = z10.object({ type: z10.literal("text"), text: z10.string().min(1) });
|
|
4627
|
+
var imageAssetSchema = z10.object({
|
|
4628
|
+
type: z10.literal("image"),
|
|
4629
|
+
imageId: z10.string().min(1),
|
|
4630
|
+
name: z10.string().optional()
|
|
4631
|
+
});
|
|
4632
|
+
var youtubeVideoAssetSchema = z10.object({
|
|
4633
|
+
type: z10.literal("youtubeVideo"),
|
|
4634
|
+
youtubeVideoId: z10.string().min(1),
|
|
4635
|
+
name: z10.string().optional()
|
|
4636
|
+
});
|
|
4637
|
+
var sitelinkAssetSchema = z10.object({
|
|
4638
|
+
type: z10.literal("sitelink"),
|
|
4639
|
+
linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4640
|
+
description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4641
|
+
description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4642
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1)
|
|
4643
|
+
});
|
|
4644
|
+
var calloutAssetSchema = z10.object({
|
|
4645
|
+
type: z10.literal("callout"),
|
|
4646
|
+
calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4647
|
+
});
|
|
4648
|
+
var structuredSnippetAssetSchema = z10.object({
|
|
4649
|
+
type: z10.literal("structuredSnippet"),
|
|
4650
|
+
header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4651
|
+
values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4652
|
+
});
|
|
4653
|
+
var callToActionAssetSchema = z10.object({ type: z10.literal("callToAction"), callToAction: z10.string().min(1) });
|
|
4654
|
+
var assetCreateSchema = z10.discriminatedUnion("type", [
|
|
4673
4655
|
textAssetSchema,
|
|
4674
4656
|
imageAssetSchema,
|
|
4675
4657
|
youtubeVideoAssetSchema,
|
|
@@ -4678,136 +4660,136 @@ var assetCreateSchema = z11.discriminatedUnion("type", [
|
|
|
4678
4660
|
structuredSnippetAssetSchema,
|
|
4679
4661
|
callToActionAssetSchema
|
|
4680
4662
|
]);
|
|
4681
|
-
var assetUpdateSchema =
|
|
4682
|
-
name:
|
|
4683
|
-
linkText:
|
|
4684
|
-
description1:
|
|
4685
|
-
description2:
|
|
4686
|
-
finalUrls:
|
|
4687
|
-
calloutText:
|
|
4688
|
-
header:
|
|
4689
|
-
values:
|
|
4690
|
-
callToAction:
|
|
4691
|
-
text:
|
|
4663
|
+
var assetUpdateSchema = z10.object({
|
|
4664
|
+
name: z10.string().min(1).optional(),
|
|
4665
|
+
linkText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
4666
|
+
description1: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4667
|
+
description2: z10.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4668
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
|
|
4669
|
+
calloutText: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
4670
|
+
header: z10.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
|
|
4671
|
+
values: z10.array(z10.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
4672
|
+
callToAction: z10.string().min(1).optional(),
|
|
4673
|
+
text: z10.string().min(1).optional()
|
|
4692
4674
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4693
|
-
var assetLinkAttachSchema =
|
|
4694
|
-
level:
|
|
4675
|
+
var assetLinkAttachSchema = z10.object({
|
|
4676
|
+
level: z10.enum(["campaign", "adGroup", "customer"]),
|
|
4695
4677
|
parent: refSchema.optional(),
|
|
4696
4678
|
asset: refSchema,
|
|
4697
|
-
fieldType:
|
|
4679
|
+
fieldType: z10.enum(ASSET_FIELD_TYPES)
|
|
4698
4680
|
}).superRefine((value, ctx) => {
|
|
4699
4681
|
if (value.level !== "customer" && !value.parent) {
|
|
4700
4682
|
ctx.addIssue({
|
|
4701
|
-
code:
|
|
4683
|
+
code: z10.ZodIssueCode.custom,
|
|
4702
4684
|
path: ["parent"],
|
|
4703
4685
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
4704
4686
|
});
|
|
4705
4687
|
}
|
|
4706
4688
|
});
|
|
4707
|
-
var assetGroupCreateSchema =
|
|
4689
|
+
var assetGroupCreateSchema = z10.object({
|
|
4708
4690
|
campaign: refSchema,
|
|
4709
|
-
name:
|
|
4710
|
-
finalUrls:
|
|
4711
|
-
headlines:
|
|
4712
|
-
longHeadlines:
|
|
4713
|
-
descriptions:
|
|
4714
|
-
businessName:
|
|
4715
|
-
imageAssets:
|
|
4716
|
-
squareImageAssets:
|
|
4717
|
-
logoAssets:
|
|
4718
|
-
status:
|
|
4719
|
-
});
|
|
4720
|
-
var assetGroupUpdateSchema =
|
|
4721
|
-
name:
|
|
4722
|
-
finalUrls:
|
|
4723
|
-
status:
|
|
4691
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
4692
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1),
|
|
4693
|
+
headlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
4694
|
+
longHeadlines: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
4695
|
+
descriptions: z10.array(z10.object({ text: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
4696
|
+
businessName: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
4697
|
+
imageAssets: z10.array(refSchema).optional(),
|
|
4698
|
+
squareImageAssets: z10.array(refSchema).optional(),
|
|
4699
|
+
logoAssets: z10.array(refSchema).optional(),
|
|
4700
|
+
status: z10.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
4701
|
+
});
|
|
4702
|
+
var assetGroupUpdateSchema = z10.object({
|
|
4703
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
4704
|
+
finalUrls: z10.array(httpsUrlSchema2).min(1).optional(),
|
|
4705
|
+
status: z10.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4724
4706
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4725
|
-
var audienceCreateSchema2 =
|
|
4726
|
-
name:
|
|
4727
|
-
type:
|
|
4728
|
-
description:
|
|
4707
|
+
var audienceCreateSchema2 = z10.object({
|
|
4708
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4709
|
+
type: z10.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4710
|
+
description: z10.string().optional(),
|
|
4729
4711
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4730
|
-
members:
|
|
4731
|
-
sourceFileRef:
|
|
4712
|
+
members: z10.array(z10.record(z10.string(), z10.string())).optional(),
|
|
4713
|
+
sourceFileRef: z10.string().optional()
|
|
4732
4714
|
});
|
|
4733
|
-
var audienceCriterionAttachSchema =
|
|
4734
|
-
level:
|
|
4715
|
+
var audienceCriterionAttachSchema = z10.object({
|
|
4716
|
+
level: z10.enum(["campaign", "adGroup"]),
|
|
4735
4717
|
parent: refSchema,
|
|
4736
4718
|
userList: refSchema,
|
|
4737
|
-
negative:
|
|
4719
|
+
negative: z10.boolean().default(false)
|
|
4738
4720
|
});
|
|
4739
|
-
var conversionActionCreateSchema =
|
|
4740
|
-
name:
|
|
4741
|
-
type:
|
|
4742
|
-
category:
|
|
4743
|
-
countingType:
|
|
4721
|
+
var conversionActionCreateSchema = z10.object({
|
|
4722
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
4723
|
+
type: z10.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
4724
|
+
category: z10.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
4725
|
+
countingType: z10.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4744
4726
|
defaultValueMicros: microsSchema.optional(),
|
|
4745
|
-
defaultCurrencyCode:
|
|
4746
|
-
clickThroughLookbackWindowDays:
|
|
4747
|
-
viewThroughLookbackWindowDays:
|
|
4748
|
-
status:
|
|
4749
|
-
});
|
|
4750
|
-
var conversionActionUpdateSchema =
|
|
4751
|
-
name:
|
|
4752
|
-
category:
|
|
4753
|
-
countingType:
|
|
4727
|
+
defaultCurrencyCode: z10.string().length(3).optional(),
|
|
4728
|
+
clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
|
|
4729
|
+
viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
|
|
4730
|
+
status: z10.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
4731
|
+
});
|
|
4732
|
+
var conversionActionUpdateSchema = z10.object({
|
|
4733
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
4734
|
+
category: z10.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
4735
|
+
countingType: z10.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
4754
4736
|
defaultValueMicros: microsSchema.optional(),
|
|
4755
|
-
defaultCurrencyCode:
|
|
4756
|
-
clickThroughLookbackWindowDays:
|
|
4757
|
-
viewThroughLookbackWindowDays:
|
|
4758
|
-
status:
|
|
4737
|
+
defaultCurrencyCode: z10.string().length(3).optional(),
|
|
4738
|
+
clickThroughLookbackWindowDays: z10.number().int().positive().optional(),
|
|
4739
|
+
viewThroughLookbackWindowDays: z10.number().int().positive().optional(),
|
|
4740
|
+
status: z10.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
4759
4741
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4760
|
-
var biddingStrategyCreateSchema =
|
|
4761
|
-
name:
|
|
4742
|
+
var biddingStrategyCreateSchema = z10.object({
|
|
4743
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
4762
4744
|
config: biddingConfigSchema
|
|
4763
4745
|
}).superRefine((p, ctx) => {
|
|
4764
4746
|
if (p.config.type === "MANUAL_CPC") {
|
|
4765
4747
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
4766
4748
|
}
|
|
4767
4749
|
});
|
|
4768
|
-
var biddingStrategyUpdateSchema =
|
|
4769
|
-
name:
|
|
4750
|
+
var biddingStrategyUpdateSchema = z10.object({
|
|
4751
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
4770
4752
|
config: biddingConfigSchema.optional()
|
|
4771
4753
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4772
|
-
var labelCreateSchema =
|
|
4773
|
-
name:
|
|
4774
|
-
backgroundColor:
|
|
4775
|
-
description:
|
|
4754
|
+
var labelCreateSchema = z10.object({
|
|
4755
|
+
name: z10.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
4756
|
+
backgroundColor: z10.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
4757
|
+
description: z10.string().optional()
|
|
4776
4758
|
});
|
|
4777
|
-
var labelAttachSchema =
|
|
4778
|
-
level:
|
|
4759
|
+
var labelAttachSchema = z10.object({
|
|
4760
|
+
level: z10.enum(["campaign", "adGroup", "ad"]),
|
|
4779
4761
|
parent: refSchema,
|
|
4780
4762
|
label: refSchema
|
|
4781
4763
|
});
|
|
4782
|
-
var locationCriterionSchema =
|
|
4783
|
-
criterionType:
|
|
4784
|
-
geoTargetConstant:
|
|
4785
|
-
});
|
|
4786
|
-
var languageCriterionSchema =
|
|
4787
|
-
criterionType:
|
|
4788
|
-
languageConstant:
|
|
4789
|
-
});
|
|
4790
|
-
var adScheduleCriterionSchema =
|
|
4791
|
-
criterionType:
|
|
4792
|
-
dayOfWeek:
|
|
4793
|
-
startHour:
|
|
4794
|
-
startMinute:
|
|
4795
|
-
endHour:
|
|
4796
|
-
endMinute:
|
|
4797
|
-
});
|
|
4798
|
-
var deviceCriterionSchema =
|
|
4799
|
-
criterionType:
|
|
4800
|
-
device:
|
|
4764
|
+
var locationCriterionSchema = z10.object({
|
|
4765
|
+
criterionType: z10.literal("location"),
|
|
4766
|
+
geoTargetConstant: z10.union([z10.string().regex(GEO_TARGET_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
|
|
4767
|
+
});
|
|
4768
|
+
var languageCriterionSchema = z10.object({
|
|
4769
|
+
criterionType: z10.literal("language"),
|
|
4770
|
+
languageConstant: z10.union([z10.string().regex(LANGUAGE_CONSTANT_REGEX), z10.string().regex(NUMERIC_ID_REGEX2)])
|
|
4771
|
+
});
|
|
4772
|
+
var adScheduleCriterionSchema = z10.object({
|
|
4773
|
+
criterionType: z10.literal("adSchedule"),
|
|
4774
|
+
dayOfWeek: z10.enum(DAYS_OF_WEEK),
|
|
4775
|
+
startHour: z10.number().int().min(0).max(23),
|
|
4776
|
+
startMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
4777
|
+
endHour: z10.number().int().min(0).max(24),
|
|
4778
|
+
endMinute: z10.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
4779
|
+
});
|
|
4780
|
+
var deviceCriterionSchema = z10.object({
|
|
4781
|
+
criterionType: z10.literal("device"),
|
|
4782
|
+
device: z10.enum(DEVICE_TYPES),
|
|
4801
4783
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
4802
4784
|
// 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.
|
|
4803
|
-
bidModifier:
|
|
4785
|
+
bidModifier: z10.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
4804
4786
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
4805
4787
|
})
|
|
4806
4788
|
});
|
|
4807
|
-
var campaignCriterionAddSchema =
|
|
4789
|
+
var campaignCriterionAddSchema = z10.object({
|
|
4808
4790
|
campaign: refSchema,
|
|
4809
|
-
negative:
|
|
4810
|
-
criterion:
|
|
4791
|
+
negative: z10.boolean().default(false),
|
|
4792
|
+
criterion: z10.discriminatedUnion("criterionType", [
|
|
4811
4793
|
locationCriterionSchema,
|
|
4812
4794
|
languageCriterionSchema,
|
|
4813
4795
|
adScheduleCriterionSchema,
|
|
@@ -4817,7 +4799,7 @@ var campaignCriterionAddSchema = z11.object({
|
|
|
4817
4799
|
const c = val.criterion;
|
|
4818
4800
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
4819
4801
|
ctx.addIssue({
|
|
4820
|
-
code:
|
|
4802
|
+
code: z10.ZodIssueCode.custom,
|
|
4821
4803
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
4822
4804
|
path: ["criterion", "endMinute"]
|
|
4823
4805
|
});
|
|
@@ -4869,17 +4851,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
4869
4851
|
"google.campaignCriterion.add",
|
|
4870
4852
|
"google.campaignCriterion.remove"
|
|
4871
4853
|
];
|
|
4872
|
-
var googleDraftOpKindSchema =
|
|
4854
|
+
var googleDraftOpKindSchema = z10.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
4873
4855
|
function createOp2(kind, payload) {
|
|
4874
|
-
return
|
|
4856
|
+
return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, payload });
|
|
4875
4857
|
}
|
|
4876
4858
|
function updateOp2(kind, payload) {
|
|
4877
|
-
return
|
|
4859
|
+
return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
4878
4860
|
}
|
|
4879
4861
|
function targetOp(kind) {
|
|
4880
|
-
return
|
|
4862
|
+
return z10.object({ kind: z10.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
4881
4863
|
}
|
|
4882
|
-
var googleDraftOpInputSchema =
|
|
4864
|
+
var googleDraftOpInputSchema = z10.discriminatedUnion("kind", [
|
|
4883
4865
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
4884
4866
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
4885
4867
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -4927,132 +4909,132 @@ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
|
|
|
4927
4909
|
]);
|
|
4928
4910
|
|
|
4929
4911
|
// ../api/src/ads-google/wire.ts
|
|
4930
|
-
import { z as
|
|
4931
|
-
var googleWriteModeSchema =
|
|
4932
|
-
var googleDraftOpResultSchema =
|
|
4933
|
-
status:
|
|
4934
|
-
resourceName:
|
|
4935
|
-
error:
|
|
4936
|
-
skippedBecause:
|
|
4937
|
-
executedAt:
|
|
4938
|
-
});
|
|
4939
|
-
var googleDraftStageRequestSchema =
|
|
4940
|
-
chatId:
|
|
4912
|
+
import { z as z11 } from "zod";
|
|
4913
|
+
var googleWriteModeSchema = z11.enum(["live", "simulated"]);
|
|
4914
|
+
var googleDraftOpResultSchema = z11.object({
|
|
4915
|
+
status: z11.enum(["applied", "simulated", "failed", "skipped"]),
|
|
4916
|
+
resourceName: z11.string().optional(),
|
|
4917
|
+
error: z11.string().optional(),
|
|
4918
|
+
skippedBecause: z11.string().optional(),
|
|
4919
|
+
executedAt: z11.number().optional()
|
|
4920
|
+
});
|
|
4921
|
+
var googleDraftStageRequestSchema = z11.object({
|
|
4922
|
+
chatId: z11.string(),
|
|
4941
4923
|
op: googleDraftOpInputSchema
|
|
4942
4924
|
});
|
|
4943
|
-
var googleDraftStageResponseSchema =
|
|
4944
|
-
staged:
|
|
4945
|
-
ref:
|
|
4925
|
+
var googleDraftStageResponseSchema = z11.object({
|
|
4926
|
+
staged: z11.literal(true),
|
|
4927
|
+
ref: z11.string(),
|
|
4946
4928
|
kind: googleDraftOpKindSchema,
|
|
4947
4929
|
mode: googleWriteModeSchema,
|
|
4948
|
-
dependsOn:
|
|
4949
|
-
summary:
|
|
4950
|
-
warnings:
|
|
4930
|
+
dependsOn: z11.array(z11.string()),
|
|
4931
|
+
summary: z11.string(),
|
|
4932
|
+
warnings: z11.array(z11.string()),
|
|
4951
4933
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
4952
|
-
amended:
|
|
4934
|
+
amended: z11.boolean().optional()
|
|
4953
4935
|
});
|
|
4954
|
-
var googleDraftAmendRequestSchema =
|
|
4955
|
-
chatId:
|
|
4956
|
-
ref:
|
|
4957
|
-
patch:
|
|
4936
|
+
var googleDraftAmendRequestSchema = z11.object({
|
|
4937
|
+
chatId: z11.string(),
|
|
4938
|
+
ref: z11.string(),
|
|
4939
|
+
patch: z11.record(z11.string(), z11.unknown())
|
|
4958
4940
|
});
|
|
4959
|
-
var googleDraftShowRequestSchema =
|
|
4960
|
-
chatId:
|
|
4961
|
-
ref:
|
|
4941
|
+
var googleDraftShowRequestSchema = z11.object({
|
|
4942
|
+
chatId: z11.string(),
|
|
4943
|
+
ref: z11.string()
|
|
4962
4944
|
});
|
|
4963
4945
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
4964
|
-
var googleDraftStageBatchRequestSchema =
|
|
4965
|
-
chatId:
|
|
4966
|
-
ops:
|
|
4946
|
+
var googleDraftStageBatchRequestSchema = z11.object({
|
|
4947
|
+
chatId: z11.string(),
|
|
4948
|
+
ops: z11.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
4967
4949
|
});
|
|
4968
|
-
var googleDraftStageBatchResponseSchema =
|
|
4969
|
-
staged:
|
|
4950
|
+
var googleDraftStageBatchResponseSchema = z11.object({
|
|
4951
|
+
staged: z11.literal(true),
|
|
4970
4952
|
mode: googleWriteModeSchema,
|
|
4971
|
-
count:
|
|
4972
|
-
ops:
|
|
4973
|
-
|
|
4974
|
-
ref:
|
|
4953
|
+
count: z11.number(),
|
|
4954
|
+
ops: z11.array(
|
|
4955
|
+
z11.object({
|
|
4956
|
+
ref: z11.string(),
|
|
4975
4957
|
kind: googleDraftOpKindSchema,
|
|
4976
|
-
dependsOn:
|
|
4977
|
-
summary:
|
|
4978
|
-
warnings:
|
|
4958
|
+
dependsOn: z11.array(z11.string()),
|
|
4959
|
+
summary: z11.string(),
|
|
4960
|
+
warnings: z11.array(z11.string())
|
|
4979
4961
|
})
|
|
4980
4962
|
)
|
|
4981
4963
|
});
|
|
4982
|
-
var googleDraftOpViewSchema =
|
|
4983
|
-
ref:
|
|
4964
|
+
var googleDraftOpViewSchema = z11.object({
|
|
4965
|
+
ref: z11.string(),
|
|
4984
4966
|
kind: googleDraftOpKindSchema,
|
|
4985
|
-
customerId:
|
|
4986
|
-
target:
|
|
4987
|
-
dependsOn:
|
|
4988
|
-
summary:
|
|
4989
|
-
stagedAt:
|
|
4967
|
+
customerId: z11.string(),
|
|
4968
|
+
target: z11.string().optional(),
|
|
4969
|
+
dependsOn: z11.array(z11.string()),
|
|
4970
|
+
summary: z11.string(),
|
|
4971
|
+
stagedAt: z11.number(),
|
|
4990
4972
|
result: googleDraftOpResultSchema.optional()
|
|
4991
4973
|
});
|
|
4992
|
-
var googleDraftShowResponseSchema =
|
|
4974
|
+
var googleDraftShowResponseSchema = z11.object({
|
|
4993
4975
|
op: googleDraftOpViewSchema.extend({
|
|
4994
|
-
payload:
|
|
4995
|
-
warnings:
|
|
4996
|
-
annotations:
|
|
4976
|
+
payload: z11.unknown().optional(),
|
|
4977
|
+
warnings: z11.array(z11.string()).optional(),
|
|
4978
|
+
annotations: z11.unknown().optional()
|
|
4997
4979
|
})
|
|
4998
4980
|
});
|
|
4999
|
-
var googleDraftListRequestSchema =
|
|
5000
|
-
chatId:
|
|
4981
|
+
var googleDraftListRequestSchema = z11.object({
|
|
4982
|
+
chatId: z11.string()
|
|
5001
4983
|
});
|
|
5002
|
-
var googleDraftAdvisorySchema =
|
|
5003
|
-
scope:
|
|
5004
|
-
message:
|
|
4984
|
+
var googleDraftAdvisorySchema = z11.object({
|
|
4985
|
+
scope: z11.enum(["campaign", "adGroup"]),
|
|
4986
|
+
message: z11.string()
|
|
5005
4987
|
});
|
|
5006
|
-
var googleDraftStatusCollectionSchema =
|
|
5007
|
-
label:
|
|
5008
|
-
added:
|
|
5009
|
-
removed:
|
|
5010
|
-
existing:
|
|
4988
|
+
var googleDraftStatusCollectionSchema = z11.object({
|
|
4989
|
+
label: z11.string(),
|
|
4990
|
+
added: z11.number(),
|
|
4991
|
+
removed: z11.number(),
|
|
4992
|
+
existing: z11.number()
|
|
5011
4993
|
});
|
|
5012
|
-
var googleDraftChangeOperationSchema =
|
|
5013
|
-
var googleDraftStatusNodeSchema =
|
|
5014
|
-
() =>
|
|
5015
|
-
entity:
|
|
5016
|
-
name:
|
|
4994
|
+
var googleDraftChangeOperationSchema = z11.enum(["create", "update", "pause", "resume", "remove"]);
|
|
4995
|
+
var googleDraftStatusNodeSchema = z11.lazy(
|
|
4996
|
+
() => z11.object({
|
|
4997
|
+
entity: z11.string(),
|
|
4998
|
+
name: z11.string(),
|
|
5017
4999
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
5018
|
-
existing:
|
|
5019
|
-
collections:
|
|
5020
|
-
children:
|
|
5021
|
-
warnings:
|
|
5000
|
+
existing: z11.boolean(),
|
|
5001
|
+
collections: z11.array(googleDraftStatusCollectionSchema),
|
|
5002
|
+
children: z11.array(googleDraftStatusNodeSchema),
|
|
5003
|
+
warnings: z11.array(z11.string()).optional()
|
|
5022
5004
|
})
|
|
5023
5005
|
);
|
|
5024
|
-
var googleDraftListResponseSchema =
|
|
5025
|
-
status:
|
|
5006
|
+
var googleDraftListResponseSchema = z11.object({
|
|
5007
|
+
status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
5026
5008
|
mode: googleWriteModeSchema,
|
|
5027
|
-
count:
|
|
5028
|
-
ops:
|
|
5009
|
+
count: z11.number(),
|
|
5010
|
+
ops: z11.array(googleDraftOpViewSchema),
|
|
5029
5011
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
5030
|
-
tree:
|
|
5012
|
+
tree: z11.array(googleDraftStatusNodeSchema).optional(),
|
|
5031
5013
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
5032
|
-
advisories:
|
|
5014
|
+
advisories: z11.array(googleDraftAdvisorySchema).optional()
|
|
5033
5015
|
});
|
|
5034
|
-
var googleDraftRemoveRequestSchema =
|
|
5035
|
-
chatId:
|
|
5036
|
-
ref:
|
|
5016
|
+
var googleDraftRemoveRequestSchema = z11.object({
|
|
5017
|
+
chatId: z11.string(),
|
|
5018
|
+
ref: z11.string()
|
|
5037
5019
|
});
|
|
5038
|
-
var googleDraftRemoveResponseSchema =
|
|
5020
|
+
var googleDraftRemoveResponseSchema = z11.object({
|
|
5039
5021
|
/** The requested ref plus any dependents removed by cascade. */
|
|
5040
|
-
removed:
|
|
5022
|
+
removed: z11.array(z11.string())
|
|
5041
5023
|
});
|
|
5042
|
-
var googleDraftClearRequestSchema =
|
|
5043
|
-
chatId:
|
|
5024
|
+
var googleDraftClearRequestSchema = z11.object({
|
|
5025
|
+
chatId: z11.string()
|
|
5044
5026
|
});
|
|
5045
|
-
var googleDraftClearResponseSchema =
|
|
5046
|
-
cleared:
|
|
5027
|
+
var googleDraftClearResponseSchema = z11.object({
|
|
5028
|
+
cleared: z11.number()
|
|
5047
5029
|
});
|
|
5048
|
-
var googleFieldErrorSchema =
|
|
5049
|
-
path:
|
|
5050
|
-
message:
|
|
5030
|
+
var googleFieldErrorSchema = z11.object({
|
|
5031
|
+
path: z11.string(),
|
|
5032
|
+
message: z11.string()
|
|
5051
5033
|
});
|
|
5052
|
-
var googleDraftErrorResponseSchema =
|
|
5053
|
-
code:
|
|
5054
|
-
error:
|
|
5055
|
-
fields:
|
|
5034
|
+
var googleDraftErrorResponseSchema = z11.object({
|
|
5035
|
+
code: z11.string(),
|
|
5036
|
+
error: z11.string(),
|
|
5037
|
+
fields: z11.array(googleFieldErrorSchema).optional()
|
|
5056
5038
|
});
|
|
5057
5039
|
|
|
5058
5040
|
// src/commands/ads/google/draft-status.ts
|
|
@@ -11095,17 +11077,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
11095
11077
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
11096
11078
|
|
|
11097
11079
|
// ../api/src/ads-meta/ops.ts
|
|
11098
|
-
import { z as
|
|
11099
|
-
var tempRefSchema3 =
|
|
11100
|
-
var parentRefSchema2 =
|
|
11101
|
-
var moneySchema2 =
|
|
11102
|
-
amount:
|
|
11103
|
-
currencyCode:
|
|
11104
|
-
});
|
|
11105
|
-
var httpsUrlSchema3 =
|
|
11106
|
-
var bakerMediaIdSchema2 =
|
|
11107
|
-
var stageableStatusSchema3 =
|
|
11108
|
-
var updateStatusSchema =
|
|
11080
|
+
import { z as z12 } from "zod";
|
|
11081
|
+
var tempRefSchema3 = z12.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
11082
|
+
var parentRefSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
11083
|
+
var moneySchema2 = z12.object({
|
|
11084
|
+
amount: z12.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
|
|
11085
|
+
currencyCode: z12.string().length(3).optional()
|
|
11086
|
+
});
|
|
11087
|
+
var httpsUrlSchema3 = z12.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
11088
|
+
var bakerMediaIdSchema2 = z12.string().min(1);
|
|
11089
|
+
var stageableStatusSchema3 = z12.enum(STAGEABLE_CREATE_STATUSES3);
|
|
11090
|
+
var updateStatusSchema = z12.enum(UPDATE_STATUSES);
|
|
11109
11091
|
function currencyMinimums2(currencyCode) {
|
|
11110
11092
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
11111
11093
|
}
|
|
@@ -11117,50 +11099,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
|
|
|
11117
11099
|
}
|
|
11118
11100
|
}
|
|
11119
11101
|
}
|
|
11120
|
-
var geoLocationsSchema =
|
|
11121
|
-
countries:
|
|
11122
|
-
regions:
|
|
11123
|
-
cities:
|
|
11124
|
-
zips:
|
|
11125
|
-
location_types:
|
|
11126
|
-
}).catchall(
|
|
11127
|
-
var idNameSchema =
|
|
11128
|
-
var metaTargetingSchema =
|
|
11102
|
+
var geoLocationsSchema = z12.object({
|
|
11103
|
+
countries: z12.array(z12.string().length(2)).optional(),
|
|
11104
|
+
regions: z12.array(z12.object({ key: z12.string() })).optional(),
|
|
11105
|
+
cities: z12.array(z12.object({ key: z12.string(), radius: z12.number().optional(), distance_unit: z12.string().optional() })).optional(),
|
|
11106
|
+
zips: z12.array(z12.object({ key: z12.string() })).optional(),
|
|
11107
|
+
location_types: z12.array(z12.string()).optional()
|
|
11108
|
+
}).catchall(z12.unknown());
|
|
11109
|
+
var idNameSchema = z12.object({ id: z12.string(), name: z12.string().optional() });
|
|
11110
|
+
var metaTargetingSchema = z12.object({
|
|
11129
11111
|
geo_locations: geoLocationsSchema.optional(),
|
|
11130
11112
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
11131
|
-
age_min:
|
|
11132
|
-
age_max:
|
|
11133
|
-
genders:
|
|
11134
|
-
locales:
|
|
11135
|
-
interests:
|
|
11136
|
-
behaviors:
|
|
11137
|
-
custom_audiences:
|
|
11138
|
-
excluded_custom_audiences:
|
|
11139
|
-
flexible_spec:
|
|
11140
|
-
exclusions:
|
|
11141
|
-
publisher_platforms:
|
|
11142
|
-
facebook_positions:
|
|
11143
|
-
instagram_positions:
|
|
11144
|
-
audience_network_positions:
|
|
11145
|
-
messenger_positions:
|
|
11146
|
-
device_platforms:
|
|
11147
|
-
targeting_automation:
|
|
11148
|
-
}).catchall(
|
|
11149
|
-
var specialAdCategoriesSchema =
|
|
11150
|
-
var campaignCreateSchema3 =
|
|
11151
|
-
name:
|
|
11152
|
-
objective:
|
|
11113
|
+
age_min: z12.number().int().min(13).max(65).optional(),
|
|
11114
|
+
age_max: z12.number().int().min(13).max(65).optional(),
|
|
11115
|
+
genders: z12.array(z12.union([z12.literal(1), z12.literal(2)])).optional(),
|
|
11116
|
+
locales: z12.array(z12.number().int()).optional(),
|
|
11117
|
+
interests: z12.array(idNameSchema).optional(),
|
|
11118
|
+
behaviors: z12.array(idNameSchema).optional(),
|
|
11119
|
+
custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
|
|
11120
|
+
excluded_custom_audiences: z12.array(z12.object({ id: parentRefSchema2 })).optional(),
|
|
11121
|
+
flexible_spec: z12.array(z12.record(z12.string(), z12.unknown())).optional(),
|
|
11122
|
+
exclusions: z12.record(z12.string(), z12.unknown()).optional(),
|
|
11123
|
+
publisher_platforms: z12.array(z12.string()).optional(),
|
|
11124
|
+
facebook_positions: z12.array(z12.string()).optional(),
|
|
11125
|
+
instagram_positions: z12.array(z12.string()).optional(),
|
|
11126
|
+
audience_network_positions: z12.array(z12.string()).optional(),
|
|
11127
|
+
messenger_positions: z12.array(z12.string()).optional(),
|
|
11128
|
+
device_platforms: z12.array(z12.string()).optional(),
|
|
11129
|
+
targeting_automation: z12.object({ advantage_audience: z12.union([z12.literal(0), z12.literal(1)]) }).partial().optional()
|
|
11130
|
+
}).catchall(z12.unknown());
|
|
11131
|
+
var specialAdCategoriesSchema = z12.array(z12.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
11132
|
+
var campaignCreateSchema3 = z12.object({
|
|
11133
|
+
name: z12.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
11134
|
+
objective: z12.enum(OBJECTIVES),
|
|
11153
11135
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11154
11136
|
special_ad_categories: specialAdCategoriesSchema,
|
|
11155
|
-
special_ad_category_country:
|
|
11156
|
-
buying_type:
|
|
11157
|
-
bid_strategy:
|
|
11137
|
+
special_ad_category_country: z12.array(z12.string().length(2)).optional(),
|
|
11138
|
+
buying_type: z12.enum(BUYING_TYPES).default("AUCTION"),
|
|
11139
|
+
bid_strategy: z12.enum(BID_STRATEGIES).optional(),
|
|
11158
11140
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
11159
11141
|
dailyBudget: moneySchema2.optional(),
|
|
11160
11142
|
lifetimeBudget: moneySchema2.optional(),
|
|
11161
11143
|
spendCap: moneySchema2.optional(),
|
|
11162
|
-
start_time:
|
|
11163
|
-
stop_time:
|
|
11144
|
+
start_time: z12.number().int().positive().optional(),
|
|
11145
|
+
stop_time: z12.number().int().positive().optional()
|
|
11164
11146
|
}).superRefine((p, ctx) => {
|
|
11165
11147
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
11166
11148
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -11170,15 +11152,15 @@ var campaignCreateSchema3 = z13.object({
|
|
|
11170
11152
|
ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
|
|
11171
11153
|
}
|
|
11172
11154
|
});
|
|
11173
|
-
var campaignUpdateSchema3 =
|
|
11174
|
-
name:
|
|
11155
|
+
var campaignUpdateSchema3 = z12.object({
|
|
11156
|
+
name: z12.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
11175
11157
|
status: updateStatusSchema.optional(),
|
|
11176
|
-
bid_strategy:
|
|
11158
|
+
bid_strategy: z12.enum(BID_STRATEGIES).optional(),
|
|
11177
11159
|
dailyBudget: moneySchema2.optional(),
|
|
11178
11160
|
lifetimeBudget: moneySchema2.optional(),
|
|
11179
11161
|
spendCap: moneySchema2.optional(),
|
|
11180
|
-
start_time:
|
|
11181
|
-
stop_time:
|
|
11162
|
+
start_time: z12.number().int().positive().optional(),
|
|
11163
|
+
stop_time: z12.number().int().positive().optional()
|
|
11182
11164
|
}).superRefine((p, ctx) => {
|
|
11183
11165
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
11184
11166
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -11188,38 +11170,38 @@ var campaignUpdateSchema3 = z13.object({
|
|
|
11188
11170
|
}
|
|
11189
11171
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
11190
11172
|
});
|
|
11191
|
-
var promotedObjectSchema =
|
|
11173
|
+
var promotedObjectSchema = z12.object({
|
|
11192
11174
|
page_id: parentRefSchema2.optional(),
|
|
11193
|
-
pixel_id:
|
|
11194
|
-
custom_event_type:
|
|
11195
|
-
application_id:
|
|
11196
|
-
object_store_url:
|
|
11197
|
-
product_catalog_id:
|
|
11198
|
-
product_set_id:
|
|
11199
|
-
whatsapp_phone_number:
|
|
11200
|
-
offline_conversion_data_set_id:
|
|
11175
|
+
pixel_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11176
|
+
custom_event_type: z12.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
11177
|
+
application_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11178
|
+
object_store_url: z12.string().url().optional(),
|
|
11179
|
+
product_catalog_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11180
|
+
product_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11181
|
+
whatsapp_phone_number: z12.string().optional(),
|
|
11182
|
+
offline_conversion_data_set_id: z12.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
11201
11183
|
}).partial();
|
|
11202
|
-
var attributionSpecSchema =
|
|
11203
|
-
|
|
11204
|
-
event_type:
|
|
11205
|
-
window_days:
|
|
11184
|
+
var attributionSpecSchema = z12.array(
|
|
11185
|
+
z12.object({
|
|
11186
|
+
event_type: z12.enum(ATTRIBUTION_EVENT_TYPES),
|
|
11187
|
+
window_days: z12.union([z12.literal(1), z12.literal(7), z12.literal(28)])
|
|
11206
11188
|
})
|
|
11207
11189
|
);
|
|
11208
11190
|
var adSetFields = {
|
|
11209
|
-
name:
|
|
11191
|
+
name: z12.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
11210
11192
|
campaign_id: parentRefSchema2,
|
|
11211
11193
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11212
11194
|
dailyBudget: moneySchema2.optional(),
|
|
11213
11195
|
lifetimeBudget: moneySchema2.optional(),
|
|
11214
11196
|
bidAmount: moneySchema2.optional(),
|
|
11215
|
-
bid_strategy:
|
|
11216
|
-
billing_event:
|
|
11217
|
-
optimization_goal:
|
|
11218
|
-
destination_type:
|
|
11197
|
+
bid_strategy: z12.enum(BID_STRATEGIES).optional(),
|
|
11198
|
+
billing_event: z12.enum(BILLING_EVENTS),
|
|
11199
|
+
optimization_goal: z12.enum(OPTIMIZATION_GOALS),
|
|
11200
|
+
destination_type: z12.enum(DESTINATION_TYPES).optional(),
|
|
11219
11201
|
promoted_object: promotedObjectSchema.optional(),
|
|
11220
11202
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11221
|
-
start_time:
|
|
11222
|
-
end_time:
|
|
11203
|
+
start_time: z12.number().int().positive().optional(),
|
|
11204
|
+
end_time: z12.number().int().positive().optional(),
|
|
11223
11205
|
targeting: metaTargetingSchema
|
|
11224
11206
|
};
|
|
11225
11207
|
function validateAdSetBudgetAndBid(p, ctx) {
|
|
@@ -11237,22 +11219,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
|
|
|
11237
11219
|
ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
|
|
11238
11220
|
}
|
|
11239
11221
|
}
|
|
11240
|
-
var adSetCreateSchema =
|
|
11222
|
+
var adSetCreateSchema = z12.object(adSetFields).superRefine((p, ctx) => {
|
|
11241
11223
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11242
11224
|
});
|
|
11243
|
-
var adSetUpdateSchema =
|
|
11225
|
+
var adSetUpdateSchema = z12.object({
|
|
11244
11226
|
name: adSetFields.name.optional(),
|
|
11245
11227
|
status: updateStatusSchema.optional(),
|
|
11246
11228
|
dailyBudget: moneySchema2.optional(),
|
|
11247
11229
|
lifetimeBudget: moneySchema2.optional(),
|
|
11248
11230
|
bidAmount: moneySchema2.optional(),
|
|
11249
|
-
bid_strategy:
|
|
11250
|
-
optimization_goal:
|
|
11251
|
-
destination_type:
|
|
11231
|
+
bid_strategy: z12.enum(BID_STRATEGIES).optional(),
|
|
11232
|
+
optimization_goal: z12.enum(OPTIMIZATION_GOALS).optional(),
|
|
11233
|
+
destination_type: z12.enum(DESTINATION_TYPES).optional(),
|
|
11252
11234
|
promoted_object: promotedObjectSchema.optional(),
|
|
11253
11235
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11254
|
-
start_time:
|
|
11255
|
-
end_time:
|
|
11236
|
+
start_time: z12.number().int().positive().optional(),
|
|
11237
|
+
end_time: z12.number().int().positive().optional(),
|
|
11256
11238
|
targeting: metaTargetingSchema.optional()
|
|
11257
11239
|
}).superRefine((p, ctx) => {
|
|
11258
11240
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
@@ -11260,38 +11242,38 @@ var adSetUpdateSchema = z13.object({
|
|
|
11260
11242
|
}
|
|
11261
11243
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11262
11244
|
});
|
|
11263
|
-
var messageSchema =
|
|
11264
|
-
var headlineSchema2 =
|
|
11265
|
-
var descriptionSchema =
|
|
11266
|
-
var callToActionSchema =
|
|
11267
|
-
type:
|
|
11245
|
+
var messageSchema = z12.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
11246
|
+
var headlineSchema2 = z12.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
11247
|
+
var descriptionSchema = z12.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
11248
|
+
var callToActionSchema = z12.object({
|
|
11249
|
+
type: z12.enum(CTA_TYPES2),
|
|
11268
11250
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
11269
11251
|
link: httpsUrlSchema3.optional()
|
|
11270
11252
|
});
|
|
11271
|
-
var creativeEnhancementsSchema =
|
|
11272
|
-
standardEnhancements:
|
|
11273
|
-
features:
|
|
11253
|
+
var creativeEnhancementsSchema = z12.object({
|
|
11254
|
+
standardEnhancements: z12.enum(ENROLL_STATUSES).optional(),
|
|
11255
|
+
features: z12.record(z12.string(), z12.enum(ENROLL_STATUSES)).optional()
|
|
11274
11256
|
});
|
|
11275
11257
|
var creativeSharedFields = {
|
|
11276
|
-
name:
|
|
11258
|
+
name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11277
11259
|
/** Facebook Page id backing the ad's identity. */
|
|
11278
11260
|
page_id: parentRefSchema2,
|
|
11279
11261
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
11280
|
-
instagram_user_id:
|
|
11262
|
+
instagram_user_id: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11281
11263
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
11282
|
-
url_tags:
|
|
11264
|
+
url_tags: z12.string().max(1e3).optional(),
|
|
11283
11265
|
enhancements: creativeEnhancementsSchema.optional()
|
|
11284
11266
|
};
|
|
11285
11267
|
var imageMediaFields = {
|
|
11286
|
-
imageHash:
|
|
11268
|
+
imageHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11287
11269
|
imageRef: tempRefSchema3.optional()
|
|
11288
11270
|
};
|
|
11289
11271
|
var videoMediaFields = {
|
|
11290
|
-
videoId:
|
|
11272
|
+
videoId: z12.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11291
11273
|
videoRef: tempRefSchema3.optional(),
|
|
11292
11274
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
11293
|
-
thumbnailHash:
|
|
11294
|
-
imageUrl:
|
|
11275
|
+
thumbnailHash: z12.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11276
|
+
imageUrl: z12.string().url().optional()
|
|
11295
11277
|
};
|
|
11296
11278
|
function countImageRefs(p) {
|
|
11297
11279
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -11299,8 +11281,8 @@ function countImageRefs(p) {
|
|
|
11299
11281
|
function countVideoRefs(p) {
|
|
11300
11282
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
11301
11283
|
}
|
|
11302
|
-
var singleCreativeSchema =
|
|
11303
|
-
creativeType:
|
|
11284
|
+
var singleCreativeSchema = z12.object({
|
|
11285
|
+
creativeType: z12.literal("single"),
|
|
11304
11286
|
...creativeSharedFields,
|
|
11305
11287
|
/** Primary text. */
|
|
11306
11288
|
message: messageSchema,
|
|
@@ -11309,7 +11291,7 @@ var singleCreativeSchema = z13.object({
|
|
|
11309
11291
|
headline: headlineSchema2.optional(),
|
|
11310
11292
|
description: descriptionSchema.optional(),
|
|
11311
11293
|
/** Display URL / caption shown under the headline. */
|
|
11312
|
-
caption:
|
|
11294
|
+
caption: z12.string().max(255).optional(),
|
|
11313
11295
|
call_to_action: callToActionSchema.optional(),
|
|
11314
11296
|
...imageMediaFields,
|
|
11315
11297
|
...videoMediaFields
|
|
@@ -11333,10 +11315,10 @@ var singleCreativeSchema = z13.object({
|
|
|
11333
11315
|
});
|
|
11334
11316
|
}
|
|
11335
11317
|
});
|
|
11336
|
-
var carouselCardSchema =
|
|
11318
|
+
var carouselCardSchema = z12.object({
|
|
11337
11319
|
link: httpsUrlSchema3,
|
|
11338
|
-
headline:
|
|
11339
|
-
description:
|
|
11320
|
+
headline: z12.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
11321
|
+
description: z12.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
11340
11322
|
call_to_action: callToActionSchema.optional(),
|
|
11341
11323
|
...imageMediaFields,
|
|
11342
11324
|
...videoMediaFields
|
|
@@ -11356,35 +11338,35 @@ var carouselCardSchema = z13.object({
|
|
|
11356
11338
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
11357
11339
|
}
|
|
11358
11340
|
});
|
|
11359
|
-
var carouselCreativeSchema2 =
|
|
11360
|
-
creativeType:
|
|
11341
|
+
var carouselCreativeSchema2 = z12.object({
|
|
11342
|
+
creativeType: z12.literal("carousel"),
|
|
11361
11343
|
...creativeSharedFields,
|
|
11362
11344
|
message: messageSchema,
|
|
11363
11345
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
11364
11346
|
link: httpsUrlSchema3.optional(),
|
|
11365
11347
|
call_to_action: callToActionSchema.optional(),
|
|
11366
|
-
cards:
|
|
11348
|
+
cards: z12.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
11367
11349
|
});
|
|
11368
|
-
var dynamicImageSchema =
|
|
11369
|
-
var dynamicVideoSchema =
|
|
11350
|
+
var dynamicImageSchema = z12.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
11351
|
+
var dynamicVideoSchema = z12.object({
|
|
11370
11352
|
videoId: videoMediaFields.videoId,
|
|
11371
11353
|
videoRef: videoMediaFields.videoRef,
|
|
11372
11354
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
11373
11355
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
11374
11356
|
var DYN = META_LIMITS.creative;
|
|
11375
|
-
var dynamicCreativeSchema =
|
|
11376
|
-
creativeType:
|
|
11357
|
+
var dynamicCreativeSchema = z12.object({
|
|
11358
|
+
creativeType: z12.literal("dynamic"),
|
|
11377
11359
|
...creativeSharedFields,
|
|
11378
|
-
bodies:
|
|
11379
|
-
titles:
|
|
11380
|
-
descriptions:
|
|
11381
|
-
images:
|
|
11382
|
-
videos:
|
|
11383
|
-
ad_formats:
|
|
11384
|
-
call_to_action_types:
|
|
11385
|
-
link_urls:
|
|
11360
|
+
bodies: z12.array(z12.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11361
|
+
titles: z12.array(z12.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11362
|
+
descriptions: z12.array(z12.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
11363
|
+
images: z12.array(dynamicImageSchema).optional(),
|
|
11364
|
+
videos: z12.array(dynamicVideoSchema).optional(),
|
|
11365
|
+
ad_formats: z12.array(z12.enum(AD_FORMATS2)).min(1),
|
|
11366
|
+
call_to_action_types: z12.array(z12.enum(CTA_TYPES2)).optional(),
|
|
11367
|
+
link_urls: z12.array(z12.object({ website_url: httpsUrlSchema3, display_url: z12.string().optional() })).min(1),
|
|
11386
11368
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
11387
|
-
asset_customization_rules:
|
|
11369
|
+
asset_customization_rules: z12.array(z12.record(z12.string(), z12.unknown())).optional()
|
|
11388
11370
|
}).superRefine((p, ctx) => {
|
|
11389
11371
|
if (!(p.images?.length || p.videos?.length)) {
|
|
11390
11372
|
ctx.addIssue({
|
|
@@ -11394,57 +11376,57 @@ var dynamicCreativeSchema = z13.object({
|
|
|
11394
11376
|
});
|
|
11395
11377
|
}
|
|
11396
11378
|
});
|
|
11397
|
-
var existingPostCreativeSchema =
|
|
11398
|
-
creativeType:
|
|
11379
|
+
var existingPostCreativeSchema = z12.object({
|
|
11380
|
+
creativeType: z12.literal("existing_post"),
|
|
11399
11381
|
name: creativeSharedFields.name,
|
|
11400
11382
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
11401
|
-
object_story_id:
|
|
11383
|
+
object_story_id: z12.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
11402
11384
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
11403
11385
|
url_tags: creativeSharedFields.url_tags,
|
|
11404
11386
|
enhancements: creativeSharedFields.enhancements
|
|
11405
11387
|
});
|
|
11406
|
-
var creativeContentSchema2 =
|
|
11388
|
+
var creativeContentSchema2 = z12.discriminatedUnion("creativeType", [
|
|
11407
11389
|
singleCreativeSchema,
|
|
11408
11390
|
carouselCreativeSchema2,
|
|
11409
11391
|
dynamicCreativeSchema,
|
|
11410
11392
|
existingPostCreativeSchema
|
|
11411
11393
|
]);
|
|
11412
11394
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
11413
|
-
var adCreativeUpdateSchema =
|
|
11414
|
-
name:
|
|
11395
|
+
var adCreativeUpdateSchema = z12.object({
|
|
11396
|
+
name: z12.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11415
11397
|
status: updateStatusSchema.optional(),
|
|
11416
11398
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
11417
|
-
content:
|
|
11399
|
+
content: z12.record(z12.string(), z12.unknown()).optional()
|
|
11418
11400
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11419
|
-
var adCreateSchema2 =
|
|
11420
|
-
name:
|
|
11401
|
+
var adCreateSchema2 = z12.object({
|
|
11402
|
+
name: z12.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
11421
11403
|
adset_id: parentRefSchema2,
|
|
11422
11404
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11423
|
-
creative:
|
|
11405
|
+
creative: z12.object({ creative_id: parentRefSchema2 }),
|
|
11424
11406
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
11425
|
-
tracking_specs:
|
|
11407
|
+
tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
|
|
11426
11408
|
});
|
|
11427
|
-
var adUpdateSchema2 =
|
|
11428
|
-
name:
|
|
11409
|
+
var adUpdateSchema2 = z12.object({
|
|
11410
|
+
name: z12.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
11429
11411
|
status: updateStatusSchema.optional(),
|
|
11430
11412
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
11431
|
-
creative:
|
|
11432
|
-
tracking_specs:
|
|
11413
|
+
creative: z12.object({ creative_id: parentRefSchema2 }).optional(),
|
|
11414
|
+
tracking_specs: z12.array(z12.record(z12.string(), z12.unknown())).optional()
|
|
11433
11415
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11434
|
-
var lookalikeSpecSchema =
|
|
11435
|
-
origin:
|
|
11436
|
-
ratio:
|
|
11437
|
-
country:
|
|
11438
|
-
});
|
|
11439
|
-
var customAudienceCreateSchema =
|
|
11440
|
-
name:
|
|
11441
|
-
subtype:
|
|
11442
|
-
description:
|
|
11443
|
-
customer_file_source:
|
|
11444
|
-
retention_days:
|
|
11416
|
+
var lookalikeSpecSchema = z12.object({
|
|
11417
|
+
origin: z12.array(z12.object({ id: parentRefSchema2 })).min(1),
|
|
11418
|
+
ratio: z12.number().min(0.01).max(0.2).optional(),
|
|
11419
|
+
country: z12.string().length(2).optional()
|
|
11420
|
+
});
|
|
11421
|
+
var customAudienceCreateSchema = z12.object({
|
|
11422
|
+
name: z12.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
11423
|
+
subtype: z12.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
11424
|
+
description: z12.string().max(500).optional(),
|
|
11425
|
+
customer_file_source: z12.string().optional(),
|
|
11426
|
+
retention_days: z12.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
11445
11427
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
11446
11428
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
11447
|
-
rule:
|
|
11429
|
+
rule: z12.record(z12.string(), z12.unknown()).optional()
|
|
11448
11430
|
}).superRefine((p, ctx) => {
|
|
11449
11431
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
11450
11432
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -11453,16 +11435,16 @@ var customAudienceCreateSchema = z13.object({
|
|
|
11453
11435
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
11454
11436
|
}
|
|
11455
11437
|
});
|
|
11456
|
-
var customAudienceUpdateSchema =
|
|
11457
|
-
name:
|
|
11458
|
-
description:
|
|
11438
|
+
var customAudienceUpdateSchema = z12.object({
|
|
11439
|
+
name: z12.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
11440
|
+
description: z12.string().max(500).optional()
|
|
11459
11441
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11460
|
-
var mediaUploadSchema =
|
|
11461
|
-
kind:
|
|
11442
|
+
var mediaUploadSchema = z12.object({
|
|
11443
|
+
kind: z12.enum(MEDIA_KINDS),
|
|
11462
11444
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
11463
11445
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
11464
11446
|
/** Optional display name / filename hint. */
|
|
11465
|
-
name:
|
|
11447
|
+
name: z12.string().max(255).optional()
|
|
11466
11448
|
}).superRefine((p, ctx) => {
|
|
11467
11449
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
11468
11450
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -11484,16 +11466,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
11484
11466
|
"customAudience.update",
|
|
11485
11467
|
"media.upload"
|
|
11486
11468
|
];
|
|
11487
|
-
var metaDraftOpKindSchema =
|
|
11488
|
-
var accountIdSchema2 =
|
|
11489
|
-
var updateTargetSchema2 =
|
|
11469
|
+
var metaDraftOpKindSchema = z12.enum(META_DRAFT_OP_KINDS);
|
|
11470
|
+
var accountIdSchema2 = z12.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
11471
|
+
var updateTargetSchema2 = z12.union([z12.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
11490
11472
|
function createOp3(kind, payload) {
|
|
11491
|
-
return
|
|
11473
|
+
return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, payload });
|
|
11492
11474
|
}
|
|
11493
11475
|
function updateOp3(kind, payload) {
|
|
11494
|
-
return
|
|
11476
|
+
return z12.object({ kind: z12.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
11495
11477
|
}
|
|
11496
|
-
var metaDraftOpInputSchema =
|
|
11478
|
+
var metaDraftOpInputSchema = z12.discriminatedUnion("kind", [
|
|
11497
11479
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
11498
11480
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
11499
11481
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -11508,89 +11490,89 @@ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
|
|
|
11508
11490
|
]);
|
|
11509
11491
|
|
|
11510
11492
|
// ../api/src/ads-meta/wire.ts
|
|
11511
|
-
import { z as
|
|
11512
|
-
var metaWriteModeSchema =
|
|
11513
|
-
var metaDraftOpResultSchema =
|
|
11514
|
-
status:
|
|
11493
|
+
import { z as z13 } from "zod";
|
|
11494
|
+
var metaWriteModeSchema = z13.enum(["live", "simulated"]);
|
|
11495
|
+
var metaDraftOpResultSchema = z13.object({
|
|
11496
|
+
status: z13.enum(["applied", "simulated", "failed", "skipped"]),
|
|
11515
11497
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
11516
|
-
id:
|
|
11498
|
+
id: z13.string().optional(),
|
|
11517
11499
|
/** For media.upload ops: the resulting image hash. */
|
|
11518
|
-
hash:
|
|
11519
|
-
error:
|
|
11520
|
-
skippedBecause:
|
|
11521
|
-
executedAt:
|
|
11500
|
+
hash: z13.string().optional(),
|
|
11501
|
+
error: z13.string().optional(),
|
|
11502
|
+
skippedBecause: z13.string().optional(),
|
|
11503
|
+
executedAt: z13.number().optional()
|
|
11522
11504
|
});
|
|
11523
|
-
var metaDraftStageRequestSchema =
|
|
11524
|
-
chatId:
|
|
11505
|
+
var metaDraftStageRequestSchema = z13.object({
|
|
11506
|
+
chatId: z13.string(),
|
|
11525
11507
|
op: metaDraftOpInputSchema
|
|
11526
11508
|
});
|
|
11527
|
-
var metaDraftStageResponseSchema =
|
|
11528
|
-
staged:
|
|
11529
|
-
ref:
|
|
11509
|
+
var metaDraftStageResponseSchema = z13.object({
|
|
11510
|
+
staged: z13.literal(true),
|
|
11511
|
+
ref: z13.string(),
|
|
11530
11512
|
kind: metaDraftOpKindSchema,
|
|
11531
11513
|
mode: metaWriteModeSchema,
|
|
11532
|
-
dependsOn:
|
|
11533
|
-
summary:
|
|
11534
|
-
warnings:
|
|
11514
|
+
dependsOn: z13.array(z13.string()),
|
|
11515
|
+
summary: z13.string(),
|
|
11516
|
+
warnings: z13.array(z13.string()),
|
|
11535
11517
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
11536
|
-
amended:
|
|
11537
|
-
});
|
|
11538
|
-
var metaDraftDuplicateRequestSchema =
|
|
11539
|
-
chatId:
|
|
11540
|
-
accountId:
|
|
11541
|
-
entity:
|
|
11542
|
-
sourceId:
|
|
11543
|
-
overrides:
|
|
11518
|
+
amended: z13.boolean().optional()
|
|
11519
|
+
});
|
|
11520
|
+
var metaDraftDuplicateRequestSchema = z13.object({
|
|
11521
|
+
chatId: z13.string(),
|
|
11522
|
+
accountId: z13.string(),
|
|
11523
|
+
entity: z13.enum(["campaign", "adSet", "ad"]),
|
|
11524
|
+
sourceId: z13.string(),
|
|
11525
|
+
overrides: z13.record(z13.string(), z13.unknown()).optional(),
|
|
11544
11526
|
/** Pause the original after the copy publishes. */
|
|
11545
|
-
replace:
|
|
11527
|
+
replace: z13.boolean().optional()
|
|
11546
11528
|
});
|
|
11547
|
-
var metaDraftOpViewSchema =
|
|
11548
|
-
ref:
|
|
11529
|
+
var metaDraftOpViewSchema = z13.object({
|
|
11530
|
+
ref: z13.string(),
|
|
11549
11531
|
kind: metaDraftOpKindSchema,
|
|
11550
|
-
accountId:
|
|
11551
|
-
target:
|
|
11552
|
-
dependsOn:
|
|
11553
|
-
summary:
|
|
11554
|
-
stagedAt:
|
|
11532
|
+
accountId: z13.string(),
|
|
11533
|
+
target: z13.string().optional(),
|
|
11534
|
+
dependsOn: z13.array(z13.string()),
|
|
11535
|
+
summary: z13.string(),
|
|
11536
|
+
stagedAt: z13.number(),
|
|
11555
11537
|
result: metaDraftOpResultSchema.optional()
|
|
11556
11538
|
});
|
|
11557
|
-
var metaDraftListRequestSchema =
|
|
11558
|
-
chatId:
|
|
11539
|
+
var metaDraftListRequestSchema = z13.object({
|
|
11540
|
+
chatId: z13.string()
|
|
11559
11541
|
});
|
|
11560
|
-
var metaDraftAdvisorySchema =
|
|
11561
|
-
ref:
|
|
11562
|
-
message:
|
|
11542
|
+
var metaDraftAdvisorySchema = z13.object({
|
|
11543
|
+
ref: z13.string(),
|
|
11544
|
+
message: z13.string()
|
|
11563
11545
|
});
|
|
11564
|
-
var metaDraftListResponseSchema =
|
|
11565
|
-
status:
|
|
11546
|
+
var metaDraftListResponseSchema = z13.object({
|
|
11547
|
+
status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
11566
11548
|
mode: metaWriteModeSchema,
|
|
11567
|
-
count:
|
|
11568
|
-
ops:
|
|
11549
|
+
count: z13.number(),
|
|
11550
|
+
ops: z13.array(metaDraftOpViewSchema),
|
|
11569
11551
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
11570
|
-
advisories:
|
|
11552
|
+
advisories: z13.array(metaDraftAdvisorySchema)
|
|
11571
11553
|
});
|
|
11572
|
-
var metaDraftRemoveRequestSchema =
|
|
11573
|
-
chatId:
|
|
11574
|
-
ref:
|
|
11554
|
+
var metaDraftRemoveRequestSchema = z13.object({
|
|
11555
|
+
chatId: z13.string(),
|
|
11556
|
+
ref: z13.string()
|
|
11575
11557
|
});
|
|
11576
|
-
var metaDraftRemoveResponseSchema =
|
|
11558
|
+
var metaDraftRemoveResponseSchema = z13.object({
|
|
11577
11559
|
/** The requested ref plus any dependents removed by cascade. */
|
|
11578
|
-
removed:
|
|
11560
|
+
removed: z13.array(z13.string())
|
|
11579
11561
|
});
|
|
11580
|
-
var metaDraftClearRequestSchema =
|
|
11581
|
-
chatId:
|
|
11562
|
+
var metaDraftClearRequestSchema = z13.object({
|
|
11563
|
+
chatId: z13.string()
|
|
11582
11564
|
});
|
|
11583
|
-
var metaDraftClearResponseSchema =
|
|
11584
|
-
cleared:
|
|
11565
|
+
var metaDraftClearResponseSchema = z13.object({
|
|
11566
|
+
cleared: z13.number()
|
|
11585
11567
|
});
|
|
11586
|
-
var metaFieldErrorSchema =
|
|
11587
|
-
path:
|
|
11588
|
-
message:
|
|
11568
|
+
var metaFieldErrorSchema = z13.object({
|
|
11569
|
+
path: z13.string(),
|
|
11570
|
+
message: z13.string()
|
|
11589
11571
|
});
|
|
11590
|
-
var metaDraftErrorResponseSchema =
|
|
11591
|
-
code:
|
|
11592
|
-
error:
|
|
11593
|
-
fields:
|
|
11572
|
+
var metaDraftErrorResponseSchema = z13.object({
|
|
11573
|
+
code: z13.string(),
|
|
11574
|
+
error: z13.string(),
|
|
11575
|
+
fields: z13.array(metaFieldErrorSchema).optional()
|
|
11594
11576
|
});
|
|
11595
11577
|
|
|
11596
11578
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -14544,168 +14526,12 @@ Examples:
|
|
|
14544
14526
|
}
|
|
14545
14527
|
});
|
|
14546
14528
|
|
|
14547
|
-
// src/commands/analytics/index.ts
|
|
14548
|
-
import { defineCommand as defineCommand85 } from "citty";
|
|
14549
|
-
|
|
14550
|
-
// src/commands/winning-ads/shared.ts
|
|
14551
|
-
function splitList(value) {
|
|
14552
|
-
if (!value) {
|
|
14553
|
-
return [];
|
|
14554
|
-
}
|
|
14555
|
-
return value.split(",").map((v) => v.trim()).filter(Boolean);
|
|
14556
|
-
}
|
|
14557
|
-
function reportError(err) {
|
|
14558
|
-
if (err instanceof ApiError) {
|
|
14559
|
-
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
14560
|
-
process.exit(1);
|
|
14561
|
-
}
|
|
14562
|
-
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
14563
|
-
process.exit(1);
|
|
14564
|
-
}
|
|
14565
|
-
|
|
14566
|
-
// src/commands/analytics/index.ts
|
|
14567
|
-
var PERIODS = "today|7d|28d|90d";
|
|
14568
|
-
var NO_TRAFFIC_HINT = "No visits recorded in this window. Analytics counts real visitors on published pages only \u2014 previews, bots, and pre-consent traffic are excluded.";
|
|
14569
|
-
function rowsEmpty(response) {
|
|
14570
|
-
return response.rows.length === 0 || response.rows.every((row) => Object.values(row).every((v) => v === 0 || v === "" || v === null));
|
|
14571
|
-
}
|
|
14572
|
-
var OVERVIEW_SPEC = {
|
|
14573
|
-
report: "overview",
|
|
14574
|
-
description: "Headline traffic numbers: pageviews, unique visitors, sessions, form submits. Start here. Example: baker analytics overview --period 7d",
|
|
14575
|
-
hasLimit: false,
|
|
14576
|
-
hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : [
|
|
14577
|
-
"Drill down: `baker analytics pages` (top pages), `baker analytics sources` (where visitors come from), `baker analytics timeseries` (daily trend)."
|
|
14578
|
-
]
|
|
14579
|
-
};
|
|
14580
|
-
var REPORTS = [
|
|
14581
|
-
OVERVIEW_SPEC,
|
|
14582
|
-
{
|
|
14583
|
-
report: "timeseries",
|
|
14584
|
-
description: "Daily pageviews, visitors, and form submits \u2014 spot trends and campaign spikes. Example: baker analytics timeseries --period 28d --output md",
|
|
14585
|
-
hasLimit: false,
|
|
14586
|
-
hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : []
|
|
14587
|
-
},
|
|
14588
|
-
{
|
|
14589
|
-
report: "pages",
|
|
14590
|
-
description: "Top pages by pageviews, with visitors and form submits per page \u2014 find what converts. Example: baker analytics pages --period 28d --limit 20",
|
|
14591
|
-
hasLimit: true,
|
|
14592
|
-
hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : [
|
|
14593
|
-
"A page with high pageviews but zero form_submits is a conversion-rate candidate \u2014 audit it with the landing skill."
|
|
14594
|
-
]
|
|
14595
|
-
},
|
|
14596
|
-
{
|
|
14597
|
-
report: "sources",
|
|
14598
|
-
description: "Top traffic sources (utm_source, else referrer domain, else direct) with visitors and form submits. Example: baker analytics sources --period 28d",
|
|
14599
|
-
hasLimit: true,
|
|
14600
|
-
hints: (response) => rowsEmpty(response) ? [NO_TRAFFIC_HINT] : []
|
|
14601
|
-
},
|
|
14602
|
-
{
|
|
14603
|
-
report: "events",
|
|
14604
|
-
description: "Non-pageview events (form_submit + custom events) with totals, sessions, and visitors. Example: baker analytics events --period 90d",
|
|
14605
|
-
hasLimit: true,
|
|
14606
|
-
hints: (response) => rowsEmpty(response) ? [
|
|
14607
|
-
"No events in this window. Forms report `form_submit` automatically on published pages; custom events come from `window.__bakerAnalytics.track(name)`."
|
|
14608
|
-
] : []
|
|
14609
|
-
}
|
|
14610
|
-
];
|
|
14611
|
-
function parseLimit(value) {
|
|
14612
|
-
if (!value) return void 0;
|
|
14613
|
-
const limit = Number(value);
|
|
14614
|
-
return Number.isInteger(limit) && limit >= 1 && limit <= 100 ? limit : "invalid";
|
|
14615
|
-
}
|
|
14616
|
-
function parseFields(value) {
|
|
14617
|
-
if (!value) return void 0;
|
|
14618
|
-
const fields = String(value).split(",").map((f) => f.trim()).filter(Boolean);
|
|
14619
|
-
return fields.length > 0 ? fields : void 0;
|
|
14620
|
-
}
|
|
14621
|
-
function buildSubcommand(spec) {
|
|
14622
|
-
registerSchema({
|
|
14623
|
-
command: `analytics.${spec.report}`,
|
|
14624
|
-
description: spec.description,
|
|
14625
|
-
args: {
|
|
14626
|
-
period: { type: "string", description: `Time window: ${PERIODS} (default 28d)`, required: false, default: "28d" },
|
|
14627
|
-
...spec.hasLimit ? { limit: { type: "number", description: "Max rows 1-100 (default per report)", required: false } } : {},
|
|
14628
|
-
output: { type: "string", description: "Output format: json|files|md", required: false, default: "json" },
|
|
14629
|
-
fields: { type: "string", description: "Comma-separated field names to include", required: false }
|
|
14630
|
-
}
|
|
14631
|
-
});
|
|
14632
|
-
return defineCommand85({
|
|
14633
|
-
meta: { name: spec.report, description: spec.description },
|
|
14634
|
-
args: {
|
|
14635
|
-
period: { type: "string", description: `Time window: ${PERIODS} (default 28d)`, default: "28d" },
|
|
14636
|
-
...spec.hasLimit ? { limit: { type: "string", description: "Max rows 1-100" } } : {},
|
|
14637
|
-
output: { type: "string", description: "Output format: json|files|md", default: "json" },
|
|
14638
|
-
fields: { type: "string", description: "Comma-separated field names to include" }
|
|
14639
|
-
},
|
|
14640
|
-
run: async ({ args }) => {
|
|
14641
|
-
try {
|
|
14642
|
-
const limit = parseLimit("limit" in args ? args.limit : void 0);
|
|
14643
|
-
if (limit === "invalid") {
|
|
14644
|
-
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "--limit must be an integer 1-100" } });
|
|
14645
|
-
process.exit(1);
|
|
14646
|
-
}
|
|
14647
|
-
const body = { report: spec.report, period: String(args.period || "28d") };
|
|
14648
|
-
if (limit !== void 0) body.limit = limit;
|
|
14649
|
-
const response = await apiPost("/api/analytics/query", body);
|
|
14650
|
-
const format = args.output || "json";
|
|
14651
|
-
if (format === "json") {
|
|
14652
|
-
writeJson({ ok: true, data: response, meta: { count: response.rows.length }, hints: spec.hints(response) });
|
|
14653
|
-
return;
|
|
14654
|
-
}
|
|
14655
|
-
writeOutput({ ok: true, data: response.rows }, format, parseFields(args.fields), false, (record) => record);
|
|
14656
|
-
} catch (err) {
|
|
14657
|
-
reportError(err);
|
|
14658
|
-
}
|
|
14659
|
-
}
|
|
14660
|
-
});
|
|
14661
|
-
}
|
|
14662
|
-
var subCommands = Object.fromEntries(REPORTS.map((spec) => [spec.report, buildSubcommand(spec)]));
|
|
14663
|
-
var analyticsCommand2 = defineCommand85({
|
|
14664
|
-
meta: {
|
|
14665
|
-
name: "analytics",
|
|
14666
|
-
description: `Read the client's landing-page analytics: first-party pageviews, visitors, sessions, and form submits collected on every published page (no setup needed \u2014 it is always on, consent-aware, and excludes previews/bots).
|
|
14667
|
-
|
|
14668
|
-
Start here: baker analytics overview --period 7d
|
|
14669
|
-
|
|
14670
|
-
Reports:
|
|
14671
|
-
overview headline numbers (pageviews, visitors, sessions, form submits)
|
|
14672
|
-
timeseries daily trend
|
|
14673
|
-
pages top pages (find what converts)
|
|
14674
|
-
sources where visitors come from (utm_source \u2192 referrer \u2192 direct)
|
|
14675
|
-
events form_submit + custom events
|
|
14676
|
-
|
|
14677
|
-
All reports take --period ${PERIODS} (default 28d). List-style reports take --limit. Data is read-only and scoped to this client.
|
|
14678
|
-
|
|
14679
|
-
Examples:
|
|
14680
|
-
baker analytics overview
|
|
14681
|
-
baker analytics pages --period 7d --limit 20 --output md
|
|
14682
|
-
baker analytics sources --period 90d`
|
|
14683
|
-
},
|
|
14684
|
-
subCommands,
|
|
14685
|
-
run: async () => {
|
|
14686
|
-
try {
|
|
14687
|
-
const response = await apiPost("/api/analytics/query", {
|
|
14688
|
-
report: "overview",
|
|
14689
|
-
period: "28d"
|
|
14690
|
-
});
|
|
14691
|
-
writeJson({
|
|
14692
|
-
ok: true,
|
|
14693
|
-
data: response,
|
|
14694
|
-
meta: { count: response.rows.length },
|
|
14695
|
-
hints: OVERVIEW_SPEC.hints(response)
|
|
14696
|
-
});
|
|
14697
|
-
} catch (err) {
|
|
14698
|
-
reportError(err);
|
|
14699
|
-
}
|
|
14700
|
-
}
|
|
14701
|
-
});
|
|
14702
|
-
|
|
14703
14529
|
// src/commands/canvas/index.ts
|
|
14704
|
-
import { defineCommand as
|
|
14530
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
14705
14531
|
|
|
14706
14532
|
// src/commands/canvas/catalog.ts
|
|
14707
|
-
import { defineCommand as
|
|
14708
|
-
var catalogCommand =
|
|
14533
|
+
import { defineCommand as defineCommand85 } from "citty";
|
|
14534
|
+
var catalogCommand = defineCommand85({
|
|
14709
14535
|
meta: {
|
|
14710
14536
|
name: "catalog",
|
|
14711
14537
|
description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
|
|
@@ -14720,7 +14546,7 @@ var catalogCommand = defineCommand86({
|
|
|
14720
14546
|
// src/commands/canvas/critique.ts
|
|
14721
14547
|
import { readFile } from "fs/promises";
|
|
14722
14548
|
import path from "path";
|
|
14723
|
-
import { defineCommand as
|
|
14549
|
+
import { defineCommand as defineCommand86 } from "citty";
|
|
14724
14550
|
|
|
14725
14551
|
// src/engine/scaffold/lib/critique.ts
|
|
14726
14552
|
var VIBE_CUE = /\b(light|lighting|golden|moody|warm|cool|tone|grade|contrast|shadow|glow|rim|backlit|neon|soft)\b/i;
|
|
@@ -14840,7 +14666,7 @@ function critiqueCanvas(canvas) {
|
|
|
14840
14666
|
}
|
|
14841
14667
|
|
|
14842
14668
|
// src/commands/canvas/critique.ts
|
|
14843
|
-
var critiqueCommand =
|
|
14669
|
+
var critiqueCommand = defineCommand86({
|
|
14844
14670
|
meta: {
|
|
14845
14671
|
name: "critique",
|
|
14846
14672
|
description: "Pre-spend creative critic (ADVISORY \u2014 never blocks). Scores a scaffolded creative BEFORE the billed render, so weak spots get fixed for free. A VIDEO creative is scored on hook strength, sound-off first-frame legibility, retention risk, and mechanism clarity; a STATIC ad on baked-text legibility risk, identity grounding, brand-type fidelity, and mechanism clarity. Ground a video hook against `baker winning-ads hooks` for a proven pattern."
|
|
@@ -14882,9 +14708,9 @@ import { execFile } from "child_process";
|
|
|
14882
14708
|
import { readdir, readFile as readFile2, stat } from "fs/promises";
|
|
14883
14709
|
import path2 from "path";
|
|
14884
14710
|
import { promisify } from "util";
|
|
14885
|
-
import { defineCommand as
|
|
14711
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
14886
14712
|
var execFileAsync = promisify(execFile);
|
|
14887
|
-
var inspectCommand =
|
|
14713
|
+
var inspectCommand = defineCommand87({
|
|
14888
14714
|
meta: {
|
|
14889
14715
|
name: "inspect",
|
|
14890
14716
|
description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
|
|
@@ -14992,12 +14818,12 @@ async function probeDuration(filePath) {
|
|
|
14992
14818
|
|
|
14993
14819
|
// src/commands/canvas/rerun.ts
|
|
14994
14820
|
import path13 from "path";
|
|
14995
|
-
import { defineCommand as
|
|
14821
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
14996
14822
|
|
|
14997
14823
|
// src/commands/canvas/run.ts
|
|
14998
14824
|
import { readFile as readFile9 } from "fs/promises";
|
|
14999
14825
|
import path12 from "path";
|
|
15000
|
-
import { defineCommand as
|
|
14826
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
15001
14827
|
|
|
15002
14828
|
// src/commands/canvas/placeholders.ts
|
|
15003
14829
|
function unsuppliedPlaceholderAssets(canvas) {
|
|
@@ -15037,7 +14863,7 @@ function resolveNode(node, baseDir) {
|
|
|
15037
14863
|
return node;
|
|
15038
14864
|
}
|
|
15039
14865
|
function isResolvableRelative(value) {
|
|
15040
|
-
return typeof value === "string" && value.length > 0 && !value.includes("[TODO") && !path3.isAbsolute(value);
|
|
14866
|
+
return typeof value === "string" && value.length > 0 && !value.includes("[TODO") && !looksLikeHttpUrl(value) && !path3.isAbsolute(value);
|
|
15041
14867
|
}
|
|
15042
14868
|
|
|
15043
14869
|
// src/commands/canvas/source-version.ts
|
|
@@ -15159,7 +14985,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
15159
14985
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
15160
14986
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
15161
14987
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
15162
|
-
import { z as
|
|
14988
|
+
import { z as z14 } from "zod";
|
|
15163
14989
|
|
|
15164
14990
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
15165
14991
|
var SHOOT_MODES = [
|
|
@@ -15495,71 +15321,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
15495
15321
|
"{{out.video}}"
|
|
15496
15322
|
];
|
|
15497
15323
|
}
|
|
15498
|
-
var FrameAsset =
|
|
15499
|
-
var DialogueLine =
|
|
15500
|
-
speaker:
|
|
15501
|
-
line:
|
|
15324
|
+
var FrameAsset = z14.object({ url: z14.string().optional() }).loose().optional();
|
|
15325
|
+
var DialogueLine = z14.object({
|
|
15326
|
+
speaker: z14.string().optional(),
|
|
15327
|
+
line: z14.string().optional(),
|
|
15502
15328
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
15503
|
-
start_s:
|
|
15504
|
-
end_s:
|
|
15505
|
-
delivery:
|
|
15506
|
-
voice_description:
|
|
15329
|
+
start_s: z14.number().optional(),
|
|
15330
|
+
end_s: z14.number().optional(),
|
|
15331
|
+
delivery: z14.string().optional(),
|
|
15332
|
+
voice_description: z14.string().optional(),
|
|
15507
15333
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
15508
15334
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
15509
15335
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
15510
15336
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
15511
15337
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
15512
|
-
on_camera:
|
|
15338
|
+
on_camera: z14.boolean().optional()
|
|
15513
15339
|
}).loose();
|
|
15514
|
-
var Sfx =
|
|
15515
|
-
at_s:
|
|
15516
|
-
duration_s:
|
|
15517
|
-
sound_effect_prompt:
|
|
15518
|
-
description:
|
|
15340
|
+
var Sfx = z14.object({
|
|
15341
|
+
at_s: z14.number().optional(),
|
|
15342
|
+
duration_s: z14.number().optional(),
|
|
15343
|
+
sound_effect_prompt: z14.string().optional(),
|
|
15344
|
+
description: z14.string().optional()
|
|
15519
15345
|
}).loose();
|
|
15520
|
-
var CompositionRegion =
|
|
15346
|
+
var CompositionRegion = z14.object({
|
|
15521
15347
|
// full | top | bottom | left | right | inset
|
|
15522
|
-
panel:
|
|
15348
|
+
panel: z14.string().optional(),
|
|
15523
15349
|
// 9-grid anchor for an `inset` presenter box.
|
|
15524
|
-
position:
|
|
15525
|
-
is_presenter:
|
|
15350
|
+
position: z14.string().optional(),
|
|
15351
|
+
is_presenter: z14.boolean().optional(),
|
|
15526
15352
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
15527
|
-
cast_ref:
|
|
15353
|
+
cast_ref: z14.string().optional(),
|
|
15528
15354
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
15529
15355
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
15530
15356
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
15531
15357
|
// overlay layer, never AI-generated.
|
|
15532
|
-
kind:
|
|
15358
|
+
kind: z14.string().optional(),
|
|
15533
15359
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
15534
15360
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
15535
15361
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
15536
15362
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
15537
15363
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
15538
15364
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
15539
|
-
surface_id:
|
|
15365
|
+
surface_id: z14.string().optional(),
|
|
15540
15366
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
15541
15367
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
15542
15368
|
// must re-composite, not paint into the surface.
|
|
15543
|
-
nested:
|
|
15544
|
-
summary:
|
|
15545
|
-
frame_prompt:
|
|
15546
|
-
motion_prompt:
|
|
15369
|
+
nested: z14.array(z14.object({}).loose()).optional(),
|
|
15370
|
+
summary: z14.string().optional(),
|
|
15371
|
+
frame_prompt: z14.string().optional(),
|
|
15372
|
+
motion_prompt: z14.string().optional()
|
|
15547
15373
|
}).loose();
|
|
15548
|
-
var SceneComposition =
|
|
15374
|
+
var SceneComposition = z14.object({
|
|
15549
15375
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
15550
|
-
layout:
|
|
15376
|
+
layout: z14.string().optional(),
|
|
15551
15377
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
15552
|
-
split_axis:
|
|
15553
|
-
regions:
|
|
15378
|
+
split_axis: z14.string().optional(),
|
|
15379
|
+
regions: z14.array(CompositionRegion).optional()
|
|
15554
15380
|
}).loose();
|
|
15555
|
-
var CameraMotion =
|
|
15556
|
-
var TranscriptWord =
|
|
15557
|
-
var Scene =
|
|
15558
|
-
start_s:
|
|
15559
|
-
end_s:
|
|
15560
|
-
duration_s:
|
|
15561
|
-
summary:
|
|
15562
|
-
action_detail:
|
|
15381
|
+
var CameraMotion = z14.object({ movement: z14.string().optional(), detail: z14.string().optional() }).loose();
|
|
15382
|
+
var TranscriptWord = z14.object({ text: z14.string().optional() }).loose();
|
|
15383
|
+
var Scene = z14.object({
|
|
15384
|
+
start_s: z14.number().optional(),
|
|
15385
|
+
end_s: z14.number().optional(),
|
|
15386
|
+
duration_s: z14.number().optional(),
|
|
15387
|
+
summary: z14.string().optional(),
|
|
15388
|
+
action_detail: z14.string().optional(),
|
|
15563
15389
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
15564
15390
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
15565
15391
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -15567,82 +15393,82 @@ var Scene = z15.object({
|
|
|
15567
15393
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
15568
15394
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
15569
15395
|
// UGC/product mode; a human can override per scene by setting this.
|
|
15570
|
-
shoot_mode:
|
|
15396
|
+
shoot_mode: z14.string().optional(),
|
|
15571
15397
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
15572
15398
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
15573
|
-
ambient:
|
|
15399
|
+
ambient: z14.string().optional(),
|
|
15574
15400
|
camera_motion: CameraMotion.optional(),
|
|
15575
|
-
start_frame_prompt:
|
|
15576
|
-
end_frame_prompt:
|
|
15577
|
-
motion_prompt:
|
|
15401
|
+
start_frame_prompt: z14.string().optional(),
|
|
15402
|
+
end_frame_prompt: z14.string().optional(),
|
|
15403
|
+
motion_prompt: z14.string().optional(),
|
|
15578
15404
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
15579
15405
|
// script re-craft checklist. Inferred from position when absent.
|
|
15580
|
-
narrative_role:
|
|
15406
|
+
narrative_role: z14.string().optional(),
|
|
15581
15407
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
15582
15408
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
15583
15409
|
// into the hook's start-frame description so the generator renders that state,
|
|
15584
15410
|
// not a calm influencer (CCA-11).
|
|
15585
|
-
hook_mechanic:
|
|
15411
|
+
hook_mechanic: z14.object({ mechanic: z14.string().optional(), why_it_stops_scroll: z14.string().optional() }).loose().optional(),
|
|
15586
15412
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
15587
|
-
scene_setting:
|
|
15413
|
+
scene_setting: z14.string().optional(),
|
|
15588
15414
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
15589
15415
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
15590
15416
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
15591
15417
|
// ignored (nothing follows it).
|
|
15592
|
-
transition_out:
|
|
15593
|
-
dialogue:
|
|
15594
|
-
sfx:
|
|
15595
|
-
overlays:
|
|
15596
|
-
floating_elements:
|
|
15418
|
+
transition_out: z14.object({ type: z14.string().optional(), description: z14.string().optional() }).loose().optional(),
|
|
15419
|
+
dialogue: z14.array(DialogueLine).optional(),
|
|
15420
|
+
sfx: z14.array(Sfx).optional(),
|
|
15421
|
+
overlays: z14.array(z14.unknown()).optional(),
|
|
15422
|
+
floating_elements: z14.array(z14.unknown()).optional(),
|
|
15597
15423
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
15598
15424
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
15599
15425
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
15600
15426
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
15601
|
-
motion_level:
|
|
15602
|
-
transcript_slice:
|
|
15427
|
+
motion_level: z14.enum(["static", "subtle", "dynamic"]).optional(),
|
|
15428
|
+
transcript_slice: z14.array(TranscriptWord).optional(),
|
|
15603
15429
|
start_frame_asset: FrameAsset,
|
|
15604
15430
|
end_frame_asset: FrameAsset,
|
|
15605
15431
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
15606
15432
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
15607
15433
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
15608
15434
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
15609
|
-
continues_previous:
|
|
15435
|
+
continues_previous: z14.boolean().optional()
|
|
15610
15436
|
}).loose();
|
|
15611
|
-
var VideoBlueprint =
|
|
15612
|
-
source:
|
|
15613
|
-
global:
|
|
15614
|
-
music:
|
|
15615
|
-
present:
|
|
15616
|
-
music_prompt:
|
|
15437
|
+
var VideoBlueprint = z14.object({
|
|
15438
|
+
source: z14.object({ aspect_ratio: z14.string().optional(), duration_s: z14.number().optional() }).loose().optional(),
|
|
15439
|
+
global: z14.object({
|
|
15440
|
+
music: z14.object({
|
|
15441
|
+
present: z14.boolean().optional(),
|
|
15442
|
+
music_prompt: z14.string().optional(),
|
|
15617
15443
|
// Absolute second the music enters in the reference (the bed often
|
|
15618
15444
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
15619
15445
|
// instead of at 0 so the timing matches.
|
|
15620
|
-
starts_at_s:
|
|
15446
|
+
starts_at_s: z14.number().optional(),
|
|
15621
15447
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
15622
15448
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
15623
|
-
identified_track:
|
|
15449
|
+
identified_track: z14.object({ title: z14.string().optional(), artist: z14.string().optional() }).loose().nullish()
|
|
15624
15450
|
}).loose().optional(),
|
|
15625
|
-
cast:
|
|
15626
|
-
|
|
15627
|
-
id:
|
|
15628
|
-
description:
|
|
15451
|
+
cast: z14.array(
|
|
15452
|
+
z14.object({
|
|
15453
|
+
id: z14.string().optional(),
|
|
15454
|
+
description: z14.string().optional(),
|
|
15629
15455
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
15630
15456
|
// French speaker") — read to derive the spoken-track language code.
|
|
15631
|
-
market_localization_note:
|
|
15457
|
+
market_localization_note: z14.string().optional()
|
|
15632
15458
|
}).loose()
|
|
15633
15459
|
).optional(),
|
|
15634
|
-
voiceover:
|
|
15460
|
+
voiceover: z14.object({
|
|
15635
15461
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
15636
15462
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
15637
|
-
mode:
|
|
15638
|
-
voice_description:
|
|
15639
|
-
persona:
|
|
15463
|
+
mode: z14.string().optional(),
|
|
15464
|
+
voice_description: z14.string().optional(),
|
|
15465
|
+
persona: z14.string().optional()
|
|
15640
15466
|
}).loose().optional(),
|
|
15641
15467
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
15642
15468
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
15643
|
-
style:
|
|
15469
|
+
style: z14.object({ palette: z14.array(z14.object({ hex: z14.string().optional() }).loose()).optional() }).loose().optional()
|
|
15644
15470
|
}).loose().optional(),
|
|
15645
|
-
scenes:
|
|
15471
|
+
scenes: z14.array(Scene).min(1)
|
|
15646
15472
|
}).loose();
|
|
15647
15473
|
function injectHookPhysicality(blueprint) {
|
|
15648
15474
|
for (const scene of blueprint.scenes) {
|
|
@@ -15659,26 +15485,26 @@ function clipIntentOf(scene, sceneIndex) {
|
|
|
15659
15485
|
if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
|
|
15660
15486
|
return "body";
|
|
15661
15487
|
}
|
|
15662
|
-
var AppearsItem =
|
|
15663
|
-
var RecurringElement =
|
|
15488
|
+
var AppearsItem = z14.union([z14.number(), z14.object({ scene: z14.number(), edge: z14.string().optional() }).loose()]);
|
|
15489
|
+
var RecurringElement = z14.object({
|
|
15664
15490
|
// person | animal | product | logo | badge | other
|
|
15665
|
-
type:
|
|
15666
|
-
label:
|
|
15667
|
-
description:
|
|
15668
|
-
expression:
|
|
15491
|
+
type: z14.string(),
|
|
15492
|
+
label: z14.string().optional(),
|
|
15493
|
+
description: z14.string().optional(),
|
|
15494
|
+
expression: z14.string().nullable().optional(),
|
|
15669
15495
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
15670
|
-
cast_id:
|
|
15496
|
+
cast_id: z14.string().nullable().optional(),
|
|
15671
15497
|
// The label of another element that is the SAME individual as this one, shown
|
|
15672
15498
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
15673
15499
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
15674
15500
|
// slot, but the face/identity must stay identical across them.
|
|
15675
|
-
same_as:
|
|
15501
|
+
same_as: z14.string().nullable().optional(),
|
|
15676
15502
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
15677
15503
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
15678
|
-
scenes:
|
|
15679
|
-
appears_in:
|
|
15504
|
+
scenes: z14.array(z14.number()).optional(),
|
|
15505
|
+
appears_in: z14.array(AppearsItem).optional()
|
|
15680
15506
|
}).loose();
|
|
15681
|
-
var RecurringElements =
|
|
15507
|
+
var RecurringElements = z14.array(RecurringElement);
|
|
15682
15508
|
function sanitizeId(raw, fallback) {
|
|
15683
15509
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
15684
15510
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -16151,7 +15977,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
16151
15977
|
return kept;
|
|
16152
15978
|
}
|
|
16153
15979
|
function sceneFloatDescs(scene) {
|
|
16154
|
-
const floats =
|
|
15980
|
+
const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
16155
15981
|
if (!floats.success) return [];
|
|
16156
15982
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
16157
15983
|
}
|
|
@@ -17575,25 +17401,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
|
|
|
17575
17401
|
}
|
|
17576
17402
|
return tracks;
|
|
17577
17403
|
}
|
|
17578
|
-
var OverlayStyle =
|
|
17579
|
-
var Overlay =
|
|
17580
|
-
text:
|
|
17581
|
-
appears_at_s:
|
|
17582
|
-
duration_s:
|
|
17583
|
-
position:
|
|
17584
|
-
role:
|
|
17585
|
-
animation:
|
|
17586
|
-
animation_detail:
|
|
17404
|
+
var OverlayStyle = z14.object({ color_hex: z14.string().optional(), background: z14.string().optional(), size: z14.string().optional() }).loose();
|
|
17405
|
+
var Overlay = z14.object({
|
|
17406
|
+
text: z14.string().optional(),
|
|
17407
|
+
appears_at_s: z14.number().optional(),
|
|
17408
|
+
duration_s: z14.number().optional(),
|
|
17409
|
+
position: z14.string().optional(),
|
|
17410
|
+
role: z14.string().optional(),
|
|
17411
|
+
animation: z14.string().optional(),
|
|
17412
|
+
animation_detail: z14.string().optional(),
|
|
17587
17413
|
style: OverlayStyle.optional()
|
|
17588
17414
|
}).loose();
|
|
17589
|
-
var FloatingElement =
|
|
17590
|
-
kind:
|
|
17591
|
-
description:
|
|
17592
|
-
brand_name:
|
|
17593
|
-
what_it_represents:
|
|
17594
|
-
appears_at_s:
|
|
17595
|
-
duration_s:
|
|
17596
|
-
position:
|
|
17415
|
+
var FloatingElement = z14.object({
|
|
17416
|
+
kind: z14.string().optional(),
|
|
17417
|
+
description: z14.string().optional(),
|
|
17418
|
+
brand_name: z14.string().nullish(),
|
|
17419
|
+
what_it_represents: z14.string().optional(),
|
|
17420
|
+
appears_at_s: z14.number().optional(),
|
|
17421
|
+
duration_s: z14.number().optional(),
|
|
17422
|
+
position: z14.string().optional()
|
|
17597
17423
|
}).loose();
|
|
17598
17424
|
function escapeHtml(s) {
|
|
17599
17425
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -17625,7 +17451,7 @@ function positionClass(position) {
|
|
|
17625
17451
|
function collectCaptions(blueprint, clock) {
|
|
17626
17452
|
return blueprint.scenes.flatMap((scene, i) => {
|
|
17627
17453
|
const sceneStart = scene.start_s ?? 0;
|
|
17628
|
-
const overlays =
|
|
17454
|
+
const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17629
17455
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
17630
17456
|
const at = clock.map(i, ov.appears_at_s ?? sceneStart);
|
|
17631
17457
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -17705,7 +17531,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
|
|
|
17705
17531
|
const windows = /* @__PURE__ */ new Map();
|
|
17706
17532
|
blueprint.scenes.forEach((scene, i) => {
|
|
17707
17533
|
const sceneStart = scene.start_s ?? 0;
|
|
17708
|
-
const floats =
|
|
17534
|
+
const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
17709
17535
|
if (!floats.success) return;
|
|
17710
17536
|
for (const fe of floats.data) {
|
|
17711
17537
|
const at = clock.map(i, fe.appears_at_s ?? sceneStart);
|
|
@@ -18153,8 +17979,8 @@ function buildMotionBoard(blueprint) {
|
|
|
18153
17979
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
18154
17980
|
cursor = end_s;
|
|
18155
17981
|
const spoken = sceneSpokenText(scene);
|
|
18156
|
-
const overlays =
|
|
18157
|
-
const floats =
|
|
17982
|
+
const overlays = z14.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17983
|
+
const floats = z14.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
18158
17984
|
const graphics = [
|
|
18159
17985
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
18160
17986
|
kind: "text",
|
|
@@ -19120,7 +18946,7 @@ async function restoreRunSnapshot(manifest, targetDir, opts = {}) {
|
|
|
19120
18946
|
}
|
|
19121
18947
|
|
|
19122
18948
|
// src/commands/canvas/run.ts
|
|
19123
|
-
var runCommand =
|
|
18949
|
+
var runCommand = defineCommand88({
|
|
19124
18950
|
meta: { name: "run", description: "Validate and execute a canvas JSON file." },
|
|
19125
18951
|
args: {
|
|
19126
18952
|
file: { type: "positional", required: true, description: "Path to canvas JSON" },
|
|
@@ -19486,7 +19312,7 @@ async function postInitialRunRecord(client, payload) {
|
|
|
19486
19312
|
|
|
19487
19313
|
// src/commands/canvas/rerun.ts
|
|
19488
19314
|
var SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
19489
|
-
var rerunCommand =
|
|
19315
|
+
var rerunCommand = defineCommand89({
|
|
19490
19316
|
meta: {
|
|
19491
19317
|
name: "rerun",
|
|
19492
19318
|
description: "Re-run a creative's latest recorded canvas. Restores its definition files from run history first, so it works in a fresh workspace that never had the source chat's files \u2014 an interrupted run resumes (in-flight jobs re-attach), a completed one re-renders from the cache."
|
|
@@ -19583,10 +19409,10 @@ async function fetchManifest(url) {
|
|
|
19583
19409
|
// src/commands/canvas/scaffold-static-ad.ts
|
|
19584
19410
|
import { access, mkdir as mkdir5, readFile as readFile11, writeFile as writeFile6 } from "fs/promises";
|
|
19585
19411
|
import path17 from "path";
|
|
19586
|
-
import { defineCommand as
|
|
19412
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
19587
19413
|
|
|
19588
19414
|
// src/engine/scaffold/staticAd.ts
|
|
19589
|
-
import { z as
|
|
19415
|
+
import { z as z15 } from "zod";
|
|
19590
19416
|
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"]);
|
|
19591
19417
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
19592
19418
|
var SHEET_SUBJECT_TYPE2 = {
|
|
@@ -19595,24 +19421,27 @@ var SHEET_SUBJECT_TYPE2 = {
|
|
|
19595
19421
|
};
|
|
19596
19422
|
var ACTOR_SHEET_MODEL2 = "google/gemini-3-pro-image-preview";
|
|
19597
19423
|
var ACTOR_SHEET_IMAGE_SIZE = "4K";
|
|
19598
|
-
var
|
|
19599
|
-
|
|
19600
|
-
|
|
19424
|
+
var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
|
|
19425
|
+
var ADAPT_IMAGE_SIZE = "2K";
|
|
19426
|
+
var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
|
|
19427
|
+
var Blueprint = z15.object({
|
|
19428
|
+
meta: z15.object({ estimated_aspect_ratio: z15.string().optional() }).loose().optional(),
|
|
19429
|
+
text_content: z15.array(z15.object({ text: z15.string().optional() }).loose()).optional()
|
|
19601
19430
|
}).loose();
|
|
19602
|
-
var ElementLocator =
|
|
19603
|
-
collection:
|
|
19604
|
-
index:
|
|
19431
|
+
var ElementLocator = z15.object({
|
|
19432
|
+
collection: z15.enum(["subjects", "people", "brands_logos"]),
|
|
19433
|
+
index: z15.number().int().nonnegative()
|
|
19605
19434
|
}).loose();
|
|
19606
|
-
var MainElement =
|
|
19435
|
+
var MainElement = z15.object({
|
|
19607
19436
|
// logo | product | person | animal | badge | other
|
|
19608
|
-
type:
|
|
19609
|
-
label:
|
|
19610
|
-
description:
|
|
19611
|
-
expression:
|
|
19612
|
-
reason:
|
|
19437
|
+
type: z15.string(),
|
|
19438
|
+
label: z15.string().optional(),
|
|
19439
|
+
description: z15.string().optional(),
|
|
19440
|
+
expression: z15.string().nullable().optional(),
|
|
19441
|
+
reason: z15.string().optional(),
|
|
19613
19442
|
locator: ElementLocator.optional()
|
|
19614
19443
|
}).loose();
|
|
19615
|
-
var MainElements =
|
|
19444
|
+
var MainElements = z15.array(MainElement);
|
|
19616
19445
|
function sanitizeId2(raw, fallback) {
|
|
19617
19446
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
19618
19447
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -19675,6 +19504,16 @@ function aspectRatio(blueprint, opts) {
|
|
|
19675
19504
|
const requested = opts.aspectRatio ?? blueprint.meta?.estimated_aspect_ratio;
|
|
19676
19505
|
return requested && GEN_ASPECT_RATIOS.has(requested) ? requested : DEFAULT_ASPECT_RATIO;
|
|
19677
19506
|
}
|
|
19507
|
+
function baseAspectRatio(blueprint, opts) {
|
|
19508
|
+
const requested = aspectRatio(blueprint, opts);
|
|
19509
|
+
if (!opts.placements) return requested;
|
|
19510
|
+
const formats = platformFormats(opts.placements);
|
|
19511
|
+
return formats.includes(requested) ? requested : formats[0] ?? requested;
|
|
19512
|
+
}
|
|
19513
|
+
function outputFormats(blueprint, opts) {
|
|
19514
|
+
if (!opts.placements) return [baseAspectRatio(blueprint, opts)];
|
|
19515
|
+
return [...platformFormats(opts.placements)];
|
|
19516
|
+
}
|
|
19678
19517
|
function blueprintTextStrings(blueprint) {
|
|
19679
19518
|
return (blueprint.text_content ?? []).map((t) => typeof t.text === "string" ? t.text.trim() : "").filter((t) => t.length > 0);
|
|
19680
19519
|
}
|
|
@@ -19792,11 +19631,25 @@ function scaffoldStaticAd(input, elementsInput, opts) {
|
|
|
19792
19631
|
inputs: { reference, target_blueprint: "$ref:prompt.asset" },
|
|
19793
19632
|
params: {
|
|
19794
19633
|
model: opts.genModel,
|
|
19795
|
-
aspect_ratio:
|
|
19634
|
+
aspect_ratio: baseAspectRatio(blueprint, opts),
|
|
19796
19635
|
image_size: "2K",
|
|
19797
19636
|
prompt
|
|
19798
19637
|
}
|
|
19799
19638
|
});
|
|
19639
|
+
const fanOut = opts.placements !== void 0;
|
|
19640
|
+
if (fanOut) {
|
|
19641
|
+
nodes.push({
|
|
19642
|
+
id: "adapt",
|
|
19643
|
+
type: "image_aspect_adapt",
|
|
19644
|
+
inputs: { source: "$ref:gen.images#0" },
|
|
19645
|
+
params: {
|
|
19646
|
+
model: ADAPT_MODEL,
|
|
19647
|
+
platform: opts.placements,
|
|
19648
|
+
guidance: ADAPT_GUIDANCE,
|
|
19649
|
+
image_size: ADAPT_IMAGE_SIZE
|
|
19650
|
+
}
|
|
19651
|
+
});
|
|
19652
|
+
}
|
|
19800
19653
|
return {
|
|
19801
19654
|
schema: "baker-canvas/1",
|
|
19802
19655
|
metadata: {
|
|
@@ -19804,7 +19657,7 @@ function scaffoldStaticAd(input, elementsInput, opts) {
|
|
|
19804
19657
|
description: "Scaffolded by `baker canvas scaffold-static-ad`. Edit `prompt.json` (the blueprint generated from the source image) into the ad you want, drop a real asset at each [TODO] ingest path (logo/product/subject/badge + brand font), then `baker canvas run`. The original is wired for composition only."
|
|
19805
19658
|
},
|
|
19806
19659
|
nodes,
|
|
19807
|
-
output: { node: "gen", output: "images" }
|
|
19660
|
+
output: fanOut ? { node: "adapt", output: "images" } : { node: "gen", output: "images" }
|
|
19808
19661
|
};
|
|
19809
19662
|
}
|
|
19810
19663
|
function staticAdReport(input, elementsInput, opts) {
|
|
@@ -19821,7 +19674,9 @@ function staticAdReport(input, elementsInput, opts) {
|
|
|
19821
19674
|
})),
|
|
19822
19675
|
includes_font: opts.includeFont !== false,
|
|
19823
19676
|
actor_sheets: includeActorSheets ? assignElementLabels2(elements).filter(({ el }) => SHEET_SUBJECT_TYPE2[el.type.toLowerCase()]).map(({ label }) => label) : [],
|
|
19824
|
-
aspect_ratio:
|
|
19677
|
+
aspect_ratio: baseAspectRatio(blueprint, opts),
|
|
19678
|
+
placements: opts.placements ?? null,
|
|
19679
|
+
output_formats: outputFormats(blueprint, opts)
|
|
19825
19680
|
};
|
|
19826
19681
|
}
|
|
19827
19682
|
|
|
@@ -19841,6 +19696,12 @@ function resolveFormats(aspect) {
|
|
|
19841
19696
|
const value = aspect?.trim();
|
|
19842
19697
|
return value && FORMAT_VALUES.includes(value) ? [value] : ["4:5"];
|
|
19843
19698
|
}
|
|
19699
|
+
function resolveFormatList(formats) {
|
|
19700
|
+
const valid = [...new Set(formats.map((f) => f.trim()))].filter(
|
|
19701
|
+
(f) => FORMAT_VALUES.includes(f)
|
|
19702
|
+
);
|
|
19703
|
+
return valid.length > 0 ? valid : ["4:5"];
|
|
19704
|
+
}
|
|
19844
19705
|
function describeBlueprintIntent(blueprint) {
|
|
19845
19706
|
const intent = blueprint?.ad_intent;
|
|
19846
19707
|
if (typeof intent === "string" && intent.trim()) return intent.trim();
|
|
@@ -19889,7 +19750,7 @@ function isValidScaffoldSlug(slug) {
|
|
|
19889
19750
|
// src/commands/canvas/sync-definition.ts
|
|
19890
19751
|
import { readdir as readdir5, readFile as readFile10, stat as stat3 } from "fs/promises";
|
|
19891
19752
|
import path16 from "path";
|
|
19892
|
-
import { defineCommand as
|
|
19753
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
19893
19754
|
|
|
19894
19755
|
// src/commands/canvas/definition-graph.ts
|
|
19895
19756
|
var MAX_NODES = 300;
|
|
@@ -20002,7 +19863,7 @@ async function resolveCanvasPath(inputPath) {
|
|
|
20002
19863
|
const chosen = (slug ? canvases.find((name) => name === `${slug}.canvas.json`) : void 0) ?? canvases[0];
|
|
20003
19864
|
return chosen ? path16.join(dir, chosen) : null;
|
|
20004
19865
|
}
|
|
20005
|
-
var syncDefinitionCommand =
|
|
19866
|
+
var syncDefinitionCommand = defineCommand90({
|
|
20006
19867
|
meta: {
|
|
20007
19868
|
name: "sync-definition",
|
|
20008
19869
|
description: "Push a creative's current node-graph + input thumbnails to the dashboard without rendering. Runs automatically when you edit a creative's canvas.json or prompt.json."
|
|
@@ -20141,6 +20002,25 @@ function resolveModels(args) {
|
|
|
20141
20002
|
genModel: pick("gen-model", "image_generate", "openai/gpt-5.4-image-2")
|
|
20142
20003
|
};
|
|
20143
20004
|
}
|
|
20005
|
+
var PLATFORM_PLACEMENTS = {
|
|
20006
|
+
meta: "meta_feed_stories",
|
|
20007
|
+
google: "google_demandgen",
|
|
20008
|
+
linkedin: "linkedin",
|
|
20009
|
+
tiktok: "tiktok",
|
|
20010
|
+
youtube: "youtube",
|
|
20011
|
+
x: void 0,
|
|
20012
|
+
other: void 0
|
|
20013
|
+
};
|
|
20014
|
+
function resolvePlacements(placementsFlag, definitionPlatform) {
|
|
20015
|
+
const flag = placementsFlag?.trim();
|
|
20016
|
+
if (flag === void 0 || flag === "") return { ok: true, placements: PLATFORM_PLACEMENTS[definitionPlatform] };
|
|
20017
|
+
if (flag === "none") return { ok: true, placements: void 0 };
|
|
20018
|
+
if (AD_FORMAT_PLATFORMS.includes(flag)) return { ok: true, placements: flag };
|
|
20019
|
+
return {
|
|
20020
|
+
ok: false,
|
|
20021
|
+
message: `--placements "${flag}" is not a valid placement set. Use one of: ${AD_FORMAT_PLATFORMS.join(", ")}, or "none" for a single base ad.`
|
|
20022
|
+
};
|
|
20023
|
+
}
|
|
20144
20024
|
function regionCount(layout) {
|
|
20145
20025
|
const regions = layout?.regions;
|
|
20146
20026
|
return Array.isArray(regions) ? regions.length : 0;
|
|
@@ -20211,10 +20091,10 @@ async function runVisionPasses(canvas) {
|
|
|
20211
20091
|
return fail2("read_outputs", e instanceof Error ? e.message : String(e));
|
|
20212
20092
|
}
|
|
20213
20093
|
}
|
|
20214
|
-
var scaffoldStaticAdCommand =
|
|
20094
|
+
var scaffoldStaticAdCommand = defineCommand91({
|
|
20215
20095
|
meta: {
|
|
20216
20096
|
name: "scaffold-static-ad",
|
|
20217
|
-
description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. Edit prompt.json and drop the real assets, then `baker canvas run` it."
|
|
20097
|
+
description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. By default it also fans the hero out to the platform's placement ratios (via image_aspect_adapt \u2014 the hero ratio is free, the rest are billed AI recompositions); pass --placements none for a single base ad, or a preset to pick the set. Edit prompt.json and drop the real assets, then `baker canvas run` it."
|
|
20218
20098
|
},
|
|
20219
20099
|
args: {
|
|
20220
20100
|
file: { type: "positional", required: true, description: "Path or http(s) URL to the source/inspiration image" },
|
|
@@ -20227,14 +20107,18 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20227
20107
|
title: { type: "string", description: "Creative title for _definition.md (default: title-cased slug)" },
|
|
20228
20108
|
platform: {
|
|
20229
20109
|
type: "string",
|
|
20230
|
-
description: "Ad platform
|
|
20110
|
+
description: "Ad platform (meta|google|linkedin|tiktok|youtube|x|other; default meta). Sets _definition.md AND, unless --placements is given, the default placement set the hero auto-fans-out to (meta \u2192 4:5+9:16, google \u2192 1:1+4:5+16:9, linkedin \u2192 1:1, tiktok \u2192 9:16, youtube \u2192 16:9; x/other \u2192 none)."
|
|
20231
20111
|
},
|
|
20232
20112
|
advertiser: { type: "string", description: "Source advertiser recorded in _definition.md" },
|
|
20233
20113
|
"describe-model": { type: "string", description: "Override the image_describe model id" },
|
|
20234
20114
|
"select-model": { type: "string", description: "Override the text_generate model id for element selection" },
|
|
20235
20115
|
"layout-model": { type: "string", description: "Override the text_generate model id for the layout pass" },
|
|
20236
20116
|
"gen-model": { type: "string", description: "Override the image_generate model id" },
|
|
20237
|
-
aspect: { type: "string", description: "Force the
|
|
20117
|
+
aspect: { type: "string", description: "Force the hero's aspect ratio (else inferred from the image)" },
|
|
20118
|
+
placements: {
|
|
20119
|
+
type: "string",
|
|
20120
|
+
description: "Placement set the hero auto-fans-out to (image_aspect_adapt). One of meta_feed | meta_feed_stories | meta_all | linkedin | google_demandgen | tiktok | youtube, or `none` for a single base ad. Default: derived from --platform (meta \u2192 feed + stories). Each extra ratio is a billed render; the hero ratio passes through free."
|
|
20121
|
+
},
|
|
20238
20122
|
"skip-font": { type: "boolean", description: "Skip the brand-font \u2192 type-specimen slot" },
|
|
20239
20123
|
"skip-actor-sheets": {
|
|
20240
20124
|
type: "boolean",
|
|
@@ -20294,6 +20178,13 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20294
20178
|
canvasImageIsUrl = true;
|
|
20295
20179
|
}
|
|
20296
20180
|
}
|
|
20181
|
+
const definitionPlatform = resolvePlatform(args.platform ? String(args.platform) : void 0);
|
|
20182
|
+
const placementsResult = resolvePlacements(
|
|
20183
|
+
args.placements ? String(args.placements) : void 0,
|
|
20184
|
+
definitionPlatform
|
|
20185
|
+
);
|
|
20186
|
+
if (!placementsResult.ok) return fail2("invalid_placements", placementsResult.message);
|
|
20187
|
+
const placements = placementsResult.placements;
|
|
20297
20188
|
const opts = {
|
|
20298
20189
|
genModel,
|
|
20299
20190
|
imagePath: canvasImagePath,
|
|
@@ -20301,7 +20192,8 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20301
20192
|
blueprintPath: canvasBlueprintPath,
|
|
20302
20193
|
aspectRatio: args.aspect ? String(args.aspect) : void 0,
|
|
20303
20194
|
includeFont: !args["skip-font"],
|
|
20304
|
-
includeActorSheets: !args["skip-actor-sheets"]
|
|
20195
|
+
includeActorSheets: !args["skip-actor-sheets"],
|
|
20196
|
+
placements
|
|
20305
20197
|
};
|
|
20306
20198
|
let canvas;
|
|
20307
20199
|
let report;
|
|
@@ -20327,8 +20219,8 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20327
20219
|
buildCreativeDefinition({
|
|
20328
20220
|
title: args.title ? String(args.title) : titleFromSlug(slug ?? ""),
|
|
20329
20221
|
kind: "static",
|
|
20330
|
-
platform:
|
|
20331
|
-
formats:
|
|
20222
|
+
platform: definitionPlatform,
|
|
20223
|
+
formats: resolveFormatList(report.output_formats),
|
|
20332
20224
|
sourceReferenceUrl: durableSourceUrl ?? (imageIsUrl ? imageSource : void 0),
|
|
20333
20225
|
sourceAdvertiser: args.advertiser ? String(args.advertiser) : args.context ? String(args.context) : void 0,
|
|
20334
20226
|
sourceKind: "image",
|
|
@@ -20341,8 +20233,8 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20341
20233
|
await syncCreativeDefinitionBestEffort({
|
|
20342
20234
|
slug,
|
|
20343
20235
|
title: args.title ? String(args.title) : titleFromSlug(slug),
|
|
20344
|
-
platform:
|
|
20345
|
-
formats:
|
|
20236
|
+
platform: definitionPlatform,
|
|
20237
|
+
formats: resolveFormatList(report.output_formats),
|
|
20346
20238
|
sourceReferenceUrl: durableSourceUrl ?? (imageIsUrl ? imageSource : void 0),
|
|
20347
20239
|
canvas,
|
|
20348
20240
|
sourceSha: await computeSourceSha(outPath)
|
|
@@ -20359,6 +20251,8 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20359
20251
|
output: canvas.output,
|
|
20360
20252
|
models: { describe: describeModel, select: selectModel, layout: layoutModel, gen: opts.genModel },
|
|
20361
20253
|
aspect_ratio: report.aspect_ratio,
|
|
20254
|
+
placements: report.placements,
|
|
20255
|
+
output_formats: report.output_formats,
|
|
20362
20256
|
layout_regions: regionCount(layout),
|
|
20363
20257
|
stats: {
|
|
20364
20258
|
total_nodes: canvas.nodes.length,
|
|
@@ -20370,6 +20264,7 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20370
20264
|
assets_to_supply: report.elements,
|
|
20371
20265
|
font_slot: report.includes_font ? "Drop a brand font at the [TODO] brandfont path (the describe pass recorded the ad's typefaces under `fonts` in prompt.json \u2014 match those). The font is wired into the render as a TYPE SPECIMEN reference so generated text takes the brand letterforms. Delete the brandfont + type_ref nodes to skip it." : "skipped (--skip-font)",
|
|
20372
20266
|
actor_sheets: report.actor_sheets.length > 0 ? `Each living hero (${report.actor_sheets.join(", ")}) is fused into a generated multi-view reference sheet (image_reference_sheet) that the render grounds on \u2014 so drop ONE clean photo at that hero's ingest and the sheet builds the consistent turnaround. Pass --skip-actor-sheets to ground on the lone photo instead.` : "none (no person/animal heroes detected, or --skip-actor-sheets)",
|
|
20267
|
+
placements: report.placements === null ? `Single format (${report.aspect_ratio}). Pass --placements meta_feed_stories|meta_all|linkedin|\u2026 to auto-fan-out to a platform's set.` : `Auto-fans the approved hero out to ${report.placements} \u2192 ${report.output_formats.join(", ")}. The hero ratio (${report.aspect_ratio}) passes through free; each other ratio is a billed render, AI-recomposed (not cropped). Re-read the copy and confirm the brand-color treatment on EVERY ratio before publishing \u2014 adaptation re-generates and can silently mangle text or flatten a color device. Pass --placements none for a single base ad.`,
|
|
20373
20268
|
note: "Populate as you go: for each [TODO] ingest slot, source its real asset and wire it into the slot right away \u2014 one at a time, not all sourced first then reconciled at the end. When every slot is filled, `baker canvas validate` then `baker canvas run`. Running generates a billed image \u2014 it is not free."
|
|
20374
20269
|
}
|
|
20375
20270
|
},
|
|
@@ -20385,7 +20280,7 @@ var scaffoldStaticAdCommand = defineCommand92({
|
|
|
20385
20280
|
import { access as access2, cp, mkdir as mkdir6, readFile as readFile14, rm as rm6, writeFile as writeFile7 } from "fs/promises";
|
|
20386
20281
|
import { tmpdir as tmpdir2 } from "os";
|
|
20387
20282
|
import path20 from "path";
|
|
20388
|
-
import { defineCommand as
|
|
20283
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
20389
20284
|
|
|
20390
20285
|
// src/engine/scaffold/lib/model-router.ts
|
|
20391
20286
|
var SEEDANCE = "bytedance/seedance-2.0";
|
|
@@ -20839,7 +20734,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
|
|
|
20839
20734
|
return fail3("deconstruct", e instanceof Error ? e.message : String(e));
|
|
20840
20735
|
}
|
|
20841
20736
|
}
|
|
20842
|
-
var scaffoldVideoCommand =
|
|
20737
|
+
var scaffoldVideoCommand = defineCommand92({
|
|
20843
20738
|
meta: {
|
|
20844
20739
|
name: "scaffold-video",
|
|
20845
20740
|
description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to a split, editable blueprint: a global prompt.json plus one small scenes/sNN.json per scene) and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit a scene's scenes/sNN.json (or prompt.json for global cast/palette/brand), drop the real source images, then `baker canvas run`."
|
|
@@ -21144,7 +21039,7 @@ var scaffoldVideoCommand = defineCommand93({
|
|
|
21144
21039
|
// src/commands/canvas/set-prompt.ts
|
|
21145
21040
|
import { readFile as readFile15, writeFile as writeFile8 } from "fs/promises";
|
|
21146
21041
|
import path21 from "path";
|
|
21147
|
-
import { defineCommand as
|
|
21042
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
21148
21043
|
function setNodePrompt(canvas, nodeId, text) {
|
|
21149
21044
|
const nodes = canvas?.nodes;
|
|
21150
21045
|
if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
|
|
@@ -21159,7 +21054,7 @@ function setNodePrompt(canvas, nodeId, text) {
|
|
|
21159
21054
|
newNodes[idx] = newNode;
|
|
21160
21055
|
return { ...canvas, nodes: newNodes };
|
|
21161
21056
|
}
|
|
21162
|
-
var setPromptCommand =
|
|
21057
|
+
var setPromptCommand = defineCommand93({
|
|
21163
21058
|
meta: {
|
|
21164
21059
|
name: "set-prompt",
|
|
21165
21060
|
description: "Safely set a node's params.prompt (a frame description, motion prompt, etc.) without hand-editing the JSON. Prefer --text-file for multi-line/accented copy \u2014 it preserves UTF-8 exactly, unlike shell-quoted jq."
|
|
@@ -21219,8 +21114,8 @@ var setPromptCommand = defineCommand94({
|
|
|
21219
21114
|
// src/commands/canvas/validate.ts
|
|
21220
21115
|
import { readFile as readFile16 } from "fs/promises";
|
|
21221
21116
|
import path22 from "path";
|
|
21222
|
-
import { defineCommand as
|
|
21223
|
-
var validateCommand =
|
|
21117
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
21118
|
+
var validateCommand = defineCommand94({
|
|
21224
21119
|
meta: {
|
|
21225
21120
|
name: "validate",
|
|
21226
21121
|
description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
|
|
@@ -21290,7 +21185,7 @@ var validateCommand = defineCommand95({
|
|
|
21290
21185
|
});
|
|
21291
21186
|
|
|
21292
21187
|
// src/commands/canvas/index.ts
|
|
21293
|
-
var canvasCommand =
|
|
21188
|
+
var canvasCommand = defineCommand95({
|
|
21294
21189
|
meta: {
|
|
21295
21190
|
name: "canvas",
|
|
21296
21191
|
description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
|
|
@@ -21323,10 +21218,10 @@ Subcommands:
|
|
|
21323
21218
|
});
|
|
21324
21219
|
|
|
21325
21220
|
// src/commands/creatives/index.ts
|
|
21326
|
-
import { defineCommand as
|
|
21221
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
21327
21222
|
|
|
21328
21223
|
// src/commands/creatives/publish.ts
|
|
21329
|
-
import { defineCommand as
|
|
21224
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
21330
21225
|
|
|
21331
21226
|
// src/commands/images/api.ts
|
|
21332
21227
|
import { readFile as readFile17 } from "fs/promises";
|
|
@@ -21470,7 +21365,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
|
|
|
21470
21365
|
chatId: chatIdFromEnv()
|
|
21471
21366
|
});
|
|
21472
21367
|
}
|
|
21473
|
-
var publishCommand =
|
|
21368
|
+
var publishCommand = defineCommand96({
|
|
21474
21369
|
meta: {
|
|
21475
21370
|
name: "publish",
|
|
21476
21371
|
description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
|
|
@@ -21528,7 +21423,7 @@ var publishCommand = defineCommand97({
|
|
|
21528
21423
|
});
|
|
21529
21424
|
|
|
21530
21425
|
// src/commands/creatives/index.ts
|
|
21531
|
-
var creativesCommand3 =
|
|
21426
|
+
var creativesCommand3 = defineCommand97({
|
|
21532
21427
|
meta: {
|
|
21533
21428
|
name: "creatives",
|
|
21534
21429
|
description: `Publish static ad creatives as first-class Baker outputs.
|
|
@@ -21544,7 +21439,7 @@ Publishing uploads the image to the Company image library, applies the official
|
|
|
21544
21439
|
});
|
|
21545
21440
|
|
|
21546
21441
|
// src/commands/flows/index.ts
|
|
21547
|
-
import { defineCommand as
|
|
21442
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
21548
21443
|
|
|
21549
21444
|
// src/commands/flows/shared.ts
|
|
21550
21445
|
import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
|
|
@@ -21699,7 +21594,7 @@ function displayName(slug) {
|
|
|
21699
21594
|
const name = tree.displayName;
|
|
21700
21595
|
return typeof name === "string" && name.trim() ? name.trim() : slug;
|
|
21701
21596
|
}
|
|
21702
|
-
var listCommand5 =
|
|
21597
|
+
var listCommand5 = defineCommand98({
|
|
21703
21598
|
meta: {
|
|
21704
21599
|
name: "list",
|
|
21705
21600
|
description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
|
|
@@ -21713,7 +21608,7 @@ var listCommand5 = defineCommand99({
|
|
|
21713
21608
|
writeJson({ ok: true, data: { flows } });
|
|
21714
21609
|
}
|
|
21715
21610
|
});
|
|
21716
|
-
var showCommand2 =
|
|
21611
|
+
var showCommand2 = defineCommand98({
|
|
21717
21612
|
meta: {
|
|
21718
21613
|
name: "show",
|
|
21719
21614
|
description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
|
|
@@ -21734,7 +21629,7 @@ var showCommand2 = defineCommand99({
|
|
|
21734
21629
|
writeJson({ ok: true, data: response });
|
|
21735
21630
|
}
|
|
21736
21631
|
});
|
|
21737
|
-
var flowsCommand =
|
|
21632
|
+
var flowsCommand = defineCommand98({
|
|
21738
21633
|
meta: {
|
|
21739
21634
|
name: "flows",
|
|
21740
21635
|
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).
|
|
@@ -21761,10 +21656,10 @@ Examples:
|
|
|
21761
21656
|
});
|
|
21762
21657
|
|
|
21763
21658
|
// src/commands/ga4/index.ts
|
|
21764
|
-
import { defineCommand as
|
|
21659
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
21765
21660
|
|
|
21766
21661
|
// src/commands/ga4/audit.ts
|
|
21767
|
-
import { defineCommand as
|
|
21662
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
21768
21663
|
|
|
21769
21664
|
// src/commands/ga4/resolve.ts
|
|
21770
21665
|
async function fetchProperties(useCache = true) {
|
|
@@ -21827,7 +21722,7 @@ registerSchema({
|
|
|
21827
21722
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
21828
21723
|
}
|
|
21829
21724
|
});
|
|
21830
|
-
var auditCommand2 =
|
|
21725
|
+
var auditCommand2 = defineCommand99({
|
|
21831
21726
|
meta: {
|
|
21832
21727
|
name: "audit",
|
|
21833
21728
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -21879,7 +21774,7 @@ Examples:
|
|
|
21879
21774
|
});
|
|
21880
21775
|
|
|
21881
21776
|
// src/commands/ga4/properties.ts
|
|
21882
|
-
import { defineCommand as
|
|
21777
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
21883
21778
|
registerSchema({
|
|
21884
21779
|
command: "ga4.properties",
|
|
21885
21780
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -21887,7 +21782,7 @@ registerSchema({
|
|
|
21887
21782
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
21888
21783
|
}
|
|
21889
21784
|
});
|
|
21890
|
-
var propertiesCommand =
|
|
21785
|
+
var propertiesCommand = defineCommand100({
|
|
21891
21786
|
meta: {
|
|
21892
21787
|
name: "properties",
|
|
21893
21788
|
description: `List accessible GA4 properties.
|
|
@@ -21937,7 +21832,7 @@ Examples:
|
|
|
21937
21832
|
// src/commands/ga4/query.ts
|
|
21938
21833
|
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
|
|
21939
21834
|
import { resolve as resolve2 } from "path";
|
|
21940
|
-
import { defineCommand as
|
|
21835
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
21941
21836
|
|
|
21942
21837
|
// src/commands/ga4/presets.ts
|
|
21943
21838
|
var GA4_PRESETS = [
|
|
@@ -22069,7 +21964,7 @@ function handleError(err) {
|
|
|
22069
21964
|
});
|
|
22070
21965
|
process.exit(1);
|
|
22071
21966
|
}
|
|
22072
|
-
var queryCommand2 =
|
|
21967
|
+
var queryCommand2 = defineCommand101({
|
|
22073
21968
|
meta: {
|
|
22074
21969
|
name: "query",
|
|
22075
21970
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -22140,7 +22035,7 @@ Free-form (escape hatch):
|
|
|
22140
22035
|
});
|
|
22141
22036
|
|
|
22142
22037
|
// src/commands/ga4/index.ts
|
|
22143
|
-
var ga4Command =
|
|
22038
|
+
var ga4Command = defineCommand102({
|
|
22144
22039
|
meta: {
|
|
22145
22040
|
name: "ga4",
|
|
22146
22041
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -22163,12 +22058,12 @@ Examples:
|
|
|
22163
22058
|
});
|
|
22164
22059
|
|
|
22165
22060
|
// src/commands/gsc/index.ts
|
|
22166
|
-
import { defineCommand as
|
|
22061
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
22167
22062
|
|
|
22168
22063
|
// src/commands/gsc/query.ts
|
|
22169
22064
|
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
|
|
22170
22065
|
import { resolve as resolve3 } from "path";
|
|
22171
|
-
import { defineCommand as
|
|
22066
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
22172
22067
|
|
|
22173
22068
|
// src/commands/gsc/presets.ts
|
|
22174
22069
|
var GSC_PRESETS = [
|
|
@@ -22356,7 +22251,7 @@ function handleError2(err) {
|
|
|
22356
22251
|
});
|
|
22357
22252
|
process.exit(1);
|
|
22358
22253
|
}
|
|
22359
|
-
var queryCommand3 =
|
|
22254
|
+
var queryCommand3 = defineCommand103({
|
|
22360
22255
|
meta: {
|
|
22361
22256
|
name: "query",
|
|
22362
22257
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -22434,7 +22329,7 @@ Free-form (escape hatch):
|
|
|
22434
22329
|
});
|
|
22435
22330
|
|
|
22436
22331
|
// src/commands/gsc/sitemaps.ts
|
|
22437
|
-
import { defineCommand as
|
|
22332
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
22438
22333
|
registerSchema({
|
|
22439
22334
|
command: "gsc.sitemaps",
|
|
22440
22335
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -22443,7 +22338,7 @@ registerSchema({
|
|
|
22443
22338
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22444
22339
|
}
|
|
22445
22340
|
});
|
|
22446
|
-
var sitemapsCommand =
|
|
22341
|
+
var sitemapsCommand = defineCommand104({
|
|
22447
22342
|
meta: {
|
|
22448
22343
|
name: "sitemaps",
|
|
22449
22344
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -22493,7 +22388,7 @@ Examples:
|
|
|
22493
22388
|
});
|
|
22494
22389
|
|
|
22495
22390
|
// src/commands/gsc/sites.ts
|
|
22496
|
-
import { defineCommand as
|
|
22391
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
22497
22392
|
registerSchema({
|
|
22498
22393
|
command: "gsc.sites",
|
|
22499
22394
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -22501,7 +22396,7 @@ registerSchema({
|
|
|
22501
22396
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22502
22397
|
}
|
|
22503
22398
|
});
|
|
22504
|
-
var sitesCommand =
|
|
22399
|
+
var sitesCommand = defineCommand105({
|
|
22505
22400
|
meta: {
|
|
22506
22401
|
name: "sites",
|
|
22507
22402
|
description: `List verified Search Console sites.
|
|
@@ -22549,7 +22444,7 @@ Examples:
|
|
|
22549
22444
|
});
|
|
22550
22445
|
|
|
22551
22446
|
// src/commands/gsc/index.ts
|
|
22552
|
-
var gscCommand =
|
|
22447
|
+
var gscCommand = defineCommand106({
|
|
22553
22448
|
meta: {
|
|
22554
22449
|
name: "gsc",
|
|
22555
22450
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -22572,10 +22467,10 @@ Examples:
|
|
|
22572
22467
|
});
|
|
22573
22468
|
|
|
22574
22469
|
// src/commands/images/index.ts
|
|
22575
|
-
import { defineCommand as
|
|
22470
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
22576
22471
|
|
|
22577
22472
|
// src/commands/images/crop.ts
|
|
22578
|
-
import { defineCommand as
|
|
22473
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
22579
22474
|
|
|
22580
22475
|
// src/lib/image/crop-sprite.ts
|
|
22581
22476
|
import sharp from "sharp";
|
|
@@ -22700,7 +22595,7 @@ function emitError2(err) {
|
|
|
22700
22595
|
}
|
|
22701
22596
|
process.exit(1);
|
|
22702
22597
|
}
|
|
22703
|
-
var cropCommand =
|
|
22598
|
+
var cropCommand = defineCommand107({
|
|
22704
22599
|
meta: {
|
|
22705
22600
|
name: "crop",
|
|
22706
22601
|
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"
|
|
@@ -22736,7 +22631,7 @@ var cropCommand = defineCommand108({
|
|
|
22736
22631
|
});
|
|
22737
22632
|
|
|
22738
22633
|
// src/commands/images/delete.ts
|
|
22739
|
-
import { defineCommand as
|
|
22634
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
22740
22635
|
registerSchema({
|
|
22741
22636
|
command: "images.delete",
|
|
22742
22637
|
description: "Delete an image by ID",
|
|
@@ -22750,7 +22645,7 @@ registerSchema({
|
|
|
22750
22645
|
}
|
|
22751
22646
|
}
|
|
22752
22647
|
});
|
|
22753
|
-
var deleteCommand =
|
|
22648
|
+
var deleteCommand = defineCommand108({
|
|
22754
22649
|
meta: {
|
|
22755
22650
|
name: "delete",
|
|
22756
22651
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -22791,7 +22686,7 @@ var deleteCommand = defineCommand109({
|
|
|
22791
22686
|
});
|
|
22792
22687
|
|
|
22793
22688
|
// src/commands/images/dimensions.ts
|
|
22794
|
-
import { defineCommand as
|
|
22689
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
22795
22690
|
|
|
22796
22691
|
// src/lib/image/dimensions.ts
|
|
22797
22692
|
import { imageSize } from "image-size";
|
|
@@ -22814,7 +22709,7 @@ registerSchema({
|
|
|
22814
22709
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
22815
22710
|
}
|
|
22816
22711
|
});
|
|
22817
|
-
var dimensionsCommand =
|
|
22712
|
+
var dimensionsCommand = defineCommand109({
|
|
22818
22713
|
meta: {
|
|
22819
22714
|
name: "dimensions",
|
|
22820
22715
|
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"
|
|
@@ -22858,7 +22753,7 @@ var dimensionsCommand = defineCommand110({
|
|
|
22858
22753
|
});
|
|
22859
22754
|
|
|
22860
22755
|
// src/commands/images/extract.ts
|
|
22861
|
-
import { defineCommand as
|
|
22756
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
22862
22757
|
registerSchema({
|
|
22863
22758
|
command: "images.extract",
|
|
22864
22759
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -22874,7 +22769,7 @@ registerSchema({
|
|
|
22874
22769
|
}
|
|
22875
22770
|
}
|
|
22876
22771
|
});
|
|
22877
|
-
var extractCommand =
|
|
22772
|
+
var extractCommand = defineCommand110({
|
|
22878
22773
|
meta: {
|
|
22879
22774
|
name: "extract",
|
|
22880
22775
|
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"
|
|
@@ -22912,7 +22807,7 @@ var extractCommand = defineCommand111({
|
|
|
22912
22807
|
});
|
|
22913
22808
|
|
|
22914
22809
|
// src/commands/images/find.ts
|
|
22915
|
-
import { defineCommand as
|
|
22810
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
22916
22811
|
registerSchema({
|
|
22917
22812
|
command: "images.find",
|
|
22918
22813
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -22944,7 +22839,7 @@ registerSchema({
|
|
|
22944
22839
|
}
|
|
22945
22840
|
}
|
|
22946
22841
|
});
|
|
22947
|
-
var findCommand =
|
|
22842
|
+
var findCommand = defineCommand111({
|
|
22948
22843
|
meta: {
|
|
22949
22844
|
name: "find",
|
|
22950
22845
|
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"
|
|
@@ -22993,7 +22888,7 @@ var findCommand = defineCommand112({
|
|
|
22993
22888
|
|
|
22994
22889
|
// src/commands/images/generate.ts
|
|
22995
22890
|
import { readFile as readFile19 } from "fs/promises";
|
|
22996
|
-
import { defineCommand as
|
|
22891
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
22997
22892
|
import sharp2 from "sharp";
|
|
22998
22893
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
22999
22894
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -23096,7 +22991,7 @@ async function resolveReferences(spec) {
|
|
|
23096
22991
|
}
|
|
23097
22992
|
return out;
|
|
23098
22993
|
}
|
|
23099
|
-
var generateCommand =
|
|
22994
|
+
var generateCommand = defineCommand112({
|
|
23100
22995
|
meta: {
|
|
23101
22996
|
name: "generate",
|
|
23102
22997
|
description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: google/gemini-3.1-flash-image-preview (Nano Banana flash \u2014 default, fast, extreme aspect ratios) & google/gemini-3.5-flash (fast), google/gemini-3-pro-image-preview (Nano Banana Pro \u2014 highest fidelity), openai/gpt-5.4-image-2 (photoreal, cleanest in-image text, best for ad/landing reproduction), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model openai/gpt-5.4-image-2 --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
|
|
@@ -23148,7 +23043,7 @@ var generateCommand = defineCommand113({
|
|
|
23148
23043
|
});
|
|
23149
23044
|
|
|
23150
23045
|
// src/commands/images/get.ts
|
|
23151
|
-
import { defineCommand as
|
|
23046
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
23152
23047
|
registerSchema({
|
|
23153
23048
|
command: "images.get",
|
|
23154
23049
|
description: "Get a single image by ID",
|
|
@@ -23156,7 +23051,7 @@ registerSchema({
|
|
|
23156
23051
|
id: { type: "string", description: "Image ID", required: true }
|
|
23157
23052
|
}
|
|
23158
23053
|
});
|
|
23159
|
-
var getCommand2 =
|
|
23054
|
+
var getCommand2 = defineCommand113({
|
|
23160
23055
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
23161
23056
|
args: {
|
|
23162
23057
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -23192,7 +23087,7 @@ var getCommand2 = defineCommand114({
|
|
|
23192
23087
|
});
|
|
23193
23088
|
|
|
23194
23089
|
// src/commands/images/gif.ts
|
|
23195
|
-
import { defineCommand as
|
|
23090
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
23196
23091
|
registerSchema({
|
|
23197
23092
|
command: "images.gif",
|
|
23198
23093
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -23224,7 +23119,7 @@ registerSchema({
|
|
|
23224
23119
|
}
|
|
23225
23120
|
}
|
|
23226
23121
|
});
|
|
23227
|
-
var gifCommand =
|
|
23122
|
+
var gifCommand = defineCommand114({
|
|
23228
23123
|
meta: {
|
|
23229
23124
|
name: "gif",
|
|
23230
23125
|
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"
|
|
@@ -23271,7 +23166,7 @@ var gifCommand = defineCommand115({
|
|
|
23271
23166
|
});
|
|
23272
23167
|
|
|
23273
23168
|
// src/commands/images/google.ts
|
|
23274
|
-
import { defineCommand as
|
|
23169
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
23275
23170
|
registerSchema({
|
|
23276
23171
|
command: "images.google",
|
|
23277
23172
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -23307,7 +23202,7 @@ registerSchema({
|
|
|
23307
23202
|
}
|
|
23308
23203
|
}
|
|
23309
23204
|
});
|
|
23310
|
-
var googleCommand2 =
|
|
23205
|
+
var googleCommand2 = defineCommand115({
|
|
23311
23206
|
meta: {
|
|
23312
23207
|
name: "google",
|
|
23313
23208
|
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"
|
|
@@ -23355,7 +23250,7 @@ var googleCommand2 = defineCommand116({
|
|
|
23355
23250
|
});
|
|
23356
23251
|
|
|
23357
23252
|
// src/commands/images/icon.ts
|
|
23358
|
-
import { defineCommand as
|
|
23253
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
23359
23254
|
registerSchema({
|
|
23360
23255
|
command: "images.icon",
|
|
23361
23256
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -23381,7 +23276,7 @@ registerSchema({
|
|
|
23381
23276
|
}
|
|
23382
23277
|
}
|
|
23383
23278
|
});
|
|
23384
|
-
var iconCommand =
|
|
23279
|
+
var iconCommand = defineCommand116({
|
|
23385
23280
|
meta: {
|
|
23386
23281
|
name: "icon",
|
|
23387
23282
|
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'"
|
|
@@ -23421,7 +23316,7 @@ var iconCommand = defineCommand117({
|
|
|
23421
23316
|
});
|
|
23422
23317
|
|
|
23423
23318
|
// src/commands/images/ingest.ts
|
|
23424
|
-
import { defineCommand as
|
|
23319
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
23425
23320
|
registerSchema({
|
|
23426
23321
|
command: "images.ingest",
|
|
23427
23322
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -23433,7 +23328,7 @@ registerSchema({
|
|
|
23433
23328
|
context: { type: "string", description: "Description context hint", required: false }
|
|
23434
23329
|
}
|
|
23435
23330
|
});
|
|
23436
|
-
var ingestCommand =
|
|
23331
|
+
var ingestCommand = defineCommand117({
|
|
23437
23332
|
meta: {
|
|
23438
23333
|
name: "ingest",
|
|
23439
23334
|
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"
|
|
@@ -23475,7 +23370,7 @@ var ingestCommand = defineCommand118({
|
|
|
23475
23370
|
});
|
|
23476
23371
|
|
|
23477
23372
|
// src/commands/images/library.ts
|
|
23478
|
-
import { defineCommand as
|
|
23373
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
23479
23374
|
registerSchema({
|
|
23480
23375
|
command: "images.library",
|
|
23481
23376
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -23501,7 +23396,7 @@ registerSchema({
|
|
|
23501
23396
|
}
|
|
23502
23397
|
}
|
|
23503
23398
|
});
|
|
23504
|
-
var libraryCommand =
|
|
23399
|
+
var libraryCommand = defineCommand118({
|
|
23505
23400
|
meta: {
|
|
23506
23401
|
name: "library",
|
|
23507
23402
|
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"
|
|
@@ -23558,7 +23453,7 @@ var libraryCommand = defineCommand119({
|
|
|
23558
23453
|
});
|
|
23559
23454
|
|
|
23560
23455
|
// src/commands/images/logo.ts
|
|
23561
|
-
import { defineCommand as
|
|
23456
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
23562
23457
|
registerSchema({
|
|
23563
23458
|
command: "images.logo",
|
|
23564
23459
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -23583,7 +23478,7 @@ registerSchema({
|
|
|
23583
23478
|
}
|
|
23584
23479
|
}
|
|
23585
23480
|
});
|
|
23586
|
-
var logoCommand =
|
|
23481
|
+
var logoCommand = defineCommand119({
|
|
23587
23482
|
meta: {
|
|
23588
23483
|
name: "logo",
|
|
23589
23484
|
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"
|
|
@@ -23621,7 +23516,7 @@ var logoCommand = defineCommand120({
|
|
|
23621
23516
|
});
|
|
23622
23517
|
|
|
23623
23518
|
// src/commands/images/normalize.ts
|
|
23624
|
-
import { defineCommand as
|
|
23519
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
23625
23520
|
|
|
23626
23521
|
// src/lib/image/color-changer.ts
|
|
23627
23522
|
import quantize from "quantize";
|
|
@@ -24353,7 +24248,7 @@ function coerceRawArgs(args) {
|
|
|
24353
24248
|
"dry-run": bool(args["dry-run"])
|
|
24354
24249
|
};
|
|
24355
24250
|
}
|
|
24356
|
-
var normalizeCommand =
|
|
24251
|
+
var normalizeCommand = defineCommand120({
|
|
24357
24252
|
meta: {
|
|
24358
24253
|
name: "normalize",
|
|
24359
24254
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -24408,7 +24303,7 @@ Examples:
|
|
|
24408
24303
|
});
|
|
24409
24304
|
|
|
24410
24305
|
// src/commands/images/pinterest.ts
|
|
24411
|
-
import { defineCommand as
|
|
24306
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
24412
24307
|
registerSchema({
|
|
24413
24308
|
command: "images.pinterest",
|
|
24414
24309
|
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.",
|
|
@@ -24428,7 +24323,7 @@ registerSchema({
|
|
|
24428
24323
|
}
|
|
24429
24324
|
}
|
|
24430
24325
|
});
|
|
24431
|
-
var pinterestCommand =
|
|
24326
|
+
var pinterestCommand = defineCommand121({
|
|
24432
24327
|
meta: {
|
|
24433
24328
|
name: "pinterest",
|
|
24434
24329
|
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'"
|
|
@@ -24468,7 +24363,7 @@ var pinterestCommand = defineCommand122({
|
|
|
24468
24363
|
});
|
|
24469
24364
|
|
|
24470
24365
|
// src/commands/images/screenshot.ts
|
|
24471
|
-
import { defineCommand as
|
|
24366
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
24472
24367
|
registerSchema({
|
|
24473
24368
|
command: "images.screenshot",
|
|
24474
24369
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -24484,7 +24379,7 @@ registerSchema({
|
|
|
24484
24379
|
}
|
|
24485
24380
|
}
|
|
24486
24381
|
});
|
|
24487
|
-
var screenshotCommand =
|
|
24382
|
+
var screenshotCommand = defineCommand122({
|
|
24488
24383
|
meta: {
|
|
24489
24384
|
name: "screenshot",
|
|
24490
24385
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -24547,7 +24442,7 @@ var screenshotCommand = defineCommand123({
|
|
|
24547
24442
|
});
|
|
24548
24443
|
|
|
24549
24444
|
// src/commands/images/search.ts
|
|
24550
|
-
import { defineCommand as
|
|
24445
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
24551
24446
|
registerSchema({
|
|
24552
24447
|
command: "images.search",
|
|
24553
24448
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -24563,7 +24458,7 @@ registerSchema({
|
|
|
24563
24458
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
24564
24459
|
}
|
|
24565
24460
|
});
|
|
24566
|
-
var searchCommand =
|
|
24461
|
+
var searchCommand = defineCommand123({
|
|
24567
24462
|
meta: {
|
|
24568
24463
|
name: "search",
|
|
24569
24464
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -24623,7 +24518,7 @@ var searchCommand = defineCommand124({
|
|
|
24623
24518
|
});
|
|
24624
24519
|
|
|
24625
24520
|
// src/commands/images/sticker.ts
|
|
24626
|
-
import { defineCommand as
|
|
24521
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
24627
24522
|
registerSchema({
|
|
24628
24523
|
command: "images.sticker",
|
|
24629
24524
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -24655,7 +24550,7 @@ registerSchema({
|
|
|
24655
24550
|
}
|
|
24656
24551
|
}
|
|
24657
24552
|
});
|
|
24658
|
-
var stickerCommand =
|
|
24553
|
+
var stickerCommand = defineCommand124({
|
|
24659
24554
|
meta: {
|
|
24660
24555
|
name: "sticker",
|
|
24661
24556
|
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"
|
|
@@ -24702,7 +24597,7 @@ var stickerCommand = defineCommand125({
|
|
|
24702
24597
|
});
|
|
24703
24598
|
|
|
24704
24599
|
// src/commands/images/stock.ts
|
|
24705
|
-
import { defineCommand as
|
|
24600
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
24706
24601
|
registerSchema({
|
|
24707
24602
|
command: "images.stock",
|
|
24708
24603
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -24760,7 +24655,7 @@ registerSchema({
|
|
|
24760
24655
|
}
|
|
24761
24656
|
}
|
|
24762
24657
|
});
|
|
24763
|
-
var stockCommand =
|
|
24658
|
+
var stockCommand = defineCommand125({
|
|
24764
24659
|
meta: {
|
|
24765
24660
|
name: "stock",
|
|
24766
24661
|
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"
|
|
@@ -24816,7 +24711,7 @@ var stockCommand = defineCommand126({
|
|
|
24816
24711
|
});
|
|
24817
24712
|
|
|
24818
24713
|
// src/lib/tags-command.ts
|
|
24819
|
-
import { defineCommand as
|
|
24714
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
24820
24715
|
function makeTagsCommand(command, label, endpoint) {
|
|
24821
24716
|
registerSchema({
|
|
24822
24717
|
command: `${command}.tags`,
|
|
@@ -24825,7 +24720,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
24825
24720
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
24826
24721
|
}
|
|
24827
24722
|
});
|
|
24828
|
-
return
|
|
24723
|
+
return defineCommand126({
|
|
24829
24724
|
meta: {
|
|
24830
24725
|
name: "tags",
|
|
24831
24726
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -24861,7 +24756,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
24861
24756
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
24862
24757
|
|
|
24863
24758
|
// src/commands/images/upload.ts
|
|
24864
|
-
import { defineCommand as
|
|
24759
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
24865
24760
|
registerSchema({
|
|
24866
24761
|
command: "images.upload",
|
|
24867
24762
|
description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
|
|
@@ -24899,7 +24794,7 @@ registerSchema({
|
|
|
24899
24794
|
function isRemoteUrl2(value) {
|
|
24900
24795
|
return /^https?:\/\//i.test(value);
|
|
24901
24796
|
}
|
|
24902
|
-
var uploadCommand =
|
|
24797
|
+
var uploadCommand = defineCommand127({
|
|
24903
24798
|
meta: {
|
|
24904
24799
|
name: "upload",
|
|
24905
24800
|
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'"
|
|
@@ -24992,7 +24887,7 @@ async function uploadLocal(target, args) {
|
|
|
24992
24887
|
}
|
|
24993
24888
|
|
|
24994
24889
|
// src/commands/images/upscale.ts
|
|
24995
|
-
import { defineCommand as
|
|
24890
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
24996
24891
|
registerSchema({
|
|
24997
24892
|
command: "images.upscale",
|
|
24998
24893
|
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).",
|
|
@@ -25007,7 +24902,7 @@ registerSchema({
|
|
|
25007
24902
|
}
|
|
25008
24903
|
});
|
|
25009
24904
|
var POLL_INTERVAL_MS3 = 1500;
|
|
25010
|
-
var upscaleCommand =
|
|
24905
|
+
var upscaleCommand = defineCommand128({
|
|
25011
24906
|
meta: {
|
|
25012
24907
|
name: "upscale",
|
|
25013
24908
|
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"
|
|
@@ -25062,7 +24957,7 @@ var upscaleCommand = defineCommand129({
|
|
|
25062
24957
|
});
|
|
25063
24958
|
|
|
25064
24959
|
// src/commands/images/use.ts
|
|
25065
|
-
import { defineCommand as
|
|
24960
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
25066
24961
|
registerSchema({
|
|
25067
24962
|
command: "images.use",
|
|
25068
24963
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -25078,7 +24973,7 @@ registerSchema({
|
|
|
25078
24973
|
}
|
|
25079
24974
|
});
|
|
25080
24975
|
var POLL_INTERVAL_MS4 = 1500;
|
|
25081
|
-
var useCommand =
|
|
24976
|
+
var useCommand = defineCommand129({
|
|
25082
24977
|
meta: {
|
|
25083
24978
|
name: "use",
|
|
25084
24979
|
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"
|
|
@@ -25124,7 +25019,7 @@ var useCommand = defineCommand130({
|
|
|
25124
25019
|
});
|
|
25125
25020
|
|
|
25126
25021
|
// src/commands/images/index.ts
|
|
25127
|
-
var imagesCommand =
|
|
25022
|
+
var imagesCommand = defineCommand130({
|
|
25128
25023
|
meta: {
|
|
25129
25024
|
name: "images",
|
|
25130
25025
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -25194,7 +25089,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
25194
25089
|
});
|
|
25195
25090
|
|
|
25196
25091
|
// src/commands/mcp/index.ts
|
|
25197
|
-
import { defineCommand as
|
|
25092
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
25198
25093
|
var SCOPES = ["user", "user_org", "company", "org"];
|
|
25199
25094
|
function parseScope(raw) {
|
|
25200
25095
|
const scope = raw === void 0 ? "company" : String(raw);
|
|
@@ -25233,7 +25128,7 @@ registerSchema({
|
|
|
25233
25128
|
description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
|
|
25234
25129
|
args: {}
|
|
25235
25130
|
});
|
|
25236
|
-
var listCommand6 =
|
|
25131
|
+
var listCommand6 = defineCommand131({
|
|
25237
25132
|
meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
|
|
25238
25133
|
run: async () => {
|
|
25239
25134
|
try {
|
|
@@ -25258,7 +25153,7 @@ registerSchema({
|
|
|
25258
25153
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
25259
25154
|
}
|
|
25260
25155
|
});
|
|
25261
|
-
var addCommand =
|
|
25156
|
+
var addCommand = defineCommand131({
|
|
25262
25157
|
meta: {
|
|
25263
25158
|
name: "add",
|
|
25264
25159
|
description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
|
|
@@ -25299,7 +25194,7 @@ registerSchema({
|
|
|
25299
25194
|
description: "Remove a company custom MCP server by name.",
|
|
25300
25195
|
args: { name: { type: "string", description: "Server name to remove", required: true } }
|
|
25301
25196
|
});
|
|
25302
|
-
var removeCommand4 =
|
|
25197
|
+
var removeCommand4 = defineCommand131({
|
|
25303
25198
|
meta: {
|
|
25304
25199
|
name: "remove",
|
|
25305
25200
|
description: `Remove a company custom MCP server by name.
|
|
@@ -25321,7 +25216,7 @@ Example:
|
|
|
25321
25216
|
}
|
|
25322
25217
|
}
|
|
25323
25218
|
});
|
|
25324
|
-
var mcpCommand =
|
|
25219
|
+
var mcpCommand = defineCommand131({
|
|
25325
25220
|
meta: {
|
|
25326
25221
|
name: "mcp",
|
|
25327
25222
|
description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
|
|
@@ -25345,10 +25240,10 @@ Examples:
|
|
|
25345
25240
|
});
|
|
25346
25241
|
|
|
25347
25242
|
// src/commands/research/index.ts
|
|
25348
|
-
import { defineCommand as
|
|
25243
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
25349
25244
|
|
|
25350
25245
|
// src/commands/research/advertisers.ts
|
|
25351
|
-
import { defineCommand as
|
|
25246
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
25352
25247
|
|
|
25353
25248
|
// src/commands/research/output.ts
|
|
25354
25249
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -25461,7 +25356,7 @@ var FIELDS3 = {
|
|
|
25461
25356
|
etv: "Estimated traffic value (USD)",
|
|
25462
25357
|
visibility: "SERP visibility score (0-1)"
|
|
25463
25358
|
};
|
|
25464
|
-
var advertisersCommand =
|
|
25359
|
+
var advertisersCommand = defineCommand132({
|
|
25465
25360
|
meta: {
|
|
25466
25361
|
name: "advertisers",
|
|
25467
25362
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -25508,7 +25403,7 @@ Examples:
|
|
|
25508
25403
|
});
|
|
25509
25404
|
|
|
25510
25405
|
// src/commands/research/autocomplete.ts
|
|
25511
|
-
import { defineCommand as
|
|
25406
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
25512
25407
|
registerSchema({
|
|
25513
25408
|
command: "research.autocomplete",
|
|
25514
25409
|
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).",
|
|
@@ -25531,7 +25426,7 @@ registerSchema({
|
|
|
25531
25426
|
var FIELDS4 = {
|
|
25532
25427
|
suggestion: "Autocomplete suggestion from Google"
|
|
25533
25428
|
};
|
|
25534
|
-
var autocompleteCommand =
|
|
25429
|
+
var autocompleteCommand = defineCommand133({
|
|
25535
25430
|
meta: {
|
|
25536
25431
|
name: "autocomplete",
|
|
25537
25432
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -25577,7 +25472,7 @@ Examples:
|
|
|
25577
25472
|
});
|
|
25578
25473
|
|
|
25579
25474
|
// src/commands/research/countries.ts
|
|
25580
|
-
import { defineCommand as
|
|
25475
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
25581
25476
|
registerSchema({
|
|
25582
25477
|
command: "research.countries",
|
|
25583
25478
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -25634,7 +25529,7 @@ var FIELDS5 = {
|
|
|
25634
25529
|
code: "Country code to pass as --location",
|
|
25635
25530
|
name: "Country name"
|
|
25636
25531
|
};
|
|
25637
|
-
var countriesCommand =
|
|
25532
|
+
var countriesCommand = defineCommand134({
|
|
25638
25533
|
meta: {
|
|
25639
25534
|
name: "countries",
|
|
25640
25535
|
description: "List all supported country codes for --location flag."
|
|
@@ -25645,7 +25540,7 @@ var countriesCommand = defineCommand135({
|
|
|
25645
25540
|
});
|
|
25646
25541
|
|
|
25647
25542
|
// src/commands/research/intent.ts
|
|
25648
|
-
import { defineCommand as
|
|
25543
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
25649
25544
|
registerSchema({
|
|
25650
25545
|
command: "research.intent",
|
|
25651
25546
|
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.",
|
|
@@ -25668,7 +25563,7 @@ var FIELDS6 = {
|
|
|
25668
25563
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
25669
25564
|
probability: "Confidence score 0.0-1.0"
|
|
25670
25565
|
};
|
|
25671
|
-
var intentCommand =
|
|
25566
|
+
var intentCommand = defineCommand135({
|
|
25672
25567
|
meta: {
|
|
25673
25568
|
name: "intent",
|
|
25674
25569
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -25716,7 +25611,7 @@ Examples:
|
|
|
25716
25611
|
});
|
|
25717
25612
|
|
|
25718
25613
|
// src/commands/research/keyword-gap.ts
|
|
25719
|
-
import { defineCommand as
|
|
25614
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
25720
25615
|
registerSchema({
|
|
25721
25616
|
command: "research.keyword-gap",
|
|
25722
25617
|
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.",
|
|
@@ -25745,7 +25640,7 @@ var FIELDS7 = {
|
|
|
25745
25640
|
cpc: "Cost per click USD",
|
|
25746
25641
|
their_position: "Competitor's ranking position"
|
|
25747
25642
|
};
|
|
25748
|
-
var keywordGapCommand =
|
|
25643
|
+
var keywordGapCommand = defineCommand136({
|
|
25749
25644
|
meta: {
|
|
25750
25645
|
name: "keyword-gap",
|
|
25751
25646
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -25819,7 +25714,7 @@ Examples:
|
|
|
25819
25714
|
});
|
|
25820
25715
|
|
|
25821
25716
|
// src/commands/research/keywords-for-site.ts
|
|
25822
|
-
import { defineCommand as
|
|
25717
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
25823
25718
|
registerSchema({
|
|
25824
25719
|
command: "research.keywords-for-site",
|
|
25825
25720
|
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.",
|
|
@@ -25852,7 +25747,7 @@ var FIELDS8 = {
|
|
|
25852
25747
|
competition: "LOW, MEDIUM, or HIGH",
|
|
25853
25748
|
competition_index: "Competition score 0-100"
|
|
25854
25749
|
};
|
|
25855
|
-
var keywordsForSiteCommand =
|
|
25750
|
+
var keywordsForSiteCommand = defineCommand137({
|
|
25856
25751
|
meta: {
|
|
25857
25752
|
name: "keywords-for-site",
|
|
25858
25753
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -25905,7 +25800,7 @@ Examples:
|
|
|
25905
25800
|
});
|
|
25906
25801
|
|
|
25907
25802
|
// src/commands/research/languages.ts
|
|
25908
|
-
import { defineCommand as
|
|
25803
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
25909
25804
|
registerSchema({
|
|
25910
25805
|
command: "research.languages",
|
|
25911
25806
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -25935,7 +25830,7 @@ var FIELDS9 = {
|
|
|
25935
25830
|
code: "Language code to pass as --language",
|
|
25936
25831
|
name: "Language name (also accepted by --language)"
|
|
25937
25832
|
};
|
|
25938
|
-
var languagesCommand2 =
|
|
25833
|
+
var languagesCommand2 = defineCommand138({
|
|
25939
25834
|
meta: {
|
|
25940
25835
|
name: "languages",
|
|
25941
25836
|
description: "List all supported language codes for --language flag."
|
|
@@ -25946,7 +25841,7 @@ var languagesCommand2 = defineCommand139({
|
|
|
25946
25841
|
});
|
|
25947
25842
|
|
|
25948
25843
|
// src/commands/research/lighthouse.ts
|
|
25949
|
-
import { defineCommand as
|
|
25844
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
25950
25845
|
registerSchema({
|
|
25951
25846
|
command: "research.lighthouse",
|
|
25952
25847
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -25965,7 +25860,7 @@ var FIELDS10 = {
|
|
|
25965
25860
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
25966
25861
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
25967
25862
|
};
|
|
25968
|
-
var lighthouseCommand =
|
|
25863
|
+
var lighthouseCommand = defineCommand139({
|
|
25969
25864
|
meta: {
|
|
25970
25865
|
name: "lighthouse",
|
|
25971
25866
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -26003,7 +25898,7 @@ Examples:
|
|
|
26003
25898
|
});
|
|
26004
25899
|
|
|
26005
25900
|
// src/commands/research/relevant-pages.ts
|
|
26006
|
-
import { defineCommand as
|
|
25901
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
26007
25902
|
registerSchema({
|
|
26008
25903
|
command: "research.relevant-pages",
|
|
26009
25904
|
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).",
|
|
@@ -26029,7 +25924,7 @@ var FIELDS11 = {
|
|
|
26029
25924
|
keywords: "Total organic keywords the page ranks for",
|
|
26030
25925
|
top_10: "Keywords in positions 1-10"
|
|
26031
25926
|
};
|
|
26032
|
-
var relevantPagesCommand =
|
|
25927
|
+
var relevantPagesCommand = defineCommand140({
|
|
26033
25928
|
meta: {
|
|
26034
25929
|
name: "relevant-pages",
|
|
26035
25930
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -26075,7 +25970,7 @@ Examples:
|
|
|
26075
25970
|
});
|
|
26076
25971
|
|
|
26077
25972
|
// src/commands/research/web.ts
|
|
26078
|
-
import { defineCommand as
|
|
25973
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
26079
25974
|
registerSchema({
|
|
26080
25975
|
command: "research.web",
|
|
26081
25976
|
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).",
|
|
@@ -26126,7 +26021,7 @@ async function runDeepResearch(question) {
|
|
|
26126
26021
|
}
|
|
26127
26022
|
throw new Error("Deep research timed out");
|
|
26128
26023
|
}
|
|
26129
|
-
var webCommand =
|
|
26024
|
+
var webCommand = defineCommand141({
|
|
26130
26025
|
meta: {
|
|
26131
26026
|
name: "web",
|
|
26132
26027
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -26186,7 +26081,7 @@ Examples:
|
|
|
26186
26081
|
});
|
|
26187
26082
|
|
|
26188
26083
|
// src/commands/research/index.ts
|
|
26189
|
-
var researchCommand =
|
|
26084
|
+
var researchCommand = defineCommand142({
|
|
26190
26085
|
meta: {
|
|
26191
26086
|
name: "research",
|
|
26192
26087
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -26226,10 +26121,10 @@ Examples:
|
|
|
26226
26121
|
});
|
|
26227
26122
|
|
|
26228
26123
|
// src/commands/scheduled-actions/index.ts
|
|
26229
|
-
import { defineCommand as
|
|
26124
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
26230
26125
|
|
|
26231
26126
|
// src/commands/scheduled-actions/create.ts
|
|
26232
|
-
import { defineCommand as
|
|
26127
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
26233
26128
|
|
|
26234
26129
|
// src/commands/scheduled-actions/shared.ts
|
|
26235
26130
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -26344,7 +26239,7 @@ registerSchema({
|
|
|
26344
26239
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
26345
26240
|
}
|
|
26346
26241
|
});
|
|
26347
|
-
var createCommand2 =
|
|
26242
|
+
var createCommand2 = defineCommand143({
|
|
26348
26243
|
meta: {
|
|
26349
26244
|
name: "create",
|
|
26350
26245
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -26393,7 +26288,7 @@ var createCommand2 = defineCommand144({
|
|
|
26393
26288
|
});
|
|
26394
26289
|
|
|
26395
26290
|
// src/commands/scheduled-actions/delete.ts
|
|
26396
|
-
import { defineCommand as
|
|
26291
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
26397
26292
|
registerSchema({
|
|
26398
26293
|
command: "scheduled-actions.delete",
|
|
26399
26294
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -26401,7 +26296,7 @@ registerSchema({
|
|
|
26401
26296
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
26402
26297
|
}
|
|
26403
26298
|
});
|
|
26404
|
-
var deleteCommand2 =
|
|
26299
|
+
var deleteCommand2 = defineCommand144({
|
|
26405
26300
|
meta: {
|
|
26406
26301
|
name: "delete",
|
|
26407
26302
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -26430,7 +26325,7 @@ var deleteCommand2 = defineCommand145({
|
|
|
26430
26325
|
});
|
|
26431
26326
|
|
|
26432
26327
|
// src/commands/scheduled-actions/get.ts
|
|
26433
|
-
import { defineCommand as
|
|
26328
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
26434
26329
|
registerSchema({
|
|
26435
26330
|
command: "scheduled-actions.get",
|
|
26436
26331
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -26438,7 +26333,7 @@ registerSchema({
|
|
|
26438
26333
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
26439
26334
|
}
|
|
26440
26335
|
});
|
|
26441
|
-
var getCommand3 =
|
|
26336
|
+
var getCommand3 = defineCommand145({
|
|
26442
26337
|
meta: {
|
|
26443
26338
|
name: "get",
|
|
26444
26339
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -26475,13 +26370,13 @@ var getCommand3 = defineCommand146({
|
|
|
26475
26370
|
});
|
|
26476
26371
|
|
|
26477
26372
|
// src/commands/scheduled-actions/list.ts
|
|
26478
|
-
import { defineCommand as
|
|
26373
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
26479
26374
|
registerSchema({
|
|
26480
26375
|
command: "scheduled-actions.list",
|
|
26481
26376
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
26482
26377
|
args: {}
|
|
26483
26378
|
});
|
|
26484
|
-
var listCommand7 =
|
|
26379
|
+
var listCommand7 = defineCommand146({
|
|
26485
26380
|
meta: {
|
|
26486
26381
|
name: "list",
|
|
26487
26382
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -26502,7 +26397,7 @@ var listCommand7 = defineCommand147({
|
|
|
26502
26397
|
});
|
|
26503
26398
|
|
|
26504
26399
|
// src/commands/scheduled-actions/trigger.ts
|
|
26505
|
-
import { defineCommand as
|
|
26400
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
26506
26401
|
registerSchema({
|
|
26507
26402
|
command: "scheduled-actions.trigger",
|
|
26508
26403
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -26510,7 +26405,7 @@ registerSchema({
|
|
|
26510
26405
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
26511
26406
|
}
|
|
26512
26407
|
});
|
|
26513
|
-
var triggerCommand =
|
|
26408
|
+
var triggerCommand = defineCommand147({
|
|
26514
26409
|
meta: {
|
|
26515
26410
|
name: "trigger",
|
|
26516
26411
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -26547,7 +26442,7 @@ var triggerCommand = defineCommand148({
|
|
|
26547
26442
|
});
|
|
26548
26443
|
|
|
26549
26444
|
// src/commands/scheduled-actions/update.ts
|
|
26550
|
-
import { defineCommand as
|
|
26445
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
26551
26446
|
registerSchema({
|
|
26552
26447
|
command: "scheduled-actions.update",
|
|
26553
26448
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -26572,7 +26467,7 @@ registerSchema({
|
|
|
26572
26467
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
26573
26468
|
}
|
|
26574
26469
|
});
|
|
26575
|
-
var updateCommand2 =
|
|
26470
|
+
var updateCommand2 = defineCommand148({
|
|
26576
26471
|
meta: {
|
|
26577
26472
|
name: "update",
|
|
26578
26473
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -26643,7 +26538,7 @@ var updateCommand2 = defineCommand149({
|
|
|
26643
26538
|
});
|
|
26644
26539
|
|
|
26645
26540
|
// src/commands/scheduled-actions/index.ts
|
|
26646
|
-
var scheduledActionsCommand =
|
|
26541
|
+
var scheduledActionsCommand = defineCommand149({
|
|
26647
26542
|
meta: {
|
|
26648
26543
|
name: "scheduled-actions",
|
|
26649
26544
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -26669,8 +26564,8 @@ Examples:
|
|
|
26669
26564
|
});
|
|
26670
26565
|
|
|
26671
26566
|
// src/commands/schema.ts
|
|
26672
|
-
import { defineCommand as
|
|
26673
|
-
var schemaCommand =
|
|
26567
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
26568
|
+
var schemaCommand = defineCommand150({
|
|
26674
26569
|
meta: {
|
|
26675
26570
|
name: "schema",
|
|
26676
26571
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -26706,7 +26601,7 @@ var schemaCommand = defineCommand151({
|
|
|
26706
26601
|
});
|
|
26707
26602
|
|
|
26708
26603
|
// src/commands/tags/index.ts
|
|
26709
|
-
import { defineCommand as
|
|
26604
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
26710
26605
|
|
|
26711
26606
|
// src/commands/tags/shared.ts
|
|
26712
26607
|
function failApi3(err) {
|
|
@@ -26772,7 +26667,7 @@ async function listTags(json) {
|
|
|
26772
26667
|
failApi3(err);
|
|
26773
26668
|
}
|
|
26774
26669
|
}
|
|
26775
|
-
var listCommand8 =
|
|
26670
|
+
var listCommand8 = defineCommand151({
|
|
26776
26671
|
meta: {
|
|
26777
26672
|
name: "list",
|
|
26778
26673
|
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"
|
|
@@ -26791,7 +26686,7 @@ async function listDraft3() {
|
|
|
26791
26686
|
failApi3(err);
|
|
26792
26687
|
}
|
|
26793
26688
|
}
|
|
26794
|
-
var draftCommand3 =
|
|
26689
|
+
var draftCommand3 = defineCommand151({
|
|
26795
26690
|
meta: {
|
|
26796
26691
|
name: "draft",
|
|
26797
26692
|
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)."
|
|
@@ -26800,7 +26695,7 @@ var draftCommand3 = defineCommand152({
|
|
|
26800
26695
|
await listDraft3();
|
|
26801
26696
|
}
|
|
26802
26697
|
});
|
|
26803
|
-
var tagsCommand3 =
|
|
26698
|
+
var tagsCommand3 = defineCommand151({
|
|
26804
26699
|
meta: {
|
|
26805
26700
|
name: "tags",
|
|
26806
26701
|
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.
|
|
@@ -26825,10 +26720,10 @@ Examples:
|
|
|
26825
26720
|
});
|
|
26826
26721
|
|
|
26827
26722
|
// src/commands/testimonials/index.ts
|
|
26828
|
-
import { defineCommand as
|
|
26723
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
26829
26724
|
|
|
26830
26725
|
// src/commands/testimonials/get.ts
|
|
26831
|
-
import { defineCommand as
|
|
26726
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
26832
26727
|
registerSchema({
|
|
26833
26728
|
command: "testimonials.get",
|
|
26834
26729
|
description: "Get a single testimonial by ID",
|
|
@@ -26836,7 +26731,7 @@ registerSchema({
|
|
|
26836
26731
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
26837
26732
|
}
|
|
26838
26733
|
});
|
|
26839
|
-
var getCommand4 =
|
|
26734
|
+
var getCommand4 = defineCommand152({
|
|
26840
26735
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
26841
26736
|
args: {
|
|
26842
26737
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -26873,7 +26768,7 @@ var getCommand4 = defineCommand153({
|
|
|
26873
26768
|
});
|
|
26874
26769
|
|
|
26875
26770
|
// src/commands/testimonials/list.ts
|
|
26876
|
-
import { defineCommand as
|
|
26771
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
26877
26772
|
registerSchema({
|
|
26878
26773
|
command: "testimonials.list",
|
|
26879
26774
|
description: "List testimonials with optional filters.",
|
|
@@ -26903,7 +26798,7 @@ registerSchema({
|
|
|
26903
26798
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
26904
26799
|
}
|
|
26905
26800
|
});
|
|
26906
|
-
var listCommand9 =
|
|
26801
|
+
var listCommand9 = defineCommand153({
|
|
26907
26802
|
meta: {
|
|
26908
26803
|
name: "list",
|
|
26909
26804
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -26952,7 +26847,7 @@ var listCommand9 = defineCommand154({
|
|
|
26952
26847
|
});
|
|
26953
26848
|
|
|
26954
26849
|
// src/commands/testimonials/search.ts
|
|
26955
|
-
import { defineCommand as
|
|
26850
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
26956
26851
|
registerSchema({
|
|
26957
26852
|
command: "testimonials.search",
|
|
26958
26853
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -26983,7 +26878,7 @@ registerSchema({
|
|
|
26983
26878
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
26984
26879
|
}
|
|
26985
26880
|
});
|
|
26986
|
-
var searchCommand2 =
|
|
26881
|
+
var searchCommand2 = defineCommand154({
|
|
26987
26882
|
meta: {
|
|
26988
26883
|
name: "search",
|
|
26989
26884
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -27057,7 +26952,7 @@ var searchCommand2 = defineCommand155({
|
|
|
27057
26952
|
var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
27058
26953
|
|
|
27059
26954
|
// src/commands/testimonials/index.ts
|
|
27060
|
-
var testimonialsCommand =
|
|
26955
|
+
var testimonialsCommand = defineCommand155({
|
|
27061
26956
|
meta: {
|
|
27062
26957
|
name: "testimonials",
|
|
27063
26958
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -27078,10 +26973,10 @@ Examples:
|
|
|
27078
26973
|
});
|
|
27079
26974
|
|
|
27080
26975
|
// src/commands/videos/index.ts
|
|
27081
|
-
import { defineCommand as
|
|
26976
|
+
import { defineCommand as defineCommand160 } from "citty";
|
|
27082
26977
|
|
|
27083
26978
|
// src/commands/videos/delete.ts
|
|
27084
|
-
import { defineCommand as
|
|
26979
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
27085
26980
|
registerSchema({
|
|
27086
26981
|
command: "videos.delete",
|
|
27087
26982
|
description: "Delete a video by ID",
|
|
@@ -27095,7 +26990,7 @@ registerSchema({
|
|
|
27095
26990
|
}
|
|
27096
26991
|
}
|
|
27097
26992
|
});
|
|
27098
|
-
var deleteCommand3 =
|
|
26993
|
+
var deleteCommand3 = defineCommand156({
|
|
27099
26994
|
meta: {
|
|
27100
26995
|
name: "delete",
|
|
27101
26996
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -27136,7 +27031,7 @@ var deleteCommand3 = defineCommand157({
|
|
|
27136
27031
|
});
|
|
27137
27032
|
|
|
27138
27033
|
// src/commands/videos/get.ts
|
|
27139
|
-
import { defineCommand as
|
|
27034
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
27140
27035
|
registerSchema({
|
|
27141
27036
|
command: "videos.get",
|
|
27142
27037
|
description: "Get a single video by ID",
|
|
@@ -27144,7 +27039,7 @@ registerSchema({
|
|
|
27144
27039
|
id: { type: "string", description: "Video ID", required: true }
|
|
27145
27040
|
}
|
|
27146
27041
|
});
|
|
27147
|
-
var getCommand5 =
|
|
27042
|
+
var getCommand5 = defineCommand157({
|
|
27148
27043
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
27149
27044
|
args: {
|
|
27150
27045
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -27181,7 +27076,7 @@ var getCommand5 = defineCommand158({
|
|
|
27181
27076
|
});
|
|
27182
27077
|
|
|
27183
27078
|
// src/commands/videos/search.ts
|
|
27184
|
-
import { defineCommand as
|
|
27079
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
27185
27080
|
registerSchema({
|
|
27186
27081
|
command: "videos.search",
|
|
27187
27082
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -27191,7 +27086,7 @@ registerSchema({
|
|
|
27191
27086
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
27192
27087
|
}
|
|
27193
27088
|
});
|
|
27194
|
-
var searchCommand3 =
|
|
27089
|
+
var searchCommand3 = defineCommand158({
|
|
27195
27090
|
meta: {
|
|
27196
27091
|
name: "search",
|
|
27197
27092
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -27243,7 +27138,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
27243
27138
|
// src/commands/videos/upload.ts
|
|
27244
27139
|
import { readFile as readFile20, stat as stat5 } from "fs/promises";
|
|
27245
27140
|
import { extname as extname3 } from "path";
|
|
27246
|
-
import { defineCommand as
|
|
27141
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
27247
27142
|
var MIME_MAP = {
|
|
27248
27143
|
".mp4": "video/mp4",
|
|
27249
27144
|
".mov": "video/quicktime",
|
|
@@ -27277,7 +27172,7 @@ function detectContentType(filePath) {
|
|
|
27277
27172
|
}
|
|
27278
27173
|
return mime;
|
|
27279
27174
|
}
|
|
27280
|
-
var uploadCommand2 =
|
|
27175
|
+
var uploadCommand2 = defineCommand159({
|
|
27281
27176
|
meta: {
|
|
27282
27177
|
name: "upload",
|
|
27283
27178
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -27331,7 +27226,7 @@ var uploadCommand2 = defineCommand160({
|
|
|
27331
27226
|
});
|
|
27332
27227
|
|
|
27333
27228
|
// src/commands/videos/index.ts
|
|
27334
|
-
var videosCommand =
|
|
27229
|
+
var videosCommand = defineCommand160({
|
|
27335
27230
|
meta: {
|
|
27336
27231
|
name: "videos",
|
|
27337
27232
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -27354,10 +27249,28 @@ Examples:
|
|
|
27354
27249
|
});
|
|
27355
27250
|
|
|
27356
27251
|
// src/commands/winning-ads/index.ts
|
|
27357
|
-
import { defineCommand as
|
|
27252
|
+
import { defineCommand as defineCommand170 } from "citty";
|
|
27253
|
+
|
|
27254
|
+
// src/commands/winning-ads/advertisers.ts
|
|
27255
|
+
import { defineCommand as defineCommand161 } from "citty";
|
|
27256
|
+
|
|
27257
|
+
// src/commands/winning-ads/shared.ts
|
|
27258
|
+
function splitList(value) {
|
|
27259
|
+
if (!value) {
|
|
27260
|
+
return [];
|
|
27261
|
+
}
|
|
27262
|
+
return value.split(",").map((v) => v.trim()).filter(Boolean);
|
|
27263
|
+
}
|
|
27264
|
+
function reportError(err) {
|
|
27265
|
+
if (err instanceof ApiError) {
|
|
27266
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
27267
|
+
process.exit(1);
|
|
27268
|
+
}
|
|
27269
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
27270
|
+
process.exit(1);
|
|
27271
|
+
}
|
|
27358
27272
|
|
|
27359
27273
|
// src/commands/winning-ads/advertisers.ts
|
|
27360
|
-
import { defineCommand as defineCommand162 } from "citty";
|
|
27361
27274
|
registerSchema({
|
|
27362
27275
|
command: "winning-ads.advertisers",
|
|
27363
27276
|
description: "List brands in the shared ad-dna corpus by name or domain. Use it to find your OWN advertiser (to --exclude-advertiser on search) or a competitor (to --advertiser-id on search / winners).",
|
|
@@ -27392,7 +27305,7 @@ function advertiserNormalizer(record, full) {
|
|
|
27392
27305
|
last_synced_at: record.last_synced_at ?? null
|
|
27393
27306
|
};
|
|
27394
27307
|
}
|
|
27395
|
-
var advertisersCommand2 =
|
|
27308
|
+
var advertisersCommand2 = defineCommand161({
|
|
27396
27309
|
meta: {
|
|
27397
27310
|
name: "advertisers",
|
|
27398
27311
|
description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -27450,7 +27363,7 @@ var advertisersCommand2 = defineCommand162({
|
|
|
27450
27363
|
});
|
|
27451
27364
|
|
|
27452
27365
|
// src/commands/winning-ads/brief.ts
|
|
27453
|
-
import { defineCommand as
|
|
27366
|
+
import { defineCommand as defineCommand162 } from "citty";
|
|
27454
27367
|
registerSchema({
|
|
27455
27368
|
command: "winning-ads.brief",
|
|
27456
27369
|
description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
|
|
@@ -27496,7 +27409,7 @@ function parseDna(raw) {
|
|
|
27496
27409
|
}
|
|
27497
27410
|
return parsed;
|
|
27498
27411
|
}
|
|
27499
|
-
var briefCommand =
|
|
27412
|
+
var briefCommand = defineCommand162({
|
|
27500
27413
|
meta: {
|
|
27501
27414
|
name: "brief",
|
|
27502
27415
|
description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
|
|
@@ -27532,7 +27445,7 @@ var briefCommand = defineCommand163({
|
|
|
27532
27445
|
});
|
|
27533
27446
|
|
|
27534
27447
|
// src/commands/winning-ads/follow.ts
|
|
27535
|
-
import { defineCommand as
|
|
27448
|
+
import { defineCommand as defineCommand163 } from "citty";
|
|
27536
27449
|
var PLATFORMS = ["meta", "linkedin"];
|
|
27537
27450
|
registerSchema({
|
|
27538
27451
|
command: "winning-ads.follow",
|
|
@@ -27547,7 +27460,7 @@ registerSchema({
|
|
|
27547
27460
|
label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
|
|
27548
27461
|
}
|
|
27549
27462
|
});
|
|
27550
|
-
var followCommand =
|
|
27463
|
+
var followCommand = defineCommand163({
|
|
27551
27464
|
meta: {
|
|
27552
27465
|
name: "follow",
|
|
27553
27466
|
description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
|
|
@@ -27594,7 +27507,7 @@ var followCommand = defineCommand164({
|
|
|
27594
27507
|
});
|
|
27595
27508
|
|
|
27596
27509
|
// src/commands/winning-ads/following.ts
|
|
27597
|
-
import { defineCommand as
|
|
27510
|
+
import { defineCommand as defineCommand164 } from "citty";
|
|
27598
27511
|
registerSchema({
|
|
27599
27512
|
command: "winning-ads.following",
|
|
27600
27513
|
description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
|
|
@@ -27627,7 +27540,7 @@ function followingNormalizer(record, full) {
|
|
|
27627
27540
|
platforms: Array.isArray(record.platforms) ? record.platforms : []
|
|
27628
27541
|
};
|
|
27629
27542
|
}
|
|
27630
|
-
var followingCommand =
|
|
27543
|
+
var followingCommand = defineCommand164({
|
|
27631
27544
|
meta: {
|
|
27632
27545
|
name: "following",
|
|
27633
27546
|
description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
|
|
@@ -27662,7 +27575,7 @@ var followingCommand = defineCommand165({
|
|
|
27662
27575
|
});
|
|
27663
27576
|
|
|
27664
27577
|
// src/commands/winning-ads/patterns.ts
|
|
27665
|
-
import { defineCommand as
|
|
27578
|
+
import { defineCommand as defineCommand165 } from "citty";
|
|
27666
27579
|
registerSchema({
|
|
27667
27580
|
command: "winning-ads.patterns",
|
|
27668
27581
|
description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
|
|
@@ -27701,7 +27614,7 @@ function discriminatorRow(record) {
|
|
|
27701
27614
|
top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
|
|
27702
27615
|
};
|
|
27703
27616
|
}
|
|
27704
|
-
var patternsCommand =
|
|
27617
|
+
var patternsCommand = defineCommand165({
|
|
27705
27618
|
meta: {
|
|
27706
27619
|
name: "patterns",
|
|
27707
27620
|
description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
|
|
@@ -27757,7 +27670,7 @@ var patternsCommand = defineCommand166({
|
|
|
27757
27670
|
});
|
|
27758
27671
|
|
|
27759
27672
|
// src/commands/winning-ads/search.ts
|
|
27760
|
-
import { defineCommand as
|
|
27673
|
+
import { defineCommand as defineCommand166 } from "citty";
|
|
27761
27674
|
registerSchema({
|
|
27762
27675
|
command: "winning-ads.search",
|
|
27763
27676
|
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.",
|
|
@@ -27865,7 +27778,7 @@ function buildSearchBody(args) {
|
|
|
27865
27778
|
}
|
|
27866
27779
|
return body;
|
|
27867
27780
|
}
|
|
27868
|
-
var searchCommand4 =
|
|
27781
|
+
var searchCommand4 = defineCommand166({
|
|
27869
27782
|
meta: {
|
|
27870
27783
|
name: "search",
|
|
27871
27784
|
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"
|
|
@@ -27980,7 +27893,7 @@ var searchCommand4 = defineCommand167({
|
|
|
27980
27893
|
});
|
|
27981
27894
|
|
|
27982
27895
|
// src/commands/winning-ads/seeds.ts
|
|
27983
|
-
import { defineCommand as
|
|
27896
|
+
import { defineCommand as defineCommand167 } from "citty";
|
|
27984
27897
|
function leanRow(r) {
|
|
27985
27898
|
return {
|
|
27986
27899
|
key: r.key,
|
|
@@ -28008,7 +27921,7 @@ function makeSeedCommand(opts) {
|
|
|
28008
27921
|
limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
|
|
28009
27922
|
}
|
|
28010
27923
|
});
|
|
28011
|
-
return
|
|
27924
|
+
return defineCommand167({
|
|
28012
27925
|
meta: { name: opts.name, description: opts.description },
|
|
28013
27926
|
args: {
|
|
28014
27927
|
platform: { type: "string", description: "Single platform to segment on", required: false },
|
|
@@ -28057,7 +27970,7 @@ var formatsCommand = makeSeedCommand({
|
|
|
28057
27970
|
});
|
|
28058
27971
|
|
|
28059
27972
|
// src/commands/winning-ads/unfollow.ts
|
|
28060
|
-
import { defineCommand as
|
|
27973
|
+
import { defineCommand as defineCommand168 } from "citty";
|
|
28061
27974
|
registerSchema({
|
|
28062
27975
|
command: "winning-ads.unfollow",
|
|
28063
27976
|
description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
|
|
@@ -28065,7 +27978,7 @@ registerSchema({
|
|
|
28065
27978
|
advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
|
|
28066
27979
|
}
|
|
28067
27980
|
});
|
|
28068
|
-
var unfollowCommand =
|
|
27981
|
+
var unfollowCommand = defineCommand168({
|
|
28069
27982
|
meta: {
|
|
28070
27983
|
name: "unfollow",
|
|
28071
27984
|
description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
|
|
@@ -28086,7 +27999,7 @@ var unfollowCommand = defineCommand169({
|
|
|
28086
27999
|
});
|
|
28087
28000
|
|
|
28088
28001
|
// src/commands/winning-ads/winners.ts
|
|
28089
|
-
import { defineCommand as
|
|
28002
|
+
import { defineCommand as defineCommand169 } from "citty";
|
|
28090
28003
|
registerSchema({
|
|
28091
28004
|
command: "winning-ads.winners",
|
|
28092
28005
|
description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
|
|
@@ -28096,7 +28009,7 @@ registerSchema({
|
|
|
28096
28009
|
platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
|
|
28097
28010
|
}
|
|
28098
28011
|
});
|
|
28099
|
-
var winnersCommand =
|
|
28012
|
+
var winnersCommand = defineCommand169({
|
|
28100
28013
|
meta: {
|
|
28101
28014
|
name: "winners",
|
|
28102
28015
|
description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
|
|
@@ -28146,7 +28059,7 @@ var winnersCommand = defineCommand170({
|
|
|
28146
28059
|
});
|
|
28147
28060
|
|
|
28148
28061
|
// src/commands/winning-ads/index.ts
|
|
28149
|
-
var winningAdsCommand =
|
|
28062
|
+
var winningAdsCommand = defineCommand170({
|
|
28150
28063
|
meta: {
|
|
28151
28064
|
name: "winning-ads",
|
|
28152
28065
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -28207,7 +28120,7 @@ function getCliVersion() {
|
|
|
28207
28120
|
}
|
|
28208
28121
|
|
|
28209
28122
|
// src/cli.ts
|
|
28210
|
-
var main =
|
|
28123
|
+
var main = defineCommand171({
|
|
28211
28124
|
meta: {
|
|
28212
28125
|
name: "baker",
|
|
28213
28126
|
version: getCliVersion(),
|
|
@@ -28223,7 +28136,6 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
28223
28136
|
actions: actionsCommand,
|
|
28224
28137
|
"scheduled-actions": scheduledActionsCommand,
|
|
28225
28138
|
ads: adsCommand2,
|
|
28226
|
-
analytics: analyticsCommand2,
|
|
28227
28139
|
ga4: ga4Command,
|
|
28228
28140
|
gsc: gscCommand,
|
|
28229
28141
|
research: researchCommand,
|