@koda-sl/baker-cli 0.135.1-dev.46c403ad4 → 0.135.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 +0 -22
- package/dist/{chunk-GKL4CUCC.js → chunk-CIF62V7L.js} +4 -4
- package/dist/chunk-CIF62V7L.js.map +1 -0
- package/dist/cli.js +1295 -1703
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GKL4CUCC.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
toModelSafeImage,
|
|
35
35
|
ulid,
|
|
36
36
|
validateCanvasDeep
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-CIF62V7L.js";
|
|
38
38
|
import {
|
|
39
39
|
csvOrJson,
|
|
40
40
|
daysAgoIso,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
} from "./chunk-RK67WL4O.js";
|
|
74
74
|
|
|
75
75
|
// src/cli.ts
|
|
76
|
-
import { defineCommand as
|
|
76
|
+
import { defineCommand as defineCommand173, runMain } from "citty";
|
|
77
77
|
|
|
78
78
|
// src/commands/actions/index.ts
|
|
79
79
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -1928,207 +1928,8 @@ var linkedinDraftErrorResponseSchema = z4.object({
|
|
|
1928
1928
|
fields: z4.array(linkedinFieldErrorSchema).optional()
|
|
1929
1929
|
});
|
|
1930
1930
|
|
|
1931
|
-
// ../api/src/chats.ts
|
|
1932
|
-
import { z as z5 } from "zod";
|
|
1933
|
-
var chatInspectStatusSchema = z5.enum([
|
|
1934
|
-
"draft",
|
|
1935
|
-
"in_progress",
|
|
1936
|
-
"publishing",
|
|
1937
|
-
"publish_failed",
|
|
1938
|
-
"completed",
|
|
1939
|
-
"discarded"
|
|
1940
|
-
]);
|
|
1941
|
-
var chatStatusGroupSchema = z5.enum(["active", "archived", "all"]);
|
|
1942
|
-
var chatChangeTypeSchema = z5.enum([
|
|
1943
|
-
"landing",
|
|
1944
|
-
"document",
|
|
1945
|
-
"knowledge",
|
|
1946
|
-
"brand",
|
|
1947
|
-
"company",
|
|
1948
|
-
"flow",
|
|
1949
|
-
"action",
|
|
1950
|
-
"creative",
|
|
1951
|
-
"tags",
|
|
1952
|
-
"report",
|
|
1953
|
-
"linkedin-ads",
|
|
1954
|
-
"google-ads",
|
|
1955
|
-
"meta-ads",
|
|
1956
|
-
"briefs"
|
|
1957
|
-
]);
|
|
1958
|
-
var chatChangeActionSchema = z5.enum(["created", "updated", "deleted"]);
|
|
1959
|
-
var chatChangeSummarySchema = z5.object({
|
|
1960
|
-
type: chatChangeTypeSchema,
|
|
1961
|
-
slug: z5.string(),
|
|
1962
|
-
action: chatChangeActionSchema,
|
|
1963
|
-
title: z5.string().optional()
|
|
1964
|
-
});
|
|
1965
|
-
var repoSurfaceSchema = z5.enum(["knowledge", "company", "brand", "landings", "flows", "creatives"]);
|
|
1966
|
-
var chatsListRequestSchema = z5.object({
|
|
1967
|
-
status: chatStatusGroupSchema.optional(),
|
|
1968
|
-
limit: z5.number().int().min(1).max(100).optional(),
|
|
1969
|
-
/** Include each Session's full `changes[]` list (compact returns counts only). */
|
|
1970
|
-
full: z5.boolean().optional()
|
|
1971
|
-
});
|
|
1972
|
-
var chatSummarySchema = z5.object({
|
|
1973
|
-
id: z5.string(),
|
|
1974
|
-
title: z5.string(),
|
|
1975
|
-
status: chatInspectStatusSchema,
|
|
1976
|
-
createdAt: z5.number(),
|
|
1977
|
-
updatedAt: z5.number(),
|
|
1978
|
-
/** Counts of produced outputs keyed by change type. */
|
|
1979
|
-
outputs: z5.record(z5.string(), z5.number()),
|
|
1980
|
-
outputTotal: z5.number(),
|
|
1981
|
-
changes: z5.array(chatChangeSummarySchema).optional()
|
|
1982
|
-
});
|
|
1983
|
-
var chatsListResponseSchema = z5.object({
|
|
1984
|
-
ok: z5.literal(true),
|
|
1985
|
-
data: z5.object({ chats: z5.array(chatSummarySchema) })
|
|
1986
|
-
});
|
|
1987
|
-
var chatsViewRequestSchema = z5.object({
|
|
1988
|
-
chatId: z5.string(),
|
|
1989
|
-
full: z5.boolean().optional()
|
|
1990
|
-
});
|
|
1991
|
-
var chatThreadSummarySchema = z5.object({
|
|
1992
|
-
id: z5.string(),
|
|
1993
|
-
title: z5.string().nullable(),
|
|
1994
|
-
status: z5.string(),
|
|
1995
|
-
createdAt: z5.number()
|
|
1996
|
-
});
|
|
1997
|
-
var chatCommitSummarySchema = z5.object({
|
|
1998
|
-
sha: z5.string(),
|
|
1999
|
-
message: z5.string().nullable(),
|
|
2000
|
-
surfaces: z5.array(z5.string()),
|
|
2001
|
-
createdAt: z5.number()
|
|
2002
|
-
});
|
|
2003
|
-
var effectOpSchema = z5.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
|
|
2004
|
-
var contentEffectSchema = z5.object({
|
|
2005
|
-
surface: chatChangeTypeSchema,
|
|
2006
|
-
slug: z5.string(),
|
|
2007
|
-
op: effectOpSchema,
|
|
2008
|
-
staged: z5.boolean()
|
|
2009
|
-
});
|
|
2010
|
-
var actionEffectSchema = z5.object({
|
|
2011
|
-
op: effectOpSchema,
|
|
2012
|
-
staged: z5.boolean(),
|
|
2013
|
-
name: z5.string(),
|
|
2014
|
-
description: z5.string().nullable(),
|
|
2015
|
-
priority: z5.string().nullable(),
|
|
2016
|
-
tags: z5.array(z5.string()),
|
|
2017
|
-
status: z5.string().nullable(),
|
|
2018
|
-
note: z5.string().nullable(),
|
|
2019
|
-
reason: z5.string().nullable()
|
|
2020
|
-
});
|
|
2021
|
-
var scheduledEffectSchema = z5.object({
|
|
2022
|
-
op: effectOpSchema,
|
|
2023
|
-
staged: z5.boolean(),
|
|
2024
|
-
name: z5.string(),
|
|
2025
|
-
summary: z5.string().nullable()
|
|
2026
|
-
});
|
|
2027
|
-
var tagEffectSchema = z5.object({
|
|
2028
|
-
op: effectOpSchema,
|
|
2029
|
-
staged: z5.boolean(),
|
|
2030
|
-
tagType: z5.string(),
|
|
2031
|
-
title: z5.string().nullable(),
|
|
2032
|
-
summary: z5.string().nullable(),
|
|
2033
|
-
configKeys: z5.array(z5.string()),
|
|
2034
|
-
hasSecrets: z5.boolean()
|
|
2035
|
-
});
|
|
2036
|
-
var adEffectSchema = z5.object({
|
|
2037
|
-
platform: z5.enum(["google", "meta", "linkedin"]),
|
|
2038
|
-
op: effectOpSchema,
|
|
2039
|
-
staged: z5.boolean(),
|
|
2040
|
-
entity: z5.string().nullable(),
|
|
2041
|
-
operation: z5.string().nullable(),
|
|
2042
|
-
summary: z5.string().nullable()
|
|
2043
|
-
});
|
|
2044
|
-
var creativeEffectSchema = z5.object({
|
|
2045
|
-
op: effectOpSchema,
|
|
2046
|
-
staged: z5.boolean(),
|
|
2047
|
-
slug: z5.string(),
|
|
2048
|
-
title: z5.string().nullable(),
|
|
2049
|
-
status: z5.string().nullable()
|
|
2050
|
-
});
|
|
2051
|
-
var chatEffectsSchema = z5.object({
|
|
2052
|
-
content: z5.array(contentEffectSchema),
|
|
2053
|
-
actions: z5.array(actionEffectSchema),
|
|
2054
|
-
scheduledActions: z5.array(scheduledEffectSchema),
|
|
2055
|
-
tags: z5.array(tagEffectSchema),
|
|
2056
|
-
ads: z5.object({
|
|
2057
|
-
google: z5.array(adEffectSchema),
|
|
2058
|
-
meta: z5.array(adEffectSchema),
|
|
2059
|
-
linkedin: z5.array(adEffectSchema)
|
|
2060
|
-
}),
|
|
2061
|
-
creatives: z5.array(creativeEffectSchema)
|
|
2062
|
-
});
|
|
2063
|
-
var chatDetailSchema = z5.object({
|
|
2064
|
-
id: z5.string(),
|
|
2065
|
-
title: z5.string(),
|
|
2066
|
-
status: chatInspectStatusSchema,
|
|
2067
|
-
createdAt: z5.number(),
|
|
2068
|
-
updatedAt: z5.number(),
|
|
2069
|
-
completedBySource: z5.enum(["user", "bridge"]).nullable(),
|
|
2070
|
-
publishedAt: z5.number().nullable(),
|
|
2071
|
-
/** The first user message — how this Session was originally asked. */
|
|
2072
|
-
kickoff: z5.string().nullable(),
|
|
2073
|
-
outputs: z5.record(z5.string(), z5.number()),
|
|
2074
|
-
outputTotal: z5.number(),
|
|
2075
|
-
/** The unified picture of everything this Session changed — git + DB. */
|
|
2076
|
-
effects: chatEffectsSchema,
|
|
2077
|
-
threads: z5.array(chatThreadSummarySchema),
|
|
2078
|
-
commits: z5.array(chatCommitSummarySchema),
|
|
2079
|
-
/** True when a real file-level diff is available via `baker chats diff`. */
|
|
2080
|
-
diffAvailable: z5.boolean()
|
|
2081
|
-
});
|
|
2082
|
-
var chatsViewResponseSchema = z5.object({
|
|
2083
|
-
ok: z5.literal(true),
|
|
2084
|
-
data: chatDetailSchema
|
|
2085
|
-
});
|
|
2086
|
-
var chatsTranscriptRequestSchema = z5.object({
|
|
2087
|
-
chatId: z5.string(),
|
|
2088
|
-
limit: z5.number().int().min(1).max(1e3).optional(),
|
|
2089
|
-
/** Return untruncated message text (compact truncates each entry). */
|
|
2090
|
-
full: z5.boolean().optional()
|
|
2091
|
-
});
|
|
2092
|
-
var transcriptEntrySchema = z5.object({
|
|
2093
|
-
role: z5.string(),
|
|
2094
|
-
text: z5.string()
|
|
2095
|
-
});
|
|
2096
|
-
var chatsTranscriptResponseSchema = z5.object({
|
|
2097
|
-
ok: z5.literal(true),
|
|
2098
|
-
data: z5.object({
|
|
2099
|
-
chatId: z5.string(),
|
|
2100
|
-
entries: z5.array(transcriptEntrySchema),
|
|
2101
|
-
/** True when older entries were dropped to fit `limit`. */
|
|
2102
|
-
truncated: z5.boolean()
|
|
2103
|
-
})
|
|
2104
|
-
});
|
|
2105
|
-
var chatsDiffRequestSchema = z5.object({
|
|
2106
|
-
chatId: z5.string(),
|
|
2107
|
-
surface: repoSurfaceSchema.optional(),
|
|
2108
|
-
/** Include the unified-diff `patch` text per file (compact omits it). */
|
|
2109
|
-
full: z5.boolean().optional()
|
|
2110
|
-
});
|
|
2111
|
-
var diffFileSchema = z5.object({
|
|
2112
|
-
path: z5.string(),
|
|
2113
|
-
surface: repoSurfaceSchema.nullable(),
|
|
2114
|
-
status: z5.string(),
|
|
2115
|
-
additions: z5.number(),
|
|
2116
|
-
deletions: z5.number(),
|
|
2117
|
-
patch: z5.string().optional()
|
|
2118
|
-
});
|
|
2119
|
-
var chatsDiffResponseSchema = z5.object({
|
|
2120
|
-
ok: z5.literal(true),
|
|
2121
|
-
data: z5.object({
|
|
2122
|
-
chatId: z5.string(),
|
|
2123
|
-
/** False when no published git diff exists (in-progress Session or unlinked repo). */
|
|
2124
|
-
available: z5.boolean(),
|
|
2125
|
-
reason: z5.string().optional(),
|
|
2126
|
-
files: z5.array(diffFileSchema)
|
|
2127
|
-
})
|
|
2128
|
-
});
|
|
2129
|
-
|
|
2130
1931
|
// ../api/src/flows.ts
|
|
2131
|
-
import { z as
|
|
1932
|
+
import { z as z5 } from "zod";
|
|
2132
1933
|
var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
2133
1934
|
"email",
|
|
2134
1935
|
"zapier",
|
|
@@ -2139,7 +1940,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
|
2139
1940
|
"crmble",
|
|
2140
1941
|
"goHighlevelContact"
|
|
2141
1942
|
];
|
|
2142
|
-
var flowSideEffectTypeSchema =
|
|
1943
|
+
var flowSideEffectTypeSchema = z5.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
|
|
2143
1944
|
var FLOW_SECRET_FIELDS = {
|
|
2144
1945
|
email: [],
|
|
2145
1946
|
zapier: ["zapUrl"],
|
|
@@ -2167,94 +1968,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
|
|
|
2167
1968
|
"highlevel",
|
|
2168
1969
|
"highlevelForm"
|
|
2169
1970
|
];
|
|
2170
|
-
var flowResourceNodeTypeSchema =
|
|
2171
|
-
var flowInputRequestSchema =
|
|
2172
|
-
|
|
1971
|
+
var flowResourceNodeTypeSchema = z5.enum(FLOW_RESOURCE_NODE_TYPES);
|
|
1972
|
+
var flowInputRequestSchema = z5.discriminatedUnion("target", [
|
|
1973
|
+
z5.object({
|
|
2173
1974
|
/** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
|
|
2174
|
-
target:
|
|
2175
|
-
flowSlug:
|
|
1975
|
+
target: z5.literal("sideEffect"),
|
|
1976
|
+
flowSlug: z5.string(),
|
|
2176
1977
|
/** `id` of the FlowNode holding the side effect. */
|
|
2177
|
-
nodeId:
|
|
1978
|
+
nodeId: z5.string(),
|
|
2178
1979
|
/** `id` of the side effect within that node's `sideEffects[]`. */
|
|
2179
|
-
sideEffectId:
|
|
1980
|
+
sideEffectId: z5.string(),
|
|
2180
1981
|
sideEffectType: flowSideEffectTypeSchema,
|
|
2181
1982
|
/** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
|
|
2182
|
-
prefilledConfig:
|
|
1983
|
+
prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
|
|
2183
1984
|
/** Secret credential field names the agent asks the user to provide. */
|
|
2184
|
-
requestedSecretFields:
|
|
2185
|
-
message:
|
|
1985
|
+
requestedSecretFields: z5.array(z5.string()).optional(),
|
|
1986
|
+
message: z5.string().optional()
|
|
2186
1987
|
}),
|
|
2187
|
-
|
|
1988
|
+
z5.object({
|
|
2188
1989
|
/** Configure a widget node's third-party `form.external` (+ `providerId`). */
|
|
2189
|
-
target:
|
|
2190
|
-
flowSlug:
|
|
1990
|
+
target: z5.literal("node"),
|
|
1991
|
+
flowSlug: z5.string(),
|
|
2191
1992
|
/** `id` of the widget FlowNode. */
|
|
2192
|
-
nodeId:
|
|
1993
|
+
nodeId: z5.string(),
|
|
2193
1994
|
nodeType: flowResourceNodeTypeSchema,
|
|
2194
|
-
message:
|
|
1995
|
+
message: z5.string().optional()
|
|
2195
1996
|
})
|
|
2196
1997
|
]);
|
|
2197
|
-
var flowInputToolInputSchema =
|
|
2198
|
-
requests:
|
|
1998
|
+
var flowInputToolInputSchema = z5.object({
|
|
1999
|
+
requests: z5.array(flowInputRequestSchema).min(1).max(8)
|
|
2199
2000
|
});
|
|
2200
|
-
var flowInputResultSchema =
|
|
2201
|
-
|
|
2202
|
-
status:
|
|
2001
|
+
var flowInputResultSchema = z5.discriminatedUnion("status", [
|
|
2002
|
+
z5.object({
|
|
2003
|
+
status: z5.literal("submitted"),
|
|
2203
2004
|
/** Echoes which piece this result resolves. */
|
|
2204
|
-
nodeId:
|
|
2205
|
-
sideEffectId:
|
|
2005
|
+
nodeId: z5.string(),
|
|
2006
|
+
sideEffectId: z5.string().optional(),
|
|
2206
2007
|
/** Names of secret fields the user provided. Never values. */
|
|
2207
|
-
secretFieldsSet:
|
|
2008
|
+
secretFieldsSet: z5.array(z5.string()),
|
|
2208
2009
|
/** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
|
|
2209
|
-
note:
|
|
2010
|
+
note: z5.string().optional()
|
|
2210
2011
|
}),
|
|
2211
|
-
|
|
2212
|
-
status:
|
|
2213
|
-
nodeId:
|
|
2214
|
-
sideEffectId:
|
|
2215
|
-
reason:
|
|
2012
|
+
z5.object({
|
|
2013
|
+
status: z5.literal("declined"),
|
|
2014
|
+
nodeId: z5.string(),
|
|
2015
|
+
sideEffectId: z5.string().optional(),
|
|
2016
|
+
reason: z5.string().optional()
|
|
2216
2017
|
})
|
|
2217
2018
|
]);
|
|
2218
|
-
var flowInputToolResultSchema =
|
|
2219
|
-
results:
|
|
2019
|
+
var flowInputToolResultSchema = z5.object({
|
|
2020
|
+
results: z5.array(flowInputResultSchema)
|
|
2220
2021
|
});
|
|
2221
|
-
var flowsListRequestSchema =
|
|
2222
|
-
var flowSummarySchema =
|
|
2223
|
-
slug:
|
|
2224
|
-
name:
|
|
2022
|
+
var flowsListRequestSchema = z5.object({ chatId: z5.string() });
|
|
2023
|
+
var flowSummarySchema = z5.object({
|
|
2024
|
+
slug: z5.string(),
|
|
2025
|
+
name: z5.string(),
|
|
2225
2026
|
/** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
|
|
2226
|
-
needsConfig:
|
|
2027
|
+
needsConfig: z5.number()
|
|
2227
2028
|
});
|
|
2228
|
-
var flowsListResponseSchema =
|
|
2229
|
-
var flowsShowRequestSchema =
|
|
2230
|
-
chatId:
|
|
2231
|
-
slug:
|
|
2232
|
-
full:
|
|
2029
|
+
var flowsListResponseSchema = z5.object({ flows: z5.array(flowSummarySchema) });
|
|
2030
|
+
var flowsShowRequestSchema = z5.object({
|
|
2031
|
+
chatId: z5.string(),
|
|
2032
|
+
slug: z5.string(),
|
|
2033
|
+
full: z5.boolean().optional()
|
|
2233
2034
|
});
|
|
2234
|
-
var flowConfigStatusSchema =
|
|
2235
|
-
nodeId:
|
|
2236
|
-
nodeName:
|
|
2035
|
+
var flowConfigStatusSchema = z5.object({
|
|
2036
|
+
nodeId: z5.string(),
|
|
2037
|
+
nodeName: z5.string().optional(),
|
|
2237
2038
|
/** "sideEffect" credential/connection, or "node" widget resource. */
|
|
2238
|
-
target:
|
|
2239
|
-
sideEffectId:
|
|
2240
|
-
kind:
|
|
2039
|
+
target: z5.enum(["sideEffect", "node"]),
|
|
2040
|
+
sideEffectId: z5.string().optional(),
|
|
2041
|
+
kind: z5.string(),
|
|
2241
2042
|
/** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
|
|
2242
|
-
status:
|
|
2043
|
+
status: z5.string(),
|
|
2243
2044
|
/** True when a `request_flow_input` call is still needed for this piece. */
|
|
2244
|
-
needsInput:
|
|
2045
|
+
needsInput: z5.boolean()
|
|
2245
2046
|
});
|
|
2246
|
-
var flowsShowResponseSchema =
|
|
2247
|
-
slug:
|
|
2248
|
-
name:
|
|
2047
|
+
var flowsShowResponseSchema = z5.object({
|
|
2048
|
+
slug: z5.string(),
|
|
2049
|
+
name: z5.string(),
|
|
2249
2050
|
/** Confidential fields and whether each is configured. */
|
|
2250
|
-
config:
|
|
2051
|
+
config: z5.array(flowConfigStatusSchema),
|
|
2251
2052
|
/** Present only with `--full`: the whole flow tree, secret values redacted. */
|
|
2252
|
-
tree:
|
|
2053
|
+
tree: z5.unknown().optional()
|
|
2253
2054
|
});
|
|
2254
2055
|
|
|
2255
2056
|
// ../api/src/history.ts
|
|
2256
|
-
import { z as
|
|
2257
|
-
var historyCategorySchema =
|
|
2057
|
+
import { z as z6 } from "zod";
|
|
2058
|
+
var historyCategorySchema = z6.enum([
|
|
2258
2059
|
"publish",
|
|
2259
2060
|
"chat",
|
|
2260
2061
|
"action",
|
|
@@ -2271,36 +2072,36 @@ var historyCategorySchema = z7.enum([
|
|
|
2271
2072
|
"domain",
|
|
2272
2073
|
"integration"
|
|
2273
2074
|
]);
|
|
2274
|
-
var historyListRequestSchema =
|
|
2275
|
-
limit:
|
|
2075
|
+
var historyListRequestSchema = z6.object({
|
|
2076
|
+
limit: z6.number().int().min(1).max(200).optional(),
|
|
2276
2077
|
category: historyCategorySchema.optional(),
|
|
2277
2078
|
/** Only entries from the last N days. */
|
|
2278
|
-
days:
|
|
2079
|
+
days: z6.number().int().min(1).max(365).optional(),
|
|
2279
2080
|
/** Include raw metadata on each entry (compact by default). */
|
|
2280
|
-
full:
|
|
2081
|
+
full: z6.boolean().optional()
|
|
2281
2082
|
});
|
|
2282
|
-
var historyEntrySchema =
|
|
2283
|
-
id:
|
|
2083
|
+
var historyEntrySchema = z6.object({
|
|
2084
|
+
id: z6.string(),
|
|
2284
2085
|
/** Epoch ms. */
|
|
2285
|
-
at:
|
|
2086
|
+
at: z6.number(),
|
|
2286
2087
|
category: historyCategorySchema,
|
|
2287
2088
|
/** Dotted action id, e.g. "publish.commit", "member.invite_create". */
|
|
2288
|
-
action:
|
|
2289
|
-
actorType:
|
|
2089
|
+
action: z6.string(),
|
|
2090
|
+
actorType: z6.enum(["user", "agent", "system"]),
|
|
2290
2091
|
/** Display name of the acting user, when the actor is a user. */
|
|
2291
|
-
actor:
|
|
2092
|
+
actor: z6.string().nullable(),
|
|
2292
2093
|
/** What the change touched — commit subject, chat title, member email, tag type, … */
|
|
2293
|
-
target:
|
|
2294
|
-
metadata:
|
|
2094
|
+
target: z6.string().nullable(),
|
|
2095
|
+
metadata: z6.record(z6.string(), z6.unknown()).optional()
|
|
2295
2096
|
});
|
|
2296
|
-
var historyListResponseSchema =
|
|
2297
|
-
ok:
|
|
2298
|
-
data:
|
|
2097
|
+
var historyListResponseSchema = z6.object({
|
|
2098
|
+
ok: z6.literal(true),
|
|
2099
|
+
data: z6.object({ entries: z6.array(historyEntrySchema) })
|
|
2299
2100
|
});
|
|
2300
2101
|
|
|
2301
2102
|
// ../api/src/images.ts
|
|
2302
|
-
import { z as
|
|
2303
|
-
var imageSourceSchema =
|
|
2103
|
+
import { z as z7 } from "zod";
|
|
2104
|
+
var imageSourceSchema = z7.enum([
|
|
2304
2105
|
"uploaded",
|
|
2305
2106
|
"website",
|
|
2306
2107
|
"google_testimonial",
|
|
@@ -2316,49 +2117,49 @@ var imageSourceSchema = z8.enum([
|
|
|
2316
2117
|
"pinterest",
|
|
2317
2118
|
"ai_generated"
|
|
2318
2119
|
]);
|
|
2319
|
-
var imageStatusSchema =
|
|
2320
|
-
var upscaleConfigSchema =
|
|
2321
|
-
model:
|
|
2322
|
-
input:
|
|
2323
|
-
scale_factor:
|
|
2324
|
-
creativity:
|
|
2325
|
-
output_format:
|
|
2120
|
+
var imageStatusSchema = z7.enum(["uploading", "processing", "ready", "error"]);
|
|
2121
|
+
var upscaleConfigSchema = z7.object({
|
|
2122
|
+
model: z7.literal("philz1337x/crystal-upscaler"),
|
|
2123
|
+
input: z7.object({
|
|
2124
|
+
scale_factor: z7.number(),
|
|
2125
|
+
creativity: z7.number(),
|
|
2126
|
+
output_format: z7.string()
|
|
2326
2127
|
}),
|
|
2327
|
-
status:
|
|
2128
|
+
status: z7.enum(["pending", "completed"])
|
|
2328
2129
|
});
|
|
2329
|
-
var imageDocSchema =
|
|
2330
|
-
_id:
|
|
2331
|
-
_creationTime:
|
|
2332
|
-
companyId:
|
|
2333
|
-
storageKey:
|
|
2130
|
+
var imageDocSchema = z7.object({
|
|
2131
|
+
_id: z7.string(),
|
|
2132
|
+
_creationTime: z7.number(),
|
|
2133
|
+
companyId: z7.string(),
|
|
2134
|
+
storageKey: z7.string(),
|
|
2334
2135
|
upscaleConfig: upscaleConfigSchema.optional(),
|
|
2335
|
-
upscaledStorageKey:
|
|
2336
|
-
name:
|
|
2337
|
-
description:
|
|
2338
|
-
tags:
|
|
2339
|
-
source:
|
|
2340
|
-
externalId:
|
|
2341
|
-
externalUrl:
|
|
2342
|
-
contentHash:
|
|
2343
|
-
sourceId:
|
|
2344
|
-
descriptionContext:
|
|
2345
|
-
width:
|
|
2346
|
-
height:
|
|
2347
|
-
aspectRatio:
|
|
2348
|
-
dominantColor:
|
|
2349
|
-
imagePalette:
|
|
2350
|
-
thumbhashDataUri:
|
|
2351
|
-
isLightImage:
|
|
2352
|
-
descriptionEmbedding:
|
|
2353
|
-
imageEmbedding:
|
|
2354
|
-
searchText:
|
|
2136
|
+
upscaledStorageKey: z7.string().optional(),
|
|
2137
|
+
name: z7.string(),
|
|
2138
|
+
description: z7.string(),
|
|
2139
|
+
tags: z7.array(z7.string()),
|
|
2140
|
+
source: z7.string(),
|
|
2141
|
+
externalId: z7.string().optional(),
|
|
2142
|
+
externalUrl: z7.string().optional(),
|
|
2143
|
+
contentHash: z7.string().optional(),
|
|
2144
|
+
sourceId: z7.string().optional(),
|
|
2145
|
+
descriptionContext: z7.string().optional(),
|
|
2146
|
+
width: z7.number().optional(),
|
|
2147
|
+
height: z7.number().optional(),
|
|
2148
|
+
aspectRatio: z7.number().optional(),
|
|
2149
|
+
dominantColor: z7.string().optional(),
|
|
2150
|
+
imagePalette: z7.array(z7.string()).optional(),
|
|
2151
|
+
thumbhashDataUri: z7.string().optional(),
|
|
2152
|
+
isLightImage: z7.boolean().optional(),
|
|
2153
|
+
descriptionEmbedding: z7.array(z7.number()).optional(),
|
|
2154
|
+
imageEmbedding: z7.array(z7.number()).optional(),
|
|
2155
|
+
searchText: z7.string().optional(),
|
|
2355
2156
|
status: imageStatusSchema,
|
|
2356
|
-
errorMessage:
|
|
2357
|
-
createdAt:
|
|
2358
|
-
updatedAt:
|
|
2359
|
-
imageUrl:
|
|
2157
|
+
errorMessage: z7.string().optional(),
|
|
2158
|
+
createdAt: z7.number(),
|
|
2159
|
+
updatedAt: z7.number(),
|
|
2160
|
+
imageUrl: z7.string()
|
|
2360
2161
|
});
|
|
2361
|
-
var imageHitSourceSchema =
|
|
2162
|
+
var imageHitSourceSchema = z7.enum([
|
|
2362
2163
|
"library",
|
|
2363
2164
|
"magnific",
|
|
2364
2165
|
"google_images",
|
|
@@ -2369,242 +2170,242 @@ var imageHitSourceSchema = z8.enum([
|
|
|
2369
2170
|
"giphy",
|
|
2370
2171
|
"pinterest"
|
|
2371
2172
|
]);
|
|
2372
|
-
var imageHitSchema =
|
|
2173
|
+
var imageHitSchema = z7.object({
|
|
2373
2174
|
source: imageHitSourceSchema,
|
|
2374
|
-
url:
|
|
2375
|
-
thumbnailUrl:
|
|
2376
|
-
width:
|
|
2377
|
-
height:
|
|
2378
|
-
aspectRatio:
|
|
2379
|
-
dominantColor:
|
|
2380
|
-
externalId:
|
|
2381
|
-
externalUrl:
|
|
2382
|
-
providerMeta:
|
|
2383
|
-
descriptionContext:
|
|
2384
|
-
_id:
|
|
2385
|
-
name:
|
|
2386
|
-
description:
|
|
2387
|
-
tags:
|
|
2388
|
-
score:
|
|
2389
|
-
alsoInLibrary:
|
|
2390
|
-
prefetchedBytes:
|
|
2391
|
-
prefetchedContentType:
|
|
2175
|
+
url: z7.string(),
|
|
2176
|
+
thumbnailUrl: z7.string().optional(),
|
|
2177
|
+
width: z7.number().optional(),
|
|
2178
|
+
height: z7.number().optional(),
|
|
2179
|
+
aspectRatio: z7.number().optional(),
|
|
2180
|
+
dominantColor: z7.string().optional(),
|
|
2181
|
+
externalId: z7.string().optional(),
|
|
2182
|
+
externalUrl: z7.string().optional(),
|
|
2183
|
+
providerMeta: z7.record(z7.string(), z7.unknown()).optional(),
|
|
2184
|
+
descriptionContext: z7.string().optional(),
|
|
2185
|
+
_id: z7.string().optional(),
|
|
2186
|
+
name: z7.string().optional(),
|
|
2187
|
+
description: z7.string().optional(),
|
|
2188
|
+
tags: z7.array(z7.string()).optional(),
|
|
2189
|
+
score: z7.number().optional(),
|
|
2190
|
+
alsoInLibrary: z7.string().optional(),
|
|
2191
|
+
prefetchedBytes: z7.string().optional(),
|
|
2192
|
+
prefetchedContentType: z7.string().optional()
|
|
2392
2193
|
});
|
|
2393
2194
|
var ingestedImageHitSchema = imageHitSchema.extend({
|
|
2394
|
-
imageId:
|
|
2395
|
-
imageUrl:
|
|
2396
|
-
deduped:
|
|
2397
|
-
sourceUrl:
|
|
2398
|
-
});
|
|
2399
|
-
var autoIngestItemSchema =
|
|
2400
|
-
imageId:
|
|
2401
|
-
deduped:
|
|
2402
|
-
imageUrl:
|
|
2403
|
-
sourceUrl:
|
|
2404
|
-
externalUrl:
|
|
2195
|
+
imageId: z7.string().optional(),
|
|
2196
|
+
imageUrl: z7.string().optional(),
|
|
2197
|
+
deduped: z7.boolean().optional(),
|
|
2198
|
+
sourceUrl: z7.string().optional()
|
|
2199
|
+
});
|
|
2200
|
+
var autoIngestItemSchema = z7.object({
|
|
2201
|
+
imageId: z7.string(),
|
|
2202
|
+
deduped: z7.boolean(),
|
|
2203
|
+
imageUrl: z7.string(),
|
|
2204
|
+
sourceUrl: z7.string(),
|
|
2205
|
+
externalUrl: z7.string().optional()
|
|
2405
2206
|
});
|
|
2406
2207
|
function providerHitsResponseSchema() {
|
|
2407
|
-
return
|
|
2408
|
-
hits:
|
|
2409
|
-
ingested:
|
|
2208
|
+
return z7.object({
|
|
2209
|
+
hits: z7.array(ingestedImageHitSchema),
|
|
2210
|
+
ingested: z7.array(autoIngestItemSchema)
|
|
2410
2211
|
});
|
|
2411
2212
|
}
|
|
2412
|
-
var imagesGetRequestSchema =
|
|
2413
|
-
var imagesSearchRequestSchema =
|
|
2414
|
-
query:
|
|
2415
|
-
limit:
|
|
2416
|
-
aspectRatio:
|
|
2417
|
-
tags:
|
|
2418
|
-
source:
|
|
2419
|
-
externalUrlHost:
|
|
2420
|
-
});
|
|
2421
|
-
var imageSearchResultSchema =
|
|
2422
|
-
_id:
|
|
2423
|
-
imageUrl:
|
|
2424
|
-
name:
|
|
2425
|
-
description:
|
|
2426
|
-
tags:
|
|
2427
|
-
width:
|
|
2428
|
-
height:
|
|
2429
|
-
aspectRatio:
|
|
2430
|
-
dominantColor:
|
|
2431
|
-
imagePalette:
|
|
2432
|
-
source:
|
|
2433
|
-
externalUrl:
|
|
2434
|
-
score:
|
|
2435
|
-
});
|
|
2436
|
-
var imagesSearchResponseSchema =
|
|
2437
|
-
var imagesUploadRequestSchema =
|
|
2438
|
-
base64:
|
|
2439
|
-
contentType:
|
|
2440
|
-
source:
|
|
2441
|
-
descriptionContext:
|
|
2442
|
-
});
|
|
2443
|
-
var imagesUploadResponseSchema =
|
|
2444
|
-
var imagesDeleteRequestSchema =
|
|
2445
|
-
var imagesDeleteResponseSchema =
|
|
2446
|
-
var imagesUpscaleRequestSchema =
|
|
2447
|
-
var imagesUpscaleResponseSchema =
|
|
2448
|
-
imageId:
|
|
2449
|
-
status:
|
|
2213
|
+
var imagesGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
|
|
2214
|
+
var imagesSearchRequestSchema = z7.object({
|
|
2215
|
+
query: z7.string().min(1),
|
|
2216
|
+
limit: z7.coerce.number().int().positive().max(100).optional(),
|
|
2217
|
+
aspectRatio: z7.string().optional(),
|
|
2218
|
+
tags: z7.array(z7.string()).optional(),
|
|
2219
|
+
source: z7.string().optional(),
|
|
2220
|
+
externalUrlHost: z7.string().optional()
|
|
2221
|
+
});
|
|
2222
|
+
var imageSearchResultSchema = z7.object({
|
|
2223
|
+
_id: z7.string(),
|
|
2224
|
+
imageUrl: z7.string(),
|
|
2225
|
+
name: z7.string(),
|
|
2226
|
+
description: z7.string(),
|
|
2227
|
+
tags: z7.array(z7.string()),
|
|
2228
|
+
width: z7.number().optional(),
|
|
2229
|
+
height: z7.number().optional(),
|
|
2230
|
+
aspectRatio: z7.number().optional(),
|
|
2231
|
+
dominantColor: z7.string().optional(),
|
|
2232
|
+
imagePalette: z7.array(z7.string()).optional(),
|
|
2233
|
+
source: z7.string(),
|
|
2234
|
+
externalUrl: z7.string().optional(),
|
|
2235
|
+
score: z7.number()
|
|
2236
|
+
});
|
|
2237
|
+
var imagesSearchResponseSchema = z7.array(imageSearchResultSchema);
|
|
2238
|
+
var imagesUploadRequestSchema = z7.object({
|
|
2239
|
+
base64: z7.string().min(1),
|
|
2240
|
+
contentType: z7.string().min(1),
|
|
2241
|
+
source: z7.string().optional(),
|
|
2242
|
+
descriptionContext: z7.string().optional()
|
|
2243
|
+
});
|
|
2244
|
+
var imagesUploadResponseSchema = z7.object({ imageId: z7.string() });
|
|
2245
|
+
var imagesDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing image ID") });
|
|
2246
|
+
var imagesDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
|
|
2247
|
+
var imagesUpscaleRequestSchema = z7.object({ imageId: z7.string().min(1, "Missing image ID") });
|
|
2248
|
+
var imagesUpscaleResponseSchema = z7.object({
|
|
2249
|
+
imageId: z7.string(),
|
|
2250
|
+
status: z7.literal("processing")
|
|
2450
2251
|
});
|
|
2451
2252
|
var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
|
|
2452
|
-
var imagesFindRequestSchema =
|
|
2453
|
-
query:
|
|
2454
|
-
sources:
|
|
2455
|
-
limit:
|
|
2456
|
-
fallback:
|
|
2457
|
-
threshold:
|
|
2458
|
-
autoIngest:
|
|
2459
|
-
descriptionContext:
|
|
2460
|
-
});
|
|
2461
|
-
var imagesFindResponseSchema =
|
|
2462
|
-
groups:
|
|
2463
|
-
library:
|
|
2464
|
-
external:
|
|
2253
|
+
var imagesFindRequestSchema = z7.object({
|
|
2254
|
+
query: z7.string().min(1),
|
|
2255
|
+
sources: z7.array(z7.enum(IMAGES_FIND_SOURCES)).optional(),
|
|
2256
|
+
limit: z7.coerce.number().int().positive().max(50).optional(),
|
|
2257
|
+
fallback: z7.boolean().optional(),
|
|
2258
|
+
threshold: z7.number().min(0).max(1).optional(),
|
|
2259
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2260
|
+
descriptionContext: z7.string().optional()
|
|
2261
|
+
});
|
|
2262
|
+
var imagesFindResponseSchema = z7.object({
|
|
2263
|
+
groups: z7.object({
|
|
2264
|
+
library: z7.array(imageHitSchema),
|
|
2265
|
+
external: z7.array(ingestedImageHitSchema)
|
|
2465
2266
|
}),
|
|
2466
|
-
meta:
|
|
2467
|
-
counts:
|
|
2468
|
-
errors:
|
|
2267
|
+
meta: z7.object({
|
|
2268
|
+
counts: z7.record(z7.string(), z7.number()),
|
|
2269
|
+
errors: z7.array(z7.object({ source: imageHitSourceSchema, message: z7.string() }))
|
|
2469
2270
|
}),
|
|
2470
|
-
ingested:
|
|
2471
|
-
});
|
|
2472
|
-
var imagesStockRequestSchema =
|
|
2473
|
-
query:
|
|
2474
|
-
orientation:
|
|
2475
|
-
contentType:
|
|
2476
|
-
license:
|
|
2477
|
-
color:
|
|
2478
|
-
aiGenerated:
|
|
2479
|
-
people:
|
|
2480
|
-
order:
|
|
2481
|
-
limit:
|
|
2482
|
-
page:
|
|
2483
|
-
autoIngest:
|
|
2484
|
-
descriptionContext:
|
|
2271
|
+
ingested: z7.array(autoIngestItemSchema)
|
|
2272
|
+
});
|
|
2273
|
+
var imagesStockRequestSchema = z7.object({
|
|
2274
|
+
query: z7.string().min(1),
|
|
2275
|
+
orientation: z7.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
|
|
2276
|
+
contentType: z7.enum(["photo", "vector", "psd"]).optional(),
|
|
2277
|
+
license: z7.enum(["freemium", "premium"]).optional(),
|
|
2278
|
+
color: z7.string().optional(),
|
|
2279
|
+
aiGenerated: z7.enum(["exclude", "only"]).optional(),
|
|
2280
|
+
people: z7.enum(["include", "exclude", "only"]).optional(),
|
|
2281
|
+
order: z7.enum(["relevance", "recent"]).optional(),
|
|
2282
|
+
limit: z7.coerce.number().int().positive().max(50).optional(),
|
|
2283
|
+
page: z7.coerce.number().int().positive().optional(),
|
|
2284
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2285
|
+
descriptionContext: z7.string().optional()
|
|
2485
2286
|
});
|
|
2486
2287
|
var imagesStockResponseSchema = providerHitsResponseSchema();
|
|
2487
|
-
var imagesGoogleRequestSchema =
|
|
2488
|
-
query:
|
|
2489
|
-
type:
|
|
2490
|
-
size:
|
|
2491
|
-
color:
|
|
2492
|
-
safe:
|
|
2493
|
-
limit:
|
|
2494
|
-
autoIngest:
|
|
2495
|
-
descriptionContext:
|
|
2288
|
+
var imagesGoogleRequestSchema = z7.object({
|
|
2289
|
+
query: z7.string().min(1),
|
|
2290
|
+
type: z7.string().optional(),
|
|
2291
|
+
size: z7.string().optional(),
|
|
2292
|
+
color: z7.string().optional(),
|
|
2293
|
+
safe: z7.enum(["off", "active"]).optional(),
|
|
2294
|
+
limit: z7.coerce.number().int().positive().max(50).optional(),
|
|
2295
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2296
|
+
descriptionContext: z7.string().optional()
|
|
2496
2297
|
});
|
|
2497
2298
|
var imagesGoogleResponseSchema = providerHitsResponseSchema();
|
|
2498
|
-
var imagesPinterestRequestSchema =
|
|
2499
|
-
query:
|
|
2500
|
-
limit:
|
|
2501
|
-
autoIngest:
|
|
2502
|
-
descriptionContext:
|
|
2299
|
+
var imagesPinterestRequestSchema = z7.object({
|
|
2300
|
+
query: z7.string().min(1),
|
|
2301
|
+
limit: z7.coerce.number().int().positive().max(20).optional(),
|
|
2302
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2303
|
+
descriptionContext: z7.string().optional()
|
|
2503
2304
|
});
|
|
2504
2305
|
var imagesPinterestResponseSchema = providerHitsResponseSchema();
|
|
2505
|
-
var rgbTriple =
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2306
|
+
var rgbTriple = z7.tuple([
|
|
2307
|
+
z7.number().int().min(0).max(255),
|
|
2308
|
+
z7.number().int().min(0).max(255),
|
|
2309
|
+
z7.number().int().min(0).max(255)
|
|
2509
2310
|
]);
|
|
2510
|
-
var imageGenerateModelSchema =
|
|
2311
|
+
var imageGenerateModelSchema = z7.enum([
|
|
2511
2312
|
"openai/gpt-5.4-image-2",
|
|
2512
2313
|
"google/gemini-3.5-flash",
|
|
2513
2314
|
"google/gemini-3.1-flash-image-preview",
|
|
2514
2315
|
"google/gemini-3-pro-image-preview",
|
|
2515
2316
|
"recraft/recraft-v4.1-pro-vector"
|
|
2516
2317
|
]);
|
|
2517
|
-
var imagesGenerateRequestSchema =
|
|
2518
|
-
prompt:
|
|
2318
|
+
var imagesGenerateRequestSchema = z7.object({
|
|
2319
|
+
prompt: z7.string().min(1),
|
|
2519
2320
|
model: imageGenerateModelSchema.optional(),
|
|
2520
2321
|
// Aspect ratio + size are validated loosely as strings; the per-model enum
|
|
2521
2322
|
// lives in canvas-contract and OpenRouter rejects unsupported combinations.
|
|
2522
|
-
aspectRatio:
|
|
2523
|
-
imageSize:
|
|
2323
|
+
aspectRatio: z7.string().optional(),
|
|
2324
|
+
imageSize: z7.string().optional(),
|
|
2524
2325
|
// Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
|
|
2525
|
-
quality:
|
|
2326
|
+
quality: z7.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2526
2327
|
// Recraft v4.1 Pro Vector levers (ignored by other models).
|
|
2527
|
-
strength:
|
|
2528
|
-
rgbColors:
|
|
2328
|
+
strength: z7.coerce.number().min(0).max(1).optional(),
|
|
2329
|
+
rgbColors: z7.array(rgbTriple).optional(),
|
|
2529
2330
|
backgroundRgbColor: rgbTriple.optional(),
|
|
2530
2331
|
// Public image URLs used as visual references (multi-reference, in order).
|
|
2531
|
-
referenceUrls:
|
|
2532
|
-
descriptionContext:
|
|
2533
|
-
});
|
|
2534
|
-
var generatedImageSchema =
|
|
2535
|
-
imageId:
|
|
2536
|
-
deduped:
|
|
2537
|
-
imageUrl:
|
|
2538
|
-
width:
|
|
2539
|
-
height:
|
|
2540
|
-
});
|
|
2541
|
-
var imagesGenerateResponseSchema =
|
|
2542
|
-
model:
|
|
2543
|
-
costUsd:
|
|
2544
|
-
images:
|
|
2545
|
-
});
|
|
2546
|
-
var imagesLogoRequestSchema =
|
|
2547
|
-
domain:
|
|
2548
|
-
variant:
|
|
2549
|
-
autoIngest:
|
|
2550
|
-
descriptionContext:
|
|
2332
|
+
referenceUrls: z7.array(z7.string().url()).optional(),
|
|
2333
|
+
descriptionContext: z7.string().optional()
|
|
2334
|
+
});
|
|
2335
|
+
var generatedImageSchema = z7.object({
|
|
2336
|
+
imageId: z7.string(),
|
|
2337
|
+
deduped: z7.boolean(),
|
|
2338
|
+
imageUrl: z7.string(),
|
|
2339
|
+
width: z7.number().optional(),
|
|
2340
|
+
height: z7.number().optional()
|
|
2341
|
+
});
|
|
2342
|
+
var imagesGenerateResponseSchema = z7.object({
|
|
2343
|
+
model: z7.string(),
|
|
2344
|
+
costUsd: z7.number(),
|
|
2345
|
+
images: z7.array(generatedImageSchema)
|
|
2346
|
+
});
|
|
2347
|
+
var imagesLogoRequestSchema = z7.object({
|
|
2348
|
+
domain: z7.string().min(1),
|
|
2349
|
+
variant: z7.enum(["icon", "logo", "symbol"]).optional(),
|
|
2350
|
+
autoIngest: z7.coerce.number().int().min(0).max(5).optional(),
|
|
2351
|
+
descriptionContext: z7.string().optional()
|
|
2551
2352
|
});
|
|
2552
2353
|
var imagesLogoResponseSchema = providerHitsResponseSchema();
|
|
2553
|
-
var imagesIconRequestSchema =
|
|
2554
|
-
name:
|
|
2555
|
-
set:
|
|
2556
|
-
color:
|
|
2557
|
-
width:
|
|
2558
|
-
autoIngest:
|
|
2559
|
-
descriptionContext:
|
|
2354
|
+
var imagesIconRequestSchema = z7.object({
|
|
2355
|
+
name: z7.string().min(1),
|
|
2356
|
+
set: z7.string().optional(),
|
|
2357
|
+
color: z7.string().optional(),
|
|
2358
|
+
width: z7.coerce.number().int().positive().optional(),
|
|
2359
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2360
|
+
descriptionContext: z7.string().optional()
|
|
2560
2361
|
});
|
|
2561
2362
|
var imagesIconResponseSchema = providerHitsResponseSchema();
|
|
2562
|
-
var imagesExtractRequestSchema =
|
|
2563
|
-
url:
|
|
2564
|
-
waitFor:
|
|
2565
|
-
limit:
|
|
2566
|
-
autoIngest:
|
|
2567
|
-
descriptionContext:
|
|
2363
|
+
var imagesExtractRequestSchema = z7.object({
|
|
2364
|
+
url: z7.string().url(),
|
|
2365
|
+
waitFor: z7.coerce.number().int().min(0).max(3e4).optional(),
|
|
2366
|
+
limit: z7.coerce.number().int().positive().max(50).optional(),
|
|
2367
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2368
|
+
descriptionContext: z7.string().optional()
|
|
2568
2369
|
});
|
|
2569
2370
|
var imagesExtractResponseSchema = providerHitsResponseSchema();
|
|
2570
|
-
var imagesScreenshotRequestSchema =
|
|
2571
|
-
url:
|
|
2572
|
-
fullPage:
|
|
2573
|
-
viewportWidth:
|
|
2574
|
-
viewportHeight:
|
|
2575
|
-
format:
|
|
2576
|
-
descriptionContext:
|
|
2371
|
+
var imagesScreenshotRequestSchema = z7.object({
|
|
2372
|
+
url: z7.string().url(),
|
|
2373
|
+
fullPage: z7.boolean().optional(),
|
|
2374
|
+
viewportWidth: z7.coerce.number().int().positive().max(3840).optional(),
|
|
2375
|
+
viewportHeight: z7.coerce.number().int().positive().max(2160).optional(),
|
|
2376
|
+
format: z7.enum(["webp", "png", "jpg"]).optional(),
|
|
2377
|
+
descriptionContext: z7.string().optional()
|
|
2577
2378
|
});
|
|
2578
2379
|
var imagesScreenshotResponseSchema = providerHitsResponseSchema();
|
|
2579
|
-
var imagesGiphyRequestSchema =
|
|
2580
|
-
query:
|
|
2581
|
-
trending:
|
|
2582
|
-
limit:
|
|
2583
|
-
rating:
|
|
2584
|
-
lang:
|
|
2585
|
-
autoIngest:
|
|
2586
|
-
descriptionContext:
|
|
2380
|
+
var imagesGiphyRequestSchema = z7.object({
|
|
2381
|
+
query: z7.string().min(1).optional(),
|
|
2382
|
+
trending: z7.coerce.boolean().optional(),
|
|
2383
|
+
limit: z7.coerce.number().int().positive().max(50).optional(),
|
|
2384
|
+
rating: z7.enum(["g", "pg", "pg-13", "r"]).optional(),
|
|
2385
|
+
lang: z7.string().optional(),
|
|
2386
|
+
autoIngest: z7.coerce.number().int().min(0).max(20).optional(),
|
|
2387
|
+
descriptionContext: z7.string().optional()
|
|
2587
2388
|
});
|
|
2588
2389
|
var imagesGifResponseSchema = providerHitsResponseSchema();
|
|
2589
2390
|
var imagesStickerResponseSchema = providerHitsResponseSchema();
|
|
2590
|
-
var imagesIngestRequestSchema =
|
|
2591
|
-
url:
|
|
2391
|
+
var imagesIngestRequestSchema = z7.object({
|
|
2392
|
+
url: z7.string().url(),
|
|
2592
2393
|
// Validate source at the HTTP boundary so unknown values produce the standard
|
|
2593
2394
|
// `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
|
|
2594
2395
|
// `assertImageSource` inside the action.
|
|
2595
2396
|
source: imageSourceSchema,
|
|
2596
|
-
externalId:
|
|
2597
|
-
externalUrl:
|
|
2598
|
-
descriptionContext:
|
|
2397
|
+
externalId: z7.string().optional(),
|
|
2398
|
+
externalUrl: z7.string().optional(),
|
|
2399
|
+
descriptionContext: z7.string().optional()
|
|
2599
2400
|
});
|
|
2600
|
-
var imagesIngestResponseSchema =
|
|
2601
|
-
imageId:
|
|
2602
|
-
deduped:
|
|
2603
|
-
contentHash:
|
|
2401
|
+
var imagesIngestResponseSchema = z7.object({
|
|
2402
|
+
imageId: z7.string(),
|
|
2403
|
+
deduped: z7.boolean(),
|
|
2404
|
+
contentHash: z7.string()
|
|
2604
2405
|
});
|
|
2605
2406
|
|
|
2606
2407
|
// ../api/src/tags.ts
|
|
2607
|
-
import { z as
|
|
2408
|
+
import { z as z8 } from "zod";
|
|
2608
2409
|
var TAG_TYPES = [
|
|
2609
2410
|
"meta",
|
|
2610
2411
|
"amplitude",
|
|
@@ -2625,7 +2426,7 @@ var TAG_TYPES = [
|
|
|
2625
2426
|
"recaptcha",
|
|
2626
2427
|
"twitterAds"
|
|
2627
2428
|
];
|
|
2628
|
-
var tagTypeSchema =
|
|
2429
|
+
var tagTypeSchema = z8.enum(TAG_TYPES);
|
|
2629
2430
|
var TAG_IDENTIFYING_FIELD = {
|
|
2630
2431
|
meta: "pixelId",
|
|
2631
2432
|
googleAds: "conversionID",
|
|
@@ -2646,218 +2447,218 @@ var TAG_IDENTIFYING_FIELD = {
|
|
|
2646
2447
|
recaptcha: "siteKey",
|
|
2647
2448
|
twitterAds: "pixelId"
|
|
2648
2449
|
};
|
|
2649
|
-
var tagDraftOpKindSchema =
|
|
2650
|
-
var tagDraftOpViewSchema =
|
|
2450
|
+
var tagDraftOpKindSchema = z8.enum(["create", "update", "delete"]);
|
|
2451
|
+
var tagDraftOpViewSchema = z8.object({
|
|
2651
2452
|
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
2652
|
-
ref:
|
|
2453
|
+
ref: z8.string(),
|
|
2653
2454
|
kind: tagDraftOpKindSchema,
|
|
2654
2455
|
type: tagTypeSchema,
|
|
2655
2456
|
/** Present on update/delete ops — the real tag this op targets. */
|
|
2656
|
-
tagId:
|
|
2457
|
+
tagId: z8.string().optional(),
|
|
2657
2458
|
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
2658
|
-
config:
|
|
2459
|
+
config: z8.record(z8.string(), z8.string()),
|
|
2659
2460
|
/** Update only — fields the op explicitly clears. */
|
|
2660
|
-
clearFields:
|
|
2461
|
+
clearFields: z8.array(z8.string()).optional(),
|
|
2661
2462
|
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
2662
|
-
secretsSet:
|
|
2463
|
+
secretsSet: z8.array(z8.string()),
|
|
2663
2464
|
/** Names of secret fields still awaiting user input. */
|
|
2664
|
-
secretsPending:
|
|
2665
|
-
summary:
|
|
2666
|
-
stagedAt:
|
|
2465
|
+
secretsPending: z8.array(z8.string()),
|
|
2466
|
+
summary: z8.string(),
|
|
2467
|
+
stagedAt: z8.number()
|
|
2667
2468
|
});
|
|
2668
|
-
var tagsEffectiveEntrySchema =
|
|
2469
|
+
var tagsEffectiveEntrySchema = z8.object({
|
|
2669
2470
|
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
2670
|
-
ref:
|
|
2671
|
-
tagId:
|
|
2471
|
+
ref: z8.string(),
|
|
2472
|
+
tagId: z8.string().optional(),
|
|
2672
2473
|
type: tagTypeSchema,
|
|
2673
2474
|
/** Value of the type's identifying field, when set. */
|
|
2674
|
-
identifier:
|
|
2475
|
+
identifier: z8.string().optional(),
|
|
2675
2476
|
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
2676
|
-
config:
|
|
2477
|
+
config: z8.record(z8.string(), z8.string()),
|
|
2677
2478
|
/** Absent = live production tag with no staged changes in this chat. */
|
|
2678
2479
|
staged: tagDraftOpKindSchema.optional(),
|
|
2679
|
-
secretsSet:
|
|
2680
|
-
secretsPending:
|
|
2480
|
+
secretsSet: z8.array(z8.string()),
|
|
2481
|
+
secretsPending: z8.array(z8.string())
|
|
2681
2482
|
});
|
|
2682
|
-
var tagsListRequestSchema =
|
|
2683
|
-
var tagsListResponseSchema =
|
|
2684
|
-
var tagsDraftListRequestSchema =
|
|
2685
|
-
var tagsDraftListResponseSchema =
|
|
2686
|
-
status:
|
|
2687
|
-
ops:
|
|
2483
|
+
var tagsListRequestSchema = z8.object({ chatId: z8.string() });
|
|
2484
|
+
var tagsListResponseSchema = z8.object({ tags: z8.array(tagsEffectiveEntrySchema) });
|
|
2485
|
+
var tagsDraftListRequestSchema = z8.object({ chatId: z8.string() });
|
|
2486
|
+
var tagsDraftListResponseSchema = z8.object({
|
|
2487
|
+
status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
2488
|
+
ops: z8.array(tagDraftOpViewSchema)
|
|
2688
2489
|
});
|
|
2689
|
-
var tagInputRequestSchema =
|
|
2490
|
+
var tagInputRequestSchema = z8.object({
|
|
2690
2491
|
// Every tag change is a tab in the approval form: create/edit show the full
|
|
2691
2492
|
// body; delete shows a confirm. No tag change bypasses this approval.
|
|
2692
|
-
mode:
|
|
2493
|
+
mode: z8.enum(["create", "edit", "delete"]),
|
|
2693
2494
|
tagType: tagTypeSchema,
|
|
2694
2495
|
/** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
|
|
2695
|
-
ref:
|
|
2496
|
+
ref: z8.string().optional(),
|
|
2696
2497
|
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
2697
|
-
prefilledConfig:
|
|
2498
|
+
prefilledConfig: z8.record(z8.string(), z8.string()).optional(),
|
|
2698
2499
|
/** Secret field names the agent asks the user to provide. */
|
|
2699
|
-
requestedSecretFields:
|
|
2500
|
+
requestedSecretFields: z8.array(z8.string()).optional(),
|
|
2700
2501
|
/** Short message shown above the form explaining why the input is needed. */
|
|
2701
|
-
message:
|
|
2502
|
+
message: z8.string().optional()
|
|
2702
2503
|
});
|
|
2703
|
-
var tagChangeToolInputSchema =
|
|
2704
|
-
changes:
|
|
2504
|
+
var tagChangeToolInputSchema = z8.object({
|
|
2505
|
+
changes: z8.array(tagInputRequestSchema).min(1).max(8)
|
|
2705
2506
|
});
|
|
2706
|
-
var tagInputResultSchema =
|
|
2707
|
-
|
|
2708
|
-
status:
|
|
2709
|
-
ref:
|
|
2507
|
+
var tagInputResultSchema = z8.discriminatedUnion("status", [
|
|
2508
|
+
z8.object({
|
|
2509
|
+
status: z8.literal("submitted"),
|
|
2510
|
+
ref: z8.string(),
|
|
2710
2511
|
type: tagTypeSchema,
|
|
2711
2512
|
/** Identifying field name → value (non-secret), when the type has one. */
|
|
2712
|
-
identifier:
|
|
2713
|
-
secretFieldsSet:
|
|
2714
|
-
note:
|
|
2513
|
+
identifier: z8.record(z8.string(), z8.string()).optional(),
|
|
2514
|
+
secretFieldsSet: z8.array(z8.string()),
|
|
2515
|
+
note: z8.string().optional()
|
|
2715
2516
|
}),
|
|
2716
|
-
|
|
2717
|
-
status:
|
|
2718
|
-
reason:
|
|
2517
|
+
z8.object({
|
|
2518
|
+
status: z8.literal("declined"),
|
|
2519
|
+
reason: z8.string().optional()
|
|
2719
2520
|
})
|
|
2720
2521
|
]);
|
|
2721
|
-
var tagChangeToolResultSchema =
|
|
2722
|
-
results:
|
|
2522
|
+
var tagChangeToolResultSchema = z8.object({
|
|
2523
|
+
results: z8.array(tagInputResultSchema)
|
|
2723
2524
|
});
|
|
2724
2525
|
|
|
2725
2526
|
// ../api/src/testimonials.ts
|
|
2726
|
-
import { z as
|
|
2727
|
-
var testimonialSourceTypeSchema =
|
|
2728
|
-
var testimonialStatusSchema =
|
|
2729
|
-
var testimonialSentimentSchema =
|
|
2730
|
-
var testimonialDocSchema =
|
|
2731
|
-
_id:
|
|
2732
|
-
_creationTime:
|
|
2733
|
-
companyId:
|
|
2734
|
-
sourceId:
|
|
2527
|
+
import { z as z9 } from "zod";
|
|
2528
|
+
var testimonialSourceTypeSchema = z9.enum(["google", "trustpilot"]);
|
|
2529
|
+
var testimonialStatusSchema = z9.enum(["pending", "processing", "ready", "error"]);
|
|
2530
|
+
var testimonialSentimentSchema = z9.enum(["positive", "neutral", "negative"]);
|
|
2531
|
+
var testimonialDocSchema = z9.object({
|
|
2532
|
+
_id: z9.string(),
|
|
2533
|
+
_creationTime: z9.number(),
|
|
2534
|
+
companyId: z9.string(),
|
|
2535
|
+
sourceId: z9.string(),
|
|
2735
2536
|
sourceType: testimonialSourceTypeSchema,
|
|
2736
|
-
reviewText:
|
|
2737
|
-
reviewTitle:
|
|
2738
|
-
searchText:
|
|
2739
|
-
reviewerName:
|
|
2740
|
-
reviewerImageUrl:
|
|
2741
|
-
reviewerImageId:
|
|
2742
|
-
reviewerLocation:
|
|
2743
|
-
rating:
|
|
2744
|
-
reviewDate:
|
|
2745
|
-
ownerAnswer:
|
|
2746
|
-
mediaUrls:
|
|
2747
|
-
imageIds:
|
|
2748
|
-
videoIds:
|
|
2749
|
-
sourceUrl:
|
|
2750
|
-
rawData:
|
|
2751
|
-
tags:
|
|
2752
|
-
highlight:
|
|
2753
|
-
language:
|
|
2754
|
-
summary:
|
|
2537
|
+
reviewText: z9.string(),
|
|
2538
|
+
reviewTitle: z9.string().optional(),
|
|
2539
|
+
searchText: z9.string().optional(),
|
|
2540
|
+
reviewerName: z9.string().optional(),
|
|
2541
|
+
reviewerImageUrl: z9.string().optional(),
|
|
2542
|
+
reviewerImageId: z9.string().optional(),
|
|
2543
|
+
reviewerLocation: z9.string().optional(),
|
|
2544
|
+
rating: z9.number().optional(),
|
|
2545
|
+
reviewDate: z9.number().optional(),
|
|
2546
|
+
ownerAnswer: z9.string().optional(),
|
|
2547
|
+
mediaUrls: z9.array(z9.string()).optional(),
|
|
2548
|
+
imageIds: z9.array(z9.string()).optional(),
|
|
2549
|
+
videoIds: z9.array(z9.string()).optional(),
|
|
2550
|
+
sourceUrl: z9.string().optional(),
|
|
2551
|
+
rawData: z9.unknown().optional(),
|
|
2552
|
+
tags: z9.array(z9.string()),
|
|
2553
|
+
highlight: z9.string().optional(),
|
|
2554
|
+
language: z9.string().optional(),
|
|
2555
|
+
summary: z9.string().optional(),
|
|
2755
2556
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2756
|
-
textEmbedding:
|
|
2757
|
-
externalId:
|
|
2758
|
-
contentHash:
|
|
2557
|
+
textEmbedding: z9.array(z9.number()).optional(),
|
|
2558
|
+
externalId: z9.string().optional(),
|
|
2559
|
+
contentHash: z9.string().optional(),
|
|
2759
2560
|
status: testimonialStatusSchema,
|
|
2760
|
-
errorMessage:
|
|
2761
|
-
createdAt:
|
|
2762
|
-
updatedAt:
|
|
2561
|
+
errorMessage: z9.string().optional(),
|
|
2562
|
+
createdAt: z9.number(),
|
|
2563
|
+
updatedAt: z9.number()
|
|
2763
2564
|
});
|
|
2764
|
-
var testimonialsListRequestSchema =
|
|
2565
|
+
var testimonialsListRequestSchema = z9.object({
|
|
2765
2566
|
source: testimonialSourceTypeSchema.optional(),
|
|
2766
|
-
rating_min:
|
|
2767
|
-
rating_max:
|
|
2768
|
-
tags:
|
|
2567
|
+
rating_min: z9.coerce.number().int().min(1).max(5).optional(),
|
|
2568
|
+
rating_max: z9.coerce.number().int().min(1).max(5).optional(),
|
|
2569
|
+
tags: z9.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
2769
2570
|
status: testimonialStatusSchema.optional(),
|
|
2770
2571
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2771
|
-
language:
|
|
2772
|
-
limit:
|
|
2773
|
-
});
|
|
2774
|
-
var testimonialsListResponseSchema =
|
|
2775
|
-
var testimonialsGetRequestSchema =
|
|
2776
|
-
var testimonialsSearchRequestSchema =
|
|
2777
|
-
query:
|
|
2778
|
-
limit:
|
|
2572
|
+
language: z9.string().min(2).max(5).optional(),
|
|
2573
|
+
limit: z9.coerce.number().int().positive().max(200).optional()
|
|
2574
|
+
});
|
|
2575
|
+
var testimonialsListResponseSchema = z9.array(testimonialDocSchema);
|
|
2576
|
+
var testimonialsGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
|
|
2577
|
+
var testimonialsSearchRequestSchema = z9.object({
|
|
2578
|
+
query: z9.string().min(1),
|
|
2579
|
+
limit: z9.coerce.number().int().positive().max(100).optional(),
|
|
2779
2580
|
source: testimonialSourceTypeSchema.optional(),
|
|
2780
|
-
rating_min:
|
|
2781
|
-
rating_max:
|
|
2782
|
-
tags:
|
|
2581
|
+
rating_min: z9.coerce.number().int().min(1).max(5).optional(),
|
|
2582
|
+
rating_max: z9.coerce.number().int().min(1).max(5).optional(),
|
|
2583
|
+
tags: z9.array(z9.string()).optional(),
|
|
2783
2584
|
status: testimonialStatusSchema.optional(),
|
|
2784
2585
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2785
|
-
language:
|
|
2586
|
+
language: z9.string().min(2).max(5).optional()
|
|
2786
2587
|
}).refine(
|
|
2787
2588
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
2788
2589
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
2789
2590
|
);
|
|
2790
|
-
var testimonialsSearchResponseSchema =
|
|
2791
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
2792
|
-
ok:
|
|
2793
|
-
note:
|
|
2591
|
+
var testimonialsSearchResponseSchema = z9.array(testimonialDocSchema);
|
|
2592
|
+
var testimonialsOutscraperWebhookResponseSchema = z9.object({
|
|
2593
|
+
ok: z9.literal(true),
|
|
2594
|
+
note: z9.string().optional()
|
|
2794
2595
|
});
|
|
2795
2596
|
|
|
2796
2597
|
// ../api/src/videos.ts
|
|
2797
|
-
import { z as
|
|
2798
|
-
var videoStatusSchema =
|
|
2799
|
-
var videoTranscriptSegmentSchema =
|
|
2800
|
-
text:
|
|
2801
|
-
startSecond:
|
|
2802
|
-
endSecond:
|
|
2803
|
-
});
|
|
2804
|
-
var videoSceneSchema =
|
|
2805
|
-
title:
|
|
2806
|
-
description:
|
|
2807
|
-
startSecond:
|
|
2808
|
-
endSecond:
|
|
2809
|
-
thumbnailTime:
|
|
2810
|
-
});
|
|
2811
|
-
var videoDocSchema =
|
|
2812
|
-
_id:
|
|
2813
|
-
_creationTime:
|
|
2814
|
-
companyId:
|
|
2815
|
-
muxAssetId:
|
|
2816
|
-
muxPlaybackId:
|
|
2817
|
-
muxUploadId:
|
|
2818
|
-
name:
|
|
2819
|
-
description:
|
|
2820
|
-
tags:
|
|
2821
|
-
source:
|
|
2822
|
-
externalId:
|
|
2823
|
-
sourceId:
|
|
2824
|
-
width:
|
|
2825
|
-
height:
|
|
2826
|
-
aspectRatio:
|
|
2827
|
-
duration:
|
|
2828
|
-
transcript:
|
|
2829
|
-
transcriptSegments:
|
|
2830
|
-
scenes:
|
|
2831
|
-
descriptionEmbedding:
|
|
2832
|
-
searchText:
|
|
2598
|
+
import { z as z10 } from "zod";
|
|
2599
|
+
var videoStatusSchema = z10.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
2600
|
+
var videoTranscriptSegmentSchema = z10.object({
|
|
2601
|
+
text: z10.string(),
|
|
2602
|
+
startSecond: z10.number(),
|
|
2603
|
+
endSecond: z10.number()
|
|
2604
|
+
});
|
|
2605
|
+
var videoSceneSchema = z10.object({
|
|
2606
|
+
title: z10.string(),
|
|
2607
|
+
description: z10.string(),
|
|
2608
|
+
startSecond: z10.number(),
|
|
2609
|
+
endSecond: z10.number(),
|
|
2610
|
+
thumbnailTime: z10.number()
|
|
2611
|
+
});
|
|
2612
|
+
var videoDocSchema = z10.object({
|
|
2613
|
+
_id: z10.string(),
|
|
2614
|
+
_creationTime: z10.number(),
|
|
2615
|
+
companyId: z10.string(),
|
|
2616
|
+
muxAssetId: z10.string(),
|
|
2617
|
+
muxPlaybackId: z10.string(),
|
|
2618
|
+
muxUploadId: z10.string(),
|
|
2619
|
+
name: z10.string(),
|
|
2620
|
+
description: z10.string(),
|
|
2621
|
+
tags: z10.array(z10.string()),
|
|
2622
|
+
source: z10.string(),
|
|
2623
|
+
externalId: z10.string().optional(),
|
|
2624
|
+
sourceId: z10.string().optional(),
|
|
2625
|
+
width: z10.number().optional(),
|
|
2626
|
+
height: z10.number().optional(),
|
|
2627
|
+
aspectRatio: z10.number().optional(),
|
|
2628
|
+
duration: z10.number().optional(),
|
|
2629
|
+
transcript: z10.string().optional(),
|
|
2630
|
+
transcriptSegments: z10.array(videoTranscriptSegmentSchema).optional(),
|
|
2631
|
+
scenes: z10.array(videoSceneSchema).optional(),
|
|
2632
|
+
descriptionEmbedding: z10.array(z10.number()).optional(),
|
|
2633
|
+
searchText: z10.string().optional(),
|
|
2833
2634
|
status: videoStatusSchema,
|
|
2834
|
-
errorMessage:
|
|
2835
|
-
createdAt:
|
|
2836
|
-
updatedAt:
|
|
2837
|
-
thumbnailUrl:
|
|
2838
|
-
});
|
|
2839
|
-
var videosWebhookResponseSchema =
|
|
2840
|
-
var videosGetRequestSchema =
|
|
2841
|
-
var videosSearchRequestSchema =
|
|
2842
|
-
query:
|
|
2843
|
-
limit:
|
|
2844
|
-
tags:
|
|
2845
|
-
});
|
|
2846
|
-
var videoSearchResultSchema =
|
|
2847
|
-
_id:
|
|
2848
|
-
thumbnailUrl:
|
|
2849
|
-
name:
|
|
2850
|
-
description:
|
|
2851
|
-
tags:
|
|
2852
|
-
status:
|
|
2853
|
-
duration:
|
|
2854
|
-
muxPlaybackId:
|
|
2855
|
-
createdAt:
|
|
2856
|
-
});
|
|
2857
|
-
var videosSearchResponseSchema =
|
|
2858
|
-
var videosUploadResponseSchema =
|
|
2859
|
-
var videosDeleteRequestSchema =
|
|
2860
|
-
var videosDeleteResponseSchema =
|
|
2635
|
+
errorMessage: z10.string().optional(),
|
|
2636
|
+
createdAt: z10.number(),
|
|
2637
|
+
updatedAt: z10.number(),
|
|
2638
|
+
thumbnailUrl: z10.string()
|
|
2639
|
+
});
|
|
2640
|
+
var videosWebhookResponseSchema = z10.object({ ok: z10.literal(true) });
|
|
2641
|
+
var videosGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
|
|
2642
|
+
var videosSearchRequestSchema = z10.object({
|
|
2643
|
+
query: z10.string().min(1),
|
|
2644
|
+
limit: z10.coerce.number().int().positive().max(100).optional(),
|
|
2645
|
+
tags: z10.array(z10.string()).optional()
|
|
2646
|
+
});
|
|
2647
|
+
var videoSearchResultSchema = z10.object({
|
|
2648
|
+
_id: z10.string(),
|
|
2649
|
+
thumbnailUrl: z10.string(),
|
|
2650
|
+
name: z10.string(),
|
|
2651
|
+
description: z10.string(),
|
|
2652
|
+
tags: z10.array(z10.string()),
|
|
2653
|
+
status: z10.string(),
|
|
2654
|
+
duration: z10.number().optional(),
|
|
2655
|
+
muxPlaybackId: z10.string(),
|
|
2656
|
+
createdAt: z10.number()
|
|
2657
|
+
});
|
|
2658
|
+
var videosSearchResponseSchema = z10.array(videoSearchResultSchema);
|
|
2659
|
+
var videosUploadResponseSchema = z10.object({ uploadUrl: z10.string(), videoId: z10.string() });
|
|
2660
|
+
var videosDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing video ID") });
|
|
2661
|
+
var videosDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
|
|
2861
2662
|
|
|
2862
2663
|
// src/commands/actions/complete.ts
|
|
2863
2664
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -4670,37 +4471,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
4670
4471
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4671
4472
|
|
|
4672
4473
|
// ../api/src/ads-google/ops.ts
|
|
4673
|
-
import { z as
|
|
4674
|
-
var tempRefSchema2 =
|
|
4675
|
-
var refSchema =
|
|
4676
|
-
|
|
4677
|
-
|
|
4474
|
+
import { z as z11 } from "zod";
|
|
4475
|
+
var tempRefSchema2 = z11.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
4476
|
+
var refSchema = z11.union([
|
|
4477
|
+
z11.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
4478
|
+
z11.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4678
4479
|
tempRefSchema2
|
|
4679
4480
|
]);
|
|
4680
4481
|
var targetRefSchema = refSchema;
|
|
4681
|
-
var microsSchema =
|
|
4682
|
-
var httpsUrlSchema2 =
|
|
4683
|
-
var customerIdSchema =
|
|
4684
|
-
var stageableStatusSchema2 =
|
|
4685
|
-
var matchTypeSchema =
|
|
4686
|
-
var keywordTextSchema =
|
|
4687
|
-
var budgetCreateSchema =
|
|
4688
|
-
name:
|
|
4482
|
+
var microsSchema = z11.number().int().positive("expected a positive micros amount");
|
|
4483
|
+
var httpsUrlSchema2 = z11.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
4484
|
+
var customerIdSchema = z11.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
4485
|
+
var stageableStatusSchema2 = z11.enum(STAGEABLE_CREATE_STATUSES2);
|
|
4486
|
+
var matchTypeSchema = z11.enum(KEYWORD_MATCH_TYPES);
|
|
4487
|
+
var keywordTextSchema = z11.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
|
|
4488
|
+
var budgetCreateSchema = z11.object({
|
|
4489
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4689
4490
|
amountMicros: microsSchema,
|
|
4690
|
-
deliveryMethod:
|
|
4691
|
-
explicitlyShared:
|
|
4491
|
+
deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
4492
|
+
explicitlyShared: z11.boolean().default(false)
|
|
4692
4493
|
});
|
|
4693
|
-
var budgetUpdateSchema =
|
|
4694
|
-
name:
|
|
4494
|
+
var budgetUpdateSchema = z11.object({
|
|
4495
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4695
4496
|
amountMicros: microsSchema.optional(),
|
|
4696
|
-
deliveryMethod:
|
|
4497
|
+
deliveryMethod: z11.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4697
4498
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4698
|
-
var biddingConfigSchema =
|
|
4699
|
-
type:
|
|
4499
|
+
var biddingConfigSchema = z11.object({
|
|
4500
|
+
type: z11.enum(BIDDING_STRATEGY_TYPES),
|
|
4700
4501
|
targetCpaMicros: microsSchema.optional(),
|
|
4701
|
-
targetRoas:
|
|
4502
|
+
targetRoas: z11.number().positive().optional(),
|
|
4702
4503
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4703
|
-
enhancedCpcEnabled:
|
|
4504
|
+
enhancedCpcEnabled: z11.boolean().optional()
|
|
4704
4505
|
}).superRefine((p, ctx) => {
|
|
4705
4506
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4706
4507
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -4709,17 +4510,17 @@ var biddingConfigSchema = z12.object({
|
|
|
4709
4510
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4710
4511
|
}
|
|
4711
4512
|
});
|
|
4712
|
-
var networkSettingsSchema =
|
|
4713
|
-
targetGoogleSearch:
|
|
4714
|
-
targetSearchNetwork:
|
|
4715
|
-
targetContentNetwork:
|
|
4716
|
-
targetPartnerSearchNetwork:
|
|
4513
|
+
var networkSettingsSchema = z11.object({
|
|
4514
|
+
targetGoogleSearch: z11.boolean().optional(),
|
|
4515
|
+
targetSearchNetwork: z11.boolean().optional(),
|
|
4516
|
+
targetContentNetwork: z11.boolean().optional(),
|
|
4517
|
+
targetPartnerSearchNetwork: z11.boolean().optional()
|
|
4717
4518
|
});
|
|
4718
|
-
var dateSchema =
|
|
4719
|
-
var campaignCreateSchema2 =
|
|
4720
|
-
name:
|
|
4721
|
-
channelType:
|
|
4722
|
-
channelSubType:
|
|
4519
|
+
var dateSchema = z11.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4520
|
+
var campaignCreateSchema2 = z11.object({
|
|
4521
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4522
|
+
channelType: z11.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4523
|
+
channelSubType: z11.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4723
4524
|
budget: refSchema,
|
|
4724
4525
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4725
4526
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -4728,7 +4529,7 @@ var campaignCreateSchema2 = z12.object({
|
|
|
4728
4529
|
startDate: dateSchema.optional(),
|
|
4729
4530
|
endDate: dateSchema.optional(),
|
|
4730
4531
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4731
|
-
objective:
|
|
4532
|
+
objective: z11.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4732
4533
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4733
4534
|
}).superRefine((p, ctx) => {
|
|
4734
4535
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -4752,129 +4553,129 @@ var campaignCreateSchema2 = z12.object({
|
|
|
4752
4553
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4753
4554
|
}
|
|
4754
4555
|
});
|
|
4755
|
-
var campaignUpdateSchema2 =
|
|
4756
|
-
name:
|
|
4556
|
+
var campaignUpdateSchema2 = z11.object({
|
|
4557
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4757
4558
|
budget: refSchema.optional(),
|
|
4758
4559
|
bidding: biddingConfigSchema.optional(),
|
|
4759
4560
|
networkSettings: networkSettingsSchema.optional(),
|
|
4760
4561
|
startDate: dateSchema.optional(),
|
|
4761
4562
|
endDate: dateSchema.optional(),
|
|
4762
|
-
status:
|
|
4563
|
+
status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4763
4564
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4764
|
-
var adGroupCreateSchema =
|
|
4765
|
-
name:
|
|
4565
|
+
var adGroupCreateSchema = z11.object({
|
|
4566
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4766
4567
|
campaign: refSchema,
|
|
4767
|
-
type:
|
|
4568
|
+
type: z11.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4768
4569
|
cpcBidMicros: microsSchema.optional(),
|
|
4769
4570
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4770
4571
|
});
|
|
4771
|
-
var adGroupUpdateSchema =
|
|
4772
|
-
name:
|
|
4572
|
+
var adGroupUpdateSchema = z11.object({
|
|
4573
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4773
4574
|
cpcBidMicros: microsSchema.optional(),
|
|
4774
|
-
status:
|
|
4575
|
+
status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4775
4576
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4776
|
-
var keywordAddSchema =
|
|
4577
|
+
var keywordAddSchema = z11.object({
|
|
4777
4578
|
adGroup: refSchema,
|
|
4778
4579
|
text: keywordTextSchema,
|
|
4779
4580
|
matchType: matchTypeSchema,
|
|
4780
4581
|
cpcBidMicros: microsSchema.optional(),
|
|
4781
|
-
finalUrls:
|
|
4582
|
+
finalUrls: z11.array(httpsUrlSchema2).optional(),
|
|
4782
4583
|
status: stageableStatusSchema2.default("ENABLED")
|
|
4783
4584
|
});
|
|
4784
|
-
var keywordUpdateSchema =
|
|
4585
|
+
var keywordUpdateSchema = z11.object({
|
|
4785
4586
|
cpcBidMicros: microsSchema.optional(),
|
|
4786
|
-
finalUrls:
|
|
4787
|
-
status:
|
|
4587
|
+
finalUrls: z11.array(httpsUrlSchema2).optional(),
|
|
4588
|
+
status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4788
4589
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4789
|
-
var negativeKeywordAddSchema =
|
|
4790
|
-
level:
|
|
4590
|
+
var negativeKeywordAddSchema = z11.object({
|
|
4591
|
+
level: z11.enum(["adGroup", "campaign"]),
|
|
4791
4592
|
parent: refSchema,
|
|
4792
4593
|
text: keywordTextSchema,
|
|
4793
4594
|
matchType: matchTypeSchema
|
|
4794
4595
|
});
|
|
4795
|
-
var sharedSetCreateSchema =
|
|
4796
|
-
name:
|
|
4797
|
-
type:
|
|
4596
|
+
var sharedSetCreateSchema = z11.object({
|
|
4597
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4598
|
+
type: z11.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4798
4599
|
});
|
|
4799
|
-
var sharedSetMemberAddSchema =
|
|
4600
|
+
var sharedSetMemberAddSchema = z11.object({
|
|
4800
4601
|
sharedSet: refSchema,
|
|
4801
4602
|
text: keywordTextSchema,
|
|
4802
4603
|
matchType: matchTypeSchema
|
|
4803
4604
|
});
|
|
4804
|
-
var campaignSharedSetAttachSchema =
|
|
4605
|
+
var campaignSharedSetAttachSchema = z11.object({
|
|
4805
4606
|
campaign: refSchema,
|
|
4806
4607
|
sharedSet: refSchema
|
|
4807
4608
|
});
|
|
4808
|
-
var adTextAssetSchema =
|
|
4809
|
-
text:
|
|
4810
|
-
pinnedField:
|
|
4609
|
+
var adTextAssetSchema = z11.object({
|
|
4610
|
+
text: z11.string().min(1),
|
|
4611
|
+
pinnedField: z11.enum(PINNED_FIELDS).optional()
|
|
4811
4612
|
});
|
|
4812
|
-
var responsiveSearchAdSchema =
|
|
4813
|
-
format:
|
|
4814
|
-
headlines:
|
|
4613
|
+
var responsiveSearchAdSchema = z11.object({
|
|
4614
|
+
format: z11.literal("responsiveSearch"),
|
|
4615
|
+
headlines: z11.array(
|
|
4815
4616
|
adTextAssetSchema.refine(
|
|
4816
4617
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4817
4618
|
"headline exceeds 30 chars"
|
|
4818
4619
|
)
|
|
4819
4620
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4820
|
-
descriptions:
|
|
4621
|
+
descriptions: z11.array(
|
|
4821
4622
|
adTextAssetSchema.refine(
|
|
4822
4623
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4823
4624
|
"description exceeds 90 chars"
|
|
4824
4625
|
)
|
|
4825
4626
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4826
|
-
path1:
|
|
4827
|
-
path2:
|
|
4828
|
-
finalUrls:
|
|
4829
|
-
});
|
|
4830
|
-
var responsiveDisplayAdSchema =
|
|
4831
|
-
format:
|
|
4832
|
-
headlines:
|
|
4833
|
-
longHeadline:
|
|
4834
|
-
descriptions:
|
|
4835
|
-
businessName:
|
|
4627
|
+
path1: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4628
|
+
path2: z11.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4629
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1)
|
|
4630
|
+
});
|
|
4631
|
+
var responsiveDisplayAdSchema = z11.object({
|
|
4632
|
+
format: z11.literal("responsiveDisplay"),
|
|
4633
|
+
headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4634
|
+
longHeadline: z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4635
|
+
descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4636
|
+
businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4836
4637
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
4837
4638
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
4838
4639
|
// image (1:1) to serve; the logo images are optional.
|
|
4839
|
-
marketingImageAssets:
|
|
4840
|
-
squareMarketingImageAssets:
|
|
4841
|
-
logoImageAssets:
|
|
4842
|
-
finalUrls:
|
|
4843
|
-
});
|
|
4844
|
-
var callAdSchema =
|
|
4845
|
-
format:
|
|
4846
|
-
countryCode:
|
|
4847
|
-
phoneNumber:
|
|
4848
|
-
headline1:
|
|
4849
|
-
headline2:
|
|
4850
|
-
description1:
|
|
4851
|
-
description2:
|
|
4852
|
-
businessName:
|
|
4853
|
-
finalUrls:
|
|
4854
|
-
});
|
|
4855
|
-
var appAdSchema =
|
|
4856
|
-
format:
|
|
4857
|
-
headlines:
|
|
4858
|
-
descriptions:
|
|
4859
|
-
});
|
|
4860
|
-
var videoAdSchema =
|
|
4861
|
-
format:
|
|
4640
|
+
marketingImageAssets: z11.array(refSchema).optional(),
|
|
4641
|
+
squareMarketingImageAssets: z11.array(refSchema).optional(),
|
|
4642
|
+
logoImageAssets: z11.array(refSchema).optional(),
|
|
4643
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1)
|
|
4644
|
+
});
|
|
4645
|
+
var callAdSchema = z11.object({
|
|
4646
|
+
format: z11.literal("call"),
|
|
4647
|
+
countryCode: z11.string().length(2),
|
|
4648
|
+
phoneNumber: z11.string().min(3),
|
|
4649
|
+
headline1: z11.string().min(1).max(30),
|
|
4650
|
+
headline2: z11.string().min(1).max(30),
|
|
4651
|
+
description1: z11.string().min(1).max(90),
|
|
4652
|
+
description2: z11.string().min(1).max(90),
|
|
4653
|
+
businessName: z11.string().min(1).max(25),
|
|
4654
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1)
|
|
4655
|
+
});
|
|
4656
|
+
var appAdSchema = z11.object({
|
|
4657
|
+
format: z11.literal("app"),
|
|
4658
|
+
headlines: z11.array(z11.object({ text: z11.string().min(1).max(30) })).min(1),
|
|
4659
|
+
descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1)
|
|
4660
|
+
});
|
|
4661
|
+
var videoAdSchema = z11.object({
|
|
4662
|
+
format: z11.literal("video"),
|
|
4862
4663
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
4863
4664
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
4864
|
-
videoAssets:
|
|
4865
|
-
finalUrls:
|
|
4866
|
-
});
|
|
4867
|
-
var demandGenAdSchema =
|
|
4868
|
-
format:
|
|
4869
|
-
headlines:
|
|
4870
|
-
descriptions:
|
|
4871
|
-
businessName:
|
|
4872
|
-
finalUrls:
|
|
4873
|
-
imageAssets:
|
|
4874
|
-
squareImageAssets:
|
|
4875
|
-
logoImageAssets:
|
|
4876
|
-
});
|
|
4877
|
-
var adContentSchema =
|
|
4665
|
+
videoAssets: z11.array(refSchema).min(1),
|
|
4666
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1)
|
|
4667
|
+
});
|
|
4668
|
+
var demandGenAdSchema = z11.object({
|
|
4669
|
+
format: z11.literal("demandGen"),
|
|
4670
|
+
headlines: z11.array(z11.object({ text: z11.string().min(1).max(40) })).min(1).max(5),
|
|
4671
|
+
descriptions: z11.array(z11.object({ text: z11.string().min(1).max(90) })).min(1).max(5),
|
|
4672
|
+
businessName: z11.string().min(1).max(25),
|
|
4673
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1),
|
|
4674
|
+
imageAssets: z11.array(refSchema).optional(),
|
|
4675
|
+
squareImageAssets: z11.array(refSchema).optional(),
|
|
4676
|
+
logoImageAssets: z11.array(refSchema).optional()
|
|
4677
|
+
});
|
|
4678
|
+
var adContentSchema = z11.discriminatedUnion("format", [
|
|
4878
4679
|
responsiveSearchAdSchema,
|
|
4879
4680
|
responsiveDisplayAdSchema,
|
|
4880
4681
|
callAdSchema,
|
|
@@ -4882,45 +4683,45 @@ var adContentSchema = z12.discriminatedUnion("format", [
|
|
|
4882
4683
|
videoAdSchema,
|
|
4883
4684
|
demandGenAdSchema
|
|
4884
4685
|
]);
|
|
4885
|
-
var adCreateSchema =
|
|
4686
|
+
var adCreateSchema = z11.object({
|
|
4886
4687
|
adGroup: refSchema,
|
|
4887
4688
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
4888
4689
|
content: adContentSchema
|
|
4889
4690
|
});
|
|
4890
|
-
var adUpdateSchema =
|
|
4891
|
-
status:
|
|
4691
|
+
var adUpdateSchema = z11.object({
|
|
4692
|
+
status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4892
4693
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4893
|
-
content:
|
|
4694
|
+
content: z11.record(z11.string(), z11.unknown()).optional()
|
|
4894
4695
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4895
|
-
var textAssetSchema =
|
|
4896
|
-
var imageAssetSchema =
|
|
4897
|
-
type:
|
|
4898
|
-
imageId:
|
|
4899
|
-
name:
|
|
4900
|
-
});
|
|
4901
|
-
var youtubeVideoAssetSchema =
|
|
4902
|
-
type:
|
|
4903
|
-
youtubeVideoId:
|
|
4904
|
-
name:
|
|
4905
|
-
});
|
|
4906
|
-
var sitelinkAssetSchema =
|
|
4907
|
-
type:
|
|
4908
|
-
linkText:
|
|
4909
|
-
description1:
|
|
4910
|
-
description2:
|
|
4911
|
-
finalUrls:
|
|
4912
|
-
});
|
|
4913
|
-
var calloutAssetSchema =
|
|
4914
|
-
type:
|
|
4915
|
-
calloutText:
|
|
4916
|
-
});
|
|
4917
|
-
var structuredSnippetAssetSchema =
|
|
4918
|
-
type:
|
|
4919
|
-
header:
|
|
4920
|
-
values:
|
|
4921
|
-
});
|
|
4922
|
-
var callToActionAssetSchema =
|
|
4923
|
-
var assetCreateSchema =
|
|
4696
|
+
var textAssetSchema = z11.object({ type: z11.literal("text"), text: z11.string().min(1) });
|
|
4697
|
+
var imageAssetSchema = z11.object({
|
|
4698
|
+
type: z11.literal("image"),
|
|
4699
|
+
imageId: z11.string().min(1),
|
|
4700
|
+
name: z11.string().optional()
|
|
4701
|
+
});
|
|
4702
|
+
var youtubeVideoAssetSchema = z11.object({
|
|
4703
|
+
type: z11.literal("youtubeVideo"),
|
|
4704
|
+
youtubeVideoId: z11.string().min(1),
|
|
4705
|
+
name: z11.string().optional()
|
|
4706
|
+
});
|
|
4707
|
+
var sitelinkAssetSchema = z11.object({
|
|
4708
|
+
type: z11.literal("sitelink"),
|
|
4709
|
+
linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4710
|
+
description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4711
|
+
description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4712
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1)
|
|
4713
|
+
});
|
|
4714
|
+
var calloutAssetSchema = z11.object({
|
|
4715
|
+
type: z11.literal("callout"),
|
|
4716
|
+
calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4717
|
+
});
|
|
4718
|
+
var structuredSnippetAssetSchema = z11.object({
|
|
4719
|
+
type: z11.literal("structuredSnippet"),
|
|
4720
|
+
header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4721
|
+
values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4722
|
+
});
|
|
4723
|
+
var callToActionAssetSchema = z11.object({ type: z11.literal("callToAction"), callToAction: z11.string().min(1) });
|
|
4724
|
+
var assetCreateSchema = z11.discriminatedUnion("type", [
|
|
4924
4725
|
textAssetSchema,
|
|
4925
4726
|
imageAssetSchema,
|
|
4926
4727
|
youtubeVideoAssetSchema,
|
|
@@ -4929,136 +4730,136 @@ var assetCreateSchema = z12.discriminatedUnion("type", [
|
|
|
4929
4730
|
structuredSnippetAssetSchema,
|
|
4930
4731
|
callToActionAssetSchema
|
|
4931
4732
|
]);
|
|
4932
|
-
var assetUpdateSchema =
|
|
4933
|
-
name:
|
|
4934
|
-
linkText:
|
|
4935
|
-
description1:
|
|
4936
|
-
description2:
|
|
4937
|
-
finalUrls:
|
|
4938
|
-
calloutText:
|
|
4939
|
-
header:
|
|
4940
|
-
values:
|
|
4941
|
-
callToAction:
|
|
4942
|
-
text:
|
|
4733
|
+
var assetUpdateSchema = z11.object({
|
|
4734
|
+
name: z11.string().min(1).optional(),
|
|
4735
|
+
linkText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
4736
|
+
description1: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4737
|
+
description2: z11.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4738
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
|
|
4739
|
+
calloutText: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
4740
|
+
header: z11.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
|
|
4741
|
+
values: z11.array(z11.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
4742
|
+
callToAction: z11.string().min(1).optional(),
|
|
4743
|
+
text: z11.string().min(1).optional()
|
|
4943
4744
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4944
|
-
var assetLinkAttachSchema =
|
|
4945
|
-
level:
|
|
4745
|
+
var assetLinkAttachSchema = z11.object({
|
|
4746
|
+
level: z11.enum(["campaign", "adGroup", "customer"]),
|
|
4946
4747
|
parent: refSchema.optional(),
|
|
4947
4748
|
asset: refSchema,
|
|
4948
|
-
fieldType:
|
|
4749
|
+
fieldType: z11.enum(ASSET_FIELD_TYPES)
|
|
4949
4750
|
}).superRefine((value, ctx) => {
|
|
4950
4751
|
if (value.level !== "customer" && !value.parent) {
|
|
4951
4752
|
ctx.addIssue({
|
|
4952
|
-
code:
|
|
4753
|
+
code: z11.ZodIssueCode.custom,
|
|
4953
4754
|
path: ["parent"],
|
|
4954
4755
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
4955
4756
|
});
|
|
4956
4757
|
}
|
|
4957
4758
|
});
|
|
4958
|
-
var assetGroupCreateSchema =
|
|
4759
|
+
var assetGroupCreateSchema = z11.object({
|
|
4959
4760
|
campaign: refSchema,
|
|
4960
|
-
name:
|
|
4961
|
-
finalUrls:
|
|
4962
|
-
headlines:
|
|
4963
|
-
longHeadlines:
|
|
4964
|
-
descriptions:
|
|
4965
|
-
businessName:
|
|
4966
|
-
imageAssets:
|
|
4967
|
-
squareImageAssets:
|
|
4968
|
-
logoAssets:
|
|
4969
|
-
status:
|
|
4970
|
-
});
|
|
4971
|
-
var assetGroupUpdateSchema =
|
|
4972
|
-
name:
|
|
4973
|
-
finalUrls:
|
|
4974
|
-
status:
|
|
4761
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
4762
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1),
|
|
4763
|
+
headlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
4764
|
+
longHeadlines: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
4765
|
+
descriptions: z11.array(z11.object({ text: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
4766
|
+
businessName: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
4767
|
+
imageAssets: z11.array(refSchema).optional(),
|
|
4768
|
+
squareImageAssets: z11.array(refSchema).optional(),
|
|
4769
|
+
logoAssets: z11.array(refSchema).optional(),
|
|
4770
|
+
status: z11.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
4771
|
+
});
|
|
4772
|
+
var assetGroupUpdateSchema = z11.object({
|
|
4773
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
4774
|
+
finalUrls: z11.array(httpsUrlSchema2).min(1).optional(),
|
|
4775
|
+
status: z11.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4975
4776
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4976
|
-
var audienceCreateSchema2 =
|
|
4977
|
-
name:
|
|
4978
|
-
type:
|
|
4979
|
-
description:
|
|
4777
|
+
var audienceCreateSchema2 = z11.object({
|
|
4778
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4779
|
+
type: z11.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4780
|
+
description: z11.string().optional(),
|
|
4980
4781
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4981
|
-
members:
|
|
4982
|
-
sourceFileRef:
|
|
4782
|
+
members: z11.array(z11.record(z11.string(), z11.string())).optional(),
|
|
4783
|
+
sourceFileRef: z11.string().optional()
|
|
4983
4784
|
});
|
|
4984
|
-
var audienceCriterionAttachSchema =
|
|
4985
|
-
level:
|
|
4785
|
+
var audienceCriterionAttachSchema = z11.object({
|
|
4786
|
+
level: z11.enum(["campaign", "adGroup"]),
|
|
4986
4787
|
parent: refSchema,
|
|
4987
4788
|
userList: refSchema,
|
|
4988
|
-
negative:
|
|
4789
|
+
negative: z11.boolean().default(false)
|
|
4989
4790
|
});
|
|
4990
|
-
var conversionActionCreateSchema =
|
|
4991
|
-
name:
|
|
4992
|
-
type:
|
|
4993
|
-
category:
|
|
4994
|
-
countingType:
|
|
4791
|
+
var conversionActionCreateSchema = z11.object({
|
|
4792
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
4793
|
+
type: z11.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
4794
|
+
category: z11.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
4795
|
+
countingType: z11.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4995
4796
|
defaultValueMicros: microsSchema.optional(),
|
|
4996
|
-
defaultCurrencyCode:
|
|
4997
|
-
clickThroughLookbackWindowDays:
|
|
4998
|
-
viewThroughLookbackWindowDays:
|
|
4999
|
-
status:
|
|
5000
|
-
});
|
|
5001
|
-
var conversionActionUpdateSchema =
|
|
5002
|
-
name:
|
|
5003
|
-
category:
|
|
5004
|
-
countingType:
|
|
4797
|
+
defaultCurrencyCode: z11.string().length(3).optional(),
|
|
4798
|
+
clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
|
|
4799
|
+
viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
|
|
4800
|
+
status: z11.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
4801
|
+
});
|
|
4802
|
+
var conversionActionUpdateSchema = z11.object({
|
|
4803
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
4804
|
+
category: z11.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
4805
|
+
countingType: z11.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
5005
4806
|
defaultValueMicros: microsSchema.optional(),
|
|
5006
|
-
defaultCurrencyCode:
|
|
5007
|
-
clickThroughLookbackWindowDays:
|
|
5008
|
-
viewThroughLookbackWindowDays:
|
|
5009
|
-
status:
|
|
4807
|
+
defaultCurrencyCode: z11.string().length(3).optional(),
|
|
4808
|
+
clickThroughLookbackWindowDays: z11.number().int().positive().optional(),
|
|
4809
|
+
viewThroughLookbackWindowDays: z11.number().int().positive().optional(),
|
|
4810
|
+
status: z11.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
5010
4811
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5011
|
-
var biddingStrategyCreateSchema =
|
|
5012
|
-
name:
|
|
4812
|
+
var biddingStrategyCreateSchema = z11.object({
|
|
4813
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
5013
4814
|
config: biddingConfigSchema
|
|
5014
4815
|
}).superRefine((p, ctx) => {
|
|
5015
4816
|
if (p.config.type === "MANUAL_CPC") {
|
|
5016
4817
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
5017
4818
|
}
|
|
5018
4819
|
});
|
|
5019
|
-
var biddingStrategyUpdateSchema =
|
|
5020
|
-
name:
|
|
4820
|
+
var biddingStrategyUpdateSchema = z11.object({
|
|
4821
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
5021
4822
|
config: biddingConfigSchema.optional()
|
|
5022
4823
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5023
|
-
var labelCreateSchema =
|
|
5024
|
-
name:
|
|
5025
|
-
backgroundColor:
|
|
5026
|
-
description:
|
|
4824
|
+
var labelCreateSchema = z11.object({
|
|
4825
|
+
name: z11.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
4826
|
+
backgroundColor: z11.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
4827
|
+
description: z11.string().optional()
|
|
5027
4828
|
});
|
|
5028
|
-
var labelAttachSchema =
|
|
5029
|
-
level:
|
|
4829
|
+
var labelAttachSchema = z11.object({
|
|
4830
|
+
level: z11.enum(["campaign", "adGroup", "ad"]),
|
|
5030
4831
|
parent: refSchema,
|
|
5031
4832
|
label: refSchema
|
|
5032
4833
|
});
|
|
5033
|
-
var locationCriterionSchema =
|
|
5034
|
-
criterionType:
|
|
5035
|
-
geoTargetConstant:
|
|
5036
|
-
});
|
|
5037
|
-
var languageCriterionSchema =
|
|
5038
|
-
criterionType:
|
|
5039
|
-
languageConstant:
|
|
5040
|
-
});
|
|
5041
|
-
var adScheduleCriterionSchema =
|
|
5042
|
-
criterionType:
|
|
5043
|
-
dayOfWeek:
|
|
5044
|
-
startHour:
|
|
5045
|
-
startMinute:
|
|
5046
|
-
endHour:
|
|
5047
|
-
endMinute:
|
|
5048
|
-
});
|
|
5049
|
-
var deviceCriterionSchema =
|
|
5050
|
-
criterionType:
|
|
5051
|
-
device:
|
|
4834
|
+
var locationCriterionSchema = z11.object({
|
|
4835
|
+
criterionType: z11.literal("location"),
|
|
4836
|
+
geoTargetConstant: z11.union([z11.string().regex(GEO_TARGET_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
|
|
4837
|
+
});
|
|
4838
|
+
var languageCriterionSchema = z11.object({
|
|
4839
|
+
criterionType: z11.literal("language"),
|
|
4840
|
+
languageConstant: z11.union([z11.string().regex(LANGUAGE_CONSTANT_REGEX), z11.string().regex(NUMERIC_ID_REGEX2)])
|
|
4841
|
+
});
|
|
4842
|
+
var adScheduleCriterionSchema = z11.object({
|
|
4843
|
+
criterionType: z11.literal("adSchedule"),
|
|
4844
|
+
dayOfWeek: z11.enum(DAYS_OF_WEEK),
|
|
4845
|
+
startHour: z11.number().int().min(0).max(23),
|
|
4846
|
+
startMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
4847
|
+
endHour: z11.number().int().min(0).max(24),
|
|
4848
|
+
endMinute: z11.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
4849
|
+
});
|
|
4850
|
+
var deviceCriterionSchema = z11.object({
|
|
4851
|
+
criterionType: z11.literal("device"),
|
|
4852
|
+
device: z11.enum(DEVICE_TYPES),
|
|
5052
4853
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
5053
4854
|
// 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.
|
|
5054
|
-
bidModifier:
|
|
4855
|
+
bidModifier: z11.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
5055
4856
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
5056
4857
|
})
|
|
5057
4858
|
});
|
|
5058
|
-
var campaignCriterionAddSchema =
|
|
4859
|
+
var campaignCriterionAddSchema = z11.object({
|
|
5059
4860
|
campaign: refSchema,
|
|
5060
|
-
negative:
|
|
5061
|
-
criterion:
|
|
4861
|
+
negative: z11.boolean().default(false),
|
|
4862
|
+
criterion: z11.discriminatedUnion("criterionType", [
|
|
5062
4863
|
locationCriterionSchema,
|
|
5063
4864
|
languageCriterionSchema,
|
|
5064
4865
|
adScheduleCriterionSchema,
|
|
@@ -5068,7 +4869,7 @@ var campaignCriterionAddSchema = z12.object({
|
|
|
5068
4869
|
const c = val.criterion;
|
|
5069
4870
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
5070
4871
|
ctx.addIssue({
|
|
5071
|
-
code:
|
|
4872
|
+
code: z11.ZodIssueCode.custom,
|
|
5072
4873
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
5073
4874
|
path: ["criterion", "endMinute"]
|
|
5074
4875
|
});
|
|
@@ -5120,17 +4921,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
5120
4921
|
"google.campaignCriterion.add",
|
|
5121
4922
|
"google.campaignCriterion.remove"
|
|
5122
4923
|
];
|
|
5123
|
-
var googleDraftOpKindSchema =
|
|
4924
|
+
var googleDraftOpKindSchema = z11.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
5124
4925
|
function createOp2(kind, payload) {
|
|
5125
|
-
return
|
|
4926
|
+
return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, payload });
|
|
5126
4927
|
}
|
|
5127
4928
|
function updateOp2(kind, payload) {
|
|
5128
|
-
return
|
|
4929
|
+
return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
5129
4930
|
}
|
|
5130
4931
|
function targetOp(kind) {
|
|
5131
|
-
return
|
|
4932
|
+
return z11.object({ kind: z11.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
5132
4933
|
}
|
|
5133
|
-
var googleDraftOpInputSchema =
|
|
4934
|
+
var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
|
|
5134
4935
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
5135
4936
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
5136
4937
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -5178,132 +4979,132 @@ var googleDraftOpInputSchema = z12.discriminatedUnion("kind", [
|
|
|
5178
4979
|
]);
|
|
5179
4980
|
|
|
5180
4981
|
// ../api/src/ads-google/wire.ts
|
|
5181
|
-
import { z as
|
|
5182
|
-
var googleWriteModeSchema =
|
|
5183
|
-
var googleDraftOpResultSchema =
|
|
5184
|
-
status:
|
|
5185
|
-
resourceName:
|
|
5186
|
-
error:
|
|
5187
|
-
skippedBecause:
|
|
5188
|
-
executedAt:
|
|
5189
|
-
});
|
|
5190
|
-
var googleDraftStageRequestSchema =
|
|
5191
|
-
chatId:
|
|
4982
|
+
import { z as z12 } from "zod";
|
|
4983
|
+
var googleWriteModeSchema = z12.enum(["live", "simulated"]);
|
|
4984
|
+
var googleDraftOpResultSchema = z12.object({
|
|
4985
|
+
status: z12.enum(["applied", "simulated", "failed", "skipped"]),
|
|
4986
|
+
resourceName: z12.string().optional(),
|
|
4987
|
+
error: z12.string().optional(),
|
|
4988
|
+
skippedBecause: z12.string().optional(),
|
|
4989
|
+
executedAt: z12.number().optional()
|
|
4990
|
+
});
|
|
4991
|
+
var googleDraftStageRequestSchema = z12.object({
|
|
4992
|
+
chatId: z12.string(),
|
|
5192
4993
|
op: googleDraftOpInputSchema
|
|
5193
4994
|
});
|
|
5194
|
-
var googleDraftStageResponseSchema =
|
|
5195
|
-
staged:
|
|
5196
|
-
ref:
|
|
4995
|
+
var googleDraftStageResponseSchema = z12.object({
|
|
4996
|
+
staged: z12.literal(true),
|
|
4997
|
+
ref: z12.string(),
|
|
5197
4998
|
kind: googleDraftOpKindSchema,
|
|
5198
4999
|
mode: googleWriteModeSchema,
|
|
5199
|
-
dependsOn:
|
|
5200
|
-
summary:
|
|
5201
|
-
warnings:
|
|
5000
|
+
dependsOn: z12.array(z12.string()),
|
|
5001
|
+
summary: z12.string(),
|
|
5002
|
+
warnings: z12.array(z12.string()),
|
|
5202
5003
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
5203
|
-
amended:
|
|
5004
|
+
amended: z12.boolean().optional()
|
|
5204
5005
|
});
|
|
5205
|
-
var googleDraftAmendRequestSchema =
|
|
5206
|
-
chatId:
|
|
5207
|
-
ref:
|
|
5208
|
-
patch:
|
|
5006
|
+
var googleDraftAmendRequestSchema = z12.object({
|
|
5007
|
+
chatId: z12.string(),
|
|
5008
|
+
ref: z12.string(),
|
|
5009
|
+
patch: z12.record(z12.string(), z12.unknown())
|
|
5209
5010
|
});
|
|
5210
|
-
var googleDraftShowRequestSchema =
|
|
5211
|
-
chatId:
|
|
5212
|
-
ref:
|
|
5011
|
+
var googleDraftShowRequestSchema = z12.object({
|
|
5012
|
+
chatId: z12.string(),
|
|
5013
|
+
ref: z12.string()
|
|
5213
5014
|
});
|
|
5214
5015
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
5215
|
-
var googleDraftStageBatchRequestSchema =
|
|
5216
|
-
chatId:
|
|
5217
|
-
ops:
|
|
5016
|
+
var googleDraftStageBatchRequestSchema = z12.object({
|
|
5017
|
+
chatId: z12.string(),
|
|
5018
|
+
ops: z12.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
5218
5019
|
});
|
|
5219
|
-
var googleDraftStageBatchResponseSchema =
|
|
5220
|
-
staged:
|
|
5020
|
+
var googleDraftStageBatchResponseSchema = z12.object({
|
|
5021
|
+
staged: z12.literal(true),
|
|
5221
5022
|
mode: googleWriteModeSchema,
|
|
5222
|
-
count:
|
|
5223
|
-
ops:
|
|
5224
|
-
|
|
5225
|
-
ref:
|
|
5023
|
+
count: z12.number(),
|
|
5024
|
+
ops: z12.array(
|
|
5025
|
+
z12.object({
|
|
5026
|
+
ref: z12.string(),
|
|
5226
5027
|
kind: googleDraftOpKindSchema,
|
|
5227
|
-
dependsOn:
|
|
5228
|
-
summary:
|
|
5229
|
-
warnings:
|
|
5028
|
+
dependsOn: z12.array(z12.string()),
|
|
5029
|
+
summary: z12.string(),
|
|
5030
|
+
warnings: z12.array(z12.string())
|
|
5230
5031
|
})
|
|
5231
5032
|
)
|
|
5232
5033
|
});
|
|
5233
|
-
var googleDraftOpViewSchema =
|
|
5234
|
-
ref:
|
|
5034
|
+
var googleDraftOpViewSchema = z12.object({
|
|
5035
|
+
ref: z12.string(),
|
|
5235
5036
|
kind: googleDraftOpKindSchema,
|
|
5236
|
-
customerId:
|
|
5237
|
-
target:
|
|
5238
|
-
dependsOn:
|
|
5239
|
-
summary:
|
|
5240
|
-
stagedAt:
|
|
5037
|
+
customerId: z12.string(),
|
|
5038
|
+
target: z12.string().optional(),
|
|
5039
|
+
dependsOn: z12.array(z12.string()),
|
|
5040
|
+
summary: z12.string(),
|
|
5041
|
+
stagedAt: z12.number(),
|
|
5241
5042
|
result: googleDraftOpResultSchema.optional()
|
|
5242
5043
|
});
|
|
5243
|
-
var googleDraftShowResponseSchema =
|
|
5044
|
+
var googleDraftShowResponseSchema = z12.object({
|
|
5244
5045
|
op: googleDraftOpViewSchema.extend({
|
|
5245
|
-
payload:
|
|
5246
|
-
warnings:
|
|
5247
|
-
annotations:
|
|
5046
|
+
payload: z12.unknown().optional(),
|
|
5047
|
+
warnings: z12.array(z12.string()).optional(),
|
|
5048
|
+
annotations: z12.unknown().optional()
|
|
5248
5049
|
})
|
|
5249
5050
|
});
|
|
5250
|
-
var googleDraftListRequestSchema =
|
|
5251
|
-
chatId:
|
|
5051
|
+
var googleDraftListRequestSchema = z12.object({
|
|
5052
|
+
chatId: z12.string()
|
|
5252
5053
|
});
|
|
5253
|
-
var googleDraftAdvisorySchema =
|
|
5254
|
-
scope:
|
|
5255
|
-
message:
|
|
5054
|
+
var googleDraftAdvisorySchema = z12.object({
|
|
5055
|
+
scope: z12.enum(["campaign", "adGroup"]),
|
|
5056
|
+
message: z12.string()
|
|
5256
5057
|
});
|
|
5257
|
-
var googleDraftStatusCollectionSchema =
|
|
5258
|
-
label:
|
|
5259
|
-
added:
|
|
5260
|
-
removed:
|
|
5261
|
-
existing:
|
|
5058
|
+
var googleDraftStatusCollectionSchema = z12.object({
|
|
5059
|
+
label: z12.string(),
|
|
5060
|
+
added: z12.number(),
|
|
5061
|
+
removed: z12.number(),
|
|
5062
|
+
existing: z12.number()
|
|
5262
5063
|
});
|
|
5263
|
-
var googleDraftChangeOperationSchema =
|
|
5264
|
-
var googleDraftStatusNodeSchema =
|
|
5265
|
-
() =>
|
|
5266
|
-
entity:
|
|
5267
|
-
name:
|
|
5064
|
+
var googleDraftChangeOperationSchema = z12.enum(["create", "update", "pause", "resume", "remove"]);
|
|
5065
|
+
var googleDraftStatusNodeSchema = z12.lazy(
|
|
5066
|
+
() => z12.object({
|
|
5067
|
+
entity: z12.string(),
|
|
5068
|
+
name: z12.string(),
|
|
5268
5069
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
5269
|
-
existing:
|
|
5270
|
-
collections:
|
|
5271
|
-
children:
|
|
5272
|
-
warnings:
|
|
5070
|
+
existing: z12.boolean(),
|
|
5071
|
+
collections: z12.array(googleDraftStatusCollectionSchema),
|
|
5072
|
+
children: z12.array(googleDraftStatusNodeSchema),
|
|
5073
|
+
warnings: z12.array(z12.string()).optional()
|
|
5273
5074
|
})
|
|
5274
5075
|
);
|
|
5275
|
-
var googleDraftListResponseSchema =
|
|
5276
|
-
status:
|
|
5076
|
+
var googleDraftListResponseSchema = z12.object({
|
|
5077
|
+
status: z12.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
5277
5078
|
mode: googleWriteModeSchema,
|
|
5278
|
-
count:
|
|
5279
|
-
ops:
|
|
5079
|
+
count: z12.number(),
|
|
5080
|
+
ops: z12.array(googleDraftOpViewSchema),
|
|
5280
5081
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
5281
|
-
tree:
|
|
5082
|
+
tree: z12.array(googleDraftStatusNodeSchema).optional(),
|
|
5282
5083
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
5283
|
-
advisories:
|
|
5084
|
+
advisories: z12.array(googleDraftAdvisorySchema).optional()
|
|
5284
5085
|
});
|
|
5285
|
-
var googleDraftRemoveRequestSchema =
|
|
5286
|
-
chatId:
|
|
5287
|
-
ref:
|
|
5086
|
+
var googleDraftRemoveRequestSchema = z12.object({
|
|
5087
|
+
chatId: z12.string(),
|
|
5088
|
+
ref: z12.string()
|
|
5288
5089
|
});
|
|
5289
|
-
var googleDraftRemoveResponseSchema =
|
|
5090
|
+
var googleDraftRemoveResponseSchema = z12.object({
|
|
5290
5091
|
/** The requested ref plus any dependents removed by cascade. */
|
|
5291
|
-
removed:
|
|
5092
|
+
removed: z12.array(z12.string())
|
|
5292
5093
|
});
|
|
5293
|
-
var googleDraftClearRequestSchema =
|
|
5294
|
-
chatId:
|
|
5094
|
+
var googleDraftClearRequestSchema = z12.object({
|
|
5095
|
+
chatId: z12.string()
|
|
5295
5096
|
});
|
|
5296
|
-
var googleDraftClearResponseSchema =
|
|
5297
|
-
cleared:
|
|
5097
|
+
var googleDraftClearResponseSchema = z12.object({
|
|
5098
|
+
cleared: z12.number()
|
|
5298
5099
|
});
|
|
5299
|
-
var googleFieldErrorSchema =
|
|
5300
|
-
path:
|
|
5301
|
-
message:
|
|
5100
|
+
var googleFieldErrorSchema = z12.object({
|
|
5101
|
+
path: z12.string(),
|
|
5102
|
+
message: z12.string()
|
|
5302
5103
|
});
|
|
5303
|
-
var googleDraftErrorResponseSchema =
|
|
5304
|
-
code:
|
|
5305
|
-
error:
|
|
5306
|
-
fields:
|
|
5104
|
+
var googleDraftErrorResponseSchema = z12.object({
|
|
5105
|
+
code: z12.string(),
|
|
5106
|
+
error: z12.string(),
|
|
5107
|
+
fields: z12.array(googleFieldErrorSchema).optional()
|
|
5307
5108
|
});
|
|
5308
5109
|
|
|
5309
5110
|
// src/commands/ads/google/draft-status.ts
|
|
@@ -11346,17 +11147,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
11346
11147
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
11347
11148
|
|
|
11348
11149
|
// ../api/src/ads-meta/ops.ts
|
|
11349
|
-
import { z as
|
|
11350
|
-
var tempRefSchema3 =
|
|
11351
|
-
var parentRefSchema2 =
|
|
11352
|
-
var moneySchema2 =
|
|
11353
|
-
amount:
|
|
11354
|
-
currencyCode:
|
|
11355
|
-
});
|
|
11356
|
-
var httpsUrlSchema3 =
|
|
11357
|
-
var bakerMediaIdSchema2 =
|
|
11358
|
-
var stageableStatusSchema3 =
|
|
11359
|
-
var updateStatusSchema =
|
|
11150
|
+
import { z as z13 } from "zod";
|
|
11151
|
+
var tempRefSchema3 = z13.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
11152
|
+
var parentRefSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
11153
|
+
var moneySchema2 = z13.object({
|
|
11154
|
+
amount: z13.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
|
|
11155
|
+
currencyCode: z13.string().length(3).optional()
|
|
11156
|
+
});
|
|
11157
|
+
var httpsUrlSchema3 = z13.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
11158
|
+
var bakerMediaIdSchema2 = z13.string().min(1);
|
|
11159
|
+
var stageableStatusSchema3 = z13.enum(STAGEABLE_CREATE_STATUSES3);
|
|
11160
|
+
var updateStatusSchema = z13.enum(UPDATE_STATUSES);
|
|
11360
11161
|
function currencyMinimums2(currencyCode) {
|
|
11361
11162
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
11362
11163
|
}
|
|
@@ -11368,50 +11169,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
|
|
|
11368
11169
|
}
|
|
11369
11170
|
}
|
|
11370
11171
|
}
|
|
11371
|
-
var geoLocationsSchema =
|
|
11372
|
-
countries:
|
|
11373
|
-
regions:
|
|
11374
|
-
cities:
|
|
11375
|
-
zips:
|
|
11376
|
-
location_types:
|
|
11377
|
-
}).catchall(
|
|
11378
|
-
var idNameSchema =
|
|
11379
|
-
var metaTargetingSchema =
|
|
11172
|
+
var geoLocationsSchema = z13.object({
|
|
11173
|
+
countries: z13.array(z13.string().length(2)).optional(),
|
|
11174
|
+
regions: z13.array(z13.object({ key: z13.string() })).optional(),
|
|
11175
|
+
cities: z13.array(z13.object({ key: z13.string(), radius: z13.number().optional(), distance_unit: z13.string().optional() })).optional(),
|
|
11176
|
+
zips: z13.array(z13.object({ key: z13.string() })).optional(),
|
|
11177
|
+
location_types: z13.array(z13.string()).optional()
|
|
11178
|
+
}).catchall(z13.unknown());
|
|
11179
|
+
var idNameSchema = z13.object({ id: z13.string(), name: z13.string().optional() });
|
|
11180
|
+
var metaTargetingSchema = z13.object({
|
|
11380
11181
|
geo_locations: geoLocationsSchema.optional(),
|
|
11381
11182
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
11382
|
-
age_min:
|
|
11383
|
-
age_max:
|
|
11384
|
-
genders:
|
|
11385
|
-
locales:
|
|
11386
|
-
interests:
|
|
11387
|
-
behaviors:
|
|
11388
|
-
custom_audiences:
|
|
11389
|
-
excluded_custom_audiences:
|
|
11390
|
-
flexible_spec:
|
|
11391
|
-
exclusions:
|
|
11392
|
-
publisher_platforms:
|
|
11393
|
-
facebook_positions:
|
|
11394
|
-
instagram_positions:
|
|
11395
|
-
audience_network_positions:
|
|
11396
|
-
messenger_positions:
|
|
11397
|
-
device_platforms:
|
|
11398
|
-
targeting_automation:
|
|
11399
|
-
}).catchall(
|
|
11400
|
-
var specialAdCategoriesSchema =
|
|
11401
|
-
var campaignCreateSchema3 =
|
|
11402
|
-
name:
|
|
11403
|
-
objective:
|
|
11183
|
+
age_min: z13.number().int().min(13).max(65).optional(),
|
|
11184
|
+
age_max: z13.number().int().min(13).max(65).optional(),
|
|
11185
|
+
genders: z13.array(z13.union([z13.literal(1), z13.literal(2)])).optional(),
|
|
11186
|
+
locales: z13.array(z13.number().int()).optional(),
|
|
11187
|
+
interests: z13.array(idNameSchema).optional(),
|
|
11188
|
+
behaviors: z13.array(idNameSchema).optional(),
|
|
11189
|
+
custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
|
|
11190
|
+
excluded_custom_audiences: z13.array(z13.object({ id: parentRefSchema2 })).optional(),
|
|
11191
|
+
flexible_spec: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
|
|
11192
|
+
exclusions: z13.record(z13.string(), z13.unknown()).optional(),
|
|
11193
|
+
publisher_platforms: z13.array(z13.string()).optional(),
|
|
11194
|
+
facebook_positions: z13.array(z13.string()).optional(),
|
|
11195
|
+
instagram_positions: z13.array(z13.string()).optional(),
|
|
11196
|
+
audience_network_positions: z13.array(z13.string()).optional(),
|
|
11197
|
+
messenger_positions: z13.array(z13.string()).optional(),
|
|
11198
|
+
device_platforms: z13.array(z13.string()).optional(),
|
|
11199
|
+
targeting_automation: z13.object({ advantage_audience: z13.union([z13.literal(0), z13.literal(1)]) }).partial().optional()
|
|
11200
|
+
}).catchall(z13.unknown());
|
|
11201
|
+
var specialAdCategoriesSchema = z13.array(z13.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
11202
|
+
var campaignCreateSchema3 = z13.object({
|
|
11203
|
+
name: z13.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
11204
|
+
objective: z13.enum(OBJECTIVES),
|
|
11404
11205
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11405
11206
|
special_ad_categories: specialAdCategoriesSchema,
|
|
11406
|
-
special_ad_category_country:
|
|
11407
|
-
buying_type:
|
|
11408
|
-
bid_strategy:
|
|
11207
|
+
special_ad_category_country: z13.array(z13.string().length(2)).optional(),
|
|
11208
|
+
buying_type: z13.enum(BUYING_TYPES).default("AUCTION"),
|
|
11209
|
+
bid_strategy: z13.enum(BID_STRATEGIES).optional(),
|
|
11409
11210
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
11410
11211
|
dailyBudget: moneySchema2.optional(),
|
|
11411
11212
|
lifetimeBudget: moneySchema2.optional(),
|
|
11412
11213
|
spendCap: moneySchema2.optional(),
|
|
11413
|
-
start_time:
|
|
11414
|
-
stop_time:
|
|
11214
|
+
start_time: z13.number().int().positive().optional(),
|
|
11215
|
+
stop_time: z13.number().int().positive().optional()
|
|
11415
11216
|
}).superRefine((p, ctx) => {
|
|
11416
11217
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
11417
11218
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -11421,15 +11222,15 @@ var campaignCreateSchema3 = z14.object({
|
|
|
11421
11222
|
ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
|
|
11422
11223
|
}
|
|
11423
11224
|
});
|
|
11424
|
-
var campaignUpdateSchema3 =
|
|
11425
|
-
name:
|
|
11225
|
+
var campaignUpdateSchema3 = z13.object({
|
|
11226
|
+
name: z13.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
11426
11227
|
status: updateStatusSchema.optional(),
|
|
11427
|
-
bid_strategy:
|
|
11228
|
+
bid_strategy: z13.enum(BID_STRATEGIES).optional(),
|
|
11428
11229
|
dailyBudget: moneySchema2.optional(),
|
|
11429
11230
|
lifetimeBudget: moneySchema2.optional(),
|
|
11430
11231
|
spendCap: moneySchema2.optional(),
|
|
11431
|
-
start_time:
|
|
11432
|
-
stop_time:
|
|
11232
|
+
start_time: z13.number().int().positive().optional(),
|
|
11233
|
+
stop_time: z13.number().int().positive().optional()
|
|
11433
11234
|
}).superRefine((p, ctx) => {
|
|
11434
11235
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
11435
11236
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -11439,38 +11240,38 @@ var campaignUpdateSchema3 = z14.object({
|
|
|
11439
11240
|
}
|
|
11440
11241
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
11441
11242
|
});
|
|
11442
|
-
var promotedObjectSchema =
|
|
11243
|
+
var promotedObjectSchema = z13.object({
|
|
11443
11244
|
page_id: parentRefSchema2.optional(),
|
|
11444
|
-
pixel_id:
|
|
11445
|
-
custom_event_type:
|
|
11446
|
-
application_id:
|
|
11447
|
-
object_store_url:
|
|
11448
|
-
product_catalog_id:
|
|
11449
|
-
product_set_id:
|
|
11450
|
-
whatsapp_phone_number:
|
|
11451
|
-
offline_conversion_data_set_id:
|
|
11245
|
+
pixel_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11246
|
+
custom_event_type: z13.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
11247
|
+
application_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11248
|
+
object_store_url: z13.string().url().optional(),
|
|
11249
|
+
product_catalog_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11250
|
+
product_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11251
|
+
whatsapp_phone_number: z13.string().optional(),
|
|
11252
|
+
offline_conversion_data_set_id: z13.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
11452
11253
|
}).partial();
|
|
11453
|
-
var attributionSpecSchema =
|
|
11454
|
-
|
|
11455
|
-
event_type:
|
|
11456
|
-
window_days:
|
|
11254
|
+
var attributionSpecSchema = z13.array(
|
|
11255
|
+
z13.object({
|
|
11256
|
+
event_type: z13.enum(ATTRIBUTION_EVENT_TYPES),
|
|
11257
|
+
window_days: z13.union([z13.literal(1), z13.literal(7), z13.literal(28)])
|
|
11457
11258
|
})
|
|
11458
11259
|
);
|
|
11459
11260
|
var adSetFields = {
|
|
11460
|
-
name:
|
|
11261
|
+
name: z13.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
11461
11262
|
campaign_id: parentRefSchema2,
|
|
11462
11263
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11463
11264
|
dailyBudget: moneySchema2.optional(),
|
|
11464
11265
|
lifetimeBudget: moneySchema2.optional(),
|
|
11465
11266
|
bidAmount: moneySchema2.optional(),
|
|
11466
|
-
bid_strategy:
|
|
11467
|
-
billing_event:
|
|
11468
|
-
optimization_goal:
|
|
11469
|
-
destination_type:
|
|
11267
|
+
bid_strategy: z13.enum(BID_STRATEGIES).optional(),
|
|
11268
|
+
billing_event: z13.enum(BILLING_EVENTS),
|
|
11269
|
+
optimization_goal: z13.enum(OPTIMIZATION_GOALS),
|
|
11270
|
+
destination_type: z13.enum(DESTINATION_TYPES).optional(),
|
|
11470
11271
|
promoted_object: promotedObjectSchema.optional(),
|
|
11471
11272
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11472
|
-
start_time:
|
|
11473
|
-
end_time:
|
|
11273
|
+
start_time: z13.number().int().positive().optional(),
|
|
11274
|
+
end_time: z13.number().int().positive().optional(),
|
|
11474
11275
|
targeting: metaTargetingSchema
|
|
11475
11276
|
};
|
|
11476
11277
|
function validateAdSetBudgetAndBid(p, ctx) {
|
|
@@ -11488,22 +11289,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
|
|
|
11488
11289
|
ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
|
|
11489
11290
|
}
|
|
11490
11291
|
}
|
|
11491
|
-
var adSetCreateSchema =
|
|
11292
|
+
var adSetCreateSchema = z13.object(adSetFields).superRefine((p, ctx) => {
|
|
11492
11293
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11493
11294
|
});
|
|
11494
|
-
var adSetUpdateSchema =
|
|
11295
|
+
var adSetUpdateSchema = z13.object({
|
|
11495
11296
|
name: adSetFields.name.optional(),
|
|
11496
11297
|
status: updateStatusSchema.optional(),
|
|
11497
11298
|
dailyBudget: moneySchema2.optional(),
|
|
11498
11299
|
lifetimeBudget: moneySchema2.optional(),
|
|
11499
11300
|
bidAmount: moneySchema2.optional(),
|
|
11500
|
-
bid_strategy:
|
|
11501
|
-
optimization_goal:
|
|
11502
|
-
destination_type:
|
|
11301
|
+
bid_strategy: z13.enum(BID_STRATEGIES).optional(),
|
|
11302
|
+
optimization_goal: z13.enum(OPTIMIZATION_GOALS).optional(),
|
|
11303
|
+
destination_type: z13.enum(DESTINATION_TYPES).optional(),
|
|
11503
11304
|
promoted_object: promotedObjectSchema.optional(),
|
|
11504
11305
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11505
|
-
start_time:
|
|
11506
|
-
end_time:
|
|
11306
|
+
start_time: z13.number().int().positive().optional(),
|
|
11307
|
+
end_time: z13.number().int().positive().optional(),
|
|
11507
11308
|
targeting: metaTargetingSchema.optional()
|
|
11508
11309
|
}).superRefine((p, ctx) => {
|
|
11509
11310
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
@@ -11511,38 +11312,38 @@ var adSetUpdateSchema = z14.object({
|
|
|
11511
11312
|
}
|
|
11512
11313
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11513
11314
|
});
|
|
11514
|
-
var messageSchema =
|
|
11515
|
-
var headlineSchema2 =
|
|
11516
|
-
var descriptionSchema =
|
|
11517
|
-
var callToActionSchema =
|
|
11518
|
-
type:
|
|
11315
|
+
var messageSchema = z13.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
11316
|
+
var headlineSchema2 = z13.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
11317
|
+
var descriptionSchema = z13.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
11318
|
+
var callToActionSchema = z13.object({
|
|
11319
|
+
type: z13.enum(CTA_TYPES2),
|
|
11519
11320
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
11520
11321
|
link: httpsUrlSchema3.optional()
|
|
11521
11322
|
});
|
|
11522
|
-
var creativeEnhancementsSchema =
|
|
11523
|
-
standardEnhancements:
|
|
11524
|
-
features:
|
|
11323
|
+
var creativeEnhancementsSchema = z13.object({
|
|
11324
|
+
standardEnhancements: z13.enum(ENROLL_STATUSES).optional(),
|
|
11325
|
+
features: z13.record(z13.string(), z13.enum(ENROLL_STATUSES)).optional()
|
|
11525
11326
|
});
|
|
11526
11327
|
var creativeSharedFields = {
|
|
11527
|
-
name:
|
|
11328
|
+
name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11528
11329
|
/** Facebook Page id backing the ad's identity. */
|
|
11529
11330
|
page_id: parentRefSchema2,
|
|
11530
11331
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
11531
|
-
instagram_user_id:
|
|
11332
|
+
instagram_user_id: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11532
11333
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
11533
|
-
url_tags:
|
|
11334
|
+
url_tags: z13.string().max(1e3).optional(),
|
|
11534
11335
|
enhancements: creativeEnhancementsSchema.optional()
|
|
11535
11336
|
};
|
|
11536
11337
|
var imageMediaFields = {
|
|
11537
|
-
imageHash:
|
|
11338
|
+
imageHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11538
11339
|
imageRef: tempRefSchema3.optional()
|
|
11539
11340
|
};
|
|
11540
11341
|
var videoMediaFields = {
|
|
11541
|
-
videoId:
|
|
11342
|
+
videoId: z13.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11542
11343
|
videoRef: tempRefSchema3.optional(),
|
|
11543
11344
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
11544
|
-
thumbnailHash:
|
|
11545
|
-
imageUrl:
|
|
11345
|
+
thumbnailHash: z13.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11346
|
+
imageUrl: z13.string().url().optional()
|
|
11546
11347
|
};
|
|
11547
11348
|
function countImageRefs(p) {
|
|
11548
11349
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -11550,8 +11351,8 @@ function countImageRefs(p) {
|
|
|
11550
11351
|
function countVideoRefs(p) {
|
|
11551
11352
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
11552
11353
|
}
|
|
11553
|
-
var singleCreativeSchema =
|
|
11554
|
-
creativeType:
|
|
11354
|
+
var singleCreativeSchema = z13.object({
|
|
11355
|
+
creativeType: z13.literal("single"),
|
|
11555
11356
|
...creativeSharedFields,
|
|
11556
11357
|
/** Primary text. */
|
|
11557
11358
|
message: messageSchema,
|
|
@@ -11560,7 +11361,7 @@ var singleCreativeSchema = z14.object({
|
|
|
11560
11361
|
headline: headlineSchema2.optional(),
|
|
11561
11362
|
description: descriptionSchema.optional(),
|
|
11562
11363
|
/** Display URL / caption shown under the headline. */
|
|
11563
|
-
caption:
|
|
11364
|
+
caption: z13.string().max(255).optional(),
|
|
11564
11365
|
call_to_action: callToActionSchema.optional(),
|
|
11565
11366
|
...imageMediaFields,
|
|
11566
11367
|
...videoMediaFields
|
|
@@ -11584,10 +11385,10 @@ var singleCreativeSchema = z14.object({
|
|
|
11584
11385
|
});
|
|
11585
11386
|
}
|
|
11586
11387
|
});
|
|
11587
|
-
var carouselCardSchema =
|
|
11388
|
+
var carouselCardSchema = z13.object({
|
|
11588
11389
|
link: httpsUrlSchema3,
|
|
11589
|
-
headline:
|
|
11590
|
-
description:
|
|
11390
|
+
headline: z13.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
11391
|
+
description: z13.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
11591
11392
|
call_to_action: callToActionSchema.optional(),
|
|
11592
11393
|
...imageMediaFields,
|
|
11593
11394
|
...videoMediaFields
|
|
@@ -11607,35 +11408,35 @@ var carouselCardSchema = z14.object({
|
|
|
11607
11408
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
11608
11409
|
}
|
|
11609
11410
|
});
|
|
11610
|
-
var carouselCreativeSchema2 =
|
|
11611
|
-
creativeType:
|
|
11411
|
+
var carouselCreativeSchema2 = z13.object({
|
|
11412
|
+
creativeType: z13.literal("carousel"),
|
|
11612
11413
|
...creativeSharedFields,
|
|
11613
11414
|
message: messageSchema,
|
|
11614
11415
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
11615
11416
|
link: httpsUrlSchema3.optional(),
|
|
11616
11417
|
call_to_action: callToActionSchema.optional(),
|
|
11617
|
-
cards:
|
|
11418
|
+
cards: z13.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
11618
11419
|
});
|
|
11619
|
-
var dynamicImageSchema =
|
|
11620
|
-
var dynamicVideoSchema =
|
|
11420
|
+
var dynamicImageSchema = z13.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
11421
|
+
var dynamicVideoSchema = z13.object({
|
|
11621
11422
|
videoId: videoMediaFields.videoId,
|
|
11622
11423
|
videoRef: videoMediaFields.videoRef,
|
|
11623
11424
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
11624
11425
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
11625
11426
|
var DYN = META_LIMITS.creative;
|
|
11626
|
-
var dynamicCreativeSchema =
|
|
11627
|
-
creativeType:
|
|
11427
|
+
var dynamicCreativeSchema = z13.object({
|
|
11428
|
+
creativeType: z13.literal("dynamic"),
|
|
11628
11429
|
...creativeSharedFields,
|
|
11629
|
-
bodies:
|
|
11630
|
-
titles:
|
|
11631
|
-
descriptions:
|
|
11632
|
-
images:
|
|
11633
|
-
videos:
|
|
11634
|
-
ad_formats:
|
|
11635
|
-
call_to_action_types:
|
|
11636
|
-
link_urls:
|
|
11430
|
+
bodies: z13.array(z13.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11431
|
+
titles: z13.array(z13.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11432
|
+
descriptions: z13.array(z13.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
11433
|
+
images: z13.array(dynamicImageSchema).optional(),
|
|
11434
|
+
videos: z13.array(dynamicVideoSchema).optional(),
|
|
11435
|
+
ad_formats: z13.array(z13.enum(AD_FORMATS2)).min(1),
|
|
11436
|
+
call_to_action_types: z13.array(z13.enum(CTA_TYPES2)).optional(),
|
|
11437
|
+
link_urls: z13.array(z13.object({ website_url: httpsUrlSchema3, display_url: z13.string().optional() })).min(1),
|
|
11637
11438
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
11638
|
-
asset_customization_rules:
|
|
11439
|
+
asset_customization_rules: z13.array(z13.record(z13.string(), z13.unknown())).optional()
|
|
11639
11440
|
}).superRefine((p, ctx) => {
|
|
11640
11441
|
if (!(p.images?.length || p.videos?.length)) {
|
|
11641
11442
|
ctx.addIssue({
|
|
@@ -11645,57 +11446,57 @@ var dynamicCreativeSchema = z14.object({
|
|
|
11645
11446
|
});
|
|
11646
11447
|
}
|
|
11647
11448
|
});
|
|
11648
|
-
var existingPostCreativeSchema =
|
|
11649
|
-
creativeType:
|
|
11449
|
+
var existingPostCreativeSchema = z13.object({
|
|
11450
|
+
creativeType: z13.literal("existing_post"),
|
|
11650
11451
|
name: creativeSharedFields.name,
|
|
11651
11452
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
11652
|
-
object_story_id:
|
|
11453
|
+
object_story_id: z13.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
11653
11454
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
11654
11455
|
url_tags: creativeSharedFields.url_tags,
|
|
11655
11456
|
enhancements: creativeSharedFields.enhancements
|
|
11656
11457
|
});
|
|
11657
|
-
var creativeContentSchema2 =
|
|
11458
|
+
var creativeContentSchema2 = z13.discriminatedUnion("creativeType", [
|
|
11658
11459
|
singleCreativeSchema,
|
|
11659
11460
|
carouselCreativeSchema2,
|
|
11660
11461
|
dynamicCreativeSchema,
|
|
11661
11462
|
existingPostCreativeSchema
|
|
11662
11463
|
]);
|
|
11663
11464
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
11664
|
-
var adCreativeUpdateSchema =
|
|
11665
|
-
name:
|
|
11465
|
+
var adCreativeUpdateSchema = z13.object({
|
|
11466
|
+
name: z13.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11666
11467
|
status: updateStatusSchema.optional(),
|
|
11667
11468
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
11668
|
-
content:
|
|
11469
|
+
content: z13.record(z13.string(), z13.unknown()).optional()
|
|
11669
11470
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11670
|
-
var adCreateSchema2 =
|
|
11671
|
-
name:
|
|
11471
|
+
var adCreateSchema2 = z13.object({
|
|
11472
|
+
name: z13.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
11672
11473
|
adset_id: parentRefSchema2,
|
|
11673
11474
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11674
|
-
creative:
|
|
11475
|
+
creative: z13.object({ creative_id: parentRefSchema2 }),
|
|
11675
11476
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
11676
|
-
tracking_specs:
|
|
11477
|
+
tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
|
|
11677
11478
|
});
|
|
11678
|
-
var adUpdateSchema2 =
|
|
11679
|
-
name:
|
|
11479
|
+
var adUpdateSchema2 = z13.object({
|
|
11480
|
+
name: z13.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
11680
11481
|
status: updateStatusSchema.optional(),
|
|
11681
11482
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
11682
|
-
creative:
|
|
11683
|
-
tracking_specs:
|
|
11483
|
+
creative: z13.object({ creative_id: parentRefSchema2 }).optional(),
|
|
11484
|
+
tracking_specs: z13.array(z13.record(z13.string(), z13.unknown())).optional()
|
|
11684
11485
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11685
|
-
var lookalikeSpecSchema =
|
|
11686
|
-
origin:
|
|
11687
|
-
ratio:
|
|
11688
|
-
country:
|
|
11689
|
-
});
|
|
11690
|
-
var customAudienceCreateSchema =
|
|
11691
|
-
name:
|
|
11692
|
-
subtype:
|
|
11693
|
-
description:
|
|
11694
|
-
customer_file_source:
|
|
11695
|
-
retention_days:
|
|
11486
|
+
var lookalikeSpecSchema = z13.object({
|
|
11487
|
+
origin: z13.array(z13.object({ id: parentRefSchema2 })).min(1),
|
|
11488
|
+
ratio: z13.number().min(0.01).max(0.2).optional(),
|
|
11489
|
+
country: z13.string().length(2).optional()
|
|
11490
|
+
});
|
|
11491
|
+
var customAudienceCreateSchema = z13.object({
|
|
11492
|
+
name: z13.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
11493
|
+
subtype: z13.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
11494
|
+
description: z13.string().max(500).optional(),
|
|
11495
|
+
customer_file_source: z13.string().optional(),
|
|
11496
|
+
retention_days: z13.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
11696
11497
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
11697
11498
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
11698
|
-
rule:
|
|
11499
|
+
rule: z13.record(z13.string(), z13.unknown()).optional()
|
|
11699
11500
|
}).superRefine((p, ctx) => {
|
|
11700
11501
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
11701
11502
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -11704,16 +11505,16 @@ var customAudienceCreateSchema = z14.object({
|
|
|
11704
11505
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
11705
11506
|
}
|
|
11706
11507
|
});
|
|
11707
|
-
var customAudienceUpdateSchema =
|
|
11708
|
-
name:
|
|
11709
|
-
description:
|
|
11508
|
+
var customAudienceUpdateSchema = z13.object({
|
|
11509
|
+
name: z13.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
11510
|
+
description: z13.string().max(500).optional()
|
|
11710
11511
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11711
|
-
var mediaUploadSchema =
|
|
11712
|
-
kind:
|
|
11512
|
+
var mediaUploadSchema = z13.object({
|
|
11513
|
+
kind: z13.enum(MEDIA_KINDS),
|
|
11713
11514
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
11714
11515
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
11715
11516
|
/** Optional display name / filename hint. */
|
|
11716
|
-
name:
|
|
11517
|
+
name: z13.string().max(255).optional()
|
|
11717
11518
|
}).superRefine((p, ctx) => {
|
|
11718
11519
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
11719
11520
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -11735,16 +11536,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
11735
11536
|
"customAudience.update",
|
|
11736
11537
|
"media.upload"
|
|
11737
11538
|
];
|
|
11738
|
-
var metaDraftOpKindSchema =
|
|
11739
|
-
var accountIdSchema2 =
|
|
11740
|
-
var updateTargetSchema2 =
|
|
11539
|
+
var metaDraftOpKindSchema = z13.enum(META_DRAFT_OP_KINDS);
|
|
11540
|
+
var accountIdSchema2 = z13.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
11541
|
+
var updateTargetSchema2 = z13.union([z13.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
11741
11542
|
function createOp3(kind, payload) {
|
|
11742
|
-
return
|
|
11543
|
+
return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, payload });
|
|
11743
11544
|
}
|
|
11744
11545
|
function updateOp3(kind, payload) {
|
|
11745
|
-
return
|
|
11546
|
+
return z13.object({ kind: z13.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
11746
11547
|
}
|
|
11747
|
-
var metaDraftOpInputSchema =
|
|
11548
|
+
var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
|
|
11748
11549
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
11749
11550
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
11750
11551
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -11759,89 +11560,89 @@ var metaDraftOpInputSchema = z14.discriminatedUnion("kind", [
|
|
|
11759
11560
|
]);
|
|
11760
11561
|
|
|
11761
11562
|
// ../api/src/ads-meta/wire.ts
|
|
11762
|
-
import { z as
|
|
11763
|
-
var metaWriteModeSchema =
|
|
11764
|
-
var metaDraftOpResultSchema =
|
|
11765
|
-
status:
|
|
11563
|
+
import { z as z14 } from "zod";
|
|
11564
|
+
var metaWriteModeSchema = z14.enum(["live", "simulated"]);
|
|
11565
|
+
var metaDraftOpResultSchema = z14.object({
|
|
11566
|
+
status: z14.enum(["applied", "simulated", "failed", "skipped"]),
|
|
11766
11567
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
11767
|
-
id:
|
|
11568
|
+
id: z14.string().optional(),
|
|
11768
11569
|
/** For media.upload ops: the resulting image hash. */
|
|
11769
|
-
hash:
|
|
11770
|
-
error:
|
|
11771
|
-
skippedBecause:
|
|
11772
|
-
executedAt:
|
|
11570
|
+
hash: z14.string().optional(),
|
|
11571
|
+
error: z14.string().optional(),
|
|
11572
|
+
skippedBecause: z14.string().optional(),
|
|
11573
|
+
executedAt: z14.number().optional()
|
|
11773
11574
|
});
|
|
11774
|
-
var metaDraftStageRequestSchema =
|
|
11775
|
-
chatId:
|
|
11575
|
+
var metaDraftStageRequestSchema = z14.object({
|
|
11576
|
+
chatId: z14.string(),
|
|
11776
11577
|
op: metaDraftOpInputSchema
|
|
11777
11578
|
});
|
|
11778
|
-
var metaDraftStageResponseSchema =
|
|
11779
|
-
staged:
|
|
11780
|
-
ref:
|
|
11579
|
+
var metaDraftStageResponseSchema = z14.object({
|
|
11580
|
+
staged: z14.literal(true),
|
|
11581
|
+
ref: z14.string(),
|
|
11781
11582
|
kind: metaDraftOpKindSchema,
|
|
11782
11583
|
mode: metaWriteModeSchema,
|
|
11783
|
-
dependsOn:
|
|
11784
|
-
summary:
|
|
11785
|
-
warnings:
|
|
11584
|
+
dependsOn: z14.array(z14.string()),
|
|
11585
|
+
summary: z14.string(),
|
|
11586
|
+
warnings: z14.array(z14.string()),
|
|
11786
11587
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
11787
|
-
amended:
|
|
11788
|
-
});
|
|
11789
|
-
var metaDraftDuplicateRequestSchema =
|
|
11790
|
-
chatId:
|
|
11791
|
-
accountId:
|
|
11792
|
-
entity:
|
|
11793
|
-
sourceId:
|
|
11794
|
-
overrides:
|
|
11588
|
+
amended: z14.boolean().optional()
|
|
11589
|
+
});
|
|
11590
|
+
var metaDraftDuplicateRequestSchema = z14.object({
|
|
11591
|
+
chatId: z14.string(),
|
|
11592
|
+
accountId: z14.string(),
|
|
11593
|
+
entity: z14.enum(["campaign", "adSet", "ad"]),
|
|
11594
|
+
sourceId: z14.string(),
|
|
11595
|
+
overrides: z14.record(z14.string(), z14.unknown()).optional(),
|
|
11795
11596
|
/** Pause the original after the copy publishes. */
|
|
11796
|
-
replace:
|
|
11597
|
+
replace: z14.boolean().optional()
|
|
11797
11598
|
});
|
|
11798
|
-
var metaDraftOpViewSchema =
|
|
11799
|
-
ref:
|
|
11599
|
+
var metaDraftOpViewSchema = z14.object({
|
|
11600
|
+
ref: z14.string(),
|
|
11800
11601
|
kind: metaDraftOpKindSchema,
|
|
11801
|
-
accountId:
|
|
11802
|
-
target:
|
|
11803
|
-
dependsOn:
|
|
11804
|
-
summary:
|
|
11805
|
-
stagedAt:
|
|
11602
|
+
accountId: z14.string(),
|
|
11603
|
+
target: z14.string().optional(),
|
|
11604
|
+
dependsOn: z14.array(z14.string()),
|
|
11605
|
+
summary: z14.string(),
|
|
11606
|
+
stagedAt: z14.number(),
|
|
11806
11607
|
result: metaDraftOpResultSchema.optional()
|
|
11807
11608
|
});
|
|
11808
|
-
var metaDraftListRequestSchema =
|
|
11809
|
-
chatId:
|
|
11609
|
+
var metaDraftListRequestSchema = z14.object({
|
|
11610
|
+
chatId: z14.string()
|
|
11810
11611
|
});
|
|
11811
|
-
var metaDraftAdvisorySchema =
|
|
11812
|
-
ref:
|
|
11813
|
-
message:
|
|
11612
|
+
var metaDraftAdvisorySchema = z14.object({
|
|
11613
|
+
ref: z14.string(),
|
|
11614
|
+
message: z14.string()
|
|
11814
11615
|
});
|
|
11815
|
-
var metaDraftListResponseSchema =
|
|
11816
|
-
status:
|
|
11616
|
+
var metaDraftListResponseSchema = z14.object({
|
|
11617
|
+
status: z14.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
11817
11618
|
mode: metaWriteModeSchema,
|
|
11818
|
-
count:
|
|
11819
|
-
ops:
|
|
11619
|
+
count: z14.number(),
|
|
11620
|
+
ops: z14.array(metaDraftOpViewSchema),
|
|
11820
11621
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
11821
|
-
advisories:
|
|
11622
|
+
advisories: z14.array(metaDraftAdvisorySchema)
|
|
11822
11623
|
});
|
|
11823
|
-
var metaDraftRemoveRequestSchema =
|
|
11824
|
-
chatId:
|
|
11825
|
-
ref:
|
|
11624
|
+
var metaDraftRemoveRequestSchema = z14.object({
|
|
11625
|
+
chatId: z14.string(),
|
|
11626
|
+
ref: z14.string()
|
|
11826
11627
|
});
|
|
11827
|
-
var metaDraftRemoveResponseSchema =
|
|
11628
|
+
var metaDraftRemoveResponseSchema = z14.object({
|
|
11828
11629
|
/** The requested ref plus any dependents removed by cascade. */
|
|
11829
|
-
removed:
|
|
11630
|
+
removed: z14.array(z14.string())
|
|
11830
11631
|
});
|
|
11831
|
-
var metaDraftClearRequestSchema =
|
|
11832
|
-
chatId:
|
|
11632
|
+
var metaDraftClearRequestSchema = z14.object({
|
|
11633
|
+
chatId: z14.string()
|
|
11833
11634
|
});
|
|
11834
|
-
var metaDraftClearResponseSchema =
|
|
11835
|
-
cleared:
|
|
11635
|
+
var metaDraftClearResponseSchema = z14.object({
|
|
11636
|
+
cleared: z14.number()
|
|
11836
11637
|
});
|
|
11837
|
-
var metaFieldErrorSchema =
|
|
11838
|
-
path:
|
|
11839
|
-
message:
|
|
11638
|
+
var metaFieldErrorSchema = z14.object({
|
|
11639
|
+
path: z14.string(),
|
|
11640
|
+
message: z14.string()
|
|
11840
11641
|
});
|
|
11841
|
-
var metaDraftErrorResponseSchema =
|
|
11842
|
-
code:
|
|
11843
|
-
error:
|
|
11844
|
-
fields:
|
|
11642
|
+
var metaDraftErrorResponseSchema = z14.object({
|
|
11643
|
+
code: z14.string(),
|
|
11644
|
+
error: z14.string(),
|
|
11645
|
+
fields: z14.array(metaFieldErrorSchema).optional()
|
|
11845
11646
|
});
|
|
11846
11647
|
|
|
11847
11648
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -15254,7 +15055,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
15254
15055
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
15255
15056
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
15256
15057
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
15257
|
-
import { z as
|
|
15058
|
+
import { z as z15 } from "zod";
|
|
15258
15059
|
|
|
15259
15060
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
15260
15061
|
var SHOOT_MODES = [
|
|
@@ -15590,71 +15391,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
15590
15391
|
"{{out.video}}"
|
|
15591
15392
|
];
|
|
15592
15393
|
}
|
|
15593
|
-
var FrameAsset =
|
|
15594
|
-
var DialogueLine =
|
|
15595
|
-
speaker:
|
|
15596
|
-
line:
|
|
15394
|
+
var FrameAsset = z15.object({ url: z15.string().optional() }).loose().optional();
|
|
15395
|
+
var DialogueLine = z15.object({
|
|
15396
|
+
speaker: z15.string().optional(),
|
|
15397
|
+
line: z15.string().optional(),
|
|
15597
15398
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
15598
|
-
start_s:
|
|
15599
|
-
end_s:
|
|
15600
|
-
delivery:
|
|
15601
|
-
voice_description:
|
|
15399
|
+
start_s: z15.number().optional(),
|
|
15400
|
+
end_s: z15.number().optional(),
|
|
15401
|
+
delivery: z15.string().optional(),
|
|
15402
|
+
voice_description: z15.string().optional(),
|
|
15602
15403
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
15603
15404
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
15604
15405
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
15605
15406
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
15606
15407
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
15607
|
-
on_camera:
|
|
15408
|
+
on_camera: z15.boolean().optional()
|
|
15608
15409
|
}).loose();
|
|
15609
|
-
var Sfx =
|
|
15610
|
-
at_s:
|
|
15611
|
-
duration_s:
|
|
15612
|
-
sound_effect_prompt:
|
|
15613
|
-
description:
|
|
15410
|
+
var Sfx = z15.object({
|
|
15411
|
+
at_s: z15.number().optional(),
|
|
15412
|
+
duration_s: z15.number().optional(),
|
|
15413
|
+
sound_effect_prompt: z15.string().optional(),
|
|
15414
|
+
description: z15.string().optional()
|
|
15614
15415
|
}).loose();
|
|
15615
|
-
var CompositionRegion =
|
|
15416
|
+
var CompositionRegion = z15.object({
|
|
15616
15417
|
// full | top | bottom | left | right | inset
|
|
15617
|
-
panel:
|
|
15418
|
+
panel: z15.string().optional(),
|
|
15618
15419
|
// 9-grid anchor for an `inset` presenter box.
|
|
15619
|
-
position:
|
|
15620
|
-
is_presenter:
|
|
15420
|
+
position: z15.string().optional(),
|
|
15421
|
+
is_presenter: z15.boolean().optional(),
|
|
15621
15422
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
15622
|
-
cast_ref:
|
|
15423
|
+
cast_ref: z15.string().optional(),
|
|
15623
15424
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
15624
15425
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
15625
15426
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
15626
15427
|
// overlay layer, never AI-generated.
|
|
15627
|
-
kind:
|
|
15428
|
+
kind: z15.string().optional(),
|
|
15628
15429
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
15629
15430
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
15630
15431
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
15631
15432
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
15632
15433
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
15633
15434
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
15634
|
-
surface_id:
|
|
15435
|
+
surface_id: z15.string().optional(),
|
|
15635
15436
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
15636
15437
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
15637
15438
|
// must re-composite, not paint into the surface.
|
|
15638
|
-
nested:
|
|
15639
|
-
summary:
|
|
15640
|
-
frame_prompt:
|
|
15641
|
-
motion_prompt:
|
|
15439
|
+
nested: z15.array(z15.object({}).loose()).optional(),
|
|
15440
|
+
summary: z15.string().optional(),
|
|
15441
|
+
frame_prompt: z15.string().optional(),
|
|
15442
|
+
motion_prompt: z15.string().optional()
|
|
15642
15443
|
}).loose();
|
|
15643
|
-
var SceneComposition =
|
|
15444
|
+
var SceneComposition = z15.object({
|
|
15644
15445
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
15645
|
-
layout:
|
|
15446
|
+
layout: z15.string().optional(),
|
|
15646
15447
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
15647
|
-
split_axis:
|
|
15648
|
-
regions:
|
|
15448
|
+
split_axis: z15.string().optional(),
|
|
15449
|
+
regions: z15.array(CompositionRegion).optional()
|
|
15649
15450
|
}).loose();
|
|
15650
|
-
var CameraMotion =
|
|
15651
|
-
var TranscriptWord =
|
|
15652
|
-
var Scene =
|
|
15653
|
-
start_s:
|
|
15654
|
-
end_s:
|
|
15655
|
-
duration_s:
|
|
15656
|
-
summary:
|
|
15657
|
-
action_detail:
|
|
15451
|
+
var CameraMotion = z15.object({ movement: z15.string().optional(), detail: z15.string().optional() }).loose();
|
|
15452
|
+
var TranscriptWord = z15.object({ text: z15.string().optional() }).loose();
|
|
15453
|
+
var Scene = z15.object({
|
|
15454
|
+
start_s: z15.number().optional(),
|
|
15455
|
+
end_s: z15.number().optional(),
|
|
15456
|
+
duration_s: z15.number().optional(),
|
|
15457
|
+
summary: z15.string().optional(),
|
|
15458
|
+
action_detail: z15.string().optional(),
|
|
15658
15459
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
15659
15460
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
15660
15461
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -15662,82 +15463,82 @@ var Scene = z16.object({
|
|
|
15662
15463
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
15663
15464
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
15664
15465
|
// UGC/product mode; a human can override per scene by setting this.
|
|
15665
|
-
shoot_mode:
|
|
15466
|
+
shoot_mode: z15.string().optional(),
|
|
15666
15467
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
15667
15468
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
15668
|
-
ambient:
|
|
15469
|
+
ambient: z15.string().optional(),
|
|
15669
15470
|
camera_motion: CameraMotion.optional(),
|
|
15670
|
-
start_frame_prompt:
|
|
15671
|
-
end_frame_prompt:
|
|
15672
|
-
motion_prompt:
|
|
15471
|
+
start_frame_prompt: z15.string().optional(),
|
|
15472
|
+
end_frame_prompt: z15.string().optional(),
|
|
15473
|
+
motion_prompt: z15.string().optional(),
|
|
15673
15474
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
15674
15475
|
// script re-craft checklist. Inferred from position when absent.
|
|
15675
|
-
narrative_role:
|
|
15476
|
+
narrative_role: z15.string().optional(),
|
|
15676
15477
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
15677
15478
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
15678
15479
|
// into the hook's start-frame description so the generator renders that state,
|
|
15679
15480
|
// not a calm influencer (CCA-11).
|
|
15680
|
-
hook_mechanic:
|
|
15481
|
+
hook_mechanic: z15.object({ mechanic: z15.string().optional(), why_it_stops_scroll: z15.string().optional() }).loose().optional(),
|
|
15681
15482
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
15682
|
-
scene_setting:
|
|
15483
|
+
scene_setting: z15.string().optional(),
|
|
15683
15484
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
15684
15485
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
15685
15486
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
15686
15487
|
// ignored (nothing follows it).
|
|
15687
|
-
transition_out:
|
|
15688
|
-
dialogue:
|
|
15689
|
-
sfx:
|
|
15690
|
-
overlays:
|
|
15691
|
-
floating_elements:
|
|
15488
|
+
transition_out: z15.object({ type: z15.string().optional(), description: z15.string().optional() }).loose().optional(),
|
|
15489
|
+
dialogue: z15.array(DialogueLine).optional(),
|
|
15490
|
+
sfx: z15.array(Sfx).optional(),
|
|
15491
|
+
overlays: z15.array(z15.unknown()).optional(),
|
|
15492
|
+
floating_elements: z15.array(z15.unknown()).optional(),
|
|
15692
15493
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
15693
15494
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
15694
15495
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
15695
15496
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
15696
|
-
motion_level:
|
|
15697
|
-
transcript_slice:
|
|
15497
|
+
motion_level: z15.enum(["static", "subtle", "dynamic"]).optional(),
|
|
15498
|
+
transcript_slice: z15.array(TranscriptWord).optional(),
|
|
15698
15499
|
start_frame_asset: FrameAsset,
|
|
15699
15500
|
end_frame_asset: FrameAsset,
|
|
15700
15501
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
15701
15502
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
15702
15503
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
15703
15504
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
15704
|
-
continues_previous:
|
|
15505
|
+
continues_previous: z15.boolean().optional()
|
|
15705
15506
|
}).loose();
|
|
15706
|
-
var VideoBlueprint =
|
|
15707
|
-
source:
|
|
15708
|
-
global:
|
|
15709
|
-
music:
|
|
15710
|
-
present:
|
|
15711
|
-
music_prompt:
|
|
15507
|
+
var VideoBlueprint = z15.object({
|
|
15508
|
+
source: z15.object({ aspect_ratio: z15.string().optional(), duration_s: z15.number().optional() }).loose().optional(),
|
|
15509
|
+
global: z15.object({
|
|
15510
|
+
music: z15.object({
|
|
15511
|
+
present: z15.boolean().optional(),
|
|
15512
|
+
music_prompt: z15.string().optional(),
|
|
15712
15513
|
// Absolute second the music enters in the reference (the bed often
|
|
15713
15514
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
15714
15515
|
// instead of at 0 so the timing matches.
|
|
15715
|
-
starts_at_s:
|
|
15516
|
+
starts_at_s: z15.number().optional(),
|
|
15716
15517
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
15717
15518
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
15718
|
-
identified_track:
|
|
15519
|
+
identified_track: z15.object({ title: z15.string().optional(), artist: z15.string().optional() }).loose().nullish()
|
|
15719
15520
|
}).loose().optional(),
|
|
15720
|
-
cast:
|
|
15721
|
-
|
|
15722
|
-
id:
|
|
15723
|
-
description:
|
|
15521
|
+
cast: z15.array(
|
|
15522
|
+
z15.object({
|
|
15523
|
+
id: z15.string().optional(),
|
|
15524
|
+
description: z15.string().optional(),
|
|
15724
15525
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
15725
15526
|
// French speaker") — read to derive the spoken-track language code.
|
|
15726
|
-
market_localization_note:
|
|
15527
|
+
market_localization_note: z15.string().optional()
|
|
15727
15528
|
}).loose()
|
|
15728
15529
|
).optional(),
|
|
15729
|
-
voiceover:
|
|
15530
|
+
voiceover: z15.object({
|
|
15730
15531
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
15731
15532
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
15732
|
-
mode:
|
|
15733
|
-
voice_description:
|
|
15734
|
-
persona:
|
|
15533
|
+
mode: z15.string().optional(),
|
|
15534
|
+
voice_description: z15.string().optional(),
|
|
15535
|
+
persona: z15.string().optional()
|
|
15735
15536
|
}).loose().optional(),
|
|
15736
15537
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
15737
15538
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
15738
|
-
style:
|
|
15539
|
+
style: z15.object({ palette: z15.array(z15.object({ hex: z15.string().optional() }).loose()).optional() }).loose().optional()
|
|
15739
15540
|
}).loose().optional(),
|
|
15740
|
-
scenes:
|
|
15541
|
+
scenes: z15.array(Scene).min(1)
|
|
15741
15542
|
}).loose();
|
|
15742
15543
|
function injectHookPhysicality(blueprint) {
|
|
15743
15544
|
for (const scene of blueprint.scenes) {
|
|
@@ -15754,26 +15555,26 @@ function clipIntentOf(scene, sceneIndex) {
|
|
|
15754
15555
|
if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
|
|
15755
15556
|
return "body";
|
|
15756
15557
|
}
|
|
15757
|
-
var AppearsItem =
|
|
15758
|
-
var RecurringElement =
|
|
15558
|
+
var AppearsItem = z15.union([z15.number(), z15.object({ scene: z15.number(), edge: z15.string().optional() }).loose()]);
|
|
15559
|
+
var RecurringElement = z15.object({
|
|
15759
15560
|
// person | animal | product | logo | badge | other
|
|
15760
|
-
type:
|
|
15761
|
-
label:
|
|
15762
|
-
description:
|
|
15763
|
-
expression:
|
|
15561
|
+
type: z15.string(),
|
|
15562
|
+
label: z15.string().optional(),
|
|
15563
|
+
description: z15.string().optional(),
|
|
15564
|
+
expression: z15.string().nullable().optional(),
|
|
15764
15565
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
15765
|
-
cast_id:
|
|
15566
|
+
cast_id: z15.string().nullable().optional(),
|
|
15766
15567
|
// The label of another element that is the SAME individual as this one, shown
|
|
15767
15568
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
15768
15569
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
15769
15570
|
// slot, but the face/identity must stay identical across them.
|
|
15770
|
-
same_as:
|
|
15571
|
+
same_as: z15.string().nullable().optional(),
|
|
15771
15572
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
15772
15573
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
15773
|
-
scenes:
|
|
15774
|
-
appears_in:
|
|
15574
|
+
scenes: z15.array(z15.number()).optional(),
|
|
15575
|
+
appears_in: z15.array(AppearsItem).optional()
|
|
15775
15576
|
}).loose();
|
|
15776
|
-
var RecurringElements =
|
|
15577
|
+
var RecurringElements = z15.array(RecurringElement);
|
|
15777
15578
|
function sanitizeId(raw, fallback) {
|
|
15778
15579
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
15779
15580
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -16246,7 +16047,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
16246
16047
|
return kept;
|
|
16247
16048
|
}
|
|
16248
16049
|
function sceneFloatDescs(scene) {
|
|
16249
|
-
const floats =
|
|
16050
|
+
const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
16250
16051
|
if (!floats.success) return [];
|
|
16251
16052
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
16252
16053
|
}
|
|
@@ -17670,25 +17471,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
|
|
|
17670
17471
|
}
|
|
17671
17472
|
return tracks;
|
|
17672
17473
|
}
|
|
17673
|
-
var OverlayStyle =
|
|
17674
|
-
var Overlay =
|
|
17675
|
-
text:
|
|
17676
|
-
appears_at_s:
|
|
17677
|
-
duration_s:
|
|
17678
|
-
position:
|
|
17679
|
-
role:
|
|
17680
|
-
animation:
|
|
17681
|
-
animation_detail:
|
|
17474
|
+
var OverlayStyle = z15.object({ color_hex: z15.string().optional(), background: z15.string().optional(), size: z15.string().optional() }).loose();
|
|
17475
|
+
var Overlay = z15.object({
|
|
17476
|
+
text: z15.string().optional(),
|
|
17477
|
+
appears_at_s: z15.number().optional(),
|
|
17478
|
+
duration_s: z15.number().optional(),
|
|
17479
|
+
position: z15.string().optional(),
|
|
17480
|
+
role: z15.string().optional(),
|
|
17481
|
+
animation: z15.string().optional(),
|
|
17482
|
+
animation_detail: z15.string().optional(),
|
|
17682
17483
|
style: OverlayStyle.optional()
|
|
17683
17484
|
}).loose();
|
|
17684
|
-
var FloatingElement =
|
|
17685
|
-
kind:
|
|
17686
|
-
description:
|
|
17687
|
-
brand_name:
|
|
17688
|
-
what_it_represents:
|
|
17689
|
-
appears_at_s:
|
|
17690
|
-
duration_s:
|
|
17691
|
-
position:
|
|
17485
|
+
var FloatingElement = z15.object({
|
|
17486
|
+
kind: z15.string().optional(),
|
|
17487
|
+
description: z15.string().optional(),
|
|
17488
|
+
brand_name: z15.string().nullish(),
|
|
17489
|
+
what_it_represents: z15.string().optional(),
|
|
17490
|
+
appears_at_s: z15.number().optional(),
|
|
17491
|
+
duration_s: z15.number().optional(),
|
|
17492
|
+
position: z15.string().optional()
|
|
17692
17493
|
}).loose();
|
|
17693
17494
|
function escapeHtml(s) {
|
|
17694
17495
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -17720,7 +17521,7 @@ function positionClass(position) {
|
|
|
17720
17521
|
function collectCaptions(blueprint, clock) {
|
|
17721
17522
|
return blueprint.scenes.flatMap((scene, i) => {
|
|
17722
17523
|
const sceneStart = scene.start_s ?? 0;
|
|
17723
|
-
const overlays =
|
|
17524
|
+
const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17724
17525
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
17725
17526
|
const at = clock.map(i, ov.appears_at_s ?? sceneStart);
|
|
17726
17527
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -17800,7 +17601,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
|
|
|
17800
17601
|
const windows = /* @__PURE__ */ new Map();
|
|
17801
17602
|
blueprint.scenes.forEach((scene, i) => {
|
|
17802
17603
|
const sceneStart = scene.start_s ?? 0;
|
|
17803
|
-
const floats =
|
|
17604
|
+
const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
17804
17605
|
if (!floats.success) return;
|
|
17805
17606
|
for (const fe of floats.data) {
|
|
17806
17607
|
const at = clock.map(i, fe.appears_at_s ?? sceneStart);
|
|
@@ -18248,8 +18049,8 @@ function buildMotionBoard(blueprint) {
|
|
|
18248
18049
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
18249
18050
|
cursor = end_s;
|
|
18250
18051
|
const spoken = sceneSpokenText(scene);
|
|
18251
|
-
const overlays =
|
|
18252
|
-
const floats =
|
|
18052
|
+
const overlays = z15.array(Overlay).safeParse(scene.overlays ?? []);
|
|
18053
|
+
const floats = z15.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
18253
18054
|
const graphics = [
|
|
18254
18055
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
18255
18056
|
kind: "text",
|
|
@@ -19681,7 +19482,7 @@ import path17 from "path";
|
|
|
19681
19482
|
import { defineCommand as defineCommand91 } from "citty";
|
|
19682
19483
|
|
|
19683
19484
|
// src/engine/scaffold/staticAd.ts
|
|
19684
|
-
import { z as
|
|
19485
|
+
import { z as z16 } from "zod";
|
|
19685
19486
|
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"]);
|
|
19686
19487
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
19687
19488
|
var SHEET_SUBJECT_TYPE2 = {
|
|
@@ -19693,24 +19494,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
|
|
|
19693
19494
|
var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
|
|
19694
19495
|
var ADAPT_IMAGE_SIZE = "2K";
|
|
19695
19496
|
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.";
|
|
19696
|
-
var Blueprint =
|
|
19697
|
-
meta:
|
|
19698
|
-
text_content:
|
|
19497
|
+
var Blueprint = z16.object({
|
|
19498
|
+
meta: z16.object({ estimated_aspect_ratio: z16.string().optional() }).loose().optional(),
|
|
19499
|
+
text_content: z16.array(z16.object({ text: z16.string().optional() }).loose()).optional()
|
|
19699
19500
|
}).loose();
|
|
19700
|
-
var ElementLocator =
|
|
19701
|
-
collection:
|
|
19702
|
-
index:
|
|
19501
|
+
var ElementLocator = z16.object({
|
|
19502
|
+
collection: z16.enum(["subjects", "people", "brands_logos"]),
|
|
19503
|
+
index: z16.number().int().nonnegative()
|
|
19703
19504
|
}).loose();
|
|
19704
|
-
var MainElement =
|
|
19505
|
+
var MainElement = z16.object({
|
|
19705
19506
|
// logo | product | person | animal | badge | other
|
|
19706
|
-
type:
|
|
19707
|
-
label:
|
|
19708
|
-
description:
|
|
19709
|
-
expression:
|
|
19710
|
-
reason:
|
|
19507
|
+
type: z16.string(),
|
|
19508
|
+
label: z16.string().optional(),
|
|
19509
|
+
description: z16.string().optional(),
|
|
19510
|
+
expression: z16.string().nullable().optional(),
|
|
19511
|
+
reason: z16.string().optional(),
|
|
19711
19512
|
locator: ElementLocator.optional()
|
|
19712
19513
|
}).loose();
|
|
19713
|
-
var MainElements =
|
|
19514
|
+
var MainElements = z16.array(MainElement);
|
|
19714
19515
|
function sanitizeId2(raw, fallback) {
|
|
19715
19516
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
19716
19517
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -21495,219 +21296,11 @@ Subcommands:
|
|
|
21495
21296
|
}
|
|
21496
21297
|
});
|
|
21497
21298
|
|
|
21498
|
-
// src/commands/chats/index.ts
|
|
21499
|
-
import { defineCommand as defineCommand96 } from "citty";
|
|
21500
|
-
var STATUS_GROUPS = ["active", "archived", "all"];
|
|
21501
|
-
var REPO_SURFACES = ["knowledge", "company", "brand", "landings", "flows", "creatives"];
|
|
21502
|
-
function parseBoundedInt(raw, name, min, max) {
|
|
21503
|
-
if (raw === void 0) {
|
|
21504
|
-
return void 0;
|
|
21505
|
-
}
|
|
21506
|
-
const value = Number.parseInt(raw, 10);
|
|
21507
|
-
if (Number.isNaN(value) || value < min || value > max) {
|
|
21508
|
-
throw new Error(`--${name} must be an integer between ${min} and ${max}`);
|
|
21509
|
-
}
|
|
21510
|
-
return value;
|
|
21511
|
-
}
|
|
21512
|
-
registerSchema({
|
|
21513
|
-
command: "chats.list",
|
|
21514
|
-
description: "Start here: list other Sessions on this account (newest first) so you can reuse what was done before. Each row shows the Session id, title, status, and a count of what it produced (creatives, landings, actions, flows, reports\u2026). Then drill in with `baker chats view <id>`, `baker chats transcript <id>`, or `baker chats diff <id>`. Read-only.",
|
|
21515
|
-
args: {
|
|
21516
|
-
status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
|
|
21517
|
-
limit: { type: "string", description: "Max Sessions to return, 1-100 (default: 20)", required: false },
|
|
21518
|
-
full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
|
|
21519
|
-
}
|
|
21520
|
-
});
|
|
21521
|
-
var listCommand5 = defineCommand96({
|
|
21522
|
-
meta: { name: "list", description: "List other Sessions on this account, newest first." },
|
|
21523
|
-
args: {
|
|
21524
|
-
status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
|
|
21525
|
-
limit: { type: "string", description: "Max Sessions (1-100, default 20)", required: false },
|
|
21526
|
-
full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
|
|
21527
|
-
},
|
|
21528
|
-
run: async ({ args }) => {
|
|
21529
|
-
try {
|
|
21530
|
-
const body = {};
|
|
21531
|
-
if (args.status) {
|
|
21532
|
-
if (!STATUS_GROUPS.includes(args.status)) {
|
|
21533
|
-
throw new Error(`--status must be one of: ${STATUS_GROUPS.join("|")}`);
|
|
21534
|
-
}
|
|
21535
|
-
body.status = args.status;
|
|
21536
|
-
}
|
|
21537
|
-
const limit = parseBoundedInt(args.limit, "limit", 1, 100);
|
|
21538
|
-
if (limit !== void 0) {
|
|
21539
|
-
body.limit = limit;
|
|
21540
|
-
}
|
|
21541
|
-
if (args.full) {
|
|
21542
|
-
body.full = true;
|
|
21543
|
-
}
|
|
21544
|
-
const response = await apiPost("/api/chats/list", body);
|
|
21545
|
-
writeJson({
|
|
21546
|
-
...response,
|
|
21547
|
-
meta: { count: response.data.chats.length },
|
|
21548
|
-
...response.data.chats.length === 0 ? { hints: ["No Sessions matched. Widen with --status all or a larger --limit."] } : {
|
|
21549
|
-
hints: [
|
|
21550
|
-
"Drill in: `baker chats view <id>` for outputs, `chats transcript <id>` for the conversation, `chats diff <id>` for the real file changes."
|
|
21551
|
-
]
|
|
21552
|
-
}
|
|
21553
|
-
});
|
|
21554
|
-
} catch (err) {
|
|
21555
|
-
failApi(err);
|
|
21556
|
-
}
|
|
21557
|
-
}
|
|
21558
|
-
});
|
|
21559
|
-
registerSchema({
|
|
21560
|
-
command: "chats.view",
|
|
21561
|
-
description: "Inspect one Session's FULL picture of what it changed \u2014 the unified `effects`: git content (landings, creatives, flows, knowledge, brand), plus DB-only effects that never touch the repo \u2014 Actions, Scheduled Actions, Tags, and ad-platform writes \u2014 each resolved to real detail (names, descriptions, priorities, tag types, ad operations). Also the kickoff (how it was asked), threads, and commits. Effects are `staged` (in-progress draft) or applied. Use after `baker chats list` to decide whether to reuse it. Read-only.",
|
|
21562
|
-
args: {
|
|
21563
|
-
id: { type: "positional", description: "The Session id (from `baker chats list`)", required: true },
|
|
21564
|
-
full: {
|
|
21565
|
-
type: "boolean",
|
|
21566
|
-
description: "No-op today; view already returns full effect detail",
|
|
21567
|
-
required: false,
|
|
21568
|
-
default: false
|
|
21569
|
-
}
|
|
21570
|
-
}
|
|
21571
|
-
});
|
|
21572
|
-
var viewCommand = defineCommand96({
|
|
21573
|
-
meta: {
|
|
21574
|
-
name: "view",
|
|
21575
|
-
description: "Inspect one Session's full effects \u2014 git content + actions/tags/ads, kickoff, commits."
|
|
21576
|
-
},
|
|
21577
|
-
args: {
|
|
21578
|
-
id: { type: "positional", description: "The Session id", required: true },
|
|
21579
|
-
full: { type: "boolean", description: "Include full detail", required: false, default: false }
|
|
21580
|
-
},
|
|
21581
|
-
run: async ({ args }) => {
|
|
21582
|
-
try {
|
|
21583
|
-
const response = await apiPost("/api/chats/view", {
|
|
21584
|
-
chatId: args.id,
|
|
21585
|
-
...args.full ? { full: true } : {}
|
|
21586
|
-
});
|
|
21587
|
-
const hints = [];
|
|
21588
|
-
if (response.data.diffAvailable) {
|
|
21589
|
-
hints.push("See the real file-level diff of the git content with `baker chats diff <id> --full`.");
|
|
21590
|
-
}
|
|
21591
|
-
hints.push("Read the conversation with `baker chats transcript <id>`.");
|
|
21592
|
-
writeJson({ ...response, hints });
|
|
21593
|
-
} catch (err) {
|
|
21594
|
-
failApi(err);
|
|
21595
|
-
}
|
|
21596
|
-
}
|
|
21597
|
-
});
|
|
21598
|
-
registerSchema({
|
|
21599
|
-
command: "chats.transcript",
|
|
21600
|
-
description: "Read another Session's conversation (user + agent turns), most-recent first-capped. Use to see exactly how a past request was phrased and iterated before replaying it for a new goal. Compact truncates long messages; add --full for verbatim text. Read-only.",
|
|
21601
|
-
args: {
|
|
21602
|
-
id: { type: "positional", description: "The Session id", required: true },
|
|
21603
|
-
limit: { type: "string", description: "Max messages to return, 1-1000 (default: 100)", required: false },
|
|
21604
|
-
full: {
|
|
21605
|
-
type: "boolean",
|
|
21606
|
-
description: "Return verbatim (untruncated) message text",
|
|
21607
|
-
required: false,
|
|
21608
|
-
default: false
|
|
21609
|
-
}
|
|
21610
|
-
}
|
|
21611
|
-
});
|
|
21612
|
-
var transcriptCommand = defineCommand96({
|
|
21613
|
-
meta: { name: "transcript", description: "Read another Session's conversation." },
|
|
21614
|
-
args: {
|
|
21615
|
-
id: { type: "positional", description: "The Session id", required: true },
|
|
21616
|
-
limit: { type: "string", description: "Max messages (1-1000, default 100)", required: false },
|
|
21617
|
-
full: { type: "boolean", description: "Verbatim message text", required: false, default: false }
|
|
21618
|
-
},
|
|
21619
|
-
run: async ({ args }) => {
|
|
21620
|
-
try {
|
|
21621
|
-
const body = { chatId: args.id };
|
|
21622
|
-
const limit = parseBoundedInt(args.limit, "limit", 1, 1e3);
|
|
21623
|
-
if (limit !== void 0) {
|
|
21624
|
-
body.limit = limit;
|
|
21625
|
-
}
|
|
21626
|
-
if (args.full) {
|
|
21627
|
-
body.full = true;
|
|
21628
|
-
}
|
|
21629
|
-
const response = await apiPost("/api/chats/transcript", body);
|
|
21630
|
-
writeJson({
|
|
21631
|
-
...response,
|
|
21632
|
-
meta: { count: response.data.entries.length },
|
|
21633
|
-
...response.data.truncated ? { hints: ["Older messages were dropped to fit --limit. Raise --limit to see more."] } : {}
|
|
21634
|
-
});
|
|
21635
|
-
} catch (err) {
|
|
21636
|
-
failApi(err);
|
|
21637
|
-
}
|
|
21638
|
-
}
|
|
21639
|
-
});
|
|
21640
|
-
registerSchema({
|
|
21641
|
-
command: "chats.diff",
|
|
21642
|
-
description: "See the real file-level changes a Session made (landings, creatives, brand, flows, knowledge). Only available for published Sessions; in-progress ones return available:false \u2014 use `baker chats view` for their staged summary. Compact lists changed files with +/- counts; add --full for the actual diff text. Read-only.",
|
|
21643
|
-
args: {
|
|
21644
|
-
id: { type: "positional", description: "The Session id", required: true },
|
|
21645
|
-
surface: {
|
|
21646
|
-
type: "string",
|
|
21647
|
-
description: "Filter to one surface: knowledge|company|brand|landings|flows|creatives",
|
|
21648
|
-
required: false
|
|
21649
|
-
},
|
|
21650
|
-
full: {
|
|
21651
|
-
type: "boolean",
|
|
21652
|
-
description: "Include the unified-diff patch text per file",
|
|
21653
|
-
required: false,
|
|
21654
|
-
default: false
|
|
21655
|
-
}
|
|
21656
|
-
}
|
|
21657
|
-
});
|
|
21658
|
-
var diffCommand = defineCommand96({
|
|
21659
|
-
meta: { name: "diff", description: "See a published Session's real file-level changes." },
|
|
21660
|
-
args: {
|
|
21661
|
-
id: { type: "positional", description: "The Session id", required: true },
|
|
21662
|
-
surface: {
|
|
21663
|
-
type: "string",
|
|
21664
|
-
description: "Filter: knowledge|company|brand|landings|flows|creatives",
|
|
21665
|
-
required: false
|
|
21666
|
-
},
|
|
21667
|
-
full: { type: "boolean", description: "Include the diff patch text per file", required: false, default: false }
|
|
21668
|
-
},
|
|
21669
|
-
run: async ({ args }) => {
|
|
21670
|
-
try {
|
|
21671
|
-
const body = { chatId: args.id };
|
|
21672
|
-
if (args.surface) {
|
|
21673
|
-
if (!REPO_SURFACES.includes(args.surface)) {
|
|
21674
|
-
throw new Error(`--surface must be one of: ${REPO_SURFACES.join("|")}`);
|
|
21675
|
-
}
|
|
21676
|
-
body.surface = args.surface;
|
|
21677
|
-
}
|
|
21678
|
-
if (args.full) {
|
|
21679
|
-
body.full = true;
|
|
21680
|
-
}
|
|
21681
|
-
const response = await apiPost("/api/chats/diff", body);
|
|
21682
|
-
writeJson({
|
|
21683
|
-
...response,
|
|
21684
|
-
meta: { count: response.data.files.length },
|
|
21685
|
-
...!response.data.available && response.data.reason ? { hints: [response.data.reason] } : {},
|
|
21686
|
-
...response.data.available && !args.full && response.data.files.length > 0 ? { hints: ["Add --full to read the actual diff text for each file."] } : {}
|
|
21687
|
-
});
|
|
21688
|
-
} catch (err) {
|
|
21689
|
-
failApi(err);
|
|
21690
|
-
}
|
|
21691
|
-
}
|
|
21692
|
-
});
|
|
21693
|
-
var chatsCommand = defineCommand96({
|
|
21694
|
-
meta: {
|
|
21695
|
-
name: "chats",
|
|
21696
|
-
description: "Inspect other Sessions on this account (read-only): list them, view what they produced, read their conversation, and see their real file changes \u2014 so you can reuse past work for a new goal."
|
|
21697
|
-
},
|
|
21698
|
-
subCommands: {
|
|
21699
|
-
list: listCommand5,
|
|
21700
|
-
view: viewCommand,
|
|
21701
|
-
transcript: transcriptCommand,
|
|
21702
|
-
diff: diffCommand
|
|
21703
|
-
}
|
|
21704
|
-
});
|
|
21705
|
-
|
|
21706
21299
|
// src/commands/creatives/index.ts
|
|
21707
|
-
import { defineCommand as
|
|
21300
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
21708
21301
|
|
|
21709
21302
|
// src/commands/creatives/publish.ts
|
|
21710
|
-
import { defineCommand as
|
|
21303
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
21711
21304
|
|
|
21712
21305
|
// src/commands/images/api.ts
|
|
21713
21306
|
import { readFile as readFile17 } from "fs/promises";
|
|
@@ -21851,7 +21444,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
|
|
|
21851
21444
|
chatId: chatIdFromEnv()
|
|
21852
21445
|
});
|
|
21853
21446
|
}
|
|
21854
|
-
var publishCommand =
|
|
21447
|
+
var publishCommand = defineCommand96({
|
|
21855
21448
|
meta: {
|
|
21856
21449
|
name: "publish",
|
|
21857
21450
|
description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
|
|
@@ -21909,7 +21502,7 @@ var publishCommand = defineCommand97({
|
|
|
21909
21502
|
});
|
|
21910
21503
|
|
|
21911
21504
|
// src/commands/creatives/index.ts
|
|
21912
|
-
var creativesCommand3 =
|
|
21505
|
+
var creativesCommand3 = defineCommand97({
|
|
21913
21506
|
meta: {
|
|
21914
21507
|
name: "creatives",
|
|
21915
21508
|
description: `Publish static ad creatives as first-class Baker outputs.
|
|
@@ -21925,7 +21518,7 @@ Publishing uploads the image to the Company image library, applies the official
|
|
|
21925
21518
|
});
|
|
21926
21519
|
|
|
21927
21520
|
// src/commands/flows/index.ts
|
|
21928
|
-
import { defineCommand as
|
|
21521
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
21929
21522
|
|
|
21930
21523
|
// src/commands/flows/shared.ts
|
|
21931
21524
|
import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
|
|
@@ -22080,7 +21673,7 @@ function displayName(slug) {
|
|
|
22080
21673
|
const name = tree.displayName;
|
|
22081
21674
|
return typeof name === "string" && name.trim() ? name.trim() : slug;
|
|
22082
21675
|
}
|
|
22083
|
-
var
|
|
21676
|
+
var listCommand5 = defineCommand98({
|
|
22084
21677
|
meta: {
|
|
22085
21678
|
name: "list",
|
|
22086
21679
|
description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
|
|
@@ -22094,7 +21687,7 @@ var listCommand6 = defineCommand99({
|
|
|
22094
21687
|
writeJson({ ok: true, data: { flows } });
|
|
22095
21688
|
}
|
|
22096
21689
|
});
|
|
22097
|
-
var showCommand2 =
|
|
21690
|
+
var showCommand2 = defineCommand98({
|
|
22098
21691
|
meta: {
|
|
22099
21692
|
name: "show",
|
|
22100
21693
|
description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
|
|
@@ -22115,7 +21708,7 @@ var showCommand2 = defineCommand99({
|
|
|
22115
21708
|
writeJson({ ok: true, data: response });
|
|
22116
21709
|
}
|
|
22117
21710
|
});
|
|
22118
|
-
var flowsCommand =
|
|
21711
|
+
var flowsCommand = defineCommand98({
|
|
22119
21712
|
meta: {
|
|
22120
21713
|
name: "flows",
|
|
22121
21714
|
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).
|
|
@@ -22128,7 +21721,7 @@ Examples:
|
|
|
22128
21721
|
baker flows show contact --full`
|
|
22129
21722
|
},
|
|
22130
21723
|
subCommands: {
|
|
22131
|
-
list:
|
|
21724
|
+
list: listCommand5,
|
|
22132
21725
|
show: showCommand2
|
|
22133
21726
|
},
|
|
22134
21727
|
run: () => {
|
|
@@ -22142,10 +21735,10 @@ Examples:
|
|
|
22142
21735
|
});
|
|
22143
21736
|
|
|
22144
21737
|
// src/commands/ga4/index.ts
|
|
22145
|
-
import { defineCommand as
|
|
21738
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
22146
21739
|
|
|
22147
21740
|
// src/commands/ga4/audit.ts
|
|
22148
|
-
import { defineCommand as
|
|
21741
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
22149
21742
|
|
|
22150
21743
|
// src/commands/ga4/resolve.ts
|
|
22151
21744
|
async function fetchProperties(useCache = true) {
|
|
@@ -22208,7 +21801,7 @@ registerSchema({
|
|
|
22208
21801
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22209
21802
|
}
|
|
22210
21803
|
});
|
|
22211
|
-
var auditCommand2 =
|
|
21804
|
+
var auditCommand2 = defineCommand99({
|
|
22212
21805
|
meta: {
|
|
22213
21806
|
name: "audit",
|
|
22214
21807
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -22260,7 +21853,7 @@ Examples:
|
|
|
22260
21853
|
});
|
|
22261
21854
|
|
|
22262
21855
|
// src/commands/ga4/properties.ts
|
|
22263
|
-
import { defineCommand as
|
|
21856
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
22264
21857
|
registerSchema({
|
|
22265
21858
|
command: "ga4.properties",
|
|
22266
21859
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -22268,7 +21861,7 @@ registerSchema({
|
|
|
22268
21861
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22269
21862
|
}
|
|
22270
21863
|
});
|
|
22271
|
-
var propertiesCommand =
|
|
21864
|
+
var propertiesCommand = defineCommand100({
|
|
22272
21865
|
meta: {
|
|
22273
21866
|
name: "properties",
|
|
22274
21867
|
description: `List accessible GA4 properties.
|
|
@@ -22318,7 +21911,7 @@ Examples:
|
|
|
22318
21911
|
// src/commands/ga4/query.ts
|
|
22319
21912
|
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
|
|
22320
21913
|
import { resolve as resolve2 } from "path";
|
|
22321
|
-
import { defineCommand as
|
|
21914
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
22322
21915
|
|
|
22323
21916
|
// src/commands/ga4/presets.ts
|
|
22324
21917
|
var GA4_PRESETS = [
|
|
@@ -22450,7 +22043,7 @@ function handleError(err) {
|
|
|
22450
22043
|
});
|
|
22451
22044
|
process.exit(1);
|
|
22452
22045
|
}
|
|
22453
|
-
var queryCommand2 =
|
|
22046
|
+
var queryCommand2 = defineCommand101({
|
|
22454
22047
|
meta: {
|
|
22455
22048
|
name: "query",
|
|
22456
22049
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -22521,7 +22114,7 @@ Free-form (escape hatch):
|
|
|
22521
22114
|
});
|
|
22522
22115
|
|
|
22523
22116
|
// src/commands/ga4/index.ts
|
|
22524
|
-
var ga4Command =
|
|
22117
|
+
var ga4Command = defineCommand102({
|
|
22525
22118
|
meta: {
|
|
22526
22119
|
name: "ga4",
|
|
22527
22120
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -22544,12 +22137,12 @@ Examples:
|
|
|
22544
22137
|
});
|
|
22545
22138
|
|
|
22546
22139
|
// src/commands/gsc/index.ts
|
|
22547
|
-
import { defineCommand as
|
|
22140
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
22548
22141
|
|
|
22549
22142
|
// src/commands/gsc/query.ts
|
|
22550
22143
|
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
|
|
22551
22144
|
import { resolve as resolve3 } from "path";
|
|
22552
|
-
import { defineCommand as
|
|
22145
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
22553
22146
|
|
|
22554
22147
|
// src/commands/gsc/presets.ts
|
|
22555
22148
|
var GSC_PRESETS = [
|
|
@@ -22737,7 +22330,7 @@ function handleError2(err) {
|
|
|
22737
22330
|
});
|
|
22738
22331
|
process.exit(1);
|
|
22739
22332
|
}
|
|
22740
|
-
var queryCommand3 =
|
|
22333
|
+
var queryCommand3 = defineCommand103({
|
|
22741
22334
|
meta: {
|
|
22742
22335
|
name: "query",
|
|
22743
22336
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -22815,7 +22408,7 @@ Free-form (escape hatch):
|
|
|
22815
22408
|
});
|
|
22816
22409
|
|
|
22817
22410
|
// src/commands/gsc/sitemaps.ts
|
|
22818
|
-
import { defineCommand as
|
|
22411
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
22819
22412
|
registerSchema({
|
|
22820
22413
|
command: "gsc.sitemaps",
|
|
22821
22414
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -22824,7 +22417,7 @@ registerSchema({
|
|
|
22824
22417
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22825
22418
|
}
|
|
22826
22419
|
});
|
|
22827
|
-
var sitemapsCommand =
|
|
22420
|
+
var sitemapsCommand = defineCommand104({
|
|
22828
22421
|
meta: {
|
|
22829
22422
|
name: "sitemaps",
|
|
22830
22423
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -22874,7 +22467,7 @@ Examples:
|
|
|
22874
22467
|
});
|
|
22875
22468
|
|
|
22876
22469
|
// src/commands/gsc/sites.ts
|
|
22877
|
-
import { defineCommand as
|
|
22470
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
22878
22471
|
registerSchema({
|
|
22879
22472
|
command: "gsc.sites",
|
|
22880
22473
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -22882,7 +22475,7 @@ registerSchema({
|
|
|
22882
22475
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22883
22476
|
}
|
|
22884
22477
|
});
|
|
22885
|
-
var sitesCommand =
|
|
22478
|
+
var sitesCommand = defineCommand105({
|
|
22886
22479
|
meta: {
|
|
22887
22480
|
name: "sites",
|
|
22888
22481
|
description: `List verified Search Console sites.
|
|
@@ -22930,7 +22523,7 @@ Examples:
|
|
|
22930
22523
|
});
|
|
22931
22524
|
|
|
22932
22525
|
// src/commands/gsc/index.ts
|
|
22933
|
-
var gscCommand =
|
|
22526
|
+
var gscCommand = defineCommand106({
|
|
22934
22527
|
meta: {
|
|
22935
22528
|
name: "gsc",
|
|
22936
22529
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -22953,7 +22546,7 @@ Examples:
|
|
|
22953
22546
|
});
|
|
22954
22547
|
|
|
22955
22548
|
// src/commands/history/index.ts
|
|
22956
|
-
import { defineCommand as
|
|
22549
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
22957
22550
|
registerSchema({
|
|
22958
22551
|
command: "history.list",
|
|
22959
22552
|
description: "Start here: unified account history (audit log) \u2014 everything that changed on this account, newest first: publishes, chat lifecycle, backlog actions, team changes, setup links, tags, schedules, ad-platform writes, followed advertisers, media, creatives, reports, domains, and integrations. Use it to see what happened recently before planning work. Compact by default; add --full for raw metadata per entry.",
|
|
@@ -22998,7 +22591,7 @@ var CATEGORIES = [
|
|
|
22998
22591
|
"domain",
|
|
22999
22592
|
"integration"
|
|
23000
22593
|
];
|
|
23001
|
-
function
|
|
22594
|
+
function parseBoundedInt(raw, name, min, max) {
|
|
23002
22595
|
if (raw === void 0) {
|
|
23003
22596
|
return void 0;
|
|
23004
22597
|
}
|
|
@@ -23008,7 +22601,7 @@ function parseBoundedInt2(raw, name, min, max) {
|
|
|
23008
22601
|
}
|
|
23009
22602
|
return value;
|
|
23010
22603
|
}
|
|
23011
|
-
var
|
|
22604
|
+
var listCommand6 = defineCommand107({
|
|
23012
22605
|
meta: {
|
|
23013
22606
|
name: "list",
|
|
23014
22607
|
description: "List recent account changes (unified audit log), newest first."
|
|
@@ -23026,11 +22619,11 @@ var listCommand7 = defineCommand108({
|
|
|
23026
22619
|
run: async ({ args }) => {
|
|
23027
22620
|
try {
|
|
23028
22621
|
const body = {};
|
|
23029
|
-
const limit =
|
|
22622
|
+
const limit = parseBoundedInt(args.limit, "limit", 1, 200);
|
|
23030
22623
|
if (limit !== void 0) {
|
|
23031
22624
|
body.limit = limit;
|
|
23032
22625
|
}
|
|
23033
|
-
const days =
|
|
22626
|
+
const days = parseBoundedInt(args.days, "days", 1, 365);
|
|
23034
22627
|
if (days !== void 0) {
|
|
23035
22628
|
body.days = days;
|
|
23036
22629
|
}
|
|
@@ -23054,19 +22647,19 @@ var listCommand7 = defineCommand108({
|
|
|
23054
22647
|
}
|
|
23055
22648
|
}
|
|
23056
22649
|
});
|
|
23057
|
-
var historyCommand =
|
|
22650
|
+
var historyCommand = defineCommand107({
|
|
23058
22651
|
meta: {
|
|
23059
22652
|
name: "history",
|
|
23060
22653
|
description: "Unified account history (audit log): what changed, who did it, and when."
|
|
23061
22654
|
},
|
|
23062
|
-
subCommands: { list:
|
|
22655
|
+
subCommands: { list: listCommand6 }
|
|
23063
22656
|
});
|
|
23064
22657
|
|
|
23065
22658
|
// src/commands/images/index.ts
|
|
23066
|
-
import { defineCommand as
|
|
22659
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
23067
22660
|
|
|
23068
22661
|
// src/commands/images/crop.ts
|
|
23069
|
-
import { defineCommand as
|
|
22662
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
23070
22663
|
|
|
23071
22664
|
// src/lib/image/crop-sprite.ts
|
|
23072
22665
|
import sharp from "sharp";
|
|
@@ -23191,7 +22784,7 @@ function emitError2(err) {
|
|
|
23191
22784
|
}
|
|
23192
22785
|
process.exit(1);
|
|
23193
22786
|
}
|
|
23194
|
-
var cropCommand =
|
|
22787
|
+
var cropCommand = defineCommand108({
|
|
23195
22788
|
meta: {
|
|
23196
22789
|
name: "crop",
|
|
23197
22790
|
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"
|
|
@@ -23227,7 +22820,7 @@ var cropCommand = defineCommand109({
|
|
|
23227
22820
|
});
|
|
23228
22821
|
|
|
23229
22822
|
// src/commands/images/delete.ts
|
|
23230
|
-
import { defineCommand as
|
|
22823
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
23231
22824
|
registerSchema({
|
|
23232
22825
|
command: "images.delete",
|
|
23233
22826
|
description: "Delete an image by ID",
|
|
@@ -23241,7 +22834,7 @@ registerSchema({
|
|
|
23241
22834
|
}
|
|
23242
22835
|
}
|
|
23243
22836
|
});
|
|
23244
|
-
var deleteCommand =
|
|
22837
|
+
var deleteCommand = defineCommand109({
|
|
23245
22838
|
meta: {
|
|
23246
22839
|
name: "delete",
|
|
23247
22840
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -23282,7 +22875,7 @@ var deleteCommand = defineCommand110({
|
|
|
23282
22875
|
});
|
|
23283
22876
|
|
|
23284
22877
|
// src/commands/images/dimensions.ts
|
|
23285
|
-
import { defineCommand as
|
|
22878
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
23286
22879
|
|
|
23287
22880
|
// src/lib/image/dimensions.ts
|
|
23288
22881
|
import { imageSize } from "image-size";
|
|
@@ -23305,7 +22898,7 @@ registerSchema({
|
|
|
23305
22898
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
23306
22899
|
}
|
|
23307
22900
|
});
|
|
23308
|
-
var dimensionsCommand =
|
|
22901
|
+
var dimensionsCommand = defineCommand110({
|
|
23309
22902
|
meta: {
|
|
23310
22903
|
name: "dimensions",
|
|
23311
22904
|
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"
|
|
@@ -23349,7 +22942,7 @@ var dimensionsCommand = defineCommand111({
|
|
|
23349
22942
|
});
|
|
23350
22943
|
|
|
23351
22944
|
// src/commands/images/extract.ts
|
|
23352
|
-
import { defineCommand as
|
|
22945
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
23353
22946
|
registerSchema({
|
|
23354
22947
|
command: "images.extract",
|
|
23355
22948
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -23365,7 +22958,7 @@ registerSchema({
|
|
|
23365
22958
|
}
|
|
23366
22959
|
}
|
|
23367
22960
|
});
|
|
23368
|
-
var extractCommand =
|
|
22961
|
+
var extractCommand = defineCommand111({
|
|
23369
22962
|
meta: {
|
|
23370
22963
|
name: "extract",
|
|
23371
22964
|
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"
|
|
@@ -23403,7 +22996,7 @@ var extractCommand = defineCommand112({
|
|
|
23403
22996
|
});
|
|
23404
22997
|
|
|
23405
22998
|
// src/commands/images/find.ts
|
|
23406
|
-
import { defineCommand as
|
|
22999
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
23407
23000
|
registerSchema({
|
|
23408
23001
|
command: "images.find",
|
|
23409
23002
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -23435,7 +23028,7 @@ registerSchema({
|
|
|
23435
23028
|
}
|
|
23436
23029
|
}
|
|
23437
23030
|
});
|
|
23438
|
-
var findCommand =
|
|
23031
|
+
var findCommand = defineCommand112({
|
|
23439
23032
|
meta: {
|
|
23440
23033
|
name: "find",
|
|
23441
23034
|
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"
|
|
@@ -23484,7 +23077,7 @@ var findCommand = defineCommand113({
|
|
|
23484
23077
|
|
|
23485
23078
|
// src/commands/images/generate.ts
|
|
23486
23079
|
import { readFile as readFile19 } from "fs/promises";
|
|
23487
|
-
import { defineCommand as
|
|
23080
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
23488
23081
|
import sharp2 from "sharp";
|
|
23489
23082
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
23490
23083
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -23587,7 +23180,7 @@ async function resolveReferences(spec) {
|
|
|
23587
23180
|
}
|
|
23588
23181
|
return out;
|
|
23589
23182
|
}
|
|
23590
|
-
var generateCommand =
|
|
23183
|
+
var generateCommand = defineCommand113({
|
|
23591
23184
|
meta: {
|
|
23592
23185
|
name: "generate",
|
|
23593
23186
|
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]]'"
|
|
@@ -23639,7 +23232,7 @@ var generateCommand = defineCommand114({
|
|
|
23639
23232
|
});
|
|
23640
23233
|
|
|
23641
23234
|
// src/commands/images/get.ts
|
|
23642
|
-
import { defineCommand as
|
|
23235
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
23643
23236
|
registerSchema({
|
|
23644
23237
|
command: "images.get",
|
|
23645
23238
|
description: "Get a single image by ID",
|
|
@@ -23647,7 +23240,7 @@ registerSchema({
|
|
|
23647
23240
|
id: { type: "string", description: "Image ID", required: true }
|
|
23648
23241
|
}
|
|
23649
23242
|
});
|
|
23650
|
-
var getCommand2 =
|
|
23243
|
+
var getCommand2 = defineCommand114({
|
|
23651
23244
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
23652
23245
|
args: {
|
|
23653
23246
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -23683,7 +23276,7 @@ var getCommand2 = defineCommand115({
|
|
|
23683
23276
|
});
|
|
23684
23277
|
|
|
23685
23278
|
// src/commands/images/gif.ts
|
|
23686
|
-
import { defineCommand as
|
|
23279
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
23687
23280
|
registerSchema({
|
|
23688
23281
|
command: "images.gif",
|
|
23689
23282
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -23715,7 +23308,7 @@ registerSchema({
|
|
|
23715
23308
|
}
|
|
23716
23309
|
}
|
|
23717
23310
|
});
|
|
23718
|
-
var gifCommand =
|
|
23311
|
+
var gifCommand = defineCommand115({
|
|
23719
23312
|
meta: {
|
|
23720
23313
|
name: "gif",
|
|
23721
23314
|
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"
|
|
@@ -23762,7 +23355,7 @@ var gifCommand = defineCommand116({
|
|
|
23762
23355
|
});
|
|
23763
23356
|
|
|
23764
23357
|
// src/commands/images/google.ts
|
|
23765
|
-
import { defineCommand as
|
|
23358
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
23766
23359
|
registerSchema({
|
|
23767
23360
|
command: "images.google",
|
|
23768
23361
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -23798,7 +23391,7 @@ registerSchema({
|
|
|
23798
23391
|
}
|
|
23799
23392
|
}
|
|
23800
23393
|
});
|
|
23801
|
-
var googleCommand2 =
|
|
23394
|
+
var googleCommand2 = defineCommand116({
|
|
23802
23395
|
meta: {
|
|
23803
23396
|
name: "google",
|
|
23804
23397
|
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"
|
|
@@ -23846,7 +23439,7 @@ var googleCommand2 = defineCommand117({
|
|
|
23846
23439
|
});
|
|
23847
23440
|
|
|
23848
23441
|
// src/commands/images/icon.ts
|
|
23849
|
-
import { defineCommand as
|
|
23442
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
23850
23443
|
registerSchema({
|
|
23851
23444
|
command: "images.icon",
|
|
23852
23445
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -23872,7 +23465,7 @@ registerSchema({
|
|
|
23872
23465
|
}
|
|
23873
23466
|
}
|
|
23874
23467
|
});
|
|
23875
|
-
var iconCommand =
|
|
23468
|
+
var iconCommand = defineCommand117({
|
|
23876
23469
|
meta: {
|
|
23877
23470
|
name: "icon",
|
|
23878
23471
|
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'"
|
|
@@ -23912,7 +23505,7 @@ var iconCommand = defineCommand118({
|
|
|
23912
23505
|
});
|
|
23913
23506
|
|
|
23914
23507
|
// src/commands/images/ingest.ts
|
|
23915
|
-
import { defineCommand as
|
|
23508
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
23916
23509
|
registerSchema({
|
|
23917
23510
|
command: "images.ingest",
|
|
23918
23511
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -23924,7 +23517,7 @@ registerSchema({
|
|
|
23924
23517
|
context: { type: "string", description: "Description context hint", required: false }
|
|
23925
23518
|
}
|
|
23926
23519
|
});
|
|
23927
|
-
var ingestCommand =
|
|
23520
|
+
var ingestCommand = defineCommand118({
|
|
23928
23521
|
meta: {
|
|
23929
23522
|
name: "ingest",
|
|
23930
23523
|
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"
|
|
@@ -23966,7 +23559,7 @@ var ingestCommand = defineCommand119({
|
|
|
23966
23559
|
});
|
|
23967
23560
|
|
|
23968
23561
|
// src/commands/images/library.ts
|
|
23969
|
-
import { defineCommand as
|
|
23562
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
23970
23563
|
registerSchema({
|
|
23971
23564
|
command: "images.library",
|
|
23972
23565
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -23992,7 +23585,7 @@ registerSchema({
|
|
|
23992
23585
|
}
|
|
23993
23586
|
}
|
|
23994
23587
|
});
|
|
23995
|
-
var libraryCommand =
|
|
23588
|
+
var libraryCommand = defineCommand119({
|
|
23996
23589
|
meta: {
|
|
23997
23590
|
name: "library",
|
|
23998
23591
|
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"
|
|
@@ -24049,7 +23642,7 @@ var libraryCommand = defineCommand120({
|
|
|
24049
23642
|
});
|
|
24050
23643
|
|
|
24051
23644
|
// src/commands/images/logo.ts
|
|
24052
|
-
import { defineCommand as
|
|
23645
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
24053
23646
|
registerSchema({
|
|
24054
23647
|
command: "images.logo",
|
|
24055
23648
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -24074,7 +23667,7 @@ registerSchema({
|
|
|
24074
23667
|
}
|
|
24075
23668
|
}
|
|
24076
23669
|
});
|
|
24077
|
-
var logoCommand =
|
|
23670
|
+
var logoCommand = defineCommand120({
|
|
24078
23671
|
meta: {
|
|
24079
23672
|
name: "logo",
|
|
24080
23673
|
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"
|
|
@@ -24112,7 +23705,7 @@ var logoCommand = defineCommand121({
|
|
|
24112
23705
|
});
|
|
24113
23706
|
|
|
24114
23707
|
// src/commands/images/normalize.ts
|
|
24115
|
-
import { defineCommand as
|
|
23708
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
24116
23709
|
|
|
24117
23710
|
// src/lib/image/color-changer.ts
|
|
24118
23711
|
import quantize from "quantize";
|
|
@@ -24844,7 +24437,7 @@ function coerceRawArgs(args) {
|
|
|
24844
24437
|
"dry-run": bool(args["dry-run"])
|
|
24845
24438
|
};
|
|
24846
24439
|
}
|
|
24847
|
-
var normalizeCommand =
|
|
24440
|
+
var normalizeCommand = defineCommand121({
|
|
24848
24441
|
meta: {
|
|
24849
24442
|
name: "normalize",
|
|
24850
24443
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -24899,7 +24492,7 @@ Examples:
|
|
|
24899
24492
|
});
|
|
24900
24493
|
|
|
24901
24494
|
// src/commands/images/pinterest.ts
|
|
24902
|
-
import { defineCommand as
|
|
24495
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
24903
24496
|
registerSchema({
|
|
24904
24497
|
command: "images.pinterest",
|
|
24905
24498
|
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.",
|
|
@@ -24919,7 +24512,7 @@ registerSchema({
|
|
|
24919
24512
|
}
|
|
24920
24513
|
}
|
|
24921
24514
|
});
|
|
24922
|
-
var pinterestCommand =
|
|
24515
|
+
var pinterestCommand = defineCommand122({
|
|
24923
24516
|
meta: {
|
|
24924
24517
|
name: "pinterest",
|
|
24925
24518
|
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'"
|
|
@@ -24959,7 +24552,7 @@ var pinterestCommand = defineCommand123({
|
|
|
24959
24552
|
});
|
|
24960
24553
|
|
|
24961
24554
|
// src/commands/images/screenshot.ts
|
|
24962
|
-
import { defineCommand as
|
|
24555
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
24963
24556
|
registerSchema({
|
|
24964
24557
|
command: "images.screenshot",
|
|
24965
24558
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -24975,7 +24568,7 @@ registerSchema({
|
|
|
24975
24568
|
}
|
|
24976
24569
|
}
|
|
24977
24570
|
});
|
|
24978
|
-
var screenshotCommand =
|
|
24571
|
+
var screenshotCommand = defineCommand123({
|
|
24979
24572
|
meta: {
|
|
24980
24573
|
name: "screenshot",
|
|
24981
24574
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -25038,7 +24631,7 @@ var screenshotCommand = defineCommand124({
|
|
|
25038
24631
|
});
|
|
25039
24632
|
|
|
25040
24633
|
// src/commands/images/search.ts
|
|
25041
|
-
import { defineCommand as
|
|
24634
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
25042
24635
|
registerSchema({
|
|
25043
24636
|
command: "images.search",
|
|
25044
24637
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -25054,7 +24647,7 @@ registerSchema({
|
|
|
25054
24647
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
25055
24648
|
}
|
|
25056
24649
|
});
|
|
25057
|
-
var searchCommand =
|
|
24650
|
+
var searchCommand = defineCommand124({
|
|
25058
24651
|
meta: {
|
|
25059
24652
|
name: "search",
|
|
25060
24653
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -25114,7 +24707,7 @@ var searchCommand = defineCommand125({
|
|
|
25114
24707
|
});
|
|
25115
24708
|
|
|
25116
24709
|
// src/commands/images/sticker.ts
|
|
25117
|
-
import { defineCommand as
|
|
24710
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
25118
24711
|
registerSchema({
|
|
25119
24712
|
command: "images.sticker",
|
|
25120
24713
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -25146,7 +24739,7 @@ registerSchema({
|
|
|
25146
24739
|
}
|
|
25147
24740
|
}
|
|
25148
24741
|
});
|
|
25149
|
-
var stickerCommand =
|
|
24742
|
+
var stickerCommand = defineCommand125({
|
|
25150
24743
|
meta: {
|
|
25151
24744
|
name: "sticker",
|
|
25152
24745
|
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"
|
|
@@ -25193,7 +24786,7 @@ var stickerCommand = defineCommand126({
|
|
|
25193
24786
|
});
|
|
25194
24787
|
|
|
25195
24788
|
// src/commands/images/stock.ts
|
|
25196
|
-
import { defineCommand as
|
|
24789
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
25197
24790
|
registerSchema({
|
|
25198
24791
|
command: "images.stock",
|
|
25199
24792
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -25251,7 +24844,7 @@ registerSchema({
|
|
|
25251
24844
|
}
|
|
25252
24845
|
}
|
|
25253
24846
|
});
|
|
25254
|
-
var stockCommand =
|
|
24847
|
+
var stockCommand = defineCommand126({
|
|
25255
24848
|
meta: {
|
|
25256
24849
|
name: "stock",
|
|
25257
24850
|
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"
|
|
@@ -25307,7 +24900,7 @@ var stockCommand = defineCommand127({
|
|
|
25307
24900
|
});
|
|
25308
24901
|
|
|
25309
24902
|
// src/lib/tags-command.ts
|
|
25310
|
-
import { defineCommand as
|
|
24903
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
25311
24904
|
function makeTagsCommand(command, label, endpoint) {
|
|
25312
24905
|
registerSchema({
|
|
25313
24906
|
command: `${command}.tags`,
|
|
@@ -25316,7 +24909,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
25316
24909
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
25317
24910
|
}
|
|
25318
24911
|
});
|
|
25319
|
-
return
|
|
24912
|
+
return defineCommand127({
|
|
25320
24913
|
meta: {
|
|
25321
24914
|
name: "tags",
|
|
25322
24915
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -25352,7 +24945,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
25352
24945
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
25353
24946
|
|
|
25354
24947
|
// src/commands/images/upload.ts
|
|
25355
|
-
import { defineCommand as
|
|
24948
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
25356
24949
|
registerSchema({
|
|
25357
24950
|
command: "images.upload",
|
|
25358
24951
|
description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
|
|
@@ -25390,7 +24983,7 @@ registerSchema({
|
|
|
25390
24983
|
function isRemoteUrl2(value) {
|
|
25391
24984
|
return /^https?:\/\//i.test(value);
|
|
25392
24985
|
}
|
|
25393
|
-
var uploadCommand =
|
|
24986
|
+
var uploadCommand = defineCommand128({
|
|
25394
24987
|
meta: {
|
|
25395
24988
|
name: "upload",
|
|
25396
24989
|
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'"
|
|
@@ -25483,7 +25076,7 @@ async function uploadLocal(target, args) {
|
|
|
25483
25076
|
}
|
|
25484
25077
|
|
|
25485
25078
|
// src/commands/images/upscale.ts
|
|
25486
|
-
import { defineCommand as
|
|
25079
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
25487
25080
|
registerSchema({
|
|
25488
25081
|
command: "images.upscale",
|
|
25489
25082
|
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).",
|
|
@@ -25498,7 +25091,7 @@ registerSchema({
|
|
|
25498
25091
|
}
|
|
25499
25092
|
});
|
|
25500
25093
|
var POLL_INTERVAL_MS3 = 1500;
|
|
25501
|
-
var upscaleCommand =
|
|
25094
|
+
var upscaleCommand = defineCommand129({
|
|
25502
25095
|
meta: {
|
|
25503
25096
|
name: "upscale",
|
|
25504
25097
|
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"
|
|
@@ -25553,7 +25146,7 @@ var upscaleCommand = defineCommand130({
|
|
|
25553
25146
|
});
|
|
25554
25147
|
|
|
25555
25148
|
// src/commands/images/use.ts
|
|
25556
|
-
import { defineCommand as
|
|
25149
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
25557
25150
|
registerSchema({
|
|
25558
25151
|
command: "images.use",
|
|
25559
25152
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -25569,7 +25162,7 @@ registerSchema({
|
|
|
25569
25162
|
}
|
|
25570
25163
|
});
|
|
25571
25164
|
var POLL_INTERVAL_MS4 = 1500;
|
|
25572
|
-
var useCommand =
|
|
25165
|
+
var useCommand = defineCommand130({
|
|
25573
25166
|
meta: {
|
|
25574
25167
|
name: "use",
|
|
25575
25168
|
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"
|
|
@@ -25615,7 +25208,7 @@ var useCommand = defineCommand131({
|
|
|
25615
25208
|
});
|
|
25616
25209
|
|
|
25617
25210
|
// src/commands/images/index.ts
|
|
25618
|
-
var imagesCommand =
|
|
25211
|
+
var imagesCommand = defineCommand131({
|
|
25619
25212
|
meta: {
|
|
25620
25213
|
name: "images",
|
|
25621
25214
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -25685,7 +25278,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
25685
25278
|
});
|
|
25686
25279
|
|
|
25687
25280
|
// src/commands/mcp/index.ts
|
|
25688
|
-
import { defineCommand as
|
|
25281
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
25689
25282
|
var SCOPES = ["user", "user_org", "company", "org"];
|
|
25690
25283
|
function parseScope(raw) {
|
|
25691
25284
|
const scope = raw === void 0 ? "company" : String(raw);
|
|
@@ -25724,7 +25317,7 @@ registerSchema({
|
|
|
25724
25317
|
description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
|
|
25725
25318
|
args: {}
|
|
25726
25319
|
});
|
|
25727
|
-
var
|
|
25320
|
+
var listCommand7 = defineCommand132({
|
|
25728
25321
|
meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
|
|
25729
25322
|
run: async () => {
|
|
25730
25323
|
try {
|
|
@@ -25749,7 +25342,7 @@ registerSchema({
|
|
|
25749
25342
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
25750
25343
|
}
|
|
25751
25344
|
});
|
|
25752
|
-
var addCommand =
|
|
25345
|
+
var addCommand = defineCommand132({
|
|
25753
25346
|
meta: {
|
|
25754
25347
|
name: "add",
|
|
25755
25348
|
description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
|
|
@@ -25790,7 +25383,7 @@ registerSchema({
|
|
|
25790
25383
|
description: "Remove a company custom MCP server by name.",
|
|
25791
25384
|
args: { name: { type: "string", description: "Server name to remove", required: true } }
|
|
25792
25385
|
});
|
|
25793
|
-
var removeCommand4 =
|
|
25386
|
+
var removeCommand4 = defineCommand132({
|
|
25794
25387
|
meta: {
|
|
25795
25388
|
name: "remove",
|
|
25796
25389
|
description: `Remove a company custom MCP server by name.
|
|
@@ -25812,7 +25405,7 @@ Example:
|
|
|
25812
25405
|
}
|
|
25813
25406
|
}
|
|
25814
25407
|
});
|
|
25815
|
-
var mcpCommand =
|
|
25408
|
+
var mcpCommand = defineCommand132({
|
|
25816
25409
|
meta: {
|
|
25817
25410
|
name: "mcp",
|
|
25818
25411
|
description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
|
|
@@ -25829,17 +25422,17 @@ Examples:
|
|
|
25829
25422
|
baker mcp remove --name weather`
|
|
25830
25423
|
},
|
|
25831
25424
|
subCommands: {
|
|
25832
|
-
list:
|
|
25425
|
+
list: listCommand7,
|
|
25833
25426
|
add: addCommand,
|
|
25834
25427
|
remove: removeCommand4
|
|
25835
25428
|
}
|
|
25836
25429
|
});
|
|
25837
25430
|
|
|
25838
25431
|
// src/commands/research/index.ts
|
|
25839
|
-
import { defineCommand as
|
|
25432
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
25840
25433
|
|
|
25841
25434
|
// src/commands/research/advertisers.ts
|
|
25842
|
-
import { defineCommand as
|
|
25435
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
25843
25436
|
|
|
25844
25437
|
// src/commands/research/output.ts
|
|
25845
25438
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -25952,7 +25545,7 @@ var FIELDS3 = {
|
|
|
25952
25545
|
etv: "Estimated traffic value (USD)",
|
|
25953
25546
|
visibility: "SERP visibility score (0-1)"
|
|
25954
25547
|
};
|
|
25955
|
-
var advertisersCommand =
|
|
25548
|
+
var advertisersCommand = defineCommand133({
|
|
25956
25549
|
meta: {
|
|
25957
25550
|
name: "advertisers",
|
|
25958
25551
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -25999,7 +25592,7 @@ Examples:
|
|
|
25999
25592
|
});
|
|
26000
25593
|
|
|
26001
25594
|
// src/commands/research/autocomplete.ts
|
|
26002
|
-
import { defineCommand as
|
|
25595
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
26003
25596
|
registerSchema({
|
|
26004
25597
|
command: "research.autocomplete",
|
|
26005
25598
|
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).",
|
|
@@ -26022,7 +25615,7 @@ registerSchema({
|
|
|
26022
25615
|
var FIELDS4 = {
|
|
26023
25616
|
suggestion: "Autocomplete suggestion from Google"
|
|
26024
25617
|
};
|
|
26025
|
-
var autocompleteCommand =
|
|
25618
|
+
var autocompleteCommand = defineCommand134({
|
|
26026
25619
|
meta: {
|
|
26027
25620
|
name: "autocomplete",
|
|
26028
25621
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -26068,7 +25661,7 @@ Examples:
|
|
|
26068
25661
|
});
|
|
26069
25662
|
|
|
26070
25663
|
// src/commands/research/countries.ts
|
|
26071
|
-
import { defineCommand as
|
|
25664
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
26072
25665
|
registerSchema({
|
|
26073
25666
|
command: "research.countries",
|
|
26074
25667
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -26125,7 +25718,7 @@ var FIELDS5 = {
|
|
|
26125
25718
|
code: "Country code to pass as --location",
|
|
26126
25719
|
name: "Country name"
|
|
26127
25720
|
};
|
|
26128
|
-
var countriesCommand =
|
|
25721
|
+
var countriesCommand = defineCommand135({
|
|
26129
25722
|
meta: {
|
|
26130
25723
|
name: "countries",
|
|
26131
25724
|
description: "List all supported country codes for --location flag."
|
|
@@ -26136,7 +25729,7 @@ var countriesCommand = defineCommand136({
|
|
|
26136
25729
|
});
|
|
26137
25730
|
|
|
26138
25731
|
// src/commands/research/intent.ts
|
|
26139
|
-
import { defineCommand as
|
|
25732
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
26140
25733
|
registerSchema({
|
|
26141
25734
|
command: "research.intent",
|
|
26142
25735
|
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.",
|
|
@@ -26159,7 +25752,7 @@ var FIELDS6 = {
|
|
|
26159
25752
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
26160
25753
|
probability: "Confidence score 0.0-1.0"
|
|
26161
25754
|
};
|
|
26162
|
-
var intentCommand =
|
|
25755
|
+
var intentCommand = defineCommand136({
|
|
26163
25756
|
meta: {
|
|
26164
25757
|
name: "intent",
|
|
26165
25758
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -26207,7 +25800,7 @@ Examples:
|
|
|
26207
25800
|
});
|
|
26208
25801
|
|
|
26209
25802
|
// src/commands/research/keyword-gap.ts
|
|
26210
|
-
import { defineCommand as
|
|
25803
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
26211
25804
|
registerSchema({
|
|
26212
25805
|
command: "research.keyword-gap",
|
|
26213
25806
|
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.",
|
|
@@ -26236,7 +25829,7 @@ var FIELDS7 = {
|
|
|
26236
25829
|
cpc: "Cost per click USD",
|
|
26237
25830
|
their_position: "Competitor's ranking position"
|
|
26238
25831
|
};
|
|
26239
|
-
var keywordGapCommand =
|
|
25832
|
+
var keywordGapCommand = defineCommand137({
|
|
26240
25833
|
meta: {
|
|
26241
25834
|
name: "keyword-gap",
|
|
26242
25835
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -26310,7 +25903,7 @@ Examples:
|
|
|
26310
25903
|
});
|
|
26311
25904
|
|
|
26312
25905
|
// src/commands/research/keywords-for-site.ts
|
|
26313
|
-
import { defineCommand as
|
|
25906
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
26314
25907
|
registerSchema({
|
|
26315
25908
|
command: "research.keywords-for-site",
|
|
26316
25909
|
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.",
|
|
@@ -26343,7 +25936,7 @@ var FIELDS8 = {
|
|
|
26343
25936
|
competition: "LOW, MEDIUM, or HIGH",
|
|
26344
25937
|
competition_index: "Competition score 0-100"
|
|
26345
25938
|
};
|
|
26346
|
-
var keywordsForSiteCommand =
|
|
25939
|
+
var keywordsForSiteCommand = defineCommand138({
|
|
26347
25940
|
meta: {
|
|
26348
25941
|
name: "keywords-for-site",
|
|
26349
25942
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -26396,7 +25989,7 @@ Examples:
|
|
|
26396
25989
|
});
|
|
26397
25990
|
|
|
26398
25991
|
// src/commands/research/languages.ts
|
|
26399
|
-
import { defineCommand as
|
|
25992
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
26400
25993
|
registerSchema({
|
|
26401
25994
|
command: "research.languages",
|
|
26402
25995
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -26426,7 +26019,7 @@ var FIELDS9 = {
|
|
|
26426
26019
|
code: "Language code to pass as --language",
|
|
26427
26020
|
name: "Language name (also accepted by --language)"
|
|
26428
26021
|
};
|
|
26429
|
-
var languagesCommand2 =
|
|
26022
|
+
var languagesCommand2 = defineCommand139({
|
|
26430
26023
|
meta: {
|
|
26431
26024
|
name: "languages",
|
|
26432
26025
|
description: "List all supported language codes for --language flag."
|
|
@@ -26437,7 +26030,7 @@ var languagesCommand2 = defineCommand140({
|
|
|
26437
26030
|
});
|
|
26438
26031
|
|
|
26439
26032
|
// src/commands/research/lighthouse.ts
|
|
26440
|
-
import { defineCommand as
|
|
26033
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
26441
26034
|
registerSchema({
|
|
26442
26035
|
command: "research.lighthouse",
|
|
26443
26036
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -26456,7 +26049,7 @@ var FIELDS10 = {
|
|
|
26456
26049
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
26457
26050
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
26458
26051
|
};
|
|
26459
|
-
var lighthouseCommand =
|
|
26052
|
+
var lighthouseCommand = defineCommand140({
|
|
26460
26053
|
meta: {
|
|
26461
26054
|
name: "lighthouse",
|
|
26462
26055
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -26494,7 +26087,7 @@ Examples:
|
|
|
26494
26087
|
});
|
|
26495
26088
|
|
|
26496
26089
|
// src/commands/research/relevant-pages.ts
|
|
26497
|
-
import { defineCommand as
|
|
26090
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
26498
26091
|
registerSchema({
|
|
26499
26092
|
command: "research.relevant-pages",
|
|
26500
26093
|
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).",
|
|
@@ -26520,7 +26113,7 @@ var FIELDS11 = {
|
|
|
26520
26113
|
keywords: "Total organic keywords the page ranks for",
|
|
26521
26114
|
top_10: "Keywords in positions 1-10"
|
|
26522
26115
|
};
|
|
26523
|
-
var relevantPagesCommand =
|
|
26116
|
+
var relevantPagesCommand = defineCommand141({
|
|
26524
26117
|
meta: {
|
|
26525
26118
|
name: "relevant-pages",
|
|
26526
26119
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -26566,7 +26159,7 @@ Examples:
|
|
|
26566
26159
|
});
|
|
26567
26160
|
|
|
26568
26161
|
// src/commands/research/web.ts
|
|
26569
|
-
import { defineCommand as
|
|
26162
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
26570
26163
|
registerSchema({
|
|
26571
26164
|
command: "research.web",
|
|
26572
26165
|
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).",
|
|
@@ -26617,7 +26210,7 @@ async function runDeepResearch(question) {
|
|
|
26617
26210
|
}
|
|
26618
26211
|
throw new Error("Deep research timed out");
|
|
26619
26212
|
}
|
|
26620
|
-
var webCommand =
|
|
26213
|
+
var webCommand = defineCommand142({
|
|
26621
26214
|
meta: {
|
|
26622
26215
|
name: "web",
|
|
26623
26216
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -26677,7 +26270,7 @@ Examples:
|
|
|
26677
26270
|
});
|
|
26678
26271
|
|
|
26679
26272
|
// src/commands/research/index.ts
|
|
26680
|
-
var researchCommand =
|
|
26273
|
+
var researchCommand = defineCommand143({
|
|
26681
26274
|
meta: {
|
|
26682
26275
|
name: "research",
|
|
26683
26276
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -26717,10 +26310,10 @@ Examples:
|
|
|
26717
26310
|
});
|
|
26718
26311
|
|
|
26719
26312
|
// src/commands/scheduled-actions/index.ts
|
|
26720
|
-
import { defineCommand as
|
|
26313
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
26721
26314
|
|
|
26722
26315
|
// src/commands/scheduled-actions/create.ts
|
|
26723
|
-
import { defineCommand as
|
|
26316
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
26724
26317
|
|
|
26725
26318
|
// src/commands/scheduled-actions/shared.ts
|
|
26726
26319
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -26835,7 +26428,7 @@ registerSchema({
|
|
|
26835
26428
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
26836
26429
|
}
|
|
26837
26430
|
});
|
|
26838
|
-
var createCommand2 =
|
|
26431
|
+
var createCommand2 = defineCommand144({
|
|
26839
26432
|
meta: {
|
|
26840
26433
|
name: "create",
|
|
26841
26434
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -26884,7 +26477,7 @@ var createCommand2 = defineCommand145({
|
|
|
26884
26477
|
});
|
|
26885
26478
|
|
|
26886
26479
|
// src/commands/scheduled-actions/delete.ts
|
|
26887
|
-
import { defineCommand as
|
|
26480
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
26888
26481
|
registerSchema({
|
|
26889
26482
|
command: "scheduled-actions.delete",
|
|
26890
26483
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -26892,7 +26485,7 @@ registerSchema({
|
|
|
26892
26485
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
26893
26486
|
}
|
|
26894
26487
|
});
|
|
26895
|
-
var deleteCommand2 =
|
|
26488
|
+
var deleteCommand2 = defineCommand145({
|
|
26896
26489
|
meta: {
|
|
26897
26490
|
name: "delete",
|
|
26898
26491
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -26921,7 +26514,7 @@ var deleteCommand2 = defineCommand146({
|
|
|
26921
26514
|
});
|
|
26922
26515
|
|
|
26923
26516
|
// src/commands/scheduled-actions/get.ts
|
|
26924
|
-
import { defineCommand as
|
|
26517
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
26925
26518
|
registerSchema({
|
|
26926
26519
|
command: "scheduled-actions.get",
|
|
26927
26520
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -26929,7 +26522,7 @@ registerSchema({
|
|
|
26929
26522
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
26930
26523
|
}
|
|
26931
26524
|
});
|
|
26932
|
-
var getCommand3 =
|
|
26525
|
+
var getCommand3 = defineCommand146({
|
|
26933
26526
|
meta: {
|
|
26934
26527
|
name: "get",
|
|
26935
26528
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -26966,13 +26559,13 @@ var getCommand3 = defineCommand147({
|
|
|
26966
26559
|
});
|
|
26967
26560
|
|
|
26968
26561
|
// src/commands/scheduled-actions/list.ts
|
|
26969
|
-
import { defineCommand as
|
|
26562
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
26970
26563
|
registerSchema({
|
|
26971
26564
|
command: "scheduled-actions.list",
|
|
26972
26565
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
26973
26566
|
args: {}
|
|
26974
26567
|
});
|
|
26975
|
-
var
|
|
26568
|
+
var listCommand8 = defineCommand147({
|
|
26976
26569
|
meta: {
|
|
26977
26570
|
name: "list",
|
|
26978
26571
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -26993,7 +26586,7 @@ var listCommand9 = defineCommand148({
|
|
|
26993
26586
|
});
|
|
26994
26587
|
|
|
26995
26588
|
// src/commands/scheduled-actions/trigger.ts
|
|
26996
|
-
import { defineCommand as
|
|
26589
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
26997
26590
|
registerSchema({
|
|
26998
26591
|
command: "scheduled-actions.trigger",
|
|
26999
26592
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -27001,7 +26594,7 @@ registerSchema({
|
|
|
27001
26594
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
27002
26595
|
}
|
|
27003
26596
|
});
|
|
27004
|
-
var triggerCommand =
|
|
26597
|
+
var triggerCommand = defineCommand148({
|
|
27005
26598
|
meta: {
|
|
27006
26599
|
name: "trigger",
|
|
27007
26600
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -27038,7 +26631,7 @@ var triggerCommand = defineCommand149({
|
|
|
27038
26631
|
});
|
|
27039
26632
|
|
|
27040
26633
|
// src/commands/scheduled-actions/update.ts
|
|
27041
|
-
import { defineCommand as
|
|
26634
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
27042
26635
|
registerSchema({
|
|
27043
26636
|
command: "scheduled-actions.update",
|
|
27044
26637
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -27063,7 +26656,7 @@ registerSchema({
|
|
|
27063
26656
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
27064
26657
|
}
|
|
27065
26658
|
});
|
|
27066
|
-
var updateCommand2 =
|
|
26659
|
+
var updateCommand2 = defineCommand149({
|
|
27067
26660
|
meta: {
|
|
27068
26661
|
name: "update",
|
|
27069
26662
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -27134,7 +26727,7 @@ var updateCommand2 = defineCommand150({
|
|
|
27134
26727
|
});
|
|
27135
26728
|
|
|
27136
26729
|
// src/commands/scheduled-actions/index.ts
|
|
27137
|
-
var scheduledActionsCommand =
|
|
26730
|
+
var scheduledActionsCommand = defineCommand150({
|
|
27138
26731
|
meta: {
|
|
27139
26732
|
name: "scheduled-actions",
|
|
27140
26733
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -27150,7 +26743,7 @@ Examples:
|
|
|
27150
26743
|
baker scheduled-actions trigger <id>`
|
|
27151
26744
|
},
|
|
27152
26745
|
subCommands: {
|
|
27153
|
-
list:
|
|
26746
|
+
list: listCommand8,
|
|
27154
26747
|
get: getCommand3,
|
|
27155
26748
|
create: createCommand2,
|
|
27156
26749
|
update: updateCommand2,
|
|
@@ -27160,8 +26753,8 @@ Examples:
|
|
|
27160
26753
|
});
|
|
27161
26754
|
|
|
27162
26755
|
// src/commands/schema.ts
|
|
27163
|
-
import { defineCommand as
|
|
27164
|
-
var schemaCommand =
|
|
26756
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
26757
|
+
var schemaCommand = defineCommand151({
|
|
27165
26758
|
meta: {
|
|
27166
26759
|
name: "schema",
|
|
27167
26760
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -27197,7 +26790,7 @@ var schemaCommand = defineCommand152({
|
|
|
27197
26790
|
});
|
|
27198
26791
|
|
|
27199
26792
|
// src/commands/tags/index.ts
|
|
27200
|
-
import { defineCommand as
|
|
26793
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
27201
26794
|
|
|
27202
26795
|
// src/commands/tags/shared.ts
|
|
27203
26796
|
function failApi3(err) {
|
|
@@ -27263,7 +26856,7 @@ async function listTags(json) {
|
|
|
27263
26856
|
failApi3(err);
|
|
27264
26857
|
}
|
|
27265
26858
|
}
|
|
27266
|
-
var
|
|
26859
|
+
var listCommand9 = defineCommand152({
|
|
27267
26860
|
meta: {
|
|
27268
26861
|
name: "list",
|
|
27269
26862
|
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"
|
|
@@ -27282,7 +26875,7 @@ async function listDraft3() {
|
|
|
27282
26875
|
failApi3(err);
|
|
27283
26876
|
}
|
|
27284
26877
|
}
|
|
27285
|
-
var draftCommand3 =
|
|
26878
|
+
var draftCommand3 = defineCommand152({
|
|
27286
26879
|
meta: {
|
|
27287
26880
|
name: "draft",
|
|
27288
26881
|
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)."
|
|
@@ -27291,7 +26884,7 @@ var draftCommand3 = defineCommand153({
|
|
|
27291
26884
|
await listDraft3();
|
|
27292
26885
|
}
|
|
27293
26886
|
});
|
|
27294
|
-
var tagsCommand3 =
|
|
26887
|
+
var tagsCommand3 = defineCommand152({
|
|
27295
26888
|
meta: {
|
|
27296
26889
|
name: "tags",
|
|
27297
26890
|
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.
|
|
@@ -27307,7 +26900,7 @@ Examples:
|
|
|
27307
26900
|
baker tags draft # review the staged changes awaiting publish`
|
|
27308
26901
|
},
|
|
27309
26902
|
subCommands: {
|
|
27310
|
-
list:
|
|
26903
|
+
list: listCommand9,
|
|
27311
26904
|
draft: draftCommand3
|
|
27312
26905
|
},
|
|
27313
26906
|
run: async () => {
|
|
@@ -27316,10 +26909,10 @@ Examples:
|
|
|
27316
26909
|
});
|
|
27317
26910
|
|
|
27318
26911
|
// src/commands/testimonials/index.ts
|
|
27319
|
-
import { defineCommand as
|
|
26912
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
27320
26913
|
|
|
27321
26914
|
// src/commands/testimonials/get.ts
|
|
27322
|
-
import { defineCommand as
|
|
26915
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
27323
26916
|
registerSchema({
|
|
27324
26917
|
command: "testimonials.get",
|
|
27325
26918
|
description: "Get a single testimonial by ID",
|
|
@@ -27327,7 +26920,7 @@ registerSchema({
|
|
|
27327
26920
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
27328
26921
|
}
|
|
27329
26922
|
});
|
|
27330
|
-
var getCommand4 =
|
|
26923
|
+
var getCommand4 = defineCommand153({
|
|
27331
26924
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
27332
26925
|
args: {
|
|
27333
26926
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -27364,7 +26957,7 @@ var getCommand4 = defineCommand154({
|
|
|
27364
26957
|
});
|
|
27365
26958
|
|
|
27366
26959
|
// src/commands/testimonials/list.ts
|
|
27367
|
-
import { defineCommand as
|
|
26960
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
27368
26961
|
registerSchema({
|
|
27369
26962
|
command: "testimonials.list",
|
|
27370
26963
|
description: "List testimonials with optional filters.",
|
|
@@ -27394,7 +26987,7 @@ registerSchema({
|
|
|
27394
26987
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
27395
26988
|
}
|
|
27396
26989
|
});
|
|
27397
|
-
var
|
|
26990
|
+
var listCommand10 = defineCommand154({
|
|
27398
26991
|
meta: {
|
|
27399
26992
|
name: "list",
|
|
27400
26993
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -27443,7 +27036,7 @@ var listCommand11 = defineCommand155({
|
|
|
27443
27036
|
});
|
|
27444
27037
|
|
|
27445
27038
|
// src/commands/testimonials/search.ts
|
|
27446
|
-
import { defineCommand as
|
|
27039
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
27447
27040
|
registerSchema({
|
|
27448
27041
|
command: "testimonials.search",
|
|
27449
27042
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -27474,7 +27067,7 @@ registerSchema({
|
|
|
27474
27067
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
27475
27068
|
}
|
|
27476
27069
|
});
|
|
27477
|
-
var searchCommand2 =
|
|
27070
|
+
var searchCommand2 = defineCommand155({
|
|
27478
27071
|
meta: {
|
|
27479
27072
|
name: "search",
|
|
27480
27073
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -27548,7 +27141,7 @@ var searchCommand2 = defineCommand156({
|
|
|
27548
27141
|
var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
27549
27142
|
|
|
27550
27143
|
// src/commands/testimonials/index.ts
|
|
27551
|
-
var testimonialsCommand =
|
|
27144
|
+
var testimonialsCommand = defineCommand156({
|
|
27552
27145
|
meta: {
|
|
27553
27146
|
name: "testimonials",
|
|
27554
27147
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -27563,16 +27156,16 @@ Examples:
|
|
|
27563
27156
|
subCommands: {
|
|
27564
27157
|
get: getCommand4,
|
|
27565
27158
|
search: searchCommand2,
|
|
27566
|
-
list:
|
|
27159
|
+
list: listCommand10,
|
|
27567
27160
|
tags: tagsCommand4
|
|
27568
27161
|
}
|
|
27569
27162
|
});
|
|
27570
27163
|
|
|
27571
27164
|
// src/commands/videos/index.ts
|
|
27572
|
-
import { defineCommand as
|
|
27165
|
+
import { defineCommand as defineCommand161 } from "citty";
|
|
27573
27166
|
|
|
27574
27167
|
// src/commands/videos/delete.ts
|
|
27575
|
-
import { defineCommand as
|
|
27168
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
27576
27169
|
registerSchema({
|
|
27577
27170
|
command: "videos.delete",
|
|
27578
27171
|
description: "Delete a video by ID",
|
|
@@ -27586,7 +27179,7 @@ registerSchema({
|
|
|
27586
27179
|
}
|
|
27587
27180
|
}
|
|
27588
27181
|
});
|
|
27589
|
-
var deleteCommand3 =
|
|
27182
|
+
var deleteCommand3 = defineCommand157({
|
|
27590
27183
|
meta: {
|
|
27591
27184
|
name: "delete",
|
|
27592
27185
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -27627,7 +27220,7 @@ var deleteCommand3 = defineCommand158({
|
|
|
27627
27220
|
});
|
|
27628
27221
|
|
|
27629
27222
|
// src/commands/videos/get.ts
|
|
27630
|
-
import { defineCommand as
|
|
27223
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
27631
27224
|
registerSchema({
|
|
27632
27225
|
command: "videos.get",
|
|
27633
27226
|
description: "Get a single video by ID",
|
|
@@ -27635,7 +27228,7 @@ registerSchema({
|
|
|
27635
27228
|
id: { type: "string", description: "Video ID", required: true }
|
|
27636
27229
|
}
|
|
27637
27230
|
});
|
|
27638
|
-
var getCommand5 =
|
|
27231
|
+
var getCommand5 = defineCommand158({
|
|
27639
27232
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
27640
27233
|
args: {
|
|
27641
27234
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -27672,7 +27265,7 @@ var getCommand5 = defineCommand159({
|
|
|
27672
27265
|
});
|
|
27673
27266
|
|
|
27674
27267
|
// src/commands/videos/search.ts
|
|
27675
|
-
import { defineCommand as
|
|
27268
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
27676
27269
|
registerSchema({
|
|
27677
27270
|
command: "videos.search",
|
|
27678
27271
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -27682,7 +27275,7 @@ registerSchema({
|
|
|
27682
27275
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
27683
27276
|
}
|
|
27684
27277
|
});
|
|
27685
|
-
var searchCommand3 =
|
|
27278
|
+
var searchCommand3 = defineCommand159({
|
|
27686
27279
|
meta: {
|
|
27687
27280
|
name: "search",
|
|
27688
27281
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -27734,7 +27327,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
27734
27327
|
// src/commands/videos/upload.ts
|
|
27735
27328
|
import { readFile as readFile20, stat as stat5 } from "fs/promises";
|
|
27736
27329
|
import { extname as extname3 } from "path";
|
|
27737
|
-
import { defineCommand as
|
|
27330
|
+
import { defineCommand as defineCommand160 } from "citty";
|
|
27738
27331
|
var MIME_MAP = {
|
|
27739
27332
|
".mp4": "video/mp4",
|
|
27740
27333
|
".mov": "video/quicktime",
|
|
@@ -27768,7 +27361,7 @@ function detectContentType(filePath) {
|
|
|
27768
27361
|
}
|
|
27769
27362
|
return mime;
|
|
27770
27363
|
}
|
|
27771
|
-
var uploadCommand2 =
|
|
27364
|
+
var uploadCommand2 = defineCommand160({
|
|
27772
27365
|
meta: {
|
|
27773
27366
|
name: "upload",
|
|
27774
27367
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -27822,7 +27415,7 @@ var uploadCommand2 = defineCommand161({
|
|
|
27822
27415
|
});
|
|
27823
27416
|
|
|
27824
27417
|
// src/commands/videos/index.ts
|
|
27825
|
-
var videosCommand =
|
|
27418
|
+
var videosCommand = defineCommand161({
|
|
27826
27419
|
meta: {
|
|
27827
27420
|
name: "videos",
|
|
27828
27421
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -27845,10 +27438,10 @@ Examples:
|
|
|
27845
27438
|
});
|
|
27846
27439
|
|
|
27847
27440
|
// src/commands/winning-ads/index.ts
|
|
27848
|
-
import { defineCommand as
|
|
27441
|
+
import { defineCommand as defineCommand172 } from "citty";
|
|
27849
27442
|
|
|
27850
27443
|
// src/commands/winning-ads/advertisers.ts
|
|
27851
|
-
import { defineCommand as
|
|
27444
|
+
import { defineCommand as defineCommand162 } from "citty";
|
|
27852
27445
|
|
|
27853
27446
|
// src/commands/winning-ads/shared.ts
|
|
27854
27447
|
function splitList(value) {
|
|
@@ -27901,7 +27494,7 @@ function advertiserNormalizer(record, full) {
|
|
|
27901
27494
|
last_synced_at: record.last_synced_at ?? null
|
|
27902
27495
|
};
|
|
27903
27496
|
}
|
|
27904
|
-
var advertisersCommand2 =
|
|
27497
|
+
var advertisersCommand2 = defineCommand162({
|
|
27905
27498
|
meta: {
|
|
27906
27499
|
name: "advertisers",
|
|
27907
27500
|
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'
|
|
@@ -27959,7 +27552,7 @@ var advertisersCommand2 = defineCommand163({
|
|
|
27959
27552
|
});
|
|
27960
27553
|
|
|
27961
27554
|
// src/commands/winning-ads/brief.ts
|
|
27962
|
-
import { defineCommand as
|
|
27555
|
+
import { defineCommand as defineCommand163 } from "citty";
|
|
27963
27556
|
registerSchema({
|
|
27964
27557
|
command: "winning-ads.brief",
|
|
27965
27558
|
description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
|
|
@@ -28005,7 +27598,7 @@ function parseDna(raw) {
|
|
|
28005
27598
|
}
|
|
28006
27599
|
return parsed;
|
|
28007
27600
|
}
|
|
28008
|
-
var briefCommand =
|
|
27601
|
+
var briefCommand = defineCommand163({
|
|
28009
27602
|
meta: {
|
|
28010
27603
|
name: "brief",
|
|
28011
27604
|
description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
|
|
@@ -28041,7 +27634,7 @@ var briefCommand = defineCommand164({
|
|
|
28041
27634
|
});
|
|
28042
27635
|
|
|
28043
27636
|
// src/commands/winning-ads/feed.ts
|
|
28044
|
-
import { defineCommand as
|
|
27637
|
+
import { defineCommand as defineCommand164 } from "citty";
|
|
28045
27638
|
function buildFeedParams(input) {
|
|
28046
27639
|
const params = {};
|
|
28047
27640
|
const advertiser = splitList(input.advertiser);
|
|
@@ -28093,7 +27686,7 @@ registerSchema({
|
|
|
28093
27686
|
format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
|
|
28094
27687
|
}
|
|
28095
27688
|
});
|
|
28096
|
-
var feedCommand =
|
|
27689
|
+
var feedCommand = defineCommand164({
|
|
28097
27690
|
meta: {
|
|
28098
27691
|
name: "feed",
|
|
28099
27692
|
description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
|
|
@@ -28178,7 +27771,7 @@ var feedCommand = defineCommand165({
|
|
|
28178
27771
|
});
|
|
28179
27772
|
|
|
28180
27773
|
// src/commands/winning-ads/follow.ts
|
|
28181
|
-
import { defineCommand as
|
|
27774
|
+
import { defineCommand as defineCommand165 } from "citty";
|
|
28182
27775
|
var PLATFORMS = ["meta", "linkedin"];
|
|
28183
27776
|
registerSchema({
|
|
28184
27777
|
command: "winning-ads.follow",
|
|
@@ -28193,7 +27786,7 @@ registerSchema({
|
|
|
28193
27786
|
label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
|
|
28194
27787
|
}
|
|
28195
27788
|
});
|
|
28196
|
-
var followCommand =
|
|
27789
|
+
var followCommand = defineCommand165({
|
|
28197
27790
|
meta: {
|
|
28198
27791
|
name: "follow",
|
|
28199
27792
|
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'
|
|
@@ -28240,7 +27833,7 @@ var followCommand = defineCommand166({
|
|
|
28240
27833
|
});
|
|
28241
27834
|
|
|
28242
27835
|
// src/commands/winning-ads/following.ts
|
|
28243
|
-
import { defineCommand as
|
|
27836
|
+
import { defineCommand as defineCommand166 } from "citty";
|
|
28244
27837
|
registerSchema({
|
|
28245
27838
|
command: "winning-ads.following",
|
|
28246
27839
|
description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
|
|
@@ -28273,7 +27866,7 @@ function followingNormalizer(record, full) {
|
|
|
28273
27866
|
platforms: Array.isArray(record.platforms) ? record.platforms : []
|
|
28274
27867
|
};
|
|
28275
27868
|
}
|
|
28276
|
-
var followingCommand =
|
|
27869
|
+
var followingCommand = defineCommand166({
|
|
28277
27870
|
meta: {
|
|
28278
27871
|
name: "following",
|
|
28279
27872
|
description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
|
|
@@ -28308,7 +27901,7 @@ var followingCommand = defineCommand167({
|
|
|
28308
27901
|
});
|
|
28309
27902
|
|
|
28310
27903
|
// src/commands/winning-ads/patterns.ts
|
|
28311
|
-
import { defineCommand as
|
|
27904
|
+
import { defineCommand as defineCommand167 } from "citty";
|
|
28312
27905
|
registerSchema({
|
|
28313
27906
|
command: "winning-ads.patterns",
|
|
28314
27907
|
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.",
|
|
@@ -28347,7 +27940,7 @@ function discriminatorRow(record) {
|
|
|
28347
27940
|
top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
|
|
28348
27941
|
};
|
|
28349
27942
|
}
|
|
28350
|
-
var patternsCommand =
|
|
27943
|
+
var patternsCommand = defineCommand167({
|
|
28351
27944
|
meta: {
|
|
28352
27945
|
name: "patterns",
|
|
28353
27946
|
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"
|
|
@@ -28403,7 +27996,7 @@ var patternsCommand = defineCommand168({
|
|
|
28403
27996
|
});
|
|
28404
27997
|
|
|
28405
27998
|
// src/commands/winning-ads/search.ts
|
|
28406
|
-
import { defineCommand as
|
|
27999
|
+
import { defineCommand as defineCommand168 } from "citty";
|
|
28407
28000
|
registerSchema({
|
|
28408
28001
|
command: "winning-ads.search",
|
|
28409
28002
|
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.",
|
|
@@ -28511,7 +28104,7 @@ function buildSearchBody(args) {
|
|
|
28511
28104
|
}
|
|
28512
28105
|
return body;
|
|
28513
28106
|
}
|
|
28514
|
-
var searchCommand4 =
|
|
28107
|
+
var searchCommand4 = defineCommand168({
|
|
28515
28108
|
meta: {
|
|
28516
28109
|
name: "search",
|
|
28517
28110
|
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"
|
|
@@ -28626,7 +28219,7 @@ var searchCommand4 = defineCommand169({
|
|
|
28626
28219
|
});
|
|
28627
28220
|
|
|
28628
28221
|
// src/commands/winning-ads/seeds.ts
|
|
28629
|
-
import { defineCommand as
|
|
28222
|
+
import { defineCommand as defineCommand169 } from "citty";
|
|
28630
28223
|
function leanRow(r) {
|
|
28631
28224
|
return {
|
|
28632
28225
|
key: r.key,
|
|
@@ -28654,7 +28247,7 @@ function makeSeedCommand(opts) {
|
|
|
28654
28247
|
limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
|
|
28655
28248
|
}
|
|
28656
28249
|
});
|
|
28657
|
-
return
|
|
28250
|
+
return defineCommand169({
|
|
28658
28251
|
meta: { name: opts.name, description: opts.description },
|
|
28659
28252
|
args: {
|
|
28660
28253
|
platform: { type: "string", description: "Single platform to segment on", required: false },
|
|
@@ -28703,7 +28296,7 @@ var formatsCommand = makeSeedCommand({
|
|
|
28703
28296
|
});
|
|
28704
28297
|
|
|
28705
28298
|
// src/commands/winning-ads/unfollow.ts
|
|
28706
|
-
import { defineCommand as
|
|
28299
|
+
import { defineCommand as defineCommand170 } from "citty";
|
|
28707
28300
|
registerSchema({
|
|
28708
28301
|
command: "winning-ads.unfollow",
|
|
28709
28302
|
description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
|
|
@@ -28711,7 +28304,7 @@ registerSchema({
|
|
|
28711
28304
|
advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
|
|
28712
28305
|
}
|
|
28713
28306
|
});
|
|
28714
|
-
var unfollowCommand =
|
|
28307
|
+
var unfollowCommand = defineCommand170({
|
|
28715
28308
|
meta: {
|
|
28716
28309
|
name: "unfollow",
|
|
28717
28310
|
description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
|
|
@@ -28732,7 +28325,7 @@ var unfollowCommand = defineCommand171({
|
|
|
28732
28325
|
});
|
|
28733
28326
|
|
|
28734
28327
|
// src/commands/winning-ads/winners.ts
|
|
28735
|
-
import { defineCommand as
|
|
28328
|
+
import { defineCommand as defineCommand171 } from "citty";
|
|
28736
28329
|
registerSchema({
|
|
28737
28330
|
command: "winning-ads.winners",
|
|
28738
28331
|
description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
|
|
@@ -28742,7 +28335,7 @@ registerSchema({
|
|
|
28742
28335
|
platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
|
|
28743
28336
|
}
|
|
28744
28337
|
});
|
|
28745
|
-
var winnersCommand =
|
|
28338
|
+
var winnersCommand = defineCommand171({
|
|
28746
28339
|
meta: {
|
|
28747
28340
|
name: "winners",
|
|
28748
28341
|
description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
|
|
@@ -28792,7 +28385,7 @@ var winnersCommand = defineCommand172({
|
|
|
28792
28385
|
});
|
|
28793
28386
|
|
|
28794
28387
|
// src/commands/winning-ads/index.ts
|
|
28795
|
-
var winningAdsCommand =
|
|
28388
|
+
var winningAdsCommand = defineCommand172({
|
|
28796
28389
|
meta: {
|
|
28797
28390
|
name: "winning-ads",
|
|
28798
28391
|
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.
|
|
@@ -28857,7 +28450,7 @@ function getCliVersion() {
|
|
|
28857
28450
|
}
|
|
28858
28451
|
|
|
28859
28452
|
// src/cli.ts
|
|
28860
|
-
var main =
|
|
28453
|
+
var main = defineCommand173({
|
|
28861
28454
|
meta: {
|
|
28862
28455
|
name: "baker",
|
|
28863
28456
|
version: getCliVersion(),
|
|
@@ -28883,7 +28476,6 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
28883
28476
|
testimonials: testimonialsCommand,
|
|
28884
28477
|
canvas: canvasCommand,
|
|
28885
28478
|
tags: tagsCommand3,
|
|
28886
|
-
chats: chatsCommand,
|
|
28887
28479
|
history: historyCommand,
|
|
28888
28480
|
"winning-ads": winningAdsCommand,
|
|
28889
28481
|
mcp: mcpCommand,
|