@koda-sl/baker-cli 0.136.2 → 0.137.0-dev.529af4675
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 +23 -0
- package/dist/{chunk-TAGQCU36.js → chunk-TXNOPO6P.js} +4 -4
- package/dist/chunk-TXNOPO6P.js.map +1 -0
- package/dist/cli.js +1743 -1295
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-TAGQCU36.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-TXNOPO6P.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 defineCommand174, runMain } from "citty";
|
|
77
77
|
|
|
78
78
|
// src/commands/actions/index.ts
|
|
79
79
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -1928,8 +1928,224 @@ var linkedinDraftErrorResponseSchema = z4.object({
|
|
|
1928
1928
|
fields: z4.array(linkedinFieldErrorSchema).optional()
|
|
1929
1929
|
});
|
|
1930
1930
|
|
|
1931
|
-
// ../api/src/
|
|
1931
|
+
// ../api/src/chats.ts
|
|
1932
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
|
+
* The caller's OWN Session id — excluded from results so an agent never sees
|
|
1973
|
+
* its own in-flight chat listed as a separate "other Session" to reuse.
|
|
1974
|
+
*/
|
|
1975
|
+
excludeChatId: z5.string().optional()
|
|
1976
|
+
});
|
|
1977
|
+
var chatSummarySchema = z5.object({
|
|
1978
|
+
id: z5.string(),
|
|
1979
|
+
title: z5.string(),
|
|
1980
|
+
status: chatInspectStatusSchema,
|
|
1981
|
+
createdAt: z5.number(),
|
|
1982
|
+
updatedAt: z5.number(),
|
|
1983
|
+
/** Counts of produced outputs keyed by change type. */
|
|
1984
|
+
outputs: z5.record(z5.string(), z5.number()),
|
|
1985
|
+
outputTotal: z5.number(),
|
|
1986
|
+
changes: z5.array(chatChangeSummarySchema).optional()
|
|
1987
|
+
});
|
|
1988
|
+
var chatsListResponseSchema = z5.object({
|
|
1989
|
+
ok: z5.literal(true),
|
|
1990
|
+
data: z5.object({ chats: z5.array(chatSummarySchema) })
|
|
1991
|
+
});
|
|
1992
|
+
var chatsViewRequestSchema = z5.object({
|
|
1993
|
+
chatId: z5.string(),
|
|
1994
|
+
full: z5.boolean().optional()
|
|
1995
|
+
});
|
|
1996
|
+
var chatThreadSummarySchema = z5.object({
|
|
1997
|
+
id: z5.string(),
|
|
1998
|
+
title: z5.string().nullable(),
|
|
1999
|
+
status: z5.string(),
|
|
2000
|
+
createdAt: z5.number()
|
|
2001
|
+
});
|
|
2002
|
+
var chatCommitSummarySchema = z5.object({
|
|
2003
|
+
sha: z5.string(),
|
|
2004
|
+
message: z5.string().nullable(),
|
|
2005
|
+
surfaces: z5.array(z5.string()),
|
|
2006
|
+
createdAt: z5.number()
|
|
2007
|
+
});
|
|
2008
|
+
var effectOpSchema = z5.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
|
|
2009
|
+
var contentEffectSchema = z5.object({
|
|
2010
|
+
surface: chatChangeTypeSchema,
|
|
2011
|
+
slug: z5.string(),
|
|
2012
|
+
op: effectOpSchema,
|
|
2013
|
+
staged: z5.boolean()
|
|
2014
|
+
});
|
|
2015
|
+
var actionEffectSchema = z5.object({
|
|
2016
|
+
op: effectOpSchema,
|
|
2017
|
+
staged: z5.boolean(),
|
|
2018
|
+
name: z5.string(),
|
|
2019
|
+
description: z5.string().nullable(),
|
|
2020
|
+
priority: z5.string().nullable(),
|
|
2021
|
+
tags: z5.array(z5.string()),
|
|
2022
|
+
status: z5.string().nullable(),
|
|
2023
|
+
note: z5.string().nullable(),
|
|
2024
|
+
reason: z5.string().nullable()
|
|
2025
|
+
});
|
|
2026
|
+
var scheduledEffectSchema = z5.object({
|
|
2027
|
+
op: effectOpSchema,
|
|
2028
|
+
staged: z5.boolean(),
|
|
2029
|
+
name: z5.string(),
|
|
2030
|
+
summary: z5.string().nullable()
|
|
2031
|
+
});
|
|
2032
|
+
var tagEffectSchema = z5.object({
|
|
2033
|
+
op: effectOpSchema,
|
|
2034
|
+
staged: z5.boolean(),
|
|
2035
|
+
tagType: z5.string(),
|
|
2036
|
+
title: z5.string().nullable(),
|
|
2037
|
+
summary: z5.string().nullable(),
|
|
2038
|
+
configKeys: z5.array(z5.string()),
|
|
2039
|
+
hasSecrets: z5.boolean()
|
|
2040
|
+
});
|
|
2041
|
+
var adEffectSchema = z5.object({
|
|
2042
|
+
platform: z5.enum(["google", "meta", "linkedin"]),
|
|
2043
|
+
op: effectOpSchema,
|
|
2044
|
+
staged: z5.boolean(),
|
|
2045
|
+
entity: z5.string().nullable(),
|
|
2046
|
+
operation: z5.string().nullable(),
|
|
2047
|
+
summary: z5.string().nullable()
|
|
2048
|
+
});
|
|
2049
|
+
var creativeEffectSchema = z5.object({
|
|
2050
|
+
op: effectOpSchema,
|
|
2051
|
+
staged: z5.boolean(),
|
|
2052
|
+
slug: z5.string(),
|
|
2053
|
+
title: z5.string().nullable(),
|
|
2054
|
+
status: z5.string().nullable()
|
|
2055
|
+
});
|
|
2056
|
+
var chatEffectsSchema = z5.object({
|
|
2057
|
+
content: z5.array(contentEffectSchema),
|
|
2058
|
+
actions: z5.array(actionEffectSchema),
|
|
2059
|
+
scheduledActions: z5.array(scheduledEffectSchema),
|
|
2060
|
+
tags: z5.array(tagEffectSchema),
|
|
2061
|
+
ads: z5.object({
|
|
2062
|
+
google: z5.array(adEffectSchema),
|
|
2063
|
+
meta: z5.array(adEffectSchema),
|
|
2064
|
+
linkedin: z5.array(adEffectSchema)
|
|
2065
|
+
}),
|
|
2066
|
+
creatives: z5.array(creativeEffectSchema)
|
|
2067
|
+
});
|
|
2068
|
+
var chatDetailSchema = z5.object({
|
|
2069
|
+
id: z5.string(),
|
|
2070
|
+
title: z5.string(),
|
|
2071
|
+
status: chatInspectStatusSchema,
|
|
2072
|
+
createdAt: z5.number(),
|
|
2073
|
+
updatedAt: z5.number(),
|
|
2074
|
+
completedBySource: z5.enum(["user", "bridge"]).nullable(),
|
|
2075
|
+
publishedAt: z5.number().nullable(),
|
|
2076
|
+
/** The first user message — how this Session was originally asked. */
|
|
2077
|
+
kickoff: z5.string().nullable(),
|
|
2078
|
+
outputs: z5.record(z5.string(), z5.number()),
|
|
2079
|
+
outputTotal: z5.number(),
|
|
2080
|
+
/** The unified picture of everything this Session changed — git + DB. */
|
|
2081
|
+
effects: chatEffectsSchema,
|
|
2082
|
+
threads: z5.array(chatThreadSummarySchema),
|
|
2083
|
+
commits: z5.array(chatCommitSummarySchema),
|
|
2084
|
+
/** True when a real file-level diff is available via `baker chats diff`. */
|
|
2085
|
+
diffAvailable: z5.boolean()
|
|
2086
|
+
});
|
|
2087
|
+
var chatsViewResponseSchema = z5.object({
|
|
2088
|
+
ok: z5.literal(true),
|
|
2089
|
+
data: chatDetailSchema
|
|
2090
|
+
});
|
|
2091
|
+
var chatsTranscriptRequestSchema = z5.object({
|
|
2092
|
+
chatId: z5.string(),
|
|
2093
|
+
limit: z5.number().int().min(1).max(1e3).optional(),
|
|
2094
|
+
/** Return untruncated message text (compact truncates each entry). */
|
|
2095
|
+
full: z5.boolean().optional()
|
|
2096
|
+
});
|
|
2097
|
+
var transcriptEntrySchema = z5.object({
|
|
2098
|
+
role: z5.string(),
|
|
2099
|
+
text: z5.string()
|
|
2100
|
+
});
|
|
2101
|
+
var chatsTranscriptResponseSchema = z5.object({
|
|
2102
|
+
ok: z5.literal(true),
|
|
2103
|
+
data: z5.object({
|
|
2104
|
+
chatId: z5.string(),
|
|
2105
|
+
entries: z5.array(transcriptEntrySchema),
|
|
2106
|
+
/** True when older entries were dropped to fit `limit`. */
|
|
2107
|
+
truncated: z5.boolean()
|
|
2108
|
+
})
|
|
2109
|
+
});
|
|
2110
|
+
var chatsDiffRequestSchema = z5.object({
|
|
2111
|
+
chatId: z5.string(),
|
|
2112
|
+
surface: repoSurfaceSchema.optional(),
|
|
2113
|
+
/** Include the unified-diff `patch` text per file (compact omits it). */
|
|
2114
|
+
full: z5.boolean().optional(),
|
|
2115
|
+
/**
|
|
2116
|
+
* Opt in to reading an in-progress (unpublished) Session's changes straight
|
|
2117
|
+
* from its live Runtime — resumes the paused sandbox and runs a read-only git
|
|
2118
|
+
* diff. Slower and only works while the sandbox still exists (not discarded).
|
|
2119
|
+
* Ignored for published Sessions, which always read from git.
|
|
2120
|
+
*/
|
|
2121
|
+
live: z5.boolean().optional()
|
|
2122
|
+
});
|
|
2123
|
+
var diffFileSchema = z5.object({
|
|
2124
|
+
path: z5.string(),
|
|
2125
|
+
surface: repoSurfaceSchema.nullable(),
|
|
2126
|
+
status: z5.string(),
|
|
2127
|
+
additions: z5.number(),
|
|
2128
|
+
deletions: z5.number(),
|
|
2129
|
+
patch: z5.string().optional()
|
|
2130
|
+
});
|
|
2131
|
+
var diffSourceSchema = z5.enum(["published", "live"]);
|
|
2132
|
+
var chatsDiffResponseSchema = z5.object({
|
|
2133
|
+
ok: z5.literal(true),
|
|
2134
|
+
data: z5.object({
|
|
2135
|
+
chatId: z5.string(),
|
|
2136
|
+
/** False when no published git diff exists (in-progress Session or unlinked repo). */
|
|
2137
|
+
available: z5.boolean(),
|
|
2138
|
+
reason: z5.string().optional(),
|
|
2139
|
+
/** Present when available — how the diff was obtained. */
|
|
2140
|
+
source: diffSourceSchema.optional(),
|
|
2141
|
+
/** True when the live diff was capped (very large in-progress change set). */
|
|
2142
|
+
truncated: z5.boolean().optional(),
|
|
2143
|
+
files: z5.array(diffFileSchema)
|
|
2144
|
+
})
|
|
2145
|
+
});
|
|
2146
|
+
|
|
2147
|
+
// ../api/src/flows.ts
|
|
2148
|
+
import { z as z6 } from "zod";
|
|
1933
2149
|
var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
1934
2150
|
"email",
|
|
1935
2151
|
"zapier",
|
|
@@ -1940,7 +2156,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
|
1940
2156
|
"crmble",
|
|
1941
2157
|
"goHighlevelContact"
|
|
1942
2158
|
];
|
|
1943
|
-
var flowSideEffectTypeSchema =
|
|
2159
|
+
var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
|
|
1944
2160
|
var FLOW_SECRET_FIELDS = {
|
|
1945
2161
|
email: [],
|
|
1946
2162
|
zapier: ["zapUrl"],
|
|
@@ -1968,94 +2184,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
|
|
|
1968
2184
|
"highlevel",
|
|
1969
2185
|
"highlevelForm"
|
|
1970
2186
|
];
|
|
1971
|
-
var flowResourceNodeTypeSchema =
|
|
1972
|
-
var flowInputRequestSchema =
|
|
1973
|
-
|
|
2187
|
+
var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
|
|
2188
|
+
var flowInputRequestSchema = z6.discriminatedUnion("target", [
|
|
2189
|
+
z6.object({
|
|
1974
2190
|
/** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
|
|
1975
|
-
target:
|
|
1976
|
-
flowSlug:
|
|
2191
|
+
target: z6.literal("sideEffect"),
|
|
2192
|
+
flowSlug: z6.string(),
|
|
1977
2193
|
/** `id` of the FlowNode holding the side effect. */
|
|
1978
|
-
nodeId:
|
|
2194
|
+
nodeId: z6.string(),
|
|
1979
2195
|
/** `id` of the side effect within that node's `sideEffects[]`. */
|
|
1980
|
-
sideEffectId:
|
|
2196
|
+
sideEffectId: z6.string(),
|
|
1981
2197
|
sideEffectType: flowSideEffectTypeSchema,
|
|
1982
2198
|
/** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
|
|
1983
|
-
prefilledConfig:
|
|
2199
|
+
prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
|
|
1984
2200
|
/** Secret credential field names the agent asks the user to provide. */
|
|
1985
|
-
requestedSecretFields:
|
|
1986
|
-
message:
|
|
2201
|
+
requestedSecretFields: z6.array(z6.string()).optional(),
|
|
2202
|
+
message: z6.string().optional()
|
|
1987
2203
|
}),
|
|
1988
|
-
|
|
2204
|
+
z6.object({
|
|
1989
2205
|
/** Configure a widget node's third-party `form.external` (+ `providerId`). */
|
|
1990
|
-
target:
|
|
1991
|
-
flowSlug:
|
|
2206
|
+
target: z6.literal("node"),
|
|
2207
|
+
flowSlug: z6.string(),
|
|
1992
2208
|
/** `id` of the widget FlowNode. */
|
|
1993
|
-
nodeId:
|
|
2209
|
+
nodeId: z6.string(),
|
|
1994
2210
|
nodeType: flowResourceNodeTypeSchema,
|
|
1995
|
-
message:
|
|
2211
|
+
message: z6.string().optional()
|
|
1996
2212
|
})
|
|
1997
2213
|
]);
|
|
1998
|
-
var flowInputToolInputSchema =
|
|
1999
|
-
requests:
|
|
2214
|
+
var flowInputToolInputSchema = z6.object({
|
|
2215
|
+
requests: z6.array(flowInputRequestSchema).min(1).max(8)
|
|
2000
2216
|
});
|
|
2001
|
-
var flowInputResultSchema =
|
|
2002
|
-
|
|
2003
|
-
status:
|
|
2217
|
+
var flowInputResultSchema = z6.discriminatedUnion("status", [
|
|
2218
|
+
z6.object({
|
|
2219
|
+
status: z6.literal("submitted"),
|
|
2004
2220
|
/** Echoes which piece this result resolves. */
|
|
2005
|
-
nodeId:
|
|
2006
|
-
sideEffectId:
|
|
2221
|
+
nodeId: z6.string(),
|
|
2222
|
+
sideEffectId: z6.string().optional(),
|
|
2007
2223
|
/** Names of secret fields the user provided. Never values. */
|
|
2008
|
-
secretFieldsSet:
|
|
2224
|
+
secretFieldsSet: z6.array(z6.string()),
|
|
2009
2225
|
/** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
|
|
2010
|
-
note:
|
|
2226
|
+
note: z6.string().optional()
|
|
2011
2227
|
}),
|
|
2012
|
-
|
|
2013
|
-
status:
|
|
2014
|
-
nodeId:
|
|
2015
|
-
sideEffectId:
|
|
2016
|
-
reason:
|
|
2228
|
+
z6.object({
|
|
2229
|
+
status: z6.literal("declined"),
|
|
2230
|
+
nodeId: z6.string(),
|
|
2231
|
+
sideEffectId: z6.string().optional(),
|
|
2232
|
+
reason: z6.string().optional()
|
|
2017
2233
|
})
|
|
2018
2234
|
]);
|
|
2019
|
-
var flowInputToolResultSchema =
|
|
2020
|
-
results:
|
|
2235
|
+
var flowInputToolResultSchema = z6.object({
|
|
2236
|
+
results: z6.array(flowInputResultSchema)
|
|
2021
2237
|
});
|
|
2022
|
-
var flowsListRequestSchema =
|
|
2023
|
-
var flowSummarySchema =
|
|
2024
|
-
slug:
|
|
2025
|
-
name:
|
|
2238
|
+
var flowsListRequestSchema = z6.object({ chatId: z6.string() });
|
|
2239
|
+
var flowSummarySchema = z6.object({
|
|
2240
|
+
slug: z6.string(),
|
|
2241
|
+
name: z6.string(),
|
|
2026
2242
|
/** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
|
|
2027
|
-
needsConfig:
|
|
2243
|
+
needsConfig: z6.number()
|
|
2028
2244
|
});
|
|
2029
|
-
var flowsListResponseSchema =
|
|
2030
|
-
var flowsShowRequestSchema =
|
|
2031
|
-
chatId:
|
|
2032
|
-
slug:
|
|
2033
|
-
full:
|
|
2245
|
+
var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
|
|
2246
|
+
var flowsShowRequestSchema = z6.object({
|
|
2247
|
+
chatId: z6.string(),
|
|
2248
|
+
slug: z6.string(),
|
|
2249
|
+
full: z6.boolean().optional()
|
|
2034
2250
|
});
|
|
2035
|
-
var flowConfigStatusSchema =
|
|
2036
|
-
nodeId:
|
|
2037
|
-
nodeName:
|
|
2251
|
+
var flowConfigStatusSchema = z6.object({
|
|
2252
|
+
nodeId: z6.string(),
|
|
2253
|
+
nodeName: z6.string().optional(),
|
|
2038
2254
|
/** "sideEffect" credential/connection, or "node" widget resource. */
|
|
2039
|
-
target:
|
|
2040
|
-
sideEffectId:
|
|
2041
|
-
kind:
|
|
2255
|
+
target: z6.enum(["sideEffect", "node"]),
|
|
2256
|
+
sideEffectId: z6.string().optional(),
|
|
2257
|
+
kind: z6.string(),
|
|
2042
2258
|
/** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
|
|
2043
|
-
status:
|
|
2259
|
+
status: z6.string(),
|
|
2044
2260
|
/** True when a `request_flow_input` call is still needed for this piece. */
|
|
2045
|
-
needsInput:
|
|
2261
|
+
needsInput: z6.boolean()
|
|
2046
2262
|
});
|
|
2047
|
-
var flowsShowResponseSchema =
|
|
2048
|
-
slug:
|
|
2049
|
-
name:
|
|
2263
|
+
var flowsShowResponseSchema = z6.object({
|
|
2264
|
+
slug: z6.string(),
|
|
2265
|
+
name: z6.string(),
|
|
2050
2266
|
/** Confidential fields and whether each is configured. */
|
|
2051
|
-
config:
|
|
2267
|
+
config: z6.array(flowConfigStatusSchema),
|
|
2052
2268
|
/** Present only with `--full`: the whole flow tree, secret values redacted. */
|
|
2053
|
-
tree:
|
|
2269
|
+
tree: z6.unknown().optional()
|
|
2054
2270
|
});
|
|
2055
2271
|
|
|
2056
2272
|
// ../api/src/history.ts
|
|
2057
|
-
import { z as
|
|
2058
|
-
var historyCategorySchema =
|
|
2273
|
+
import { z as z7 } from "zod";
|
|
2274
|
+
var historyCategorySchema = z7.enum([
|
|
2059
2275
|
"publish",
|
|
2060
2276
|
"chat",
|
|
2061
2277
|
"action",
|
|
@@ -2072,36 +2288,36 @@ var historyCategorySchema = z6.enum([
|
|
|
2072
2288
|
"domain",
|
|
2073
2289
|
"integration"
|
|
2074
2290
|
]);
|
|
2075
|
-
var historyListRequestSchema =
|
|
2076
|
-
limit:
|
|
2291
|
+
var historyListRequestSchema = z7.object({
|
|
2292
|
+
limit: z7.number().int().min(1).max(200).optional(),
|
|
2077
2293
|
category: historyCategorySchema.optional(),
|
|
2078
2294
|
/** Only entries from the last N days. */
|
|
2079
|
-
days:
|
|
2295
|
+
days: z7.number().int().min(1).max(365).optional(),
|
|
2080
2296
|
/** Include raw metadata on each entry (compact by default). */
|
|
2081
|
-
full:
|
|
2297
|
+
full: z7.boolean().optional()
|
|
2082
2298
|
});
|
|
2083
|
-
var historyEntrySchema =
|
|
2084
|
-
id:
|
|
2299
|
+
var historyEntrySchema = z7.object({
|
|
2300
|
+
id: z7.string(),
|
|
2085
2301
|
/** Epoch ms. */
|
|
2086
|
-
at:
|
|
2302
|
+
at: z7.number(),
|
|
2087
2303
|
category: historyCategorySchema,
|
|
2088
2304
|
/** Dotted action id, e.g. "publish.commit", "member.invite_create". */
|
|
2089
|
-
action:
|
|
2090
|
-
actorType:
|
|
2305
|
+
action: z7.string(),
|
|
2306
|
+
actorType: z7.enum(["user", "agent", "system"]),
|
|
2091
2307
|
/** Display name of the acting user, when the actor is a user. */
|
|
2092
|
-
actor:
|
|
2308
|
+
actor: z7.string().nullable(),
|
|
2093
2309
|
/** What the change touched — commit subject, chat title, member email, tag type, … */
|
|
2094
|
-
target:
|
|
2095
|
-
metadata:
|
|
2310
|
+
target: z7.string().nullable(),
|
|
2311
|
+
metadata: z7.record(z7.string(), z7.unknown()).optional()
|
|
2096
2312
|
});
|
|
2097
|
-
var historyListResponseSchema =
|
|
2098
|
-
ok:
|
|
2099
|
-
data:
|
|
2313
|
+
var historyListResponseSchema = z7.object({
|
|
2314
|
+
ok: z7.literal(true),
|
|
2315
|
+
data: z7.object({ entries: z7.array(historyEntrySchema) })
|
|
2100
2316
|
});
|
|
2101
2317
|
|
|
2102
2318
|
// ../api/src/images.ts
|
|
2103
|
-
import { z as
|
|
2104
|
-
var imageSourceSchema =
|
|
2319
|
+
import { z as z8 } from "zod";
|
|
2320
|
+
var imageSourceSchema = z8.enum([
|
|
2105
2321
|
"uploaded",
|
|
2106
2322
|
"website",
|
|
2107
2323
|
"google_testimonial",
|
|
@@ -2117,49 +2333,49 @@ var imageSourceSchema = z7.enum([
|
|
|
2117
2333
|
"pinterest",
|
|
2118
2334
|
"ai_generated"
|
|
2119
2335
|
]);
|
|
2120
|
-
var imageStatusSchema =
|
|
2121
|
-
var upscaleConfigSchema =
|
|
2122
|
-
model:
|
|
2123
|
-
input:
|
|
2124
|
-
scale_factor:
|
|
2125
|
-
creativity:
|
|
2126
|
-
output_format:
|
|
2336
|
+
var imageStatusSchema = z8.enum(["uploading", "processing", "ready", "error"]);
|
|
2337
|
+
var upscaleConfigSchema = z8.object({
|
|
2338
|
+
model: z8.literal("philz1337x/crystal-upscaler"),
|
|
2339
|
+
input: z8.object({
|
|
2340
|
+
scale_factor: z8.number(),
|
|
2341
|
+
creativity: z8.number(),
|
|
2342
|
+
output_format: z8.string()
|
|
2127
2343
|
}),
|
|
2128
|
-
status:
|
|
2344
|
+
status: z8.enum(["pending", "completed"])
|
|
2129
2345
|
});
|
|
2130
|
-
var imageDocSchema =
|
|
2131
|
-
_id:
|
|
2132
|
-
_creationTime:
|
|
2133
|
-
companyId:
|
|
2134
|
-
storageKey:
|
|
2346
|
+
var imageDocSchema = z8.object({
|
|
2347
|
+
_id: z8.string(),
|
|
2348
|
+
_creationTime: z8.number(),
|
|
2349
|
+
companyId: z8.string(),
|
|
2350
|
+
storageKey: z8.string(),
|
|
2135
2351
|
upscaleConfig: upscaleConfigSchema.optional(),
|
|
2136
|
-
upscaledStorageKey:
|
|
2137
|
-
name:
|
|
2138
|
-
description:
|
|
2139
|
-
tags:
|
|
2140
|
-
source:
|
|
2141
|
-
externalId:
|
|
2142
|
-
externalUrl:
|
|
2143
|
-
contentHash:
|
|
2144
|
-
sourceId:
|
|
2145
|
-
descriptionContext:
|
|
2146
|
-
width:
|
|
2147
|
-
height:
|
|
2148
|
-
aspectRatio:
|
|
2149
|
-
dominantColor:
|
|
2150
|
-
imagePalette:
|
|
2151
|
-
thumbhashDataUri:
|
|
2152
|
-
isLightImage:
|
|
2153
|
-
descriptionEmbedding:
|
|
2154
|
-
imageEmbedding:
|
|
2155
|
-
searchText:
|
|
2352
|
+
upscaledStorageKey: z8.string().optional(),
|
|
2353
|
+
name: z8.string(),
|
|
2354
|
+
description: z8.string(),
|
|
2355
|
+
tags: z8.array(z8.string()),
|
|
2356
|
+
source: z8.string(),
|
|
2357
|
+
externalId: z8.string().optional(),
|
|
2358
|
+
externalUrl: z8.string().optional(),
|
|
2359
|
+
contentHash: z8.string().optional(),
|
|
2360
|
+
sourceId: z8.string().optional(),
|
|
2361
|
+
descriptionContext: z8.string().optional(),
|
|
2362
|
+
width: z8.number().optional(),
|
|
2363
|
+
height: z8.number().optional(),
|
|
2364
|
+
aspectRatio: z8.number().optional(),
|
|
2365
|
+
dominantColor: z8.string().optional(),
|
|
2366
|
+
imagePalette: z8.array(z8.string()).optional(),
|
|
2367
|
+
thumbhashDataUri: z8.string().optional(),
|
|
2368
|
+
isLightImage: z8.boolean().optional(),
|
|
2369
|
+
descriptionEmbedding: z8.array(z8.number()).optional(),
|
|
2370
|
+
imageEmbedding: z8.array(z8.number()).optional(),
|
|
2371
|
+
searchText: z8.string().optional(),
|
|
2156
2372
|
status: imageStatusSchema,
|
|
2157
|
-
errorMessage:
|
|
2158
|
-
createdAt:
|
|
2159
|
-
updatedAt:
|
|
2160
|
-
imageUrl:
|
|
2373
|
+
errorMessage: z8.string().optional(),
|
|
2374
|
+
createdAt: z8.number(),
|
|
2375
|
+
updatedAt: z8.number(),
|
|
2376
|
+
imageUrl: z8.string()
|
|
2161
2377
|
});
|
|
2162
|
-
var imageHitSourceSchema =
|
|
2378
|
+
var imageHitSourceSchema = z8.enum([
|
|
2163
2379
|
"library",
|
|
2164
2380
|
"magnific",
|
|
2165
2381
|
"google_images",
|
|
@@ -2170,242 +2386,242 @@ var imageHitSourceSchema = z7.enum([
|
|
|
2170
2386
|
"giphy",
|
|
2171
2387
|
"pinterest"
|
|
2172
2388
|
]);
|
|
2173
|
-
var imageHitSchema =
|
|
2389
|
+
var imageHitSchema = z8.object({
|
|
2174
2390
|
source: imageHitSourceSchema,
|
|
2175
|
-
url:
|
|
2176
|
-
thumbnailUrl:
|
|
2177
|
-
width:
|
|
2178
|
-
height:
|
|
2179
|
-
aspectRatio:
|
|
2180
|
-
dominantColor:
|
|
2181
|
-
externalId:
|
|
2182
|
-
externalUrl:
|
|
2183
|
-
providerMeta:
|
|
2184
|
-
descriptionContext:
|
|
2185
|
-
_id:
|
|
2186
|
-
name:
|
|
2187
|
-
description:
|
|
2188
|
-
tags:
|
|
2189
|
-
score:
|
|
2190
|
-
alsoInLibrary:
|
|
2191
|
-
prefetchedBytes:
|
|
2192
|
-
prefetchedContentType:
|
|
2391
|
+
url: z8.string(),
|
|
2392
|
+
thumbnailUrl: z8.string().optional(),
|
|
2393
|
+
width: z8.number().optional(),
|
|
2394
|
+
height: z8.number().optional(),
|
|
2395
|
+
aspectRatio: z8.number().optional(),
|
|
2396
|
+
dominantColor: z8.string().optional(),
|
|
2397
|
+
externalId: z8.string().optional(),
|
|
2398
|
+
externalUrl: z8.string().optional(),
|
|
2399
|
+
providerMeta: z8.record(z8.string(), z8.unknown()).optional(),
|
|
2400
|
+
descriptionContext: z8.string().optional(),
|
|
2401
|
+
_id: z8.string().optional(),
|
|
2402
|
+
name: z8.string().optional(),
|
|
2403
|
+
description: z8.string().optional(),
|
|
2404
|
+
tags: z8.array(z8.string()).optional(),
|
|
2405
|
+
score: z8.number().optional(),
|
|
2406
|
+
alsoInLibrary: z8.string().optional(),
|
|
2407
|
+
prefetchedBytes: z8.string().optional(),
|
|
2408
|
+
prefetchedContentType: z8.string().optional()
|
|
2193
2409
|
});
|
|
2194
2410
|
var ingestedImageHitSchema = imageHitSchema.extend({
|
|
2195
|
-
imageId:
|
|
2196
|
-
imageUrl:
|
|
2197
|
-
deduped:
|
|
2198
|
-
sourceUrl:
|
|
2199
|
-
});
|
|
2200
|
-
var autoIngestItemSchema =
|
|
2201
|
-
imageId:
|
|
2202
|
-
deduped:
|
|
2203
|
-
imageUrl:
|
|
2204
|
-
sourceUrl:
|
|
2205
|
-
externalUrl:
|
|
2411
|
+
imageId: z8.string().optional(),
|
|
2412
|
+
imageUrl: z8.string().optional(),
|
|
2413
|
+
deduped: z8.boolean().optional(),
|
|
2414
|
+
sourceUrl: z8.string().optional()
|
|
2415
|
+
});
|
|
2416
|
+
var autoIngestItemSchema = z8.object({
|
|
2417
|
+
imageId: z8.string(),
|
|
2418
|
+
deduped: z8.boolean(),
|
|
2419
|
+
imageUrl: z8.string(),
|
|
2420
|
+
sourceUrl: z8.string(),
|
|
2421
|
+
externalUrl: z8.string().optional()
|
|
2206
2422
|
});
|
|
2207
2423
|
function providerHitsResponseSchema() {
|
|
2208
|
-
return
|
|
2209
|
-
hits:
|
|
2210
|
-
ingested:
|
|
2424
|
+
return z8.object({
|
|
2425
|
+
hits: z8.array(ingestedImageHitSchema),
|
|
2426
|
+
ingested: z8.array(autoIngestItemSchema)
|
|
2211
2427
|
});
|
|
2212
2428
|
}
|
|
2213
|
-
var imagesGetRequestSchema =
|
|
2214
|
-
var imagesSearchRequestSchema =
|
|
2215
|
-
query:
|
|
2216
|
-
limit:
|
|
2217
|
-
aspectRatio:
|
|
2218
|
-
tags:
|
|
2219
|
-
source:
|
|
2220
|
-
externalUrlHost:
|
|
2221
|
-
});
|
|
2222
|
-
var imageSearchResultSchema =
|
|
2223
|
-
_id:
|
|
2224
|
-
imageUrl:
|
|
2225
|
-
name:
|
|
2226
|
-
description:
|
|
2227
|
-
tags:
|
|
2228
|
-
width:
|
|
2229
|
-
height:
|
|
2230
|
-
aspectRatio:
|
|
2231
|
-
dominantColor:
|
|
2232
|
-
imagePalette:
|
|
2233
|
-
source:
|
|
2234
|
-
externalUrl:
|
|
2235
|
-
score:
|
|
2236
|
-
});
|
|
2237
|
-
var imagesSearchResponseSchema =
|
|
2238
|
-
var imagesUploadRequestSchema =
|
|
2239
|
-
base64:
|
|
2240
|
-
contentType:
|
|
2241
|
-
source:
|
|
2242
|
-
descriptionContext:
|
|
2243
|
-
});
|
|
2244
|
-
var imagesUploadResponseSchema =
|
|
2245
|
-
var imagesDeleteRequestSchema =
|
|
2246
|
-
var imagesDeleteResponseSchema =
|
|
2247
|
-
var imagesUpscaleRequestSchema =
|
|
2248
|
-
var imagesUpscaleResponseSchema =
|
|
2249
|
-
imageId:
|
|
2250
|
-
status:
|
|
2429
|
+
var imagesGetRequestSchema = z8.object({ id: z8.string().min(1, "Missing id parameter") });
|
|
2430
|
+
var imagesSearchRequestSchema = z8.object({
|
|
2431
|
+
query: z8.string().min(1),
|
|
2432
|
+
limit: z8.coerce.number().int().positive().max(100).optional(),
|
|
2433
|
+
aspectRatio: z8.string().optional(),
|
|
2434
|
+
tags: z8.array(z8.string()).optional(),
|
|
2435
|
+
source: z8.string().optional(),
|
|
2436
|
+
externalUrlHost: z8.string().optional()
|
|
2437
|
+
});
|
|
2438
|
+
var imageSearchResultSchema = z8.object({
|
|
2439
|
+
_id: z8.string(),
|
|
2440
|
+
imageUrl: z8.string(),
|
|
2441
|
+
name: z8.string(),
|
|
2442
|
+
description: z8.string(),
|
|
2443
|
+
tags: z8.array(z8.string()),
|
|
2444
|
+
width: z8.number().optional(),
|
|
2445
|
+
height: z8.number().optional(),
|
|
2446
|
+
aspectRatio: z8.number().optional(),
|
|
2447
|
+
dominantColor: z8.string().optional(),
|
|
2448
|
+
imagePalette: z8.array(z8.string()).optional(),
|
|
2449
|
+
source: z8.string(),
|
|
2450
|
+
externalUrl: z8.string().optional(),
|
|
2451
|
+
score: z8.number()
|
|
2452
|
+
});
|
|
2453
|
+
var imagesSearchResponseSchema = z8.array(imageSearchResultSchema);
|
|
2454
|
+
var imagesUploadRequestSchema = z8.object({
|
|
2455
|
+
base64: z8.string().min(1),
|
|
2456
|
+
contentType: z8.string().min(1),
|
|
2457
|
+
source: z8.string().optional(),
|
|
2458
|
+
descriptionContext: z8.string().optional()
|
|
2459
|
+
});
|
|
2460
|
+
var imagesUploadResponseSchema = z8.object({ imageId: z8.string() });
|
|
2461
|
+
var imagesDeleteRequestSchema = z8.object({ id: z8.string().min(1, "Missing image ID") });
|
|
2462
|
+
var imagesDeleteResponseSchema = z8.object({ ok: z8.literal(true) });
|
|
2463
|
+
var imagesUpscaleRequestSchema = z8.object({ imageId: z8.string().min(1, "Missing image ID") });
|
|
2464
|
+
var imagesUpscaleResponseSchema = z8.object({
|
|
2465
|
+
imageId: z8.string(),
|
|
2466
|
+
status: z8.literal("processing")
|
|
2251
2467
|
});
|
|
2252
2468
|
var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
|
|
2253
|
-
var imagesFindRequestSchema =
|
|
2254
|
-
query:
|
|
2255
|
-
sources:
|
|
2256
|
-
limit:
|
|
2257
|
-
fallback:
|
|
2258
|
-
threshold:
|
|
2259
|
-
autoIngest:
|
|
2260
|
-
descriptionContext:
|
|
2261
|
-
});
|
|
2262
|
-
var imagesFindResponseSchema =
|
|
2263
|
-
groups:
|
|
2264
|
-
library:
|
|
2265
|
-
external:
|
|
2469
|
+
var imagesFindRequestSchema = z8.object({
|
|
2470
|
+
query: z8.string().min(1),
|
|
2471
|
+
sources: z8.array(z8.enum(IMAGES_FIND_SOURCES)).optional(),
|
|
2472
|
+
limit: z8.coerce.number().int().positive().max(50).optional(),
|
|
2473
|
+
fallback: z8.boolean().optional(),
|
|
2474
|
+
threshold: z8.number().min(0).max(1).optional(),
|
|
2475
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2476
|
+
descriptionContext: z8.string().optional()
|
|
2477
|
+
});
|
|
2478
|
+
var imagesFindResponseSchema = z8.object({
|
|
2479
|
+
groups: z8.object({
|
|
2480
|
+
library: z8.array(imageHitSchema),
|
|
2481
|
+
external: z8.array(ingestedImageHitSchema)
|
|
2266
2482
|
}),
|
|
2267
|
-
meta:
|
|
2268
|
-
counts:
|
|
2269
|
-
errors:
|
|
2483
|
+
meta: z8.object({
|
|
2484
|
+
counts: z8.record(z8.string(), z8.number()),
|
|
2485
|
+
errors: z8.array(z8.object({ source: imageHitSourceSchema, message: z8.string() }))
|
|
2270
2486
|
}),
|
|
2271
|
-
ingested:
|
|
2272
|
-
});
|
|
2273
|
-
var imagesStockRequestSchema =
|
|
2274
|
-
query:
|
|
2275
|
-
orientation:
|
|
2276
|
-
contentType:
|
|
2277
|
-
license:
|
|
2278
|
-
color:
|
|
2279
|
-
aiGenerated:
|
|
2280
|
-
people:
|
|
2281
|
-
order:
|
|
2282
|
-
limit:
|
|
2283
|
-
page:
|
|
2284
|
-
autoIngest:
|
|
2285
|
-
descriptionContext:
|
|
2487
|
+
ingested: z8.array(autoIngestItemSchema)
|
|
2488
|
+
});
|
|
2489
|
+
var imagesStockRequestSchema = z8.object({
|
|
2490
|
+
query: z8.string().min(1),
|
|
2491
|
+
orientation: z8.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
|
|
2492
|
+
contentType: z8.enum(["photo", "vector", "psd"]).optional(),
|
|
2493
|
+
license: z8.enum(["freemium", "premium"]).optional(),
|
|
2494
|
+
color: z8.string().optional(),
|
|
2495
|
+
aiGenerated: z8.enum(["exclude", "only"]).optional(),
|
|
2496
|
+
people: z8.enum(["include", "exclude", "only"]).optional(),
|
|
2497
|
+
order: z8.enum(["relevance", "recent"]).optional(),
|
|
2498
|
+
limit: z8.coerce.number().int().positive().max(50).optional(),
|
|
2499
|
+
page: z8.coerce.number().int().positive().optional(),
|
|
2500
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2501
|
+
descriptionContext: z8.string().optional()
|
|
2286
2502
|
});
|
|
2287
2503
|
var imagesStockResponseSchema = providerHitsResponseSchema();
|
|
2288
|
-
var imagesGoogleRequestSchema =
|
|
2289
|
-
query:
|
|
2290
|
-
type:
|
|
2291
|
-
size:
|
|
2292
|
-
color:
|
|
2293
|
-
safe:
|
|
2294
|
-
limit:
|
|
2295
|
-
autoIngest:
|
|
2296
|
-
descriptionContext:
|
|
2504
|
+
var imagesGoogleRequestSchema = z8.object({
|
|
2505
|
+
query: z8.string().min(1),
|
|
2506
|
+
type: z8.string().optional(),
|
|
2507
|
+
size: z8.string().optional(),
|
|
2508
|
+
color: z8.string().optional(),
|
|
2509
|
+
safe: z8.enum(["off", "active"]).optional(),
|
|
2510
|
+
limit: z8.coerce.number().int().positive().max(50).optional(),
|
|
2511
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2512
|
+
descriptionContext: z8.string().optional()
|
|
2297
2513
|
});
|
|
2298
2514
|
var imagesGoogleResponseSchema = providerHitsResponseSchema();
|
|
2299
|
-
var imagesPinterestRequestSchema =
|
|
2300
|
-
query:
|
|
2301
|
-
limit:
|
|
2302
|
-
autoIngest:
|
|
2303
|
-
descriptionContext:
|
|
2515
|
+
var imagesPinterestRequestSchema = z8.object({
|
|
2516
|
+
query: z8.string().min(1),
|
|
2517
|
+
limit: z8.coerce.number().int().positive().max(20).optional(),
|
|
2518
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2519
|
+
descriptionContext: z8.string().optional()
|
|
2304
2520
|
});
|
|
2305
2521
|
var imagesPinterestResponseSchema = providerHitsResponseSchema();
|
|
2306
|
-
var rgbTriple =
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2522
|
+
var rgbTriple = z8.tuple([
|
|
2523
|
+
z8.number().int().min(0).max(255),
|
|
2524
|
+
z8.number().int().min(0).max(255),
|
|
2525
|
+
z8.number().int().min(0).max(255)
|
|
2310
2526
|
]);
|
|
2311
|
-
var imageGenerateModelSchema =
|
|
2527
|
+
var imageGenerateModelSchema = z8.enum([
|
|
2312
2528
|
"openai/gpt-5.4-image-2",
|
|
2313
2529
|
"google/gemini-3.5-flash",
|
|
2314
2530
|
"google/gemini-3.1-flash-image-preview",
|
|
2315
2531
|
"google/gemini-3-pro-image-preview",
|
|
2316
2532
|
"recraft/recraft-v4.1-pro-vector"
|
|
2317
2533
|
]);
|
|
2318
|
-
var imagesGenerateRequestSchema =
|
|
2319
|
-
prompt:
|
|
2534
|
+
var imagesGenerateRequestSchema = z8.object({
|
|
2535
|
+
prompt: z8.string().min(1),
|
|
2320
2536
|
model: imageGenerateModelSchema.optional(),
|
|
2321
2537
|
// Aspect ratio + size are validated loosely as strings; the per-model enum
|
|
2322
2538
|
// lives in canvas-contract and OpenRouter rejects unsupported combinations.
|
|
2323
|
-
aspectRatio:
|
|
2324
|
-
imageSize:
|
|
2539
|
+
aspectRatio: z8.string().optional(),
|
|
2540
|
+
imageSize: z8.string().optional(),
|
|
2325
2541
|
// Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
|
|
2326
|
-
quality:
|
|
2542
|
+
quality: z8.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2327
2543
|
// Recraft v4.1 Pro Vector levers (ignored by other models).
|
|
2328
|
-
strength:
|
|
2329
|
-
rgbColors:
|
|
2544
|
+
strength: z8.coerce.number().min(0).max(1).optional(),
|
|
2545
|
+
rgbColors: z8.array(rgbTriple).optional(),
|
|
2330
2546
|
backgroundRgbColor: rgbTriple.optional(),
|
|
2331
2547
|
// Public image URLs used as visual references (multi-reference, in order).
|
|
2332
|
-
referenceUrls:
|
|
2333
|
-
descriptionContext:
|
|
2334
|
-
});
|
|
2335
|
-
var generatedImageSchema =
|
|
2336
|
-
imageId:
|
|
2337
|
-
deduped:
|
|
2338
|
-
imageUrl:
|
|
2339
|
-
width:
|
|
2340
|
-
height:
|
|
2341
|
-
});
|
|
2342
|
-
var imagesGenerateResponseSchema =
|
|
2343
|
-
model:
|
|
2344
|
-
costUsd:
|
|
2345
|
-
images:
|
|
2346
|
-
});
|
|
2347
|
-
var imagesLogoRequestSchema =
|
|
2348
|
-
domain:
|
|
2349
|
-
variant:
|
|
2350
|
-
autoIngest:
|
|
2351
|
-
descriptionContext:
|
|
2548
|
+
referenceUrls: z8.array(z8.string().url()).optional(),
|
|
2549
|
+
descriptionContext: z8.string().optional()
|
|
2550
|
+
});
|
|
2551
|
+
var generatedImageSchema = z8.object({
|
|
2552
|
+
imageId: z8.string(),
|
|
2553
|
+
deduped: z8.boolean(),
|
|
2554
|
+
imageUrl: z8.string(),
|
|
2555
|
+
width: z8.number().optional(),
|
|
2556
|
+
height: z8.number().optional()
|
|
2557
|
+
});
|
|
2558
|
+
var imagesGenerateResponseSchema = z8.object({
|
|
2559
|
+
model: z8.string(),
|
|
2560
|
+
costUsd: z8.number(),
|
|
2561
|
+
images: z8.array(generatedImageSchema)
|
|
2562
|
+
});
|
|
2563
|
+
var imagesLogoRequestSchema = z8.object({
|
|
2564
|
+
domain: z8.string().min(1),
|
|
2565
|
+
variant: z8.enum(["icon", "logo", "symbol"]).optional(),
|
|
2566
|
+
autoIngest: z8.coerce.number().int().min(0).max(5).optional(),
|
|
2567
|
+
descriptionContext: z8.string().optional()
|
|
2352
2568
|
});
|
|
2353
2569
|
var imagesLogoResponseSchema = providerHitsResponseSchema();
|
|
2354
|
-
var imagesIconRequestSchema =
|
|
2355
|
-
name:
|
|
2356
|
-
set:
|
|
2357
|
-
color:
|
|
2358
|
-
width:
|
|
2359
|
-
autoIngest:
|
|
2360
|
-
descriptionContext:
|
|
2570
|
+
var imagesIconRequestSchema = z8.object({
|
|
2571
|
+
name: z8.string().min(1),
|
|
2572
|
+
set: z8.string().optional(),
|
|
2573
|
+
color: z8.string().optional(),
|
|
2574
|
+
width: z8.coerce.number().int().positive().optional(),
|
|
2575
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2576
|
+
descriptionContext: z8.string().optional()
|
|
2361
2577
|
});
|
|
2362
2578
|
var imagesIconResponseSchema = providerHitsResponseSchema();
|
|
2363
|
-
var imagesExtractRequestSchema =
|
|
2364
|
-
url:
|
|
2365
|
-
waitFor:
|
|
2366
|
-
limit:
|
|
2367
|
-
autoIngest:
|
|
2368
|
-
descriptionContext:
|
|
2579
|
+
var imagesExtractRequestSchema = z8.object({
|
|
2580
|
+
url: z8.string().url(),
|
|
2581
|
+
waitFor: z8.coerce.number().int().min(0).max(3e4).optional(),
|
|
2582
|
+
limit: z8.coerce.number().int().positive().max(50).optional(),
|
|
2583
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2584
|
+
descriptionContext: z8.string().optional()
|
|
2369
2585
|
});
|
|
2370
2586
|
var imagesExtractResponseSchema = providerHitsResponseSchema();
|
|
2371
|
-
var imagesScreenshotRequestSchema =
|
|
2372
|
-
url:
|
|
2373
|
-
fullPage:
|
|
2374
|
-
viewportWidth:
|
|
2375
|
-
viewportHeight:
|
|
2376
|
-
format:
|
|
2377
|
-
descriptionContext:
|
|
2587
|
+
var imagesScreenshotRequestSchema = z8.object({
|
|
2588
|
+
url: z8.string().url(),
|
|
2589
|
+
fullPage: z8.boolean().optional(),
|
|
2590
|
+
viewportWidth: z8.coerce.number().int().positive().max(3840).optional(),
|
|
2591
|
+
viewportHeight: z8.coerce.number().int().positive().max(2160).optional(),
|
|
2592
|
+
format: z8.enum(["webp", "png", "jpg"]).optional(),
|
|
2593
|
+
descriptionContext: z8.string().optional()
|
|
2378
2594
|
});
|
|
2379
2595
|
var imagesScreenshotResponseSchema = providerHitsResponseSchema();
|
|
2380
|
-
var imagesGiphyRequestSchema =
|
|
2381
|
-
query:
|
|
2382
|
-
trending:
|
|
2383
|
-
limit:
|
|
2384
|
-
rating:
|
|
2385
|
-
lang:
|
|
2386
|
-
autoIngest:
|
|
2387
|
-
descriptionContext:
|
|
2596
|
+
var imagesGiphyRequestSchema = z8.object({
|
|
2597
|
+
query: z8.string().min(1).optional(),
|
|
2598
|
+
trending: z8.coerce.boolean().optional(),
|
|
2599
|
+
limit: z8.coerce.number().int().positive().max(50).optional(),
|
|
2600
|
+
rating: z8.enum(["g", "pg", "pg-13", "r"]).optional(),
|
|
2601
|
+
lang: z8.string().optional(),
|
|
2602
|
+
autoIngest: z8.coerce.number().int().min(0).max(20).optional(),
|
|
2603
|
+
descriptionContext: z8.string().optional()
|
|
2388
2604
|
});
|
|
2389
2605
|
var imagesGifResponseSchema = providerHitsResponseSchema();
|
|
2390
2606
|
var imagesStickerResponseSchema = providerHitsResponseSchema();
|
|
2391
|
-
var imagesIngestRequestSchema =
|
|
2392
|
-
url:
|
|
2607
|
+
var imagesIngestRequestSchema = z8.object({
|
|
2608
|
+
url: z8.string().url(),
|
|
2393
2609
|
// Validate source at the HTTP boundary so unknown values produce the standard
|
|
2394
2610
|
// `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
|
|
2395
2611
|
// `assertImageSource` inside the action.
|
|
2396
2612
|
source: imageSourceSchema,
|
|
2397
|
-
externalId:
|
|
2398
|
-
externalUrl:
|
|
2399
|
-
descriptionContext:
|
|
2613
|
+
externalId: z8.string().optional(),
|
|
2614
|
+
externalUrl: z8.string().optional(),
|
|
2615
|
+
descriptionContext: z8.string().optional()
|
|
2400
2616
|
});
|
|
2401
|
-
var imagesIngestResponseSchema =
|
|
2402
|
-
imageId:
|
|
2403
|
-
deduped:
|
|
2404
|
-
contentHash:
|
|
2617
|
+
var imagesIngestResponseSchema = z8.object({
|
|
2618
|
+
imageId: z8.string(),
|
|
2619
|
+
deduped: z8.boolean(),
|
|
2620
|
+
contentHash: z8.string()
|
|
2405
2621
|
});
|
|
2406
2622
|
|
|
2407
2623
|
// ../api/src/tags.ts
|
|
2408
|
-
import { z as
|
|
2624
|
+
import { z as z9 } from "zod";
|
|
2409
2625
|
var TAG_TYPES = [
|
|
2410
2626
|
"meta",
|
|
2411
2627
|
"amplitude",
|
|
@@ -2426,7 +2642,7 @@ var TAG_TYPES = [
|
|
|
2426
2642
|
"recaptcha",
|
|
2427
2643
|
"twitterAds"
|
|
2428
2644
|
];
|
|
2429
|
-
var tagTypeSchema =
|
|
2645
|
+
var tagTypeSchema = z9.enum(TAG_TYPES);
|
|
2430
2646
|
var TAG_IDENTIFYING_FIELD = {
|
|
2431
2647
|
meta: "pixelId",
|
|
2432
2648
|
googleAds: "conversionID",
|
|
@@ -2447,218 +2663,218 @@ var TAG_IDENTIFYING_FIELD = {
|
|
|
2447
2663
|
recaptcha: "siteKey",
|
|
2448
2664
|
twitterAds: "pixelId"
|
|
2449
2665
|
};
|
|
2450
|
-
var tagDraftOpKindSchema =
|
|
2451
|
-
var tagDraftOpViewSchema =
|
|
2666
|
+
var tagDraftOpKindSchema = z9.enum(["create", "update", "delete"]);
|
|
2667
|
+
var tagDraftOpViewSchema = z9.object({
|
|
2452
2668
|
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
2453
|
-
ref:
|
|
2669
|
+
ref: z9.string(),
|
|
2454
2670
|
kind: tagDraftOpKindSchema,
|
|
2455
2671
|
type: tagTypeSchema,
|
|
2456
2672
|
/** Present on update/delete ops — the real tag this op targets. */
|
|
2457
|
-
tagId:
|
|
2673
|
+
tagId: z9.string().optional(),
|
|
2458
2674
|
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
2459
|
-
config:
|
|
2675
|
+
config: z9.record(z9.string(), z9.string()),
|
|
2460
2676
|
/** Update only — fields the op explicitly clears. */
|
|
2461
|
-
clearFields:
|
|
2677
|
+
clearFields: z9.array(z9.string()).optional(),
|
|
2462
2678
|
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
2463
|
-
secretsSet:
|
|
2679
|
+
secretsSet: z9.array(z9.string()),
|
|
2464
2680
|
/** Names of secret fields still awaiting user input. */
|
|
2465
|
-
secretsPending:
|
|
2466
|
-
summary:
|
|
2467
|
-
stagedAt:
|
|
2681
|
+
secretsPending: z9.array(z9.string()),
|
|
2682
|
+
summary: z9.string(),
|
|
2683
|
+
stagedAt: z9.number()
|
|
2468
2684
|
});
|
|
2469
|
-
var tagsEffectiveEntrySchema =
|
|
2685
|
+
var tagsEffectiveEntrySchema = z9.object({
|
|
2470
2686
|
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
2471
|
-
ref:
|
|
2472
|
-
tagId:
|
|
2687
|
+
ref: z9.string(),
|
|
2688
|
+
tagId: z9.string().optional(),
|
|
2473
2689
|
type: tagTypeSchema,
|
|
2474
2690
|
/** Value of the type's identifying field, when set. */
|
|
2475
|
-
identifier:
|
|
2691
|
+
identifier: z9.string().optional(),
|
|
2476
2692
|
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
2477
|
-
config:
|
|
2693
|
+
config: z9.record(z9.string(), z9.string()),
|
|
2478
2694
|
/** Absent = live production tag with no staged changes in this chat. */
|
|
2479
2695
|
staged: tagDraftOpKindSchema.optional(),
|
|
2480
|
-
secretsSet:
|
|
2481
|
-
secretsPending:
|
|
2696
|
+
secretsSet: z9.array(z9.string()),
|
|
2697
|
+
secretsPending: z9.array(z9.string())
|
|
2482
2698
|
});
|
|
2483
|
-
var tagsListRequestSchema =
|
|
2484
|
-
var tagsListResponseSchema =
|
|
2485
|
-
var tagsDraftListRequestSchema =
|
|
2486
|
-
var tagsDraftListResponseSchema =
|
|
2487
|
-
status:
|
|
2488
|
-
ops:
|
|
2699
|
+
var tagsListRequestSchema = z9.object({ chatId: z9.string() });
|
|
2700
|
+
var tagsListResponseSchema = z9.object({ tags: z9.array(tagsEffectiveEntrySchema) });
|
|
2701
|
+
var tagsDraftListRequestSchema = z9.object({ chatId: z9.string() });
|
|
2702
|
+
var tagsDraftListResponseSchema = z9.object({
|
|
2703
|
+
status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
2704
|
+
ops: z9.array(tagDraftOpViewSchema)
|
|
2489
2705
|
});
|
|
2490
|
-
var tagInputRequestSchema =
|
|
2706
|
+
var tagInputRequestSchema = z9.object({
|
|
2491
2707
|
// Every tag change is a tab in the approval form: create/edit show the full
|
|
2492
2708
|
// body; delete shows a confirm. No tag change bypasses this approval.
|
|
2493
|
-
mode:
|
|
2709
|
+
mode: z9.enum(["create", "edit", "delete"]),
|
|
2494
2710
|
tagType: tagTypeSchema,
|
|
2495
2711
|
/** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
|
|
2496
|
-
ref:
|
|
2712
|
+
ref: z9.string().optional(),
|
|
2497
2713
|
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
2498
|
-
prefilledConfig:
|
|
2714
|
+
prefilledConfig: z9.record(z9.string(), z9.string()).optional(),
|
|
2499
2715
|
/** Secret field names the agent asks the user to provide. */
|
|
2500
|
-
requestedSecretFields:
|
|
2716
|
+
requestedSecretFields: z9.array(z9.string()).optional(),
|
|
2501
2717
|
/** Short message shown above the form explaining why the input is needed. */
|
|
2502
|
-
message:
|
|
2718
|
+
message: z9.string().optional()
|
|
2503
2719
|
});
|
|
2504
|
-
var tagChangeToolInputSchema =
|
|
2505
|
-
changes:
|
|
2720
|
+
var tagChangeToolInputSchema = z9.object({
|
|
2721
|
+
changes: z9.array(tagInputRequestSchema).min(1).max(8)
|
|
2506
2722
|
});
|
|
2507
|
-
var tagInputResultSchema =
|
|
2508
|
-
|
|
2509
|
-
status:
|
|
2510
|
-
ref:
|
|
2723
|
+
var tagInputResultSchema = z9.discriminatedUnion("status", [
|
|
2724
|
+
z9.object({
|
|
2725
|
+
status: z9.literal("submitted"),
|
|
2726
|
+
ref: z9.string(),
|
|
2511
2727
|
type: tagTypeSchema,
|
|
2512
2728
|
/** Identifying field name → value (non-secret), when the type has one. */
|
|
2513
|
-
identifier:
|
|
2514
|
-
secretFieldsSet:
|
|
2515
|
-
note:
|
|
2729
|
+
identifier: z9.record(z9.string(), z9.string()).optional(),
|
|
2730
|
+
secretFieldsSet: z9.array(z9.string()),
|
|
2731
|
+
note: z9.string().optional()
|
|
2516
2732
|
}),
|
|
2517
|
-
|
|
2518
|
-
status:
|
|
2519
|
-
reason:
|
|
2733
|
+
z9.object({
|
|
2734
|
+
status: z9.literal("declined"),
|
|
2735
|
+
reason: z9.string().optional()
|
|
2520
2736
|
})
|
|
2521
2737
|
]);
|
|
2522
|
-
var tagChangeToolResultSchema =
|
|
2523
|
-
results:
|
|
2738
|
+
var tagChangeToolResultSchema = z9.object({
|
|
2739
|
+
results: z9.array(tagInputResultSchema)
|
|
2524
2740
|
});
|
|
2525
2741
|
|
|
2526
2742
|
// ../api/src/testimonials.ts
|
|
2527
|
-
import { z as
|
|
2528
|
-
var testimonialSourceTypeSchema =
|
|
2529
|
-
var testimonialStatusSchema =
|
|
2530
|
-
var testimonialSentimentSchema =
|
|
2531
|
-
var testimonialDocSchema =
|
|
2532
|
-
_id:
|
|
2533
|
-
_creationTime:
|
|
2534
|
-
companyId:
|
|
2535
|
-
sourceId:
|
|
2743
|
+
import { z as z10 } from "zod";
|
|
2744
|
+
var testimonialSourceTypeSchema = z10.enum(["google", "trustpilot"]);
|
|
2745
|
+
var testimonialStatusSchema = z10.enum(["pending", "processing", "ready", "error"]);
|
|
2746
|
+
var testimonialSentimentSchema = z10.enum(["positive", "neutral", "negative"]);
|
|
2747
|
+
var testimonialDocSchema = z10.object({
|
|
2748
|
+
_id: z10.string(),
|
|
2749
|
+
_creationTime: z10.number(),
|
|
2750
|
+
companyId: z10.string(),
|
|
2751
|
+
sourceId: z10.string(),
|
|
2536
2752
|
sourceType: testimonialSourceTypeSchema,
|
|
2537
|
-
reviewText:
|
|
2538
|
-
reviewTitle:
|
|
2539
|
-
searchText:
|
|
2540
|
-
reviewerName:
|
|
2541
|
-
reviewerImageUrl:
|
|
2542
|
-
reviewerImageId:
|
|
2543
|
-
reviewerLocation:
|
|
2544
|
-
rating:
|
|
2545
|
-
reviewDate:
|
|
2546
|
-
ownerAnswer:
|
|
2547
|
-
mediaUrls:
|
|
2548
|
-
imageIds:
|
|
2549
|
-
videoIds:
|
|
2550
|
-
sourceUrl:
|
|
2551
|
-
rawData:
|
|
2552
|
-
tags:
|
|
2553
|
-
highlight:
|
|
2554
|
-
language:
|
|
2555
|
-
summary:
|
|
2753
|
+
reviewText: z10.string(),
|
|
2754
|
+
reviewTitle: z10.string().optional(),
|
|
2755
|
+
searchText: z10.string().optional(),
|
|
2756
|
+
reviewerName: z10.string().optional(),
|
|
2757
|
+
reviewerImageUrl: z10.string().optional(),
|
|
2758
|
+
reviewerImageId: z10.string().optional(),
|
|
2759
|
+
reviewerLocation: z10.string().optional(),
|
|
2760
|
+
rating: z10.number().optional(),
|
|
2761
|
+
reviewDate: z10.number().optional(),
|
|
2762
|
+
ownerAnswer: z10.string().optional(),
|
|
2763
|
+
mediaUrls: z10.array(z10.string()).optional(),
|
|
2764
|
+
imageIds: z10.array(z10.string()).optional(),
|
|
2765
|
+
videoIds: z10.array(z10.string()).optional(),
|
|
2766
|
+
sourceUrl: z10.string().optional(),
|
|
2767
|
+
rawData: z10.unknown().optional(),
|
|
2768
|
+
tags: z10.array(z10.string()),
|
|
2769
|
+
highlight: z10.string().optional(),
|
|
2770
|
+
language: z10.string().optional(),
|
|
2771
|
+
summary: z10.string().optional(),
|
|
2556
2772
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2557
|
-
textEmbedding:
|
|
2558
|
-
externalId:
|
|
2559
|
-
contentHash:
|
|
2773
|
+
textEmbedding: z10.array(z10.number()).optional(),
|
|
2774
|
+
externalId: z10.string().optional(),
|
|
2775
|
+
contentHash: z10.string().optional(),
|
|
2560
2776
|
status: testimonialStatusSchema,
|
|
2561
|
-
errorMessage:
|
|
2562
|
-
createdAt:
|
|
2563
|
-
updatedAt:
|
|
2777
|
+
errorMessage: z10.string().optional(),
|
|
2778
|
+
createdAt: z10.number(),
|
|
2779
|
+
updatedAt: z10.number()
|
|
2564
2780
|
});
|
|
2565
|
-
var testimonialsListRequestSchema =
|
|
2781
|
+
var testimonialsListRequestSchema = z10.object({
|
|
2566
2782
|
source: testimonialSourceTypeSchema.optional(),
|
|
2567
|
-
rating_min:
|
|
2568
|
-
rating_max:
|
|
2569
|
-
tags:
|
|
2783
|
+
rating_min: z10.coerce.number().int().min(1).max(5).optional(),
|
|
2784
|
+
rating_max: z10.coerce.number().int().min(1).max(5).optional(),
|
|
2785
|
+
tags: z10.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
2570
2786
|
status: testimonialStatusSchema.optional(),
|
|
2571
2787
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2572
|
-
language:
|
|
2573
|
-
limit:
|
|
2574
|
-
});
|
|
2575
|
-
var testimonialsListResponseSchema =
|
|
2576
|
-
var testimonialsGetRequestSchema =
|
|
2577
|
-
var testimonialsSearchRequestSchema =
|
|
2578
|
-
query:
|
|
2579
|
-
limit:
|
|
2788
|
+
language: z10.string().min(2).max(5).optional(),
|
|
2789
|
+
limit: z10.coerce.number().int().positive().max(200).optional()
|
|
2790
|
+
});
|
|
2791
|
+
var testimonialsListResponseSchema = z10.array(testimonialDocSchema);
|
|
2792
|
+
var testimonialsGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
|
|
2793
|
+
var testimonialsSearchRequestSchema = z10.object({
|
|
2794
|
+
query: z10.string().min(1),
|
|
2795
|
+
limit: z10.coerce.number().int().positive().max(100).optional(),
|
|
2580
2796
|
source: testimonialSourceTypeSchema.optional(),
|
|
2581
|
-
rating_min:
|
|
2582
|
-
rating_max:
|
|
2583
|
-
tags:
|
|
2797
|
+
rating_min: z10.coerce.number().int().min(1).max(5).optional(),
|
|
2798
|
+
rating_max: z10.coerce.number().int().min(1).max(5).optional(),
|
|
2799
|
+
tags: z10.array(z10.string()).optional(),
|
|
2584
2800
|
status: testimonialStatusSchema.optional(),
|
|
2585
2801
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2586
|
-
language:
|
|
2802
|
+
language: z10.string().min(2).max(5).optional()
|
|
2587
2803
|
}).refine(
|
|
2588
2804
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
2589
2805
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
2590
2806
|
);
|
|
2591
|
-
var testimonialsSearchResponseSchema =
|
|
2592
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
2593
|
-
ok:
|
|
2594
|
-
note:
|
|
2807
|
+
var testimonialsSearchResponseSchema = z10.array(testimonialDocSchema);
|
|
2808
|
+
var testimonialsOutscraperWebhookResponseSchema = z10.object({
|
|
2809
|
+
ok: z10.literal(true),
|
|
2810
|
+
note: z10.string().optional()
|
|
2595
2811
|
});
|
|
2596
2812
|
|
|
2597
2813
|
// ../api/src/videos.ts
|
|
2598
|
-
import { z as
|
|
2599
|
-
var videoStatusSchema =
|
|
2600
|
-
var videoTranscriptSegmentSchema =
|
|
2601
|
-
text:
|
|
2602
|
-
startSecond:
|
|
2603
|
-
endSecond:
|
|
2604
|
-
});
|
|
2605
|
-
var videoSceneSchema =
|
|
2606
|
-
title:
|
|
2607
|
-
description:
|
|
2608
|
-
startSecond:
|
|
2609
|
-
endSecond:
|
|
2610
|
-
thumbnailTime:
|
|
2611
|
-
});
|
|
2612
|
-
var videoDocSchema =
|
|
2613
|
-
_id:
|
|
2614
|
-
_creationTime:
|
|
2615
|
-
companyId:
|
|
2616
|
-
muxAssetId:
|
|
2617
|
-
muxPlaybackId:
|
|
2618
|
-
muxUploadId:
|
|
2619
|
-
name:
|
|
2620
|
-
description:
|
|
2621
|
-
tags:
|
|
2622
|
-
source:
|
|
2623
|
-
externalId:
|
|
2624
|
-
sourceId:
|
|
2625
|
-
width:
|
|
2626
|
-
height:
|
|
2627
|
-
aspectRatio:
|
|
2628
|
-
duration:
|
|
2629
|
-
transcript:
|
|
2630
|
-
transcriptSegments:
|
|
2631
|
-
scenes:
|
|
2632
|
-
descriptionEmbedding:
|
|
2633
|
-
searchText:
|
|
2814
|
+
import { z as z11 } from "zod";
|
|
2815
|
+
var videoStatusSchema = z11.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
2816
|
+
var videoTranscriptSegmentSchema = z11.object({
|
|
2817
|
+
text: z11.string(),
|
|
2818
|
+
startSecond: z11.number(),
|
|
2819
|
+
endSecond: z11.number()
|
|
2820
|
+
});
|
|
2821
|
+
var videoSceneSchema = z11.object({
|
|
2822
|
+
title: z11.string(),
|
|
2823
|
+
description: z11.string(),
|
|
2824
|
+
startSecond: z11.number(),
|
|
2825
|
+
endSecond: z11.number(),
|
|
2826
|
+
thumbnailTime: z11.number()
|
|
2827
|
+
});
|
|
2828
|
+
var videoDocSchema = z11.object({
|
|
2829
|
+
_id: z11.string(),
|
|
2830
|
+
_creationTime: z11.number(),
|
|
2831
|
+
companyId: z11.string(),
|
|
2832
|
+
muxAssetId: z11.string(),
|
|
2833
|
+
muxPlaybackId: z11.string(),
|
|
2834
|
+
muxUploadId: z11.string(),
|
|
2835
|
+
name: z11.string(),
|
|
2836
|
+
description: z11.string(),
|
|
2837
|
+
tags: z11.array(z11.string()),
|
|
2838
|
+
source: z11.string(),
|
|
2839
|
+
externalId: z11.string().optional(),
|
|
2840
|
+
sourceId: z11.string().optional(),
|
|
2841
|
+
width: z11.number().optional(),
|
|
2842
|
+
height: z11.number().optional(),
|
|
2843
|
+
aspectRatio: z11.number().optional(),
|
|
2844
|
+
duration: z11.number().optional(),
|
|
2845
|
+
transcript: z11.string().optional(),
|
|
2846
|
+
transcriptSegments: z11.array(videoTranscriptSegmentSchema).optional(),
|
|
2847
|
+
scenes: z11.array(videoSceneSchema).optional(),
|
|
2848
|
+
descriptionEmbedding: z11.array(z11.number()).optional(),
|
|
2849
|
+
searchText: z11.string().optional(),
|
|
2634
2850
|
status: videoStatusSchema,
|
|
2635
|
-
errorMessage:
|
|
2636
|
-
createdAt:
|
|
2637
|
-
updatedAt:
|
|
2638
|
-
thumbnailUrl:
|
|
2639
|
-
});
|
|
2640
|
-
var videosWebhookResponseSchema =
|
|
2641
|
-
var videosGetRequestSchema =
|
|
2642
|
-
var videosSearchRequestSchema =
|
|
2643
|
-
query:
|
|
2644
|
-
limit:
|
|
2645
|
-
tags:
|
|
2646
|
-
});
|
|
2647
|
-
var videoSearchResultSchema =
|
|
2648
|
-
_id:
|
|
2649
|
-
thumbnailUrl:
|
|
2650
|
-
name:
|
|
2651
|
-
description:
|
|
2652
|
-
tags:
|
|
2653
|
-
status:
|
|
2654
|
-
duration:
|
|
2655
|
-
muxPlaybackId:
|
|
2656
|
-
createdAt:
|
|
2657
|
-
});
|
|
2658
|
-
var videosSearchResponseSchema =
|
|
2659
|
-
var videosUploadResponseSchema =
|
|
2660
|
-
var videosDeleteRequestSchema =
|
|
2661
|
-
var videosDeleteResponseSchema =
|
|
2851
|
+
errorMessage: z11.string().optional(),
|
|
2852
|
+
createdAt: z11.number(),
|
|
2853
|
+
updatedAt: z11.number(),
|
|
2854
|
+
thumbnailUrl: z11.string()
|
|
2855
|
+
});
|
|
2856
|
+
var videosWebhookResponseSchema = z11.object({ ok: z11.literal(true) });
|
|
2857
|
+
var videosGetRequestSchema = z11.object({ id: z11.string().min(1, "Missing id parameter") });
|
|
2858
|
+
var videosSearchRequestSchema = z11.object({
|
|
2859
|
+
query: z11.string().min(1),
|
|
2860
|
+
limit: z11.coerce.number().int().positive().max(100).optional(),
|
|
2861
|
+
tags: z11.array(z11.string()).optional()
|
|
2862
|
+
});
|
|
2863
|
+
var videoSearchResultSchema = z11.object({
|
|
2864
|
+
_id: z11.string(),
|
|
2865
|
+
thumbnailUrl: z11.string(),
|
|
2866
|
+
name: z11.string(),
|
|
2867
|
+
description: z11.string(),
|
|
2868
|
+
tags: z11.array(z11.string()),
|
|
2869
|
+
status: z11.string(),
|
|
2870
|
+
duration: z11.number().optional(),
|
|
2871
|
+
muxPlaybackId: z11.string(),
|
|
2872
|
+
createdAt: z11.number()
|
|
2873
|
+
});
|
|
2874
|
+
var videosSearchResponseSchema = z11.array(videoSearchResultSchema);
|
|
2875
|
+
var videosUploadResponseSchema = z11.object({ uploadUrl: z11.string(), videoId: z11.string() });
|
|
2876
|
+
var videosDeleteRequestSchema = z11.object({ id: z11.string().min(1, "Missing video ID") });
|
|
2877
|
+
var videosDeleteResponseSchema = z11.object({ ok: z11.literal(true) });
|
|
2662
2878
|
|
|
2663
2879
|
// src/commands/actions/complete.ts
|
|
2664
2880
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -4471,37 +4687,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
4471
4687
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4472
4688
|
|
|
4473
4689
|
// ../api/src/ads-google/ops.ts
|
|
4474
|
-
import { z as
|
|
4475
|
-
var tempRefSchema2 =
|
|
4476
|
-
var refSchema =
|
|
4477
|
-
|
|
4478
|
-
|
|
4690
|
+
import { z as z12 } from "zod";
|
|
4691
|
+
var tempRefSchema2 = z12.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
4692
|
+
var refSchema = z12.union([
|
|
4693
|
+
z12.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
4694
|
+
z12.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4479
4695
|
tempRefSchema2
|
|
4480
4696
|
]);
|
|
4481
4697
|
var targetRefSchema = refSchema;
|
|
4482
|
-
var microsSchema =
|
|
4483
|
-
var httpsUrlSchema2 =
|
|
4484
|
-
var customerIdSchema =
|
|
4485
|
-
var stageableStatusSchema2 =
|
|
4486
|
-
var matchTypeSchema =
|
|
4487
|
-
var keywordTextSchema =
|
|
4488
|
-
var budgetCreateSchema =
|
|
4489
|
-
name:
|
|
4698
|
+
var microsSchema = z12.number().int().positive("expected a positive micros amount");
|
|
4699
|
+
var httpsUrlSchema2 = z12.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
4700
|
+
var customerIdSchema = z12.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
4701
|
+
var stageableStatusSchema2 = z12.enum(STAGEABLE_CREATE_STATUSES2);
|
|
4702
|
+
var matchTypeSchema = z12.enum(KEYWORD_MATCH_TYPES);
|
|
4703
|
+
var keywordTextSchema = z12.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");
|
|
4704
|
+
var budgetCreateSchema = z12.object({
|
|
4705
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4490
4706
|
amountMicros: microsSchema,
|
|
4491
|
-
deliveryMethod:
|
|
4492
|
-
explicitlyShared:
|
|
4707
|
+
deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
4708
|
+
explicitlyShared: z12.boolean().default(false)
|
|
4493
4709
|
});
|
|
4494
|
-
var budgetUpdateSchema =
|
|
4495
|
-
name:
|
|
4710
|
+
var budgetUpdateSchema = z12.object({
|
|
4711
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4496
4712
|
amountMicros: microsSchema.optional(),
|
|
4497
|
-
deliveryMethod:
|
|
4713
|
+
deliveryMethod: z12.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4498
4714
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4499
|
-
var biddingConfigSchema =
|
|
4500
|
-
type:
|
|
4715
|
+
var biddingConfigSchema = z12.object({
|
|
4716
|
+
type: z12.enum(BIDDING_STRATEGY_TYPES),
|
|
4501
4717
|
targetCpaMicros: microsSchema.optional(),
|
|
4502
|
-
targetRoas:
|
|
4718
|
+
targetRoas: z12.number().positive().optional(),
|
|
4503
4719
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4504
|
-
enhancedCpcEnabled:
|
|
4720
|
+
enhancedCpcEnabled: z12.boolean().optional()
|
|
4505
4721
|
}).superRefine((p, ctx) => {
|
|
4506
4722
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4507
4723
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -4510,17 +4726,17 @@ var biddingConfigSchema = z11.object({
|
|
|
4510
4726
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4511
4727
|
}
|
|
4512
4728
|
});
|
|
4513
|
-
var networkSettingsSchema =
|
|
4514
|
-
targetGoogleSearch:
|
|
4515
|
-
targetSearchNetwork:
|
|
4516
|
-
targetContentNetwork:
|
|
4517
|
-
targetPartnerSearchNetwork:
|
|
4729
|
+
var networkSettingsSchema = z12.object({
|
|
4730
|
+
targetGoogleSearch: z12.boolean().optional(),
|
|
4731
|
+
targetSearchNetwork: z12.boolean().optional(),
|
|
4732
|
+
targetContentNetwork: z12.boolean().optional(),
|
|
4733
|
+
targetPartnerSearchNetwork: z12.boolean().optional()
|
|
4518
4734
|
});
|
|
4519
|
-
var dateSchema =
|
|
4520
|
-
var campaignCreateSchema2 =
|
|
4521
|
-
name:
|
|
4522
|
-
channelType:
|
|
4523
|
-
channelSubType:
|
|
4735
|
+
var dateSchema = z12.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4736
|
+
var campaignCreateSchema2 = z12.object({
|
|
4737
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4738
|
+
channelType: z12.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4739
|
+
channelSubType: z12.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4524
4740
|
budget: refSchema,
|
|
4525
4741
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4526
4742
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -4529,7 +4745,7 @@ var campaignCreateSchema2 = z11.object({
|
|
|
4529
4745
|
startDate: dateSchema.optional(),
|
|
4530
4746
|
endDate: dateSchema.optional(),
|
|
4531
4747
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4532
|
-
objective:
|
|
4748
|
+
objective: z12.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4533
4749
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4534
4750
|
}).superRefine((p, ctx) => {
|
|
4535
4751
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -4553,129 +4769,129 @@ var campaignCreateSchema2 = z11.object({
|
|
|
4553
4769
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4554
4770
|
}
|
|
4555
4771
|
});
|
|
4556
|
-
var campaignUpdateSchema2 =
|
|
4557
|
-
name:
|
|
4772
|
+
var campaignUpdateSchema2 = z12.object({
|
|
4773
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4558
4774
|
budget: refSchema.optional(),
|
|
4559
4775
|
bidding: biddingConfigSchema.optional(),
|
|
4560
4776
|
networkSettings: networkSettingsSchema.optional(),
|
|
4561
4777
|
startDate: dateSchema.optional(),
|
|
4562
4778
|
endDate: dateSchema.optional(),
|
|
4563
|
-
status:
|
|
4779
|
+
status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4564
4780
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4565
|
-
var adGroupCreateSchema =
|
|
4566
|
-
name:
|
|
4781
|
+
var adGroupCreateSchema = z12.object({
|
|
4782
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4567
4783
|
campaign: refSchema,
|
|
4568
|
-
type:
|
|
4784
|
+
type: z12.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4569
4785
|
cpcBidMicros: microsSchema.optional(),
|
|
4570
4786
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4571
4787
|
});
|
|
4572
|
-
var adGroupUpdateSchema =
|
|
4573
|
-
name:
|
|
4788
|
+
var adGroupUpdateSchema = z12.object({
|
|
4789
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4574
4790
|
cpcBidMicros: microsSchema.optional(),
|
|
4575
|
-
status:
|
|
4791
|
+
status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4576
4792
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4577
|
-
var keywordAddSchema =
|
|
4793
|
+
var keywordAddSchema = z12.object({
|
|
4578
4794
|
adGroup: refSchema,
|
|
4579
4795
|
text: keywordTextSchema,
|
|
4580
4796
|
matchType: matchTypeSchema,
|
|
4581
4797
|
cpcBidMicros: microsSchema.optional(),
|
|
4582
|
-
finalUrls:
|
|
4798
|
+
finalUrls: z12.array(httpsUrlSchema2).optional(),
|
|
4583
4799
|
status: stageableStatusSchema2.default("ENABLED")
|
|
4584
4800
|
});
|
|
4585
|
-
var keywordUpdateSchema =
|
|
4801
|
+
var keywordUpdateSchema = z12.object({
|
|
4586
4802
|
cpcBidMicros: microsSchema.optional(),
|
|
4587
|
-
finalUrls:
|
|
4588
|
-
status:
|
|
4803
|
+
finalUrls: z12.array(httpsUrlSchema2).optional(),
|
|
4804
|
+
status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4589
4805
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4590
|
-
var negativeKeywordAddSchema =
|
|
4591
|
-
level:
|
|
4806
|
+
var negativeKeywordAddSchema = z12.object({
|
|
4807
|
+
level: z12.enum(["adGroup", "campaign"]),
|
|
4592
4808
|
parent: refSchema,
|
|
4593
4809
|
text: keywordTextSchema,
|
|
4594
4810
|
matchType: matchTypeSchema
|
|
4595
4811
|
});
|
|
4596
|
-
var sharedSetCreateSchema =
|
|
4597
|
-
name:
|
|
4598
|
-
type:
|
|
4812
|
+
var sharedSetCreateSchema = z12.object({
|
|
4813
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4814
|
+
type: z12.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4599
4815
|
});
|
|
4600
|
-
var sharedSetMemberAddSchema =
|
|
4816
|
+
var sharedSetMemberAddSchema = z12.object({
|
|
4601
4817
|
sharedSet: refSchema,
|
|
4602
4818
|
text: keywordTextSchema,
|
|
4603
4819
|
matchType: matchTypeSchema
|
|
4604
4820
|
});
|
|
4605
|
-
var campaignSharedSetAttachSchema =
|
|
4821
|
+
var campaignSharedSetAttachSchema = z12.object({
|
|
4606
4822
|
campaign: refSchema,
|
|
4607
4823
|
sharedSet: refSchema
|
|
4608
4824
|
});
|
|
4609
|
-
var adTextAssetSchema =
|
|
4610
|
-
text:
|
|
4611
|
-
pinnedField:
|
|
4825
|
+
var adTextAssetSchema = z12.object({
|
|
4826
|
+
text: z12.string().min(1),
|
|
4827
|
+
pinnedField: z12.enum(PINNED_FIELDS).optional()
|
|
4612
4828
|
});
|
|
4613
|
-
var responsiveSearchAdSchema =
|
|
4614
|
-
format:
|
|
4615
|
-
headlines:
|
|
4829
|
+
var responsiveSearchAdSchema = z12.object({
|
|
4830
|
+
format: z12.literal("responsiveSearch"),
|
|
4831
|
+
headlines: z12.array(
|
|
4616
4832
|
adTextAssetSchema.refine(
|
|
4617
4833
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4618
4834
|
"headline exceeds 30 chars"
|
|
4619
4835
|
)
|
|
4620
4836
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4621
|
-
descriptions:
|
|
4837
|
+
descriptions: z12.array(
|
|
4622
4838
|
adTextAssetSchema.refine(
|
|
4623
4839
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4624
4840
|
"description exceeds 90 chars"
|
|
4625
4841
|
)
|
|
4626
4842
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4627
|
-
path1:
|
|
4628
|
-
path2:
|
|
4629
|
-
finalUrls:
|
|
4630
|
-
});
|
|
4631
|
-
var responsiveDisplayAdSchema =
|
|
4632
|
-
format:
|
|
4633
|
-
headlines:
|
|
4634
|
-
longHeadline:
|
|
4635
|
-
descriptions:
|
|
4636
|
-
businessName:
|
|
4843
|
+
path1: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4844
|
+
path2: z12.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4845
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1)
|
|
4846
|
+
});
|
|
4847
|
+
var responsiveDisplayAdSchema = z12.object({
|
|
4848
|
+
format: z12.literal("responsiveDisplay"),
|
|
4849
|
+
headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4850
|
+
longHeadline: z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4851
|
+
descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4852
|
+
businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4637
4853
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
4638
4854
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
4639
4855
|
// image (1:1) to serve; the logo images are optional.
|
|
4640
|
-
marketingImageAssets:
|
|
4641
|
-
squareMarketingImageAssets:
|
|
4642
|
-
logoImageAssets:
|
|
4643
|
-
finalUrls:
|
|
4644
|
-
});
|
|
4645
|
-
var callAdSchema =
|
|
4646
|
-
format:
|
|
4647
|
-
countryCode:
|
|
4648
|
-
phoneNumber:
|
|
4649
|
-
headline1:
|
|
4650
|
-
headline2:
|
|
4651
|
-
description1:
|
|
4652
|
-
description2:
|
|
4653
|
-
businessName:
|
|
4654
|
-
finalUrls:
|
|
4655
|
-
});
|
|
4656
|
-
var appAdSchema =
|
|
4657
|
-
format:
|
|
4658
|
-
headlines:
|
|
4659
|
-
descriptions:
|
|
4660
|
-
});
|
|
4661
|
-
var videoAdSchema =
|
|
4662
|
-
format:
|
|
4856
|
+
marketingImageAssets: z12.array(refSchema).optional(),
|
|
4857
|
+
squareMarketingImageAssets: z12.array(refSchema).optional(),
|
|
4858
|
+
logoImageAssets: z12.array(refSchema).optional(),
|
|
4859
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1)
|
|
4860
|
+
});
|
|
4861
|
+
var callAdSchema = z12.object({
|
|
4862
|
+
format: z12.literal("call"),
|
|
4863
|
+
countryCode: z12.string().length(2),
|
|
4864
|
+
phoneNumber: z12.string().min(3),
|
|
4865
|
+
headline1: z12.string().min(1).max(30),
|
|
4866
|
+
headline2: z12.string().min(1).max(30),
|
|
4867
|
+
description1: z12.string().min(1).max(90),
|
|
4868
|
+
description2: z12.string().min(1).max(90),
|
|
4869
|
+
businessName: z12.string().min(1).max(25),
|
|
4870
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1)
|
|
4871
|
+
});
|
|
4872
|
+
var appAdSchema = z12.object({
|
|
4873
|
+
format: z12.literal("app"),
|
|
4874
|
+
headlines: z12.array(z12.object({ text: z12.string().min(1).max(30) })).min(1),
|
|
4875
|
+
descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1)
|
|
4876
|
+
});
|
|
4877
|
+
var videoAdSchema = z12.object({
|
|
4878
|
+
format: z12.literal("video"),
|
|
4663
4879
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
4664
4880
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
4665
|
-
videoAssets:
|
|
4666
|
-
finalUrls:
|
|
4667
|
-
});
|
|
4668
|
-
var demandGenAdSchema =
|
|
4669
|
-
format:
|
|
4670
|
-
headlines:
|
|
4671
|
-
descriptions:
|
|
4672
|
-
businessName:
|
|
4673
|
-
finalUrls:
|
|
4674
|
-
imageAssets:
|
|
4675
|
-
squareImageAssets:
|
|
4676
|
-
logoImageAssets:
|
|
4677
|
-
});
|
|
4678
|
-
var adContentSchema =
|
|
4881
|
+
videoAssets: z12.array(refSchema).min(1),
|
|
4882
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1)
|
|
4883
|
+
});
|
|
4884
|
+
var demandGenAdSchema = z12.object({
|
|
4885
|
+
format: z12.literal("demandGen"),
|
|
4886
|
+
headlines: z12.array(z12.object({ text: z12.string().min(1).max(40) })).min(1).max(5),
|
|
4887
|
+
descriptions: z12.array(z12.object({ text: z12.string().min(1).max(90) })).min(1).max(5),
|
|
4888
|
+
businessName: z12.string().min(1).max(25),
|
|
4889
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1),
|
|
4890
|
+
imageAssets: z12.array(refSchema).optional(),
|
|
4891
|
+
squareImageAssets: z12.array(refSchema).optional(),
|
|
4892
|
+
logoImageAssets: z12.array(refSchema).optional()
|
|
4893
|
+
});
|
|
4894
|
+
var adContentSchema = z12.discriminatedUnion("format", [
|
|
4679
4895
|
responsiveSearchAdSchema,
|
|
4680
4896
|
responsiveDisplayAdSchema,
|
|
4681
4897
|
callAdSchema,
|
|
@@ -4683,45 +4899,45 @@ var adContentSchema = z11.discriminatedUnion("format", [
|
|
|
4683
4899
|
videoAdSchema,
|
|
4684
4900
|
demandGenAdSchema
|
|
4685
4901
|
]);
|
|
4686
|
-
var adCreateSchema =
|
|
4902
|
+
var adCreateSchema = z12.object({
|
|
4687
4903
|
adGroup: refSchema,
|
|
4688
4904
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
4689
4905
|
content: adContentSchema
|
|
4690
4906
|
});
|
|
4691
|
-
var adUpdateSchema =
|
|
4692
|
-
status:
|
|
4907
|
+
var adUpdateSchema = z12.object({
|
|
4908
|
+
status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4693
4909
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4694
|
-
content:
|
|
4910
|
+
content: z12.record(z12.string(), z12.unknown()).optional()
|
|
4695
4911
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4696
|
-
var textAssetSchema =
|
|
4697
|
-
var imageAssetSchema =
|
|
4698
|
-
type:
|
|
4699
|
-
imageId:
|
|
4700
|
-
name:
|
|
4701
|
-
});
|
|
4702
|
-
var youtubeVideoAssetSchema =
|
|
4703
|
-
type:
|
|
4704
|
-
youtubeVideoId:
|
|
4705
|
-
name:
|
|
4706
|
-
});
|
|
4707
|
-
var sitelinkAssetSchema =
|
|
4708
|
-
type:
|
|
4709
|
-
linkText:
|
|
4710
|
-
description1:
|
|
4711
|
-
description2:
|
|
4712
|
-
finalUrls:
|
|
4713
|
-
});
|
|
4714
|
-
var calloutAssetSchema =
|
|
4715
|
-
type:
|
|
4716
|
-
calloutText:
|
|
4717
|
-
});
|
|
4718
|
-
var structuredSnippetAssetSchema =
|
|
4719
|
-
type:
|
|
4720
|
-
header:
|
|
4721
|
-
values:
|
|
4722
|
-
});
|
|
4723
|
-
var callToActionAssetSchema =
|
|
4724
|
-
var assetCreateSchema =
|
|
4912
|
+
var textAssetSchema = z12.object({ type: z12.literal("text"), text: z12.string().min(1) });
|
|
4913
|
+
var imageAssetSchema = z12.object({
|
|
4914
|
+
type: z12.literal("image"),
|
|
4915
|
+
imageId: z12.string().min(1),
|
|
4916
|
+
name: z12.string().optional()
|
|
4917
|
+
});
|
|
4918
|
+
var youtubeVideoAssetSchema = z12.object({
|
|
4919
|
+
type: z12.literal("youtubeVideo"),
|
|
4920
|
+
youtubeVideoId: z12.string().min(1),
|
|
4921
|
+
name: z12.string().optional()
|
|
4922
|
+
});
|
|
4923
|
+
var sitelinkAssetSchema = z12.object({
|
|
4924
|
+
type: z12.literal("sitelink"),
|
|
4925
|
+
linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4926
|
+
description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4927
|
+
description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4928
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1)
|
|
4929
|
+
});
|
|
4930
|
+
var calloutAssetSchema = z12.object({
|
|
4931
|
+
type: z12.literal("callout"),
|
|
4932
|
+
calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4933
|
+
});
|
|
4934
|
+
var structuredSnippetAssetSchema = z12.object({
|
|
4935
|
+
type: z12.literal("structuredSnippet"),
|
|
4936
|
+
header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4937
|
+
values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4938
|
+
});
|
|
4939
|
+
var callToActionAssetSchema = z12.object({ type: z12.literal("callToAction"), callToAction: z12.string().min(1) });
|
|
4940
|
+
var assetCreateSchema = z12.discriminatedUnion("type", [
|
|
4725
4941
|
textAssetSchema,
|
|
4726
4942
|
imageAssetSchema,
|
|
4727
4943
|
youtubeVideoAssetSchema,
|
|
@@ -4730,136 +4946,136 @@ var assetCreateSchema = z11.discriminatedUnion("type", [
|
|
|
4730
4946
|
structuredSnippetAssetSchema,
|
|
4731
4947
|
callToActionAssetSchema
|
|
4732
4948
|
]);
|
|
4733
|
-
var assetUpdateSchema =
|
|
4734
|
-
name:
|
|
4735
|
-
linkText:
|
|
4736
|
-
description1:
|
|
4737
|
-
description2:
|
|
4738
|
-
finalUrls:
|
|
4739
|
-
calloutText:
|
|
4740
|
-
header:
|
|
4741
|
-
values:
|
|
4742
|
-
callToAction:
|
|
4743
|
-
text:
|
|
4949
|
+
var assetUpdateSchema = z12.object({
|
|
4950
|
+
name: z12.string().min(1).optional(),
|
|
4951
|
+
linkText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
4952
|
+
description1: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4953
|
+
description2: z12.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4954
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
|
|
4955
|
+
calloutText: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
4956
|
+
header: z12.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
|
|
4957
|
+
values: z12.array(z12.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
4958
|
+
callToAction: z12.string().min(1).optional(),
|
|
4959
|
+
text: z12.string().min(1).optional()
|
|
4744
4960
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4745
|
-
var assetLinkAttachSchema =
|
|
4746
|
-
level:
|
|
4961
|
+
var assetLinkAttachSchema = z12.object({
|
|
4962
|
+
level: z12.enum(["campaign", "adGroup", "customer"]),
|
|
4747
4963
|
parent: refSchema.optional(),
|
|
4748
4964
|
asset: refSchema,
|
|
4749
|
-
fieldType:
|
|
4965
|
+
fieldType: z12.enum(ASSET_FIELD_TYPES)
|
|
4750
4966
|
}).superRefine((value, ctx) => {
|
|
4751
4967
|
if (value.level !== "customer" && !value.parent) {
|
|
4752
4968
|
ctx.addIssue({
|
|
4753
|
-
code:
|
|
4969
|
+
code: z12.ZodIssueCode.custom,
|
|
4754
4970
|
path: ["parent"],
|
|
4755
4971
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
4756
4972
|
});
|
|
4757
4973
|
}
|
|
4758
4974
|
});
|
|
4759
|
-
var assetGroupCreateSchema =
|
|
4975
|
+
var assetGroupCreateSchema = z12.object({
|
|
4760
4976
|
campaign: refSchema,
|
|
4761
|
-
name:
|
|
4762
|
-
finalUrls:
|
|
4763
|
-
headlines:
|
|
4764
|
-
longHeadlines:
|
|
4765
|
-
descriptions:
|
|
4766
|
-
businessName:
|
|
4767
|
-
imageAssets:
|
|
4768
|
-
squareImageAssets:
|
|
4769
|
-
logoAssets:
|
|
4770
|
-
status:
|
|
4771
|
-
});
|
|
4772
|
-
var assetGroupUpdateSchema =
|
|
4773
|
-
name:
|
|
4774
|
-
finalUrls:
|
|
4775
|
-
status:
|
|
4977
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
4978
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1),
|
|
4979
|
+
headlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
4980
|
+
longHeadlines: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
4981
|
+
descriptions: z12.array(z12.object({ text: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
4982
|
+
businessName: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
4983
|
+
imageAssets: z12.array(refSchema).optional(),
|
|
4984
|
+
squareImageAssets: z12.array(refSchema).optional(),
|
|
4985
|
+
logoAssets: z12.array(refSchema).optional(),
|
|
4986
|
+
status: z12.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
4987
|
+
});
|
|
4988
|
+
var assetGroupUpdateSchema = z12.object({
|
|
4989
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
4990
|
+
finalUrls: z12.array(httpsUrlSchema2).min(1).optional(),
|
|
4991
|
+
status: z12.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4776
4992
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4777
|
-
var audienceCreateSchema2 =
|
|
4778
|
-
name:
|
|
4779
|
-
type:
|
|
4780
|
-
description:
|
|
4993
|
+
var audienceCreateSchema2 = z12.object({
|
|
4994
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4995
|
+
type: z12.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4996
|
+
description: z12.string().optional(),
|
|
4781
4997
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4782
|
-
members:
|
|
4783
|
-
sourceFileRef:
|
|
4998
|
+
members: z12.array(z12.record(z12.string(), z12.string())).optional(),
|
|
4999
|
+
sourceFileRef: z12.string().optional()
|
|
4784
5000
|
});
|
|
4785
|
-
var audienceCriterionAttachSchema =
|
|
4786
|
-
level:
|
|
5001
|
+
var audienceCriterionAttachSchema = z12.object({
|
|
5002
|
+
level: z12.enum(["campaign", "adGroup"]),
|
|
4787
5003
|
parent: refSchema,
|
|
4788
5004
|
userList: refSchema,
|
|
4789
|
-
negative:
|
|
5005
|
+
negative: z12.boolean().default(false)
|
|
4790
5006
|
});
|
|
4791
|
-
var conversionActionCreateSchema =
|
|
4792
|
-
name:
|
|
4793
|
-
type:
|
|
4794
|
-
category:
|
|
4795
|
-
countingType:
|
|
5007
|
+
var conversionActionCreateSchema = z12.object({
|
|
5008
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
5009
|
+
type: z12.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
5010
|
+
category: z12.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
5011
|
+
countingType: z12.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4796
5012
|
defaultValueMicros: microsSchema.optional(),
|
|
4797
|
-
defaultCurrencyCode:
|
|
4798
|
-
clickThroughLookbackWindowDays:
|
|
4799
|
-
viewThroughLookbackWindowDays:
|
|
4800
|
-
status:
|
|
4801
|
-
});
|
|
4802
|
-
var conversionActionUpdateSchema =
|
|
4803
|
-
name:
|
|
4804
|
-
category:
|
|
4805
|
-
countingType:
|
|
5013
|
+
defaultCurrencyCode: z12.string().length(3).optional(),
|
|
5014
|
+
clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
|
|
5015
|
+
viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
|
|
5016
|
+
status: z12.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
5017
|
+
});
|
|
5018
|
+
var conversionActionUpdateSchema = z12.object({
|
|
5019
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
5020
|
+
category: z12.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
5021
|
+
countingType: z12.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
4806
5022
|
defaultValueMicros: microsSchema.optional(),
|
|
4807
|
-
defaultCurrencyCode:
|
|
4808
|
-
clickThroughLookbackWindowDays:
|
|
4809
|
-
viewThroughLookbackWindowDays:
|
|
4810
|
-
status:
|
|
5023
|
+
defaultCurrencyCode: z12.string().length(3).optional(),
|
|
5024
|
+
clickThroughLookbackWindowDays: z12.number().int().positive().optional(),
|
|
5025
|
+
viewThroughLookbackWindowDays: z12.number().int().positive().optional(),
|
|
5026
|
+
status: z12.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
4811
5027
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4812
|
-
var biddingStrategyCreateSchema =
|
|
4813
|
-
name:
|
|
5028
|
+
var biddingStrategyCreateSchema = z12.object({
|
|
5029
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
4814
5030
|
config: biddingConfigSchema
|
|
4815
5031
|
}).superRefine((p, ctx) => {
|
|
4816
5032
|
if (p.config.type === "MANUAL_CPC") {
|
|
4817
5033
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
4818
5034
|
}
|
|
4819
5035
|
});
|
|
4820
|
-
var biddingStrategyUpdateSchema =
|
|
4821
|
-
name:
|
|
5036
|
+
var biddingStrategyUpdateSchema = z12.object({
|
|
5037
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
4822
5038
|
config: biddingConfigSchema.optional()
|
|
4823
5039
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4824
|
-
var labelCreateSchema =
|
|
4825
|
-
name:
|
|
4826
|
-
backgroundColor:
|
|
4827
|
-
description:
|
|
5040
|
+
var labelCreateSchema = z12.object({
|
|
5041
|
+
name: z12.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
5042
|
+
backgroundColor: z12.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
5043
|
+
description: z12.string().optional()
|
|
4828
5044
|
});
|
|
4829
|
-
var labelAttachSchema =
|
|
4830
|
-
level:
|
|
5045
|
+
var labelAttachSchema = z12.object({
|
|
5046
|
+
level: z12.enum(["campaign", "adGroup", "ad"]),
|
|
4831
5047
|
parent: refSchema,
|
|
4832
5048
|
label: refSchema
|
|
4833
5049
|
});
|
|
4834
|
-
var locationCriterionSchema =
|
|
4835
|
-
criterionType:
|
|
4836
|
-
geoTargetConstant:
|
|
4837
|
-
});
|
|
4838
|
-
var languageCriterionSchema =
|
|
4839
|
-
criterionType:
|
|
4840
|
-
languageConstant:
|
|
4841
|
-
});
|
|
4842
|
-
var adScheduleCriterionSchema =
|
|
4843
|
-
criterionType:
|
|
4844
|
-
dayOfWeek:
|
|
4845
|
-
startHour:
|
|
4846
|
-
startMinute:
|
|
4847
|
-
endHour:
|
|
4848
|
-
endMinute:
|
|
4849
|
-
});
|
|
4850
|
-
var deviceCriterionSchema =
|
|
4851
|
-
criterionType:
|
|
4852
|
-
device:
|
|
5050
|
+
var locationCriterionSchema = z12.object({
|
|
5051
|
+
criterionType: z12.literal("location"),
|
|
5052
|
+
geoTargetConstant: z12.union([z12.string().regex(GEO_TARGET_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
|
|
5053
|
+
});
|
|
5054
|
+
var languageCriterionSchema = z12.object({
|
|
5055
|
+
criterionType: z12.literal("language"),
|
|
5056
|
+
languageConstant: z12.union([z12.string().regex(LANGUAGE_CONSTANT_REGEX), z12.string().regex(NUMERIC_ID_REGEX2)])
|
|
5057
|
+
});
|
|
5058
|
+
var adScheduleCriterionSchema = z12.object({
|
|
5059
|
+
criterionType: z12.literal("adSchedule"),
|
|
5060
|
+
dayOfWeek: z12.enum(DAYS_OF_WEEK),
|
|
5061
|
+
startHour: z12.number().int().min(0).max(23),
|
|
5062
|
+
startMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
5063
|
+
endHour: z12.number().int().min(0).max(24),
|
|
5064
|
+
endMinute: z12.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
5065
|
+
});
|
|
5066
|
+
var deviceCriterionSchema = z12.object({
|
|
5067
|
+
criterionType: z12.literal("device"),
|
|
5068
|
+
device: z12.enum(DEVICE_TYPES),
|
|
4853
5069
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
4854
5070
|
// 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.
|
|
4855
|
-
bidModifier:
|
|
5071
|
+
bidModifier: z12.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
4856
5072
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
4857
5073
|
})
|
|
4858
5074
|
});
|
|
4859
|
-
var campaignCriterionAddSchema =
|
|
5075
|
+
var campaignCriterionAddSchema = z12.object({
|
|
4860
5076
|
campaign: refSchema,
|
|
4861
|
-
negative:
|
|
4862
|
-
criterion:
|
|
5077
|
+
negative: z12.boolean().default(false),
|
|
5078
|
+
criterion: z12.discriminatedUnion("criterionType", [
|
|
4863
5079
|
locationCriterionSchema,
|
|
4864
5080
|
languageCriterionSchema,
|
|
4865
5081
|
adScheduleCriterionSchema,
|
|
@@ -4869,7 +5085,7 @@ var campaignCriterionAddSchema = z11.object({
|
|
|
4869
5085
|
const c = val.criterion;
|
|
4870
5086
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
4871
5087
|
ctx.addIssue({
|
|
4872
|
-
code:
|
|
5088
|
+
code: z12.ZodIssueCode.custom,
|
|
4873
5089
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
4874
5090
|
path: ["criterion", "endMinute"]
|
|
4875
5091
|
});
|
|
@@ -4921,17 +5137,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
4921
5137
|
"google.campaignCriterion.add",
|
|
4922
5138
|
"google.campaignCriterion.remove"
|
|
4923
5139
|
];
|
|
4924
|
-
var googleDraftOpKindSchema =
|
|
5140
|
+
var googleDraftOpKindSchema = z12.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
4925
5141
|
function createOp2(kind, payload) {
|
|
4926
|
-
return
|
|
5142
|
+
return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, payload });
|
|
4927
5143
|
}
|
|
4928
5144
|
function updateOp2(kind, payload) {
|
|
4929
|
-
return
|
|
5145
|
+
return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
4930
5146
|
}
|
|
4931
5147
|
function targetOp(kind) {
|
|
4932
|
-
return
|
|
5148
|
+
return z12.object({ kind: z12.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
4933
5149
|
}
|
|
4934
|
-
var googleDraftOpInputSchema =
|
|
5150
|
+
var googleDraftOpInputSchema = z12.discriminatedUnion("kind", [
|
|
4935
5151
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
4936
5152
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
4937
5153
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -4979,132 +5195,132 @@ var googleDraftOpInputSchema = z11.discriminatedUnion("kind", [
|
|
|
4979
5195
|
]);
|
|
4980
5196
|
|
|
4981
5197
|
// ../api/src/ads-google/wire.ts
|
|
4982
|
-
import { z as
|
|
4983
|
-
var googleWriteModeSchema =
|
|
4984
|
-
var googleDraftOpResultSchema =
|
|
4985
|
-
status:
|
|
4986
|
-
resourceName:
|
|
4987
|
-
error:
|
|
4988
|
-
skippedBecause:
|
|
4989
|
-
executedAt:
|
|
4990
|
-
});
|
|
4991
|
-
var googleDraftStageRequestSchema =
|
|
4992
|
-
chatId:
|
|
5198
|
+
import { z as z13 } from "zod";
|
|
5199
|
+
var googleWriteModeSchema = z13.enum(["live", "simulated"]);
|
|
5200
|
+
var googleDraftOpResultSchema = z13.object({
|
|
5201
|
+
status: z13.enum(["applied", "simulated", "failed", "skipped"]),
|
|
5202
|
+
resourceName: z13.string().optional(),
|
|
5203
|
+
error: z13.string().optional(),
|
|
5204
|
+
skippedBecause: z13.string().optional(),
|
|
5205
|
+
executedAt: z13.number().optional()
|
|
5206
|
+
});
|
|
5207
|
+
var googleDraftStageRequestSchema = z13.object({
|
|
5208
|
+
chatId: z13.string(),
|
|
4993
5209
|
op: googleDraftOpInputSchema
|
|
4994
5210
|
});
|
|
4995
|
-
var googleDraftStageResponseSchema =
|
|
4996
|
-
staged:
|
|
4997
|
-
ref:
|
|
5211
|
+
var googleDraftStageResponseSchema = z13.object({
|
|
5212
|
+
staged: z13.literal(true),
|
|
5213
|
+
ref: z13.string(),
|
|
4998
5214
|
kind: googleDraftOpKindSchema,
|
|
4999
5215
|
mode: googleWriteModeSchema,
|
|
5000
|
-
dependsOn:
|
|
5001
|
-
summary:
|
|
5002
|
-
warnings:
|
|
5216
|
+
dependsOn: z13.array(z13.string()),
|
|
5217
|
+
summary: z13.string(),
|
|
5218
|
+
warnings: z13.array(z13.string()),
|
|
5003
5219
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
5004
|
-
amended:
|
|
5220
|
+
amended: z13.boolean().optional()
|
|
5005
5221
|
});
|
|
5006
|
-
var googleDraftAmendRequestSchema =
|
|
5007
|
-
chatId:
|
|
5008
|
-
ref:
|
|
5009
|
-
patch:
|
|
5222
|
+
var googleDraftAmendRequestSchema = z13.object({
|
|
5223
|
+
chatId: z13.string(),
|
|
5224
|
+
ref: z13.string(),
|
|
5225
|
+
patch: z13.record(z13.string(), z13.unknown())
|
|
5010
5226
|
});
|
|
5011
|
-
var googleDraftShowRequestSchema =
|
|
5012
|
-
chatId:
|
|
5013
|
-
ref:
|
|
5227
|
+
var googleDraftShowRequestSchema = z13.object({
|
|
5228
|
+
chatId: z13.string(),
|
|
5229
|
+
ref: z13.string()
|
|
5014
5230
|
});
|
|
5015
5231
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
5016
|
-
var googleDraftStageBatchRequestSchema =
|
|
5017
|
-
chatId:
|
|
5018
|
-
ops:
|
|
5232
|
+
var googleDraftStageBatchRequestSchema = z13.object({
|
|
5233
|
+
chatId: z13.string(),
|
|
5234
|
+
ops: z13.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
5019
5235
|
});
|
|
5020
|
-
var googleDraftStageBatchResponseSchema =
|
|
5021
|
-
staged:
|
|
5236
|
+
var googleDraftStageBatchResponseSchema = z13.object({
|
|
5237
|
+
staged: z13.literal(true),
|
|
5022
5238
|
mode: googleWriteModeSchema,
|
|
5023
|
-
count:
|
|
5024
|
-
ops:
|
|
5025
|
-
|
|
5026
|
-
ref:
|
|
5239
|
+
count: z13.number(),
|
|
5240
|
+
ops: z13.array(
|
|
5241
|
+
z13.object({
|
|
5242
|
+
ref: z13.string(),
|
|
5027
5243
|
kind: googleDraftOpKindSchema,
|
|
5028
|
-
dependsOn:
|
|
5029
|
-
summary:
|
|
5030
|
-
warnings:
|
|
5244
|
+
dependsOn: z13.array(z13.string()),
|
|
5245
|
+
summary: z13.string(),
|
|
5246
|
+
warnings: z13.array(z13.string())
|
|
5031
5247
|
})
|
|
5032
5248
|
)
|
|
5033
5249
|
});
|
|
5034
|
-
var googleDraftOpViewSchema =
|
|
5035
|
-
ref:
|
|
5250
|
+
var googleDraftOpViewSchema = z13.object({
|
|
5251
|
+
ref: z13.string(),
|
|
5036
5252
|
kind: googleDraftOpKindSchema,
|
|
5037
|
-
customerId:
|
|
5038
|
-
target:
|
|
5039
|
-
dependsOn:
|
|
5040
|
-
summary:
|
|
5041
|
-
stagedAt:
|
|
5253
|
+
customerId: z13.string(),
|
|
5254
|
+
target: z13.string().optional(),
|
|
5255
|
+
dependsOn: z13.array(z13.string()),
|
|
5256
|
+
summary: z13.string(),
|
|
5257
|
+
stagedAt: z13.number(),
|
|
5042
5258
|
result: googleDraftOpResultSchema.optional()
|
|
5043
5259
|
});
|
|
5044
|
-
var googleDraftShowResponseSchema =
|
|
5260
|
+
var googleDraftShowResponseSchema = z13.object({
|
|
5045
5261
|
op: googleDraftOpViewSchema.extend({
|
|
5046
|
-
payload:
|
|
5047
|
-
warnings:
|
|
5048
|
-
annotations:
|
|
5262
|
+
payload: z13.unknown().optional(),
|
|
5263
|
+
warnings: z13.array(z13.string()).optional(),
|
|
5264
|
+
annotations: z13.unknown().optional()
|
|
5049
5265
|
})
|
|
5050
5266
|
});
|
|
5051
|
-
var googleDraftListRequestSchema =
|
|
5052
|
-
chatId:
|
|
5267
|
+
var googleDraftListRequestSchema = z13.object({
|
|
5268
|
+
chatId: z13.string()
|
|
5053
5269
|
});
|
|
5054
|
-
var googleDraftAdvisorySchema =
|
|
5055
|
-
scope:
|
|
5056
|
-
message:
|
|
5270
|
+
var googleDraftAdvisorySchema = z13.object({
|
|
5271
|
+
scope: z13.enum(["campaign", "adGroup"]),
|
|
5272
|
+
message: z13.string()
|
|
5057
5273
|
});
|
|
5058
|
-
var googleDraftStatusCollectionSchema =
|
|
5059
|
-
label:
|
|
5060
|
-
added:
|
|
5061
|
-
removed:
|
|
5062
|
-
existing:
|
|
5274
|
+
var googleDraftStatusCollectionSchema = z13.object({
|
|
5275
|
+
label: z13.string(),
|
|
5276
|
+
added: z13.number(),
|
|
5277
|
+
removed: z13.number(),
|
|
5278
|
+
existing: z13.number()
|
|
5063
5279
|
});
|
|
5064
|
-
var googleDraftChangeOperationSchema =
|
|
5065
|
-
var googleDraftStatusNodeSchema =
|
|
5066
|
-
() =>
|
|
5067
|
-
entity:
|
|
5068
|
-
name:
|
|
5280
|
+
var googleDraftChangeOperationSchema = z13.enum(["create", "update", "pause", "resume", "remove"]);
|
|
5281
|
+
var googleDraftStatusNodeSchema = z13.lazy(
|
|
5282
|
+
() => z13.object({
|
|
5283
|
+
entity: z13.string(),
|
|
5284
|
+
name: z13.string(),
|
|
5069
5285
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
5070
|
-
existing:
|
|
5071
|
-
collections:
|
|
5072
|
-
children:
|
|
5073
|
-
warnings:
|
|
5286
|
+
existing: z13.boolean(),
|
|
5287
|
+
collections: z13.array(googleDraftStatusCollectionSchema),
|
|
5288
|
+
children: z13.array(googleDraftStatusNodeSchema),
|
|
5289
|
+
warnings: z13.array(z13.string()).optional()
|
|
5074
5290
|
})
|
|
5075
5291
|
);
|
|
5076
|
-
var googleDraftListResponseSchema =
|
|
5077
|
-
status:
|
|
5292
|
+
var googleDraftListResponseSchema = z13.object({
|
|
5293
|
+
status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
5078
5294
|
mode: googleWriteModeSchema,
|
|
5079
|
-
count:
|
|
5080
|
-
ops:
|
|
5295
|
+
count: z13.number(),
|
|
5296
|
+
ops: z13.array(googleDraftOpViewSchema),
|
|
5081
5297
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
5082
|
-
tree:
|
|
5298
|
+
tree: z13.array(googleDraftStatusNodeSchema).optional(),
|
|
5083
5299
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
5084
|
-
advisories:
|
|
5300
|
+
advisories: z13.array(googleDraftAdvisorySchema).optional()
|
|
5085
5301
|
});
|
|
5086
|
-
var googleDraftRemoveRequestSchema =
|
|
5087
|
-
chatId:
|
|
5088
|
-
ref:
|
|
5302
|
+
var googleDraftRemoveRequestSchema = z13.object({
|
|
5303
|
+
chatId: z13.string(),
|
|
5304
|
+
ref: z13.string()
|
|
5089
5305
|
});
|
|
5090
|
-
var googleDraftRemoveResponseSchema =
|
|
5306
|
+
var googleDraftRemoveResponseSchema = z13.object({
|
|
5091
5307
|
/** The requested ref plus any dependents removed by cascade. */
|
|
5092
|
-
removed:
|
|
5308
|
+
removed: z13.array(z13.string())
|
|
5093
5309
|
});
|
|
5094
|
-
var googleDraftClearRequestSchema =
|
|
5095
|
-
chatId:
|
|
5310
|
+
var googleDraftClearRequestSchema = z13.object({
|
|
5311
|
+
chatId: z13.string()
|
|
5096
5312
|
});
|
|
5097
|
-
var googleDraftClearResponseSchema =
|
|
5098
|
-
cleared:
|
|
5313
|
+
var googleDraftClearResponseSchema = z13.object({
|
|
5314
|
+
cleared: z13.number()
|
|
5099
5315
|
});
|
|
5100
|
-
var googleFieldErrorSchema =
|
|
5101
|
-
path:
|
|
5102
|
-
message:
|
|
5316
|
+
var googleFieldErrorSchema = z13.object({
|
|
5317
|
+
path: z13.string(),
|
|
5318
|
+
message: z13.string()
|
|
5103
5319
|
});
|
|
5104
|
-
var googleDraftErrorResponseSchema =
|
|
5105
|
-
code:
|
|
5106
|
-
error:
|
|
5107
|
-
fields:
|
|
5320
|
+
var googleDraftErrorResponseSchema = z13.object({
|
|
5321
|
+
code: z13.string(),
|
|
5322
|
+
error: z13.string(),
|
|
5323
|
+
fields: z13.array(googleFieldErrorSchema).optional()
|
|
5108
5324
|
});
|
|
5109
5325
|
|
|
5110
5326
|
// src/commands/ads/google/draft-status.ts
|
|
@@ -11147,17 +11363,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
11147
11363
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
11148
11364
|
|
|
11149
11365
|
// ../api/src/ads-meta/ops.ts
|
|
11150
|
-
import { z as
|
|
11151
|
-
var tempRefSchema3 =
|
|
11152
|
-
var parentRefSchema2 =
|
|
11153
|
-
var moneySchema2 =
|
|
11154
|
-
amount:
|
|
11155
|
-
currencyCode:
|
|
11156
|
-
});
|
|
11157
|
-
var httpsUrlSchema3 =
|
|
11158
|
-
var bakerMediaIdSchema2 =
|
|
11159
|
-
var stageableStatusSchema3 =
|
|
11160
|
-
var updateStatusSchema =
|
|
11366
|
+
import { z as z14 } from "zod";
|
|
11367
|
+
var tempRefSchema3 = z14.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
11368
|
+
var parentRefSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
11369
|
+
var moneySchema2 = z14.object({
|
|
11370
|
+
amount: z14.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"),
|
|
11371
|
+
currencyCode: z14.string().length(3).optional()
|
|
11372
|
+
});
|
|
11373
|
+
var httpsUrlSchema3 = z14.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
11374
|
+
var bakerMediaIdSchema2 = z14.string().min(1);
|
|
11375
|
+
var stageableStatusSchema3 = z14.enum(STAGEABLE_CREATE_STATUSES3);
|
|
11376
|
+
var updateStatusSchema = z14.enum(UPDATE_STATUSES);
|
|
11161
11377
|
function currencyMinimums2(currencyCode) {
|
|
11162
11378
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
11163
11379
|
}
|
|
@@ -11169,50 +11385,50 @@ function validateDailyBudgetFloor(money, ctx, path23) {
|
|
|
11169
11385
|
}
|
|
11170
11386
|
}
|
|
11171
11387
|
}
|
|
11172
|
-
var geoLocationsSchema =
|
|
11173
|
-
countries:
|
|
11174
|
-
regions:
|
|
11175
|
-
cities:
|
|
11176
|
-
zips:
|
|
11177
|
-
location_types:
|
|
11178
|
-
}).catchall(
|
|
11179
|
-
var idNameSchema =
|
|
11180
|
-
var metaTargetingSchema =
|
|
11388
|
+
var geoLocationsSchema = z14.object({
|
|
11389
|
+
countries: z14.array(z14.string().length(2)).optional(),
|
|
11390
|
+
regions: z14.array(z14.object({ key: z14.string() })).optional(),
|
|
11391
|
+
cities: z14.array(z14.object({ key: z14.string(), radius: z14.number().optional(), distance_unit: z14.string().optional() })).optional(),
|
|
11392
|
+
zips: z14.array(z14.object({ key: z14.string() })).optional(),
|
|
11393
|
+
location_types: z14.array(z14.string()).optional()
|
|
11394
|
+
}).catchall(z14.unknown());
|
|
11395
|
+
var idNameSchema = z14.object({ id: z14.string(), name: z14.string().optional() });
|
|
11396
|
+
var metaTargetingSchema = z14.object({
|
|
11181
11397
|
geo_locations: geoLocationsSchema.optional(),
|
|
11182
11398
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
11183
|
-
age_min:
|
|
11184
|
-
age_max:
|
|
11185
|
-
genders:
|
|
11186
|
-
locales:
|
|
11187
|
-
interests:
|
|
11188
|
-
behaviors:
|
|
11189
|
-
custom_audiences:
|
|
11190
|
-
excluded_custom_audiences:
|
|
11191
|
-
flexible_spec:
|
|
11192
|
-
exclusions:
|
|
11193
|
-
publisher_platforms:
|
|
11194
|
-
facebook_positions:
|
|
11195
|
-
instagram_positions:
|
|
11196
|
-
audience_network_positions:
|
|
11197
|
-
messenger_positions:
|
|
11198
|
-
device_platforms:
|
|
11199
|
-
targeting_automation:
|
|
11200
|
-
}).catchall(
|
|
11201
|
-
var specialAdCategoriesSchema =
|
|
11202
|
-
var campaignCreateSchema3 =
|
|
11203
|
-
name:
|
|
11204
|
-
objective:
|
|
11399
|
+
age_min: z14.number().int().min(13).max(65).optional(),
|
|
11400
|
+
age_max: z14.number().int().min(13).max(65).optional(),
|
|
11401
|
+
genders: z14.array(z14.union([z14.literal(1), z14.literal(2)])).optional(),
|
|
11402
|
+
locales: z14.array(z14.number().int()).optional(),
|
|
11403
|
+
interests: z14.array(idNameSchema).optional(),
|
|
11404
|
+
behaviors: z14.array(idNameSchema).optional(),
|
|
11405
|
+
custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
|
|
11406
|
+
excluded_custom_audiences: z14.array(z14.object({ id: parentRefSchema2 })).optional(),
|
|
11407
|
+
flexible_spec: z14.array(z14.record(z14.string(), z14.unknown())).optional(),
|
|
11408
|
+
exclusions: z14.record(z14.string(), z14.unknown()).optional(),
|
|
11409
|
+
publisher_platforms: z14.array(z14.string()).optional(),
|
|
11410
|
+
facebook_positions: z14.array(z14.string()).optional(),
|
|
11411
|
+
instagram_positions: z14.array(z14.string()).optional(),
|
|
11412
|
+
audience_network_positions: z14.array(z14.string()).optional(),
|
|
11413
|
+
messenger_positions: z14.array(z14.string()).optional(),
|
|
11414
|
+
device_platforms: z14.array(z14.string()).optional(),
|
|
11415
|
+
targeting_automation: z14.object({ advantage_audience: z14.union([z14.literal(0), z14.literal(1)]) }).partial().optional()
|
|
11416
|
+
}).catchall(z14.unknown());
|
|
11417
|
+
var specialAdCategoriesSchema = z14.array(z14.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
11418
|
+
var campaignCreateSchema3 = z14.object({
|
|
11419
|
+
name: z14.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
11420
|
+
objective: z14.enum(OBJECTIVES),
|
|
11205
11421
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11206
11422
|
special_ad_categories: specialAdCategoriesSchema,
|
|
11207
|
-
special_ad_category_country:
|
|
11208
|
-
buying_type:
|
|
11209
|
-
bid_strategy:
|
|
11423
|
+
special_ad_category_country: z14.array(z14.string().length(2)).optional(),
|
|
11424
|
+
buying_type: z14.enum(BUYING_TYPES).default("AUCTION"),
|
|
11425
|
+
bid_strategy: z14.enum(BID_STRATEGIES).optional(),
|
|
11210
11426
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
11211
11427
|
dailyBudget: moneySchema2.optional(),
|
|
11212
11428
|
lifetimeBudget: moneySchema2.optional(),
|
|
11213
11429
|
spendCap: moneySchema2.optional(),
|
|
11214
|
-
start_time:
|
|
11215
|
-
stop_time:
|
|
11430
|
+
start_time: z14.number().int().positive().optional(),
|
|
11431
|
+
stop_time: z14.number().int().positive().optional()
|
|
11216
11432
|
}).superRefine((p, ctx) => {
|
|
11217
11433
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
11218
11434
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -11222,15 +11438,15 @@ var campaignCreateSchema3 = z13.object({
|
|
|
11222
11438
|
ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
|
|
11223
11439
|
}
|
|
11224
11440
|
});
|
|
11225
|
-
var campaignUpdateSchema3 =
|
|
11226
|
-
name:
|
|
11441
|
+
var campaignUpdateSchema3 = z14.object({
|
|
11442
|
+
name: z14.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
11227
11443
|
status: updateStatusSchema.optional(),
|
|
11228
|
-
bid_strategy:
|
|
11444
|
+
bid_strategy: z14.enum(BID_STRATEGIES).optional(),
|
|
11229
11445
|
dailyBudget: moneySchema2.optional(),
|
|
11230
11446
|
lifetimeBudget: moneySchema2.optional(),
|
|
11231
11447
|
spendCap: moneySchema2.optional(),
|
|
11232
|
-
start_time:
|
|
11233
|
-
stop_time:
|
|
11448
|
+
start_time: z14.number().int().positive().optional(),
|
|
11449
|
+
stop_time: z14.number().int().positive().optional()
|
|
11234
11450
|
}).superRefine((p, ctx) => {
|
|
11235
11451
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
11236
11452
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -11240,38 +11456,38 @@ var campaignUpdateSchema3 = z13.object({
|
|
|
11240
11456
|
}
|
|
11241
11457
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
11242
11458
|
});
|
|
11243
|
-
var promotedObjectSchema =
|
|
11459
|
+
var promotedObjectSchema = z14.object({
|
|
11244
11460
|
page_id: parentRefSchema2.optional(),
|
|
11245
|
-
pixel_id:
|
|
11246
|
-
custom_event_type:
|
|
11247
|
-
application_id:
|
|
11248
|
-
object_store_url:
|
|
11249
|
-
product_catalog_id:
|
|
11250
|
-
product_set_id:
|
|
11251
|
-
whatsapp_phone_number:
|
|
11252
|
-
offline_conversion_data_set_id:
|
|
11461
|
+
pixel_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11462
|
+
custom_event_type: z14.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
11463
|
+
application_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11464
|
+
object_store_url: z14.string().url().optional(),
|
|
11465
|
+
product_catalog_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11466
|
+
product_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11467
|
+
whatsapp_phone_number: z14.string().optional(),
|
|
11468
|
+
offline_conversion_data_set_id: z14.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
11253
11469
|
}).partial();
|
|
11254
|
-
var attributionSpecSchema =
|
|
11255
|
-
|
|
11256
|
-
event_type:
|
|
11257
|
-
window_days:
|
|
11470
|
+
var attributionSpecSchema = z14.array(
|
|
11471
|
+
z14.object({
|
|
11472
|
+
event_type: z14.enum(ATTRIBUTION_EVENT_TYPES),
|
|
11473
|
+
window_days: z14.union([z14.literal(1), z14.literal(7), z14.literal(28)])
|
|
11258
11474
|
})
|
|
11259
11475
|
);
|
|
11260
11476
|
var adSetFields = {
|
|
11261
|
-
name:
|
|
11477
|
+
name: z14.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
11262
11478
|
campaign_id: parentRefSchema2,
|
|
11263
11479
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11264
11480
|
dailyBudget: moneySchema2.optional(),
|
|
11265
11481
|
lifetimeBudget: moneySchema2.optional(),
|
|
11266
11482
|
bidAmount: moneySchema2.optional(),
|
|
11267
|
-
bid_strategy:
|
|
11268
|
-
billing_event:
|
|
11269
|
-
optimization_goal:
|
|
11270
|
-
destination_type:
|
|
11483
|
+
bid_strategy: z14.enum(BID_STRATEGIES).optional(),
|
|
11484
|
+
billing_event: z14.enum(BILLING_EVENTS),
|
|
11485
|
+
optimization_goal: z14.enum(OPTIMIZATION_GOALS),
|
|
11486
|
+
destination_type: z14.enum(DESTINATION_TYPES).optional(),
|
|
11271
11487
|
promoted_object: promotedObjectSchema.optional(),
|
|
11272
11488
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11273
|
-
start_time:
|
|
11274
|
-
end_time:
|
|
11489
|
+
start_time: z14.number().int().positive().optional(),
|
|
11490
|
+
end_time: z14.number().int().positive().optional(),
|
|
11275
11491
|
targeting: metaTargetingSchema
|
|
11276
11492
|
};
|
|
11277
11493
|
function validateAdSetBudgetAndBid(p, ctx) {
|
|
@@ -11289,22 +11505,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
|
|
|
11289
11505
|
ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
|
|
11290
11506
|
}
|
|
11291
11507
|
}
|
|
11292
|
-
var adSetCreateSchema =
|
|
11508
|
+
var adSetCreateSchema = z14.object(adSetFields).superRefine((p, ctx) => {
|
|
11293
11509
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11294
11510
|
});
|
|
11295
|
-
var adSetUpdateSchema =
|
|
11511
|
+
var adSetUpdateSchema = z14.object({
|
|
11296
11512
|
name: adSetFields.name.optional(),
|
|
11297
11513
|
status: updateStatusSchema.optional(),
|
|
11298
11514
|
dailyBudget: moneySchema2.optional(),
|
|
11299
11515
|
lifetimeBudget: moneySchema2.optional(),
|
|
11300
11516
|
bidAmount: moneySchema2.optional(),
|
|
11301
|
-
bid_strategy:
|
|
11302
|
-
optimization_goal:
|
|
11303
|
-
destination_type:
|
|
11517
|
+
bid_strategy: z14.enum(BID_STRATEGIES).optional(),
|
|
11518
|
+
optimization_goal: z14.enum(OPTIMIZATION_GOALS).optional(),
|
|
11519
|
+
destination_type: z14.enum(DESTINATION_TYPES).optional(),
|
|
11304
11520
|
promoted_object: promotedObjectSchema.optional(),
|
|
11305
11521
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11306
|
-
start_time:
|
|
11307
|
-
end_time:
|
|
11522
|
+
start_time: z14.number().int().positive().optional(),
|
|
11523
|
+
end_time: z14.number().int().positive().optional(),
|
|
11308
11524
|
targeting: metaTargetingSchema.optional()
|
|
11309
11525
|
}).superRefine((p, ctx) => {
|
|
11310
11526
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
@@ -11312,38 +11528,38 @@ var adSetUpdateSchema = z13.object({
|
|
|
11312
11528
|
}
|
|
11313
11529
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11314
11530
|
});
|
|
11315
|
-
var messageSchema =
|
|
11316
|
-
var headlineSchema2 =
|
|
11317
|
-
var descriptionSchema =
|
|
11318
|
-
var callToActionSchema =
|
|
11319
|
-
type:
|
|
11531
|
+
var messageSchema = z14.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
11532
|
+
var headlineSchema2 = z14.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
11533
|
+
var descriptionSchema = z14.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
11534
|
+
var callToActionSchema = z14.object({
|
|
11535
|
+
type: z14.enum(CTA_TYPES2),
|
|
11320
11536
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
11321
11537
|
link: httpsUrlSchema3.optional()
|
|
11322
11538
|
});
|
|
11323
|
-
var creativeEnhancementsSchema =
|
|
11324
|
-
standardEnhancements:
|
|
11325
|
-
features:
|
|
11539
|
+
var creativeEnhancementsSchema = z14.object({
|
|
11540
|
+
standardEnhancements: z14.enum(ENROLL_STATUSES).optional(),
|
|
11541
|
+
features: z14.record(z14.string(), z14.enum(ENROLL_STATUSES)).optional()
|
|
11326
11542
|
});
|
|
11327
11543
|
var creativeSharedFields = {
|
|
11328
|
-
name:
|
|
11544
|
+
name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11329
11545
|
/** Facebook Page id backing the ad's identity. */
|
|
11330
11546
|
page_id: parentRefSchema2,
|
|
11331
11547
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
11332
|
-
instagram_user_id:
|
|
11548
|
+
instagram_user_id: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11333
11549
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
11334
|
-
url_tags:
|
|
11550
|
+
url_tags: z14.string().max(1e3).optional(),
|
|
11335
11551
|
enhancements: creativeEnhancementsSchema.optional()
|
|
11336
11552
|
};
|
|
11337
11553
|
var imageMediaFields = {
|
|
11338
|
-
imageHash:
|
|
11554
|
+
imageHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11339
11555
|
imageRef: tempRefSchema3.optional()
|
|
11340
11556
|
};
|
|
11341
11557
|
var videoMediaFields = {
|
|
11342
|
-
videoId:
|
|
11558
|
+
videoId: z14.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11343
11559
|
videoRef: tempRefSchema3.optional(),
|
|
11344
11560
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
11345
|
-
thumbnailHash:
|
|
11346
|
-
imageUrl:
|
|
11561
|
+
thumbnailHash: z14.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11562
|
+
imageUrl: z14.string().url().optional()
|
|
11347
11563
|
};
|
|
11348
11564
|
function countImageRefs(p) {
|
|
11349
11565
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -11351,8 +11567,8 @@ function countImageRefs(p) {
|
|
|
11351
11567
|
function countVideoRefs(p) {
|
|
11352
11568
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
11353
11569
|
}
|
|
11354
|
-
var singleCreativeSchema =
|
|
11355
|
-
creativeType:
|
|
11570
|
+
var singleCreativeSchema = z14.object({
|
|
11571
|
+
creativeType: z14.literal("single"),
|
|
11356
11572
|
...creativeSharedFields,
|
|
11357
11573
|
/** Primary text. */
|
|
11358
11574
|
message: messageSchema,
|
|
@@ -11361,7 +11577,7 @@ var singleCreativeSchema = z13.object({
|
|
|
11361
11577
|
headline: headlineSchema2.optional(),
|
|
11362
11578
|
description: descriptionSchema.optional(),
|
|
11363
11579
|
/** Display URL / caption shown under the headline. */
|
|
11364
|
-
caption:
|
|
11580
|
+
caption: z14.string().max(255).optional(),
|
|
11365
11581
|
call_to_action: callToActionSchema.optional(),
|
|
11366
11582
|
...imageMediaFields,
|
|
11367
11583
|
...videoMediaFields
|
|
@@ -11385,10 +11601,10 @@ var singleCreativeSchema = z13.object({
|
|
|
11385
11601
|
});
|
|
11386
11602
|
}
|
|
11387
11603
|
});
|
|
11388
|
-
var carouselCardSchema =
|
|
11604
|
+
var carouselCardSchema = z14.object({
|
|
11389
11605
|
link: httpsUrlSchema3,
|
|
11390
|
-
headline:
|
|
11391
|
-
description:
|
|
11606
|
+
headline: z14.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
11607
|
+
description: z14.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
11392
11608
|
call_to_action: callToActionSchema.optional(),
|
|
11393
11609
|
...imageMediaFields,
|
|
11394
11610
|
...videoMediaFields
|
|
@@ -11408,35 +11624,35 @@ var carouselCardSchema = z13.object({
|
|
|
11408
11624
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
11409
11625
|
}
|
|
11410
11626
|
});
|
|
11411
|
-
var carouselCreativeSchema2 =
|
|
11412
|
-
creativeType:
|
|
11627
|
+
var carouselCreativeSchema2 = z14.object({
|
|
11628
|
+
creativeType: z14.literal("carousel"),
|
|
11413
11629
|
...creativeSharedFields,
|
|
11414
11630
|
message: messageSchema,
|
|
11415
11631
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
11416
11632
|
link: httpsUrlSchema3.optional(),
|
|
11417
11633
|
call_to_action: callToActionSchema.optional(),
|
|
11418
|
-
cards:
|
|
11634
|
+
cards: z14.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
11419
11635
|
});
|
|
11420
|
-
var dynamicImageSchema =
|
|
11421
|
-
var dynamicVideoSchema =
|
|
11636
|
+
var dynamicImageSchema = z14.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
11637
|
+
var dynamicVideoSchema = z14.object({
|
|
11422
11638
|
videoId: videoMediaFields.videoId,
|
|
11423
11639
|
videoRef: videoMediaFields.videoRef,
|
|
11424
11640
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
11425
11641
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
11426
11642
|
var DYN = META_LIMITS.creative;
|
|
11427
|
-
var dynamicCreativeSchema =
|
|
11428
|
-
creativeType:
|
|
11643
|
+
var dynamicCreativeSchema = z14.object({
|
|
11644
|
+
creativeType: z14.literal("dynamic"),
|
|
11429
11645
|
...creativeSharedFields,
|
|
11430
|
-
bodies:
|
|
11431
|
-
titles:
|
|
11432
|
-
descriptions:
|
|
11433
|
-
images:
|
|
11434
|
-
videos:
|
|
11435
|
-
ad_formats:
|
|
11436
|
-
call_to_action_types:
|
|
11437
|
-
link_urls:
|
|
11646
|
+
bodies: z14.array(z14.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11647
|
+
titles: z14.array(z14.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11648
|
+
descriptions: z14.array(z14.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
11649
|
+
images: z14.array(dynamicImageSchema).optional(),
|
|
11650
|
+
videos: z14.array(dynamicVideoSchema).optional(),
|
|
11651
|
+
ad_formats: z14.array(z14.enum(AD_FORMATS2)).min(1),
|
|
11652
|
+
call_to_action_types: z14.array(z14.enum(CTA_TYPES2)).optional(),
|
|
11653
|
+
link_urls: z14.array(z14.object({ website_url: httpsUrlSchema3, display_url: z14.string().optional() })).min(1),
|
|
11438
11654
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
11439
|
-
asset_customization_rules:
|
|
11655
|
+
asset_customization_rules: z14.array(z14.record(z14.string(), z14.unknown())).optional()
|
|
11440
11656
|
}).superRefine((p, ctx) => {
|
|
11441
11657
|
if (!(p.images?.length || p.videos?.length)) {
|
|
11442
11658
|
ctx.addIssue({
|
|
@@ -11446,57 +11662,57 @@ var dynamicCreativeSchema = z13.object({
|
|
|
11446
11662
|
});
|
|
11447
11663
|
}
|
|
11448
11664
|
});
|
|
11449
|
-
var existingPostCreativeSchema =
|
|
11450
|
-
creativeType:
|
|
11665
|
+
var existingPostCreativeSchema = z14.object({
|
|
11666
|
+
creativeType: z14.literal("existing_post"),
|
|
11451
11667
|
name: creativeSharedFields.name,
|
|
11452
11668
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
11453
|
-
object_story_id:
|
|
11669
|
+
object_story_id: z14.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
11454
11670
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
11455
11671
|
url_tags: creativeSharedFields.url_tags,
|
|
11456
11672
|
enhancements: creativeSharedFields.enhancements
|
|
11457
11673
|
});
|
|
11458
|
-
var creativeContentSchema2 =
|
|
11674
|
+
var creativeContentSchema2 = z14.discriminatedUnion("creativeType", [
|
|
11459
11675
|
singleCreativeSchema,
|
|
11460
11676
|
carouselCreativeSchema2,
|
|
11461
11677
|
dynamicCreativeSchema,
|
|
11462
11678
|
existingPostCreativeSchema
|
|
11463
11679
|
]);
|
|
11464
11680
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
11465
|
-
var adCreativeUpdateSchema =
|
|
11466
|
-
name:
|
|
11681
|
+
var adCreativeUpdateSchema = z14.object({
|
|
11682
|
+
name: z14.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11467
11683
|
status: updateStatusSchema.optional(),
|
|
11468
11684
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
11469
|
-
content:
|
|
11685
|
+
content: z14.record(z14.string(), z14.unknown()).optional()
|
|
11470
11686
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11471
|
-
var adCreateSchema2 =
|
|
11472
|
-
name:
|
|
11687
|
+
var adCreateSchema2 = z14.object({
|
|
11688
|
+
name: z14.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
11473
11689
|
adset_id: parentRefSchema2,
|
|
11474
11690
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11475
|
-
creative:
|
|
11691
|
+
creative: z14.object({ creative_id: parentRefSchema2 }),
|
|
11476
11692
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
11477
|
-
tracking_specs:
|
|
11693
|
+
tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
|
|
11478
11694
|
});
|
|
11479
|
-
var adUpdateSchema2 =
|
|
11480
|
-
name:
|
|
11695
|
+
var adUpdateSchema2 = z14.object({
|
|
11696
|
+
name: z14.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
11481
11697
|
status: updateStatusSchema.optional(),
|
|
11482
11698
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
11483
|
-
creative:
|
|
11484
|
-
tracking_specs:
|
|
11699
|
+
creative: z14.object({ creative_id: parentRefSchema2 }).optional(),
|
|
11700
|
+
tracking_specs: z14.array(z14.record(z14.string(), z14.unknown())).optional()
|
|
11485
11701
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11486
|
-
var lookalikeSpecSchema =
|
|
11487
|
-
origin:
|
|
11488
|
-
ratio:
|
|
11489
|
-
country:
|
|
11490
|
-
});
|
|
11491
|
-
var customAudienceCreateSchema =
|
|
11492
|
-
name:
|
|
11493
|
-
subtype:
|
|
11494
|
-
description:
|
|
11495
|
-
customer_file_source:
|
|
11496
|
-
retention_days:
|
|
11702
|
+
var lookalikeSpecSchema = z14.object({
|
|
11703
|
+
origin: z14.array(z14.object({ id: parentRefSchema2 })).min(1),
|
|
11704
|
+
ratio: z14.number().min(0.01).max(0.2).optional(),
|
|
11705
|
+
country: z14.string().length(2).optional()
|
|
11706
|
+
});
|
|
11707
|
+
var customAudienceCreateSchema = z14.object({
|
|
11708
|
+
name: z14.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
11709
|
+
subtype: z14.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
11710
|
+
description: z14.string().max(500).optional(),
|
|
11711
|
+
customer_file_source: z14.string().optional(),
|
|
11712
|
+
retention_days: z14.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
11497
11713
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
11498
11714
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
11499
|
-
rule:
|
|
11715
|
+
rule: z14.record(z14.string(), z14.unknown()).optional()
|
|
11500
11716
|
}).superRefine((p, ctx) => {
|
|
11501
11717
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
11502
11718
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -11505,16 +11721,16 @@ var customAudienceCreateSchema = z13.object({
|
|
|
11505
11721
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
11506
11722
|
}
|
|
11507
11723
|
});
|
|
11508
|
-
var customAudienceUpdateSchema =
|
|
11509
|
-
name:
|
|
11510
|
-
description:
|
|
11724
|
+
var customAudienceUpdateSchema = z14.object({
|
|
11725
|
+
name: z14.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
11726
|
+
description: z14.string().max(500).optional()
|
|
11511
11727
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11512
|
-
var mediaUploadSchema =
|
|
11513
|
-
kind:
|
|
11728
|
+
var mediaUploadSchema = z14.object({
|
|
11729
|
+
kind: z14.enum(MEDIA_KINDS),
|
|
11514
11730
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
11515
11731
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
11516
11732
|
/** Optional display name / filename hint. */
|
|
11517
|
-
name:
|
|
11733
|
+
name: z14.string().max(255).optional()
|
|
11518
11734
|
}).superRefine((p, ctx) => {
|
|
11519
11735
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
11520
11736
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -11536,16 +11752,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
11536
11752
|
"customAudience.update",
|
|
11537
11753
|
"media.upload"
|
|
11538
11754
|
];
|
|
11539
|
-
var metaDraftOpKindSchema =
|
|
11540
|
-
var accountIdSchema2 =
|
|
11541
|
-
var updateTargetSchema2 =
|
|
11755
|
+
var metaDraftOpKindSchema = z14.enum(META_DRAFT_OP_KINDS);
|
|
11756
|
+
var accountIdSchema2 = z14.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
11757
|
+
var updateTargetSchema2 = z14.union([z14.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
11542
11758
|
function createOp3(kind, payload) {
|
|
11543
|
-
return
|
|
11759
|
+
return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, payload });
|
|
11544
11760
|
}
|
|
11545
11761
|
function updateOp3(kind, payload) {
|
|
11546
|
-
return
|
|
11762
|
+
return z14.object({ kind: z14.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
11547
11763
|
}
|
|
11548
|
-
var metaDraftOpInputSchema =
|
|
11764
|
+
var metaDraftOpInputSchema = z14.discriminatedUnion("kind", [
|
|
11549
11765
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
11550
11766
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
11551
11767
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -11560,89 +11776,89 @@ var metaDraftOpInputSchema = z13.discriminatedUnion("kind", [
|
|
|
11560
11776
|
]);
|
|
11561
11777
|
|
|
11562
11778
|
// ../api/src/ads-meta/wire.ts
|
|
11563
|
-
import { z as
|
|
11564
|
-
var metaWriteModeSchema =
|
|
11565
|
-
var metaDraftOpResultSchema =
|
|
11566
|
-
status:
|
|
11779
|
+
import { z as z15 } from "zod";
|
|
11780
|
+
var metaWriteModeSchema = z15.enum(["live", "simulated"]);
|
|
11781
|
+
var metaDraftOpResultSchema = z15.object({
|
|
11782
|
+
status: z15.enum(["applied", "simulated", "failed", "skipped"]),
|
|
11567
11783
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
11568
|
-
id:
|
|
11784
|
+
id: z15.string().optional(),
|
|
11569
11785
|
/** For media.upload ops: the resulting image hash. */
|
|
11570
|
-
hash:
|
|
11571
|
-
error:
|
|
11572
|
-
skippedBecause:
|
|
11573
|
-
executedAt:
|
|
11786
|
+
hash: z15.string().optional(),
|
|
11787
|
+
error: z15.string().optional(),
|
|
11788
|
+
skippedBecause: z15.string().optional(),
|
|
11789
|
+
executedAt: z15.number().optional()
|
|
11574
11790
|
});
|
|
11575
|
-
var metaDraftStageRequestSchema =
|
|
11576
|
-
chatId:
|
|
11791
|
+
var metaDraftStageRequestSchema = z15.object({
|
|
11792
|
+
chatId: z15.string(),
|
|
11577
11793
|
op: metaDraftOpInputSchema
|
|
11578
11794
|
});
|
|
11579
|
-
var metaDraftStageResponseSchema =
|
|
11580
|
-
staged:
|
|
11581
|
-
ref:
|
|
11795
|
+
var metaDraftStageResponseSchema = z15.object({
|
|
11796
|
+
staged: z15.literal(true),
|
|
11797
|
+
ref: z15.string(),
|
|
11582
11798
|
kind: metaDraftOpKindSchema,
|
|
11583
11799
|
mode: metaWriteModeSchema,
|
|
11584
|
-
dependsOn:
|
|
11585
|
-
summary:
|
|
11586
|
-
warnings:
|
|
11800
|
+
dependsOn: z15.array(z15.string()),
|
|
11801
|
+
summary: z15.string(),
|
|
11802
|
+
warnings: z15.array(z15.string()),
|
|
11587
11803
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
11588
|
-
amended:
|
|
11589
|
-
});
|
|
11590
|
-
var metaDraftDuplicateRequestSchema =
|
|
11591
|
-
chatId:
|
|
11592
|
-
accountId:
|
|
11593
|
-
entity:
|
|
11594
|
-
sourceId:
|
|
11595
|
-
overrides:
|
|
11804
|
+
amended: z15.boolean().optional()
|
|
11805
|
+
});
|
|
11806
|
+
var metaDraftDuplicateRequestSchema = z15.object({
|
|
11807
|
+
chatId: z15.string(),
|
|
11808
|
+
accountId: z15.string(),
|
|
11809
|
+
entity: z15.enum(["campaign", "adSet", "ad"]),
|
|
11810
|
+
sourceId: z15.string(),
|
|
11811
|
+
overrides: z15.record(z15.string(), z15.unknown()).optional(),
|
|
11596
11812
|
/** Pause the original after the copy publishes. */
|
|
11597
|
-
replace:
|
|
11813
|
+
replace: z15.boolean().optional()
|
|
11598
11814
|
});
|
|
11599
|
-
var metaDraftOpViewSchema =
|
|
11600
|
-
ref:
|
|
11815
|
+
var metaDraftOpViewSchema = z15.object({
|
|
11816
|
+
ref: z15.string(),
|
|
11601
11817
|
kind: metaDraftOpKindSchema,
|
|
11602
|
-
accountId:
|
|
11603
|
-
target:
|
|
11604
|
-
dependsOn:
|
|
11605
|
-
summary:
|
|
11606
|
-
stagedAt:
|
|
11818
|
+
accountId: z15.string(),
|
|
11819
|
+
target: z15.string().optional(),
|
|
11820
|
+
dependsOn: z15.array(z15.string()),
|
|
11821
|
+
summary: z15.string(),
|
|
11822
|
+
stagedAt: z15.number(),
|
|
11607
11823
|
result: metaDraftOpResultSchema.optional()
|
|
11608
11824
|
});
|
|
11609
|
-
var metaDraftListRequestSchema =
|
|
11610
|
-
chatId:
|
|
11825
|
+
var metaDraftListRequestSchema = z15.object({
|
|
11826
|
+
chatId: z15.string()
|
|
11611
11827
|
});
|
|
11612
|
-
var metaDraftAdvisorySchema =
|
|
11613
|
-
ref:
|
|
11614
|
-
message:
|
|
11828
|
+
var metaDraftAdvisorySchema = z15.object({
|
|
11829
|
+
ref: z15.string(),
|
|
11830
|
+
message: z15.string()
|
|
11615
11831
|
});
|
|
11616
|
-
var metaDraftListResponseSchema =
|
|
11617
|
-
status:
|
|
11832
|
+
var metaDraftListResponseSchema = z15.object({
|
|
11833
|
+
status: z15.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
11618
11834
|
mode: metaWriteModeSchema,
|
|
11619
|
-
count:
|
|
11620
|
-
ops:
|
|
11835
|
+
count: z15.number(),
|
|
11836
|
+
ops: z15.array(metaDraftOpViewSchema),
|
|
11621
11837
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
11622
|
-
advisories:
|
|
11838
|
+
advisories: z15.array(metaDraftAdvisorySchema)
|
|
11623
11839
|
});
|
|
11624
|
-
var metaDraftRemoveRequestSchema =
|
|
11625
|
-
chatId:
|
|
11626
|
-
ref:
|
|
11840
|
+
var metaDraftRemoveRequestSchema = z15.object({
|
|
11841
|
+
chatId: z15.string(),
|
|
11842
|
+
ref: z15.string()
|
|
11627
11843
|
});
|
|
11628
|
-
var metaDraftRemoveResponseSchema =
|
|
11844
|
+
var metaDraftRemoveResponseSchema = z15.object({
|
|
11629
11845
|
/** The requested ref plus any dependents removed by cascade. */
|
|
11630
|
-
removed:
|
|
11846
|
+
removed: z15.array(z15.string())
|
|
11631
11847
|
});
|
|
11632
|
-
var metaDraftClearRequestSchema =
|
|
11633
|
-
chatId:
|
|
11848
|
+
var metaDraftClearRequestSchema = z15.object({
|
|
11849
|
+
chatId: z15.string()
|
|
11634
11850
|
});
|
|
11635
|
-
var metaDraftClearResponseSchema =
|
|
11636
|
-
cleared:
|
|
11851
|
+
var metaDraftClearResponseSchema = z15.object({
|
|
11852
|
+
cleared: z15.number()
|
|
11637
11853
|
});
|
|
11638
|
-
var metaFieldErrorSchema =
|
|
11639
|
-
path:
|
|
11640
|
-
message:
|
|
11854
|
+
var metaFieldErrorSchema = z15.object({
|
|
11855
|
+
path: z15.string(),
|
|
11856
|
+
message: z15.string()
|
|
11641
11857
|
});
|
|
11642
|
-
var metaDraftErrorResponseSchema =
|
|
11643
|
-
code:
|
|
11644
|
-
error:
|
|
11645
|
-
fields:
|
|
11858
|
+
var metaDraftErrorResponseSchema = z15.object({
|
|
11859
|
+
code: z15.string(),
|
|
11860
|
+
error: z15.string(),
|
|
11861
|
+
fields: z15.array(metaFieldErrorSchema).optional()
|
|
11646
11862
|
});
|
|
11647
11863
|
|
|
11648
11864
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -15055,7 +15271,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
15055
15271
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
15056
15272
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
15057
15273
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
15058
|
-
import { z as
|
|
15274
|
+
import { z as z16 } from "zod";
|
|
15059
15275
|
|
|
15060
15276
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
15061
15277
|
var SHOOT_MODES = [
|
|
@@ -15391,71 +15607,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
15391
15607
|
"{{out.video}}"
|
|
15392
15608
|
];
|
|
15393
15609
|
}
|
|
15394
|
-
var FrameAsset =
|
|
15395
|
-
var DialogueLine =
|
|
15396
|
-
speaker:
|
|
15397
|
-
line:
|
|
15610
|
+
var FrameAsset = z16.object({ url: z16.string().optional() }).loose().optional();
|
|
15611
|
+
var DialogueLine = z16.object({
|
|
15612
|
+
speaker: z16.string().optional(),
|
|
15613
|
+
line: z16.string().optional(),
|
|
15398
15614
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
15399
|
-
start_s:
|
|
15400
|
-
end_s:
|
|
15401
|
-
delivery:
|
|
15402
|
-
voice_description:
|
|
15615
|
+
start_s: z16.number().optional(),
|
|
15616
|
+
end_s: z16.number().optional(),
|
|
15617
|
+
delivery: z16.string().optional(),
|
|
15618
|
+
voice_description: z16.string().optional(),
|
|
15403
15619
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
15404
15620
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
15405
15621
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
15406
15622
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
15407
15623
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
15408
|
-
on_camera:
|
|
15624
|
+
on_camera: z16.boolean().optional()
|
|
15409
15625
|
}).loose();
|
|
15410
|
-
var Sfx =
|
|
15411
|
-
at_s:
|
|
15412
|
-
duration_s:
|
|
15413
|
-
sound_effect_prompt:
|
|
15414
|
-
description:
|
|
15626
|
+
var Sfx = z16.object({
|
|
15627
|
+
at_s: z16.number().optional(),
|
|
15628
|
+
duration_s: z16.number().optional(),
|
|
15629
|
+
sound_effect_prompt: z16.string().optional(),
|
|
15630
|
+
description: z16.string().optional()
|
|
15415
15631
|
}).loose();
|
|
15416
|
-
var CompositionRegion =
|
|
15632
|
+
var CompositionRegion = z16.object({
|
|
15417
15633
|
// full | top | bottom | left | right | inset
|
|
15418
|
-
panel:
|
|
15634
|
+
panel: z16.string().optional(),
|
|
15419
15635
|
// 9-grid anchor for an `inset` presenter box.
|
|
15420
|
-
position:
|
|
15421
|
-
is_presenter:
|
|
15636
|
+
position: z16.string().optional(),
|
|
15637
|
+
is_presenter: z16.boolean().optional(),
|
|
15422
15638
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
15423
|
-
cast_ref:
|
|
15639
|
+
cast_ref: z16.string().optional(),
|
|
15424
15640
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
15425
15641
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
15426
15642
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
15427
15643
|
// overlay layer, never AI-generated.
|
|
15428
|
-
kind:
|
|
15644
|
+
kind: z16.string().optional(),
|
|
15429
15645
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
15430
15646
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
15431
15647
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
15432
15648
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
15433
15649
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
15434
15650
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
15435
|
-
surface_id:
|
|
15651
|
+
surface_id: z16.string().optional(),
|
|
15436
15652
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
15437
15653
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
15438
15654
|
// must re-composite, not paint into the surface.
|
|
15439
|
-
nested:
|
|
15440
|
-
summary:
|
|
15441
|
-
frame_prompt:
|
|
15442
|
-
motion_prompt:
|
|
15655
|
+
nested: z16.array(z16.object({}).loose()).optional(),
|
|
15656
|
+
summary: z16.string().optional(),
|
|
15657
|
+
frame_prompt: z16.string().optional(),
|
|
15658
|
+
motion_prompt: z16.string().optional()
|
|
15443
15659
|
}).loose();
|
|
15444
|
-
var SceneComposition =
|
|
15660
|
+
var SceneComposition = z16.object({
|
|
15445
15661
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
15446
|
-
layout:
|
|
15662
|
+
layout: z16.string().optional(),
|
|
15447
15663
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
15448
|
-
split_axis:
|
|
15449
|
-
regions:
|
|
15664
|
+
split_axis: z16.string().optional(),
|
|
15665
|
+
regions: z16.array(CompositionRegion).optional()
|
|
15450
15666
|
}).loose();
|
|
15451
|
-
var CameraMotion =
|
|
15452
|
-
var TranscriptWord =
|
|
15453
|
-
var Scene =
|
|
15454
|
-
start_s:
|
|
15455
|
-
end_s:
|
|
15456
|
-
duration_s:
|
|
15457
|
-
summary:
|
|
15458
|
-
action_detail:
|
|
15667
|
+
var CameraMotion = z16.object({ movement: z16.string().optional(), detail: z16.string().optional() }).loose();
|
|
15668
|
+
var TranscriptWord = z16.object({ text: z16.string().optional() }).loose();
|
|
15669
|
+
var Scene = z16.object({
|
|
15670
|
+
start_s: z16.number().optional(),
|
|
15671
|
+
end_s: z16.number().optional(),
|
|
15672
|
+
duration_s: z16.number().optional(),
|
|
15673
|
+
summary: z16.string().optional(),
|
|
15674
|
+
action_detail: z16.string().optional(),
|
|
15459
15675
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
15460
15676
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
15461
15677
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -15463,82 +15679,82 @@ var Scene = z15.object({
|
|
|
15463
15679
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
15464
15680
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
15465
15681
|
// UGC/product mode; a human can override per scene by setting this.
|
|
15466
|
-
shoot_mode:
|
|
15682
|
+
shoot_mode: z16.string().optional(),
|
|
15467
15683
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
15468
15684
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
15469
|
-
ambient:
|
|
15685
|
+
ambient: z16.string().optional(),
|
|
15470
15686
|
camera_motion: CameraMotion.optional(),
|
|
15471
|
-
start_frame_prompt:
|
|
15472
|
-
end_frame_prompt:
|
|
15473
|
-
motion_prompt:
|
|
15687
|
+
start_frame_prompt: z16.string().optional(),
|
|
15688
|
+
end_frame_prompt: z16.string().optional(),
|
|
15689
|
+
motion_prompt: z16.string().optional(),
|
|
15474
15690
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
15475
15691
|
// script re-craft checklist. Inferred from position when absent.
|
|
15476
|
-
narrative_role:
|
|
15692
|
+
narrative_role: z16.string().optional(),
|
|
15477
15693
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
15478
15694
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
15479
15695
|
// into the hook's start-frame description so the generator renders that state,
|
|
15480
15696
|
// not a calm influencer (CCA-11).
|
|
15481
|
-
hook_mechanic:
|
|
15697
|
+
hook_mechanic: z16.object({ mechanic: z16.string().optional(), why_it_stops_scroll: z16.string().optional() }).loose().optional(),
|
|
15482
15698
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
15483
|
-
scene_setting:
|
|
15699
|
+
scene_setting: z16.string().optional(),
|
|
15484
15700
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
15485
15701
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
15486
15702
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
15487
15703
|
// ignored (nothing follows it).
|
|
15488
|
-
transition_out:
|
|
15489
|
-
dialogue:
|
|
15490
|
-
sfx:
|
|
15491
|
-
overlays:
|
|
15492
|
-
floating_elements:
|
|
15704
|
+
transition_out: z16.object({ type: z16.string().optional(), description: z16.string().optional() }).loose().optional(),
|
|
15705
|
+
dialogue: z16.array(DialogueLine).optional(),
|
|
15706
|
+
sfx: z16.array(Sfx).optional(),
|
|
15707
|
+
overlays: z16.array(z16.unknown()).optional(),
|
|
15708
|
+
floating_elements: z16.array(z16.unknown()).optional(),
|
|
15493
15709
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
15494
15710
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
15495
15711
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
15496
15712
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
15497
|
-
motion_level:
|
|
15498
|
-
transcript_slice:
|
|
15713
|
+
motion_level: z16.enum(["static", "subtle", "dynamic"]).optional(),
|
|
15714
|
+
transcript_slice: z16.array(TranscriptWord).optional(),
|
|
15499
15715
|
start_frame_asset: FrameAsset,
|
|
15500
15716
|
end_frame_asset: FrameAsset,
|
|
15501
15717
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
15502
15718
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
15503
15719
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
15504
15720
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
15505
|
-
continues_previous:
|
|
15721
|
+
continues_previous: z16.boolean().optional()
|
|
15506
15722
|
}).loose();
|
|
15507
|
-
var VideoBlueprint =
|
|
15508
|
-
source:
|
|
15509
|
-
global:
|
|
15510
|
-
music:
|
|
15511
|
-
present:
|
|
15512
|
-
music_prompt:
|
|
15723
|
+
var VideoBlueprint = z16.object({
|
|
15724
|
+
source: z16.object({ aspect_ratio: z16.string().optional(), duration_s: z16.number().optional() }).loose().optional(),
|
|
15725
|
+
global: z16.object({
|
|
15726
|
+
music: z16.object({
|
|
15727
|
+
present: z16.boolean().optional(),
|
|
15728
|
+
music_prompt: z16.string().optional(),
|
|
15513
15729
|
// Absolute second the music enters in the reference (the bed often
|
|
15514
15730
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
15515
15731
|
// instead of at 0 so the timing matches.
|
|
15516
|
-
starts_at_s:
|
|
15732
|
+
starts_at_s: z16.number().optional(),
|
|
15517
15733
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
15518
15734
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
15519
|
-
identified_track:
|
|
15735
|
+
identified_track: z16.object({ title: z16.string().optional(), artist: z16.string().optional() }).loose().nullish()
|
|
15520
15736
|
}).loose().optional(),
|
|
15521
|
-
cast:
|
|
15522
|
-
|
|
15523
|
-
id:
|
|
15524
|
-
description:
|
|
15737
|
+
cast: z16.array(
|
|
15738
|
+
z16.object({
|
|
15739
|
+
id: z16.string().optional(),
|
|
15740
|
+
description: z16.string().optional(),
|
|
15525
15741
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
15526
15742
|
// French speaker") — read to derive the spoken-track language code.
|
|
15527
|
-
market_localization_note:
|
|
15743
|
+
market_localization_note: z16.string().optional()
|
|
15528
15744
|
}).loose()
|
|
15529
15745
|
).optional(),
|
|
15530
|
-
voiceover:
|
|
15746
|
+
voiceover: z16.object({
|
|
15531
15747
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
15532
15748
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
15533
|
-
mode:
|
|
15534
|
-
voice_description:
|
|
15535
|
-
persona:
|
|
15749
|
+
mode: z16.string().optional(),
|
|
15750
|
+
voice_description: z16.string().optional(),
|
|
15751
|
+
persona: z16.string().optional()
|
|
15536
15752
|
}).loose().optional(),
|
|
15537
15753
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
15538
15754
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
15539
|
-
style:
|
|
15755
|
+
style: z16.object({ palette: z16.array(z16.object({ hex: z16.string().optional() }).loose()).optional() }).loose().optional()
|
|
15540
15756
|
}).loose().optional(),
|
|
15541
|
-
scenes:
|
|
15757
|
+
scenes: z16.array(Scene).min(1)
|
|
15542
15758
|
}).loose();
|
|
15543
15759
|
function injectHookPhysicality(blueprint) {
|
|
15544
15760
|
for (const scene of blueprint.scenes) {
|
|
@@ -15555,26 +15771,26 @@ function clipIntentOf(scene, sceneIndex) {
|
|
|
15555
15771
|
if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
|
|
15556
15772
|
return "body";
|
|
15557
15773
|
}
|
|
15558
|
-
var AppearsItem =
|
|
15559
|
-
var RecurringElement =
|
|
15774
|
+
var AppearsItem = z16.union([z16.number(), z16.object({ scene: z16.number(), edge: z16.string().optional() }).loose()]);
|
|
15775
|
+
var RecurringElement = z16.object({
|
|
15560
15776
|
// person | animal | product | logo | badge | other
|
|
15561
|
-
type:
|
|
15562
|
-
label:
|
|
15563
|
-
description:
|
|
15564
|
-
expression:
|
|
15777
|
+
type: z16.string(),
|
|
15778
|
+
label: z16.string().optional(),
|
|
15779
|
+
description: z16.string().optional(),
|
|
15780
|
+
expression: z16.string().nullable().optional(),
|
|
15565
15781
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
15566
|
-
cast_id:
|
|
15782
|
+
cast_id: z16.string().nullable().optional(),
|
|
15567
15783
|
// The label of another element that is the SAME individual as this one, shown
|
|
15568
15784
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
15569
15785
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
15570
15786
|
// slot, but the face/identity must stay identical across them.
|
|
15571
|
-
same_as:
|
|
15787
|
+
same_as: z16.string().nullable().optional(),
|
|
15572
15788
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
15573
15789
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
15574
|
-
scenes:
|
|
15575
|
-
appears_in:
|
|
15790
|
+
scenes: z16.array(z16.number()).optional(),
|
|
15791
|
+
appears_in: z16.array(AppearsItem).optional()
|
|
15576
15792
|
}).loose();
|
|
15577
|
-
var RecurringElements =
|
|
15793
|
+
var RecurringElements = z16.array(RecurringElement);
|
|
15578
15794
|
function sanitizeId(raw, fallback) {
|
|
15579
15795
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
15580
15796
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -16047,7 +16263,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
16047
16263
|
return kept;
|
|
16048
16264
|
}
|
|
16049
16265
|
function sceneFloatDescs(scene) {
|
|
16050
|
-
const floats =
|
|
16266
|
+
const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
16051
16267
|
if (!floats.success) return [];
|
|
16052
16268
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
16053
16269
|
}
|
|
@@ -17471,25 +17687,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
|
|
|
17471
17687
|
}
|
|
17472
17688
|
return tracks;
|
|
17473
17689
|
}
|
|
17474
|
-
var OverlayStyle =
|
|
17475
|
-
var Overlay =
|
|
17476
|
-
text:
|
|
17477
|
-
appears_at_s:
|
|
17478
|
-
duration_s:
|
|
17479
|
-
position:
|
|
17480
|
-
role:
|
|
17481
|
-
animation:
|
|
17482
|
-
animation_detail:
|
|
17690
|
+
var OverlayStyle = z16.object({ color_hex: z16.string().optional(), background: z16.string().optional(), size: z16.string().optional() }).loose();
|
|
17691
|
+
var Overlay = z16.object({
|
|
17692
|
+
text: z16.string().optional(),
|
|
17693
|
+
appears_at_s: z16.number().optional(),
|
|
17694
|
+
duration_s: z16.number().optional(),
|
|
17695
|
+
position: z16.string().optional(),
|
|
17696
|
+
role: z16.string().optional(),
|
|
17697
|
+
animation: z16.string().optional(),
|
|
17698
|
+
animation_detail: z16.string().optional(),
|
|
17483
17699
|
style: OverlayStyle.optional()
|
|
17484
17700
|
}).loose();
|
|
17485
|
-
var FloatingElement =
|
|
17486
|
-
kind:
|
|
17487
|
-
description:
|
|
17488
|
-
brand_name:
|
|
17489
|
-
what_it_represents:
|
|
17490
|
-
appears_at_s:
|
|
17491
|
-
duration_s:
|
|
17492
|
-
position:
|
|
17701
|
+
var FloatingElement = z16.object({
|
|
17702
|
+
kind: z16.string().optional(),
|
|
17703
|
+
description: z16.string().optional(),
|
|
17704
|
+
brand_name: z16.string().nullish(),
|
|
17705
|
+
what_it_represents: z16.string().optional(),
|
|
17706
|
+
appears_at_s: z16.number().optional(),
|
|
17707
|
+
duration_s: z16.number().optional(),
|
|
17708
|
+
position: z16.string().optional()
|
|
17493
17709
|
}).loose();
|
|
17494
17710
|
function escapeHtml(s) {
|
|
17495
17711
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -17521,7 +17737,7 @@ function positionClass(position) {
|
|
|
17521
17737
|
function collectCaptions(blueprint, clock) {
|
|
17522
17738
|
return blueprint.scenes.flatMap((scene, i) => {
|
|
17523
17739
|
const sceneStart = scene.start_s ?? 0;
|
|
17524
|
-
const overlays =
|
|
17740
|
+
const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17525
17741
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
17526
17742
|
const at = clock.map(i, ov.appears_at_s ?? sceneStart);
|
|
17527
17743
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -17601,7 +17817,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
|
|
|
17601
17817
|
const windows = /* @__PURE__ */ new Map();
|
|
17602
17818
|
blueprint.scenes.forEach((scene, i) => {
|
|
17603
17819
|
const sceneStart = scene.start_s ?? 0;
|
|
17604
|
-
const floats =
|
|
17820
|
+
const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
17605
17821
|
if (!floats.success) return;
|
|
17606
17822
|
for (const fe of floats.data) {
|
|
17607
17823
|
const at = clock.map(i, fe.appears_at_s ?? sceneStart);
|
|
@@ -18049,8 +18265,8 @@ function buildMotionBoard(blueprint) {
|
|
|
18049
18265
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
18050
18266
|
cursor = end_s;
|
|
18051
18267
|
const spoken = sceneSpokenText(scene);
|
|
18052
|
-
const overlays =
|
|
18053
|
-
const floats =
|
|
18268
|
+
const overlays = z16.array(Overlay).safeParse(scene.overlays ?? []);
|
|
18269
|
+
const floats = z16.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
18054
18270
|
const graphics = [
|
|
18055
18271
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
18056
18272
|
kind: "text",
|
|
@@ -19485,7 +19701,7 @@ import path17 from "path";
|
|
|
19485
19701
|
import { defineCommand as defineCommand91 } from "citty";
|
|
19486
19702
|
|
|
19487
19703
|
// src/engine/scaffold/staticAd.ts
|
|
19488
|
-
import { z as
|
|
19704
|
+
import { z as z17 } from "zod";
|
|
19489
19705
|
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"]);
|
|
19490
19706
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
19491
19707
|
var SHEET_SUBJECT_TYPE2 = {
|
|
@@ -19497,24 +19713,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
|
|
|
19497
19713
|
var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
|
|
19498
19714
|
var ADAPT_IMAGE_SIZE = "2K";
|
|
19499
19715
|
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.";
|
|
19500
|
-
var Blueprint =
|
|
19501
|
-
meta:
|
|
19502
|
-
text_content:
|
|
19716
|
+
var Blueprint = z17.object({
|
|
19717
|
+
meta: z17.object({ estimated_aspect_ratio: z17.string().optional() }).loose().optional(),
|
|
19718
|
+
text_content: z17.array(z17.object({ text: z17.string().optional() }).loose()).optional()
|
|
19503
19719
|
}).loose();
|
|
19504
|
-
var ElementLocator =
|
|
19505
|
-
collection:
|
|
19506
|
-
index:
|
|
19720
|
+
var ElementLocator = z17.object({
|
|
19721
|
+
collection: z17.enum(["subjects", "people", "brands_logos"]),
|
|
19722
|
+
index: z17.number().int().nonnegative()
|
|
19507
19723
|
}).loose();
|
|
19508
|
-
var MainElement =
|
|
19724
|
+
var MainElement = z17.object({
|
|
19509
19725
|
// logo | product | person | animal | badge | other
|
|
19510
|
-
type:
|
|
19511
|
-
label:
|
|
19512
|
-
description:
|
|
19513
|
-
expression:
|
|
19514
|
-
reason:
|
|
19726
|
+
type: z17.string(),
|
|
19727
|
+
label: z17.string().optional(),
|
|
19728
|
+
description: z17.string().optional(),
|
|
19729
|
+
expression: z17.string().nullable().optional(),
|
|
19730
|
+
reason: z17.string().optional(),
|
|
19515
19731
|
locator: ElementLocator.optional()
|
|
19516
19732
|
}).loose();
|
|
19517
|
-
var MainElements =
|
|
19733
|
+
var MainElements = z17.array(MainElement);
|
|
19518
19734
|
function sanitizeId2(raw, fallback) {
|
|
19519
19735
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
19520
19736
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -21299,11 +21515,242 @@ Subcommands:
|
|
|
21299
21515
|
}
|
|
21300
21516
|
});
|
|
21301
21517
|
|
|
21518
|
+
// src/commands/chats/index.ts
|
|
21519
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
21520
|
+
var STATUS_GROUPS = ["active", "archived", "all"];
|
|
21521
|
+
var REPO_SURFACES = ["knowledge", "company", "brand", "landings", "flows", "creatives"];
|
|
21522
|
+
function parseBoundedInt(raw, name, min, max) {
|
|
21523
|
+
if (raw === void 0) {
|
|
21524
|
+
return void 0;
|
|
21525
|
+
}
|
|
21526
|
+
const value = Number.parseInt(raw, 10);
|
|
21527
|
+
if (Number.isNaN(value) || value < min || value > max) {
|
|
21528
|
+
throw new Error(`--${name} must be an integer between ${min} and ${max}`);
|
|
21529
|
+
}
|
|
21530
|
+
return value;
|
|
21531
|
+
}
|
|
21532
|
+
registerSchema({
|
|
21533
|
+
command: "chats.list",
|
|
21534
|
+
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.",
|
|
21535
|
+
args: {
|
|
21536
|
+
status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
|
|
21537
|
+
limit: { type: "string", description: "Max Sessions to return, 1-100 (default: 20)", required: false },
|
|
21538
|
+
full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
|
|
21539
|
+
}
|
|
21540
|
+
});
|
|
21541
|
+
var listCommand5 = defineCommand96({
|
|
21542
|
+
meta: { name: "list", description: "List other Sessions on this account, newest first." },
|
|
21543
|
+
args: {
|
|
21544
|
+
status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
|
|
21545
|
+
limit: { type: "string", description: "Max Sessions (1-100, default 20)", required: false },
|
|
21546
|
+
full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
|
|
21547
|
+
},
|
|
21548
|
+
run: async ({ args }) => {
|
|
21549
|
+
try {
|
|
21550
|
+
const body = {};
|
|
21551
|
+
if (args.status) {
|
|
21552
|
+
if (!STATUS_GROUPS.includes(args.status)) {
|
|
21553
|
+
throw new Error(`--status must be one of: ${STATUS_GROUPS.join("|")}`);
|
|
21554
|
+
}
|
|
21555
|
+
body.status = args.status;
|
|
21556
|
+
}
|
|
21557
|
+
const limit = parseBoundedInt(args.limit, "limit", 1, 100);
|
|
21558
|
+
if (limit !== void 0) {
|
|
21559
|
+
body.limit = limit;
|
|
21560
|
+
}
|
|
21561
|
+
if (args.full) {
|
|
21562
|
+
body.full = true;
|
|
21563
|
+
}
|
|
21564
|
+
const selfChatId = getEnv().BAKER_CHAT_ID;
|
|
21565
|
+
if (selfChatId) {
|
|
21566
|
+
body.excludeChatId = selfChatId;
|
|
21567
|
+
}
|
|
21568
|
+
const response = await apiPost("/api/chats/list", body);
|
|
21569
|
+
writeJson({
|
|
21570
|
+
...response,
|
|
21571
|
+
meta: { count: response.data.chats.length },
|
|
21572
|
+
...response.data.chats.length === 0 ? { hints: ["No Sessions matched. Widen with --status all or a larger --limit."] } : {
|
|
21573
|
+
hints: [
|
|
21574
|
+
"Drill in: `baker chats view <id>` for outputs, `chats transcript <id>` for the conversation, `chats diff <id>` for the real file changes."
|
|
21575
|
+
]
|
|
21576
|
+
}
|
|
21577
|
+
});
|
|
21578
|
+
} catch (err) {
|
|
21579
|
+
failApi(err);
|
|
21580
|
+
}
|
|
21581
|
+
}
|
|
21582
|
+
});
|
|
21583
|
+
registerSchema({
|
|
21584
|
+
command: "chats.view",
|
|
21585
|
+
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.",
|
|
21586
|
+
args: {
|
|
21587
|
+
id: { type: "positional", description: "The Session id (from `baker chats list`)", required: true },
|
|
21588
|
+
full: {
|
|
21589
|
+
type: "boolean",
|
|
21590
|
+
description: "No-op today; view already returns full effect detail",
|
|
21591
|
+
required: false,
|
|
21592
|
+
default: false
|
|
21593
|
+
}
|
|
21594
|
+
}
|
|
21595
|
+
});
|
|
21596
|
+
var viewCommand = defineCommand96({
|
|
21597
|
+
meta: {
|
|
21598
|
+
name: "view",
|
|
21599
|
+
description: "Inspect one Session's full effects \u2014 git content + actions/tags/ads, kickoff, commits."
|
|
21600
|
+
},
|
|
21601
|
+
args: {
|
|
21602
|
+
id: { type: "positional", description: "The Session id", required: true },
|
|
21603
|
+
full: { type: "boolean", description: "Include full detail", required: false, default: false }
|
|
21604
|
+
},
|
|
21605
|
+
run: async ({ args }) => {
|
|
21606
|
+
try {
|
|
21607
|
+
const response = await apiPost("/api/chats/view", {
|
|
21608
|
+
chatId: args.id,
|
|
21609
|
+
...args.full ? { full: true } : {}
|
|
21610
|
+
});
|
|
21611
|
+
const hints = [];
|
|
21612
|
+
if (response.data.diffAvailable) {
|
|
21613
|
+
hints.push("See the real file-level diff of the git content with `baker chats diff <id> --full`.");
|
|
21614
|
+
} else if (response.data.status === "in_progress" || response.data.status === "publishing") {
|
|
21615
|
+
hints.push(
|
|
21616
|
+
"This Session is still in progress \u2014 read its current file changes with `baker chats diff <id> --live`."
|
|
21617
|
+
);
|
|
21618
|
+
}
|
|
21619
|
+
hints.push("Read the conversation with `baker chats transcript <id>`.");
|
|
21620
|
+
writeJson({ ...response, hints });
|
|
21621
|
+
} catch (err) {
|
|
21622
|
+
failApi(err);
|
|
21623
|
+
}
|
|
21624
|
+
}
|
|
21625
|
+
});
|
|
21626
|
+
registerSchema({
|
|
21627
|
+
command: "chats.transcript",
|
|
21628
|
+
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.",
|
|
21629
|
+
args: {
|
|
21630
|
+
id: { type: "positional", description: "The Session id", required: true },
|
|
21631
|
+
limit: { type: "string", description: "Max messages to return, 1-1000 (default: 100)", required: false },
|
|
21632
|
+
full: {
|
|
21633
|
+
type: "boolean",
|
|
21634
|
+
description: "Return verbatim (untruncated) message text",
|
|
21635
|
+
required: false,
|
|
21636
|
+
default: false
|
|
21637
|
+
}
|
|
21638
|
+
}
|
|
21639
|
+
});
|
|
21640
|
+
var transcriptCommand = defineCommand96({
|
|
21641
|
+
meta: { name: "transcript", description: "Read another Session's conversation." },
|
|
21642
|
+
args: {
|
|
21643
|
+
id: { type: "positional", description: "The Session id", required: true },
|
|
21644
|
+
limit: { type: "string", description: "Max messages (1-1000, default 100)", required: false },
|
|
21645
|
+
full: { type: "boolean", description: "Verbatim message text", required: false, default: false }
|
|
21646
|
+
},
|
|
21647
|
+
run: async ({ args }) => {
|
|
21648
|
+
try {
|
|
21649
|
+
const body = { chatId: args.id };
|
|
21650
|
+
const limit = parseBoundedInt(args.limit, "limit", 1, 1e3);
|
|
21651
|
+
if (limit !== void 0) {
|
|
21652
|
+
body.limit = limit;
|
|
21653
|
+
}
|
|
21654
|
+
if (args.full) {
|
|
21655
|
+
body.full = true;
|
|
21656
|
+
}
|
|
21657
|
+
const response = await apiPost("/api/chats/transcript", body);
|
|
21658
|
+
writeJson({
|
|
21659
|
+
...response,
|
|
21660
|
+
meta: { count: response.data.entries.length },
|
|
21661
|
+
...response.data.truncated ? { hints: ["Older messages were dropped to fit --limit. Raise --limit to see more."] } : {}
|
|
21662
|
+
});
|
|
21663
|
+
} catch (err) {
|
|
21664
|
+
failApi(err);
|
|
21665
|
+
}
|
|
21666
|
+
}
|
|
21667
|
+
});
|
|
21668
|
+
registerSchema({
|
|
21669
|
+
command: "chats.diff",
|
|
21670
|
+
description: "See the real file-level changes a Session made (landings, creatives, brand, flows, knowledge). Published Sessions read from git; for an in-progress (unpublished) Session pass --live to read its changes straight from its running workspace. Without --live, an unpublished Session returns available:false \u2014 use `baker chats view` for the staged summary. Compact lists changed files with +/- counts; add --full for the actual diff text. Read-only.",
|
|
21671
|
+
args: {
|
|
21672
|
+
id: { type: "positional", description: "The Session id", required: true },
|
|
21673
|
+
surface: {
|
|
21674
|
+
type: "string",
|
|
21675
|
+
description: "Filter to one surface: knowledge|company|brand|landings|flows|creatives",
|
|
21676
|
+
required: false
|
|
21677
|
+
},
|
|
21678
|
+
full: {
|
|
21679
|
+
type: "boolean",
|
|
21680
|
+
description: "Include the unified-diff patch text per file",
|
|
21681
|
+
required: false,
|
|
21682
|
+
default: false
|
|
21683
|
+
},
|
|
21684
|
+
live: {
|
|
21685
|
+
type: "boolean",
|
|
21686
|
+
description: "For an in-progress Session, read its changes from the live workspace (slower; resumes the paused Runtime). Ignored for published Sessions.",
|
|
21687
|
+
required: false,
|
|
21688
|
+
default: false
|
|
21689
|
+
}
|
|
21690
|
+
}
|
|
21691
|
+
});
|
|
21692
|
+
var diffCommand = defineCommand96({
|
|
21693
|
+
meta: { name: "diff", description: "See a published Session's real file-level changes." },
|
|
21694
|
+
args: {
|
|
21695
|
+
id: { type: "positional", description: "The Session id", required: true },
|
|
21696
|
+
surface: {
|
|
21697
|
+
type: "string",
|
|
21698
|
+
description: "Filter: knowledge|company|brand|landings|flows|creatives",
|
|
21699
|
+
required: false
|
|
21700
|
+
},
|
|
21701
|
+
full: { type: "boolean", description: "Include the diff patch text per file", required: false, default: false },
|
|
21702
|
+
live: {
|
|
21703
|
+
type: "boolean",
|
|
21704
|
+
description: "Read an in-progress Session's changes from its live workspace (slower)",
|
|
21705
|
+
required: false,
|
|
21706
|
+
default: false
|
|
21707
|
+
}
|
|
21708
|
+
},
|
|
21709
|
+
run: async ({ args }) => {
|
|
21710
|
+
try {
|
|
21711
|
+
const body = { chatId: args.id };
|
|
21712
|
+
if (args.surface) {
|
|
21713
|
+
if (!REPO_SURFACES.includes(args.surface)) {
|
|
21714
|
+
throw new Error(`--surface must be one of: ${REPO_SURFACES.join("|")}`);
|
|
21715
|
+
}
|
|
21716
|
+
body.surface = args.surface;
|
|
21717
|
+
}
|
|
21718
|
+
if (args.full) {
|
|
21719
|
+
body.full = true;
|
|
21720
|
+
}
|
|
21721
|
+
if (args.live) {
|
|
21722
|
+
body.live = true;
|
|
21723
|
+
}
|
|
21724
|
+
const response = await apiPost("/api/chats/diff", body);
|
|
21725
|
+
writeJson({
|
|
21726
|
+
...response,
|
|
21727
|
+
meta: { count: response.data.files.length },
|
|
21728
|
+
...!response.data.available && response.data.reason ? { hints: [response.data.reason] } : {},
|
|
21729
|
+
...response.data.available && !args.full && response.data.files.length > 0 ? { hints: ["Add --full to read the actual diff text for each file."] } : {}
|
|
21730
|
+
});
|
|
21731
|
+
} catch (err) {
|
|
21732
|
+
failApi(err);
|
|
21733
|
+
}
|
|
21734
|
+
}
|
|
21735
|
+
});
|
|
21736
|
+
var chatsCommand = defineCommand96({
|
|
21737
|
+
meta: {
|
|
21738
|
+
name: "chats",
|
|
21739
|
+
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."
|
|
21740
|
+
},
|
|
21741
|
+
subCommands: {
|
|
21742
|
+
list: listCommand5,
|
|
21743
|
+
view: viewCommand,
|
|
21744
|
+
transcript: transcriptCommand,
|
|
21745
|
+
diff: diffCommand
|
|
21746
|
+
}
|
|
21747
|
+
});
|
|
21748
|
+
|
|
21302
21749
|
// src/commands/creatives/index.ts
|
|
21303
|
-
import { defineCommand as
|
|
21750
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
21304
21751
|
|
|
21305
21752
|
// src/commands/creatives/publish.ts
|
|
21306
|
-
import { defineCommand as
|
|
21753
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
21307
21754
|
|
|
21308
21755
|
// src/commands/images/api.ts
|
|
21309
21756
|
import { readFile as readFile17 } from "fs/promises";
|
|
@@ -21447,7 +21894,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
|
|
|
21447
21894
|
chatId: chatIdFromEnv()
|
|
21448
21895
|
});
|
|
21449
21896
|
}
|
|
21450
|
-
var publishCommand =
|
|
21897
|
+
var publishCommand = defineCommand97({
|
|
21451
21898
|
meta: {
|
|
21452
21899
|
name: "publish",
|
|
21453
21900
|
description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
|
|
@@ -21505,7 +21952,7 @@ var publishCommand = defineCommand96({
|
|
|
21505
21952
|
});
|
|
21506
21953
|
|
|
21507
21954
|
// src/commands/creatives/index.ts
|
|
21508
|
-
var creativesCommand3 =
|
|
21955
|
+
var creativesCommand3 = defineCommand98({
|
|
21509
21956
|
meta: {
|
|
21510
21957
|
name: "creatives",
|
|
21511
21958
|
description: `Publish static ad creatives as first-class Baker outputs.
|
|
@@ -21521,7 +21968,7 @@ Publishing uploads the image to the Company image library, applies the official
|
|
|
21521
21968
|
});
|
|
21522
21969
|
|
|
21523
21970
|
// src/commands/flows/index.ts
|
|
21524
|
-
import { defineCommand as
|
|
21971
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
21525
21972
|
|
|
21526
21973
|
// src/commands/flows/shared.ts
|
|
21527
21974
|
import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
|
|
@@ -21676,7 +22123,7 @@ function displayName(slug) {
|
|
|
21676
22123
|
const name = tree.displayName;
|
|
21677
22124
|
return typeof name === "string" && name.trim() ? name.trim() : slug;
|
|
21678
22125
|
}
|
|
21679
|
-
var
|
|
22126
|
+
var listCommand6 = defineCommand99({
|
|
21680
22127
|
meta: {
|
|
21681
22128
|
name: "list",
|
|
21682
22129
|
description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
|
|
@@ -21690,7 +22137,7 @@ var listCommand5 = defineCommand98({
|
|
|
21690
22137
|
writeJson({ ok: true, data: { flows } });
|
|
21691
22138
|
}
|
|
21692
22139
|
});
|
|
21693
|
-
var showCommand2 =
|
|
22140
|
+
var showCommand2 = defineCommand99({
|
|
21694
22141
|
meta: {
|
|
21695
22142
|
name: "show",
|
|
21696
22143
|
description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
|
|
@@ -21711,7 +22158,7 @@ var showCommand2 = defineCommand98({
|
|
|
21711
22158
|
writeJson({ ok: true, data: response });
|
|
21712
22159
|
}
|
|
21713
22160
|
});
|
|
21714
|
-
var flowsCommand =
|
|
22161
|
+
var flowsCommand = defineCommand99({
|
|
21715
22162
|
meta: {
|
|
21716
22163
|
name: "flows",
|
|
21717
22164
|
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).
|
|
@@ -21724,7 +22171,7 @@ Examples:
|
|
|
21724
22171
|
baker flows show contact --full`
|
|
21725
22172
|
},
|
|
21726
22173
|
subCommands: {
|
|
21727
|
-
list:
|
|
22174
|
+
list: listCommand6,
|
|
21728
22175
|
show: showCommand2
|
|
21729
22176
|
},
|
|
21730
22177
|
run: () => {
|
|
@@ -21738,10 +22185,10 @@ Examples:
|
|
|
21738
22185
|
});
|
|
21739
22186
|
|
|
21740
22187
|
// src/commands/ga4/index.ts
|
|
21741
|
-
import { defineCommand as
|
|
22188
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
21742
22189
|
|
|
21743
22190
|
// src/commands/ga4/audit.ts
|
|
21744
|
-
import { defineCommand as
|
|
22191
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
21745
22192
|
|
|
21746
22193
|
// src/commands/ga4/resolve.ts
|
|
21747
22194
|
async function fetchProperties(useCache = true) {
|
|
@@ -21804,7 +22251,7 @@ registerSchema({
|
|
|
21804
22251
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
21805
22252
|
}
|
|
21806
22253
|
});
|
|
21807
|
-
var auditCommand2 =
|
|
22254
|
+
var auditCommand2 = defineCommand100({
|
|
21808
22255
|
meta: {
|
|
21809
22256
|
name: "audit",
|
|
21810
22257
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -21856,7 +22303,7 @@ Examples:
|
|
|
21856
22303
|
});
|
|
21857
22304
|
|
|
21858
22305
|
// src/commands/ga4/properties.ts
|
|
21859
|
-
import { defineCommand as
|
|
22306
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
21860
22307
|
registerSchema({
|
|
21861
22308
|
command: "ga4.properties",
|
|
21862
22309
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -21864,7 +22311,7 @@ registerSchema({
|
|
|
21864
22311
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
21865
22312
|
}
|
|
21866
22313
|
});
|
|
21867
|
-
var propertiesCommand =
|
|
22314
|
+
var propertiesCommand = defineCommand101({
|
|
21868
22315
|
meta: {
|
|
21869
22316
|
name: "properties",
|
|
21870
22317
|
description: `List accessible GA4 properties.
|
|
@@ -21914,7 +22361,7 @@ Examples:
|
|
|
21914
22361
|
// src/commands/ga4/query.ts
|
|
21915
22362
|
import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
|
|
21916
22363
|
import { resolve as resolve2 } from "path";
|
|
21917
|
-
import { defineCommand as
|
|
22364
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
21918
22365
|
|
|
21919
22366
|
// src/commands/ga4/presets.ts
|
|
21920
22367
|
var GA4_PRESETS = [
|
|
@@ -22046,7 +22493,7 @@ function handleError(err) {
|
|
|
22046
22493
|
});
|
|
22047
22494
|
process.exit(1);
|
|
22048
22495
|
}
|
|
22049
|
-
var queryCommand2 =
|
|
22496
|
+
var queryCommand2 = defineCommand102({
|
|
22050
22497
|
meta: {
|
|
22051
22498
|
name: "query",
|
|
22052
22499
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -22117,7 +22564,7 @@ Free-form (escape hatch):
|
|
|
22117
22564
|
});
|
|
22118
22565
|
|
|
22119
22566
|
// src/commands/ga4/index.ts
|
|
22120
|
-
var ga4Command =
|
|
22567
|
+
var ga4Command = defineCommand103({
|
|
22121
22568
|
meta: {
|
|
22122
22569
|
name: "ga4",
|
|
22123
22570
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -22140,12 +22587,12 @@ Examples:
|
|
|
22140
22587
|
});
|
|
22141
22588
|
|
|
22142
22589
|
// src/commands/gsc/index.ts
|
|
22143
|
-
import { defineCommand as
|
|
22590
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
22144
22591
|
|
|
22145
22592
|
// src/commands/gsc/query.ts
|
|
22146
22593
|
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
|
|
22147
22594
|
import { resolve as resolve3 } from "path";
|
|
22148
|
-
import { defineCommand as
|
|
22595
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
22149
22596
|
|
|
22150
22597
|
// src/commands/gsc/presets.ts
|
|
22151
22598
|
var GSC_PRESETS = [
|
|
@@ -22333,7 +22780,7 @@ function handleError2(err) {
|
|
|
22333
22780
|
});
|
|
22334
22781
|
process.exit(1);
|
|
22335
22782
|
}
|
|
22336
|
-
var queryCommand3 =
|
|
22783
|
+
var queryCommand3 = defineCommand104({
|
|
22337
22784
|
meta: {
|
|
22338
22785
|
name: "query",
|
|
22339
22786
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -22411,7 +22858,7 @@ Free-form (escape hatch):
|
|
|
22411
22858
|
});
|
|
22412
22859
|
|
|
22413
22860
|
// src/commands/gsc/sitemaps.ts
|
|
22414
|
-
import { defineCommand as
|
|
22861
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
22415
22862
|
registerSchema({
|
|
22416
22863
|
command: "gsc.sitemaps",
|
|
22417
22864
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -22420,7 +22867,7 @@ registerSchema({
|
|
|
22420
22867
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22421
22868
|
}
|
|
22422
22869
|
});
|
|
22423
|
-
var sitemapsCommand =
|
|
22870
|
+
var sitemapsCommand = defineCommand105({
|
|
22424
22871
|
meta: {
|
|
22425
22872
|
name: "sitemaps",
|
|
22426
22873
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -22470,7 +22917,7 @@ Examples:
|
|
|
22470
22917
|
});
|
|
22471
22918
|
|
|
22472
22919
|
// src/commands/gsc/sites.ts
|
|
22473
|
-
import { defineCommand as
|
|
22920
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
22474
22921
|
registerSchema({
|
|
22475
22922
|
command: "gsc.sites",
|
|
22476
22923
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -22478,7 +22925,7 @@ registerSchema({
|
|
|
22478
22925
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
22479
22926
|
}
|
|
22480
22927
|
});
|
|
22481
|
-
var sitesCommand =
|
|
22928
|
+
var sitesCommand = defineCommand106({
|
|
22482
22929
|
meta: {
|
|
22483
22930
|
name: "sites",
|
|
22484
22931
|
description: `List verified Search Console sites.
|
|
@@ -22526,7 +22973,7 @@ Examples:
|
|
|
22526
22973
|
});
|
|
22527
22974
|
|
|
22528
22975
|
// src/commands/gsc/index.ts
|
|
22529
|
-
var gscCommand =
|
|
22976
|
+
var gscCommand = defineCommand107({
|
|
22530
22977
|
meta: {
|
|
22531
22978
|
name: "gsc",
|
|
22532
22979
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -22549,7 +22996,7 @@ Examples:
|
|
|
22549
22996
|
});
|
|
22550
22997
|
|
|
22551
22998
|
// src/commands/history/index.ts
|
|
22552
|
-
import { defineCommand as
|
|
22999
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
22553
23000
|
registerSchema({
|
|
22554
23001
|
command: "history.list",
|
|
22555
23002
|
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.",
|
|
@@ -22594,7 +23041,7 @@ var CATEGORIES = [
|
|
|
22594
23041
|
"domain",
|
|
22595
23042
|
"integration"
|
|
22596
23043
|
];
|
|
22597
|
-
function
|
|
23044
|
+
function parseBoundedInt2(raw, name, min, max) {
|
|
22598
23045
|
if (raw === void 0) {
|
|
22599
23046
|
return void 0;
|
|
22600
23047
|
}
|
|
@@ -22604,7 +23051,7 @@ function parseBoundedInt(raw, name, min, max) {
|
|
|
22604
23051
|
}
|
|
22605
23052
|
return value;
|
|
22606
23053
|
}
|
|
22607
|
-
var
|
|
23054
|
+
var listCommand7 = defineCommand108({
|
|
22608
23055
|
meta: {
|
|
22609
23056
|
name: "list",
|
|
22610
23057
|
description: "List recent account changes (unified audit log), newest first."
|
|
@@ -22622,11 +23069,11 @@ var listCommand6 = defineCommand107({
|
|
|
22622
23069
|
run: async ({ args }) => {
|
|
22623
23070
|
try {
|
|
22624
23071
|
const body = {};
|
|
22625
|
-
const limit =
|
|
23072
|
+
const limit = parseBoundedInt2(args.limit, "limit", 1, 200);
|
|
22626
23073
|
if (limit !== void 0) {
|
|
22627
23074
|
body.limit = limit;
|
|
22628
23075
|
}
|
|
22629
|
-
const days =
|
|
23076
|
+
const days = parseBoundedInt2(args.days, "days", 1, 365);
|
|
22630
23077
|
if (days !== void 0) {
|
|
22631
23078
|
body.days = days;
|
|
22632
23079
|
}
|
|
@@ -22650,19 +23097,19 @@ var listCommand6 = defineCommand107({
|
|
|
22650
23097
|
}
|
|
22651
23098
|
}
|
|
22652
23099
|
});
|
|
22653
|
-
var historyCommand =
|
|
23100
|
+
var historyCommand = defineCommand108({
|
|
22654
23101
|
meta: {
|
|
22655
23102
|
name: "history",
|
|
22656
23103
|
description: "Unified account history (audit log): what changed, who did it, and when."
|
|
22657
23104
|
},
|
|
22658
|
-
subCommands: { list:
|
|
23105
|
+
subCommands: { list: listCommand7 }
|
|
22659
23106
|
});
|
|
22660
23107
|
|
|
22661
23108
|
// src/commands/images/index.ts
|
|
22662
|
-
import { defineCommand as
|
|
23109
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
22663
23110
|
|
|
22664
23111
|
// src/commands/images/crop.ts
|
|
22665
|
-
import { defineCommand as
|
|
23112
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
22666
23113
|
|
|
22667
23114
|
// src/lib/image/crop-sprite.ts
|
|
22668
23115
|
import sharp from "sharp";
|
|
@@ -22787,7 +23234,7 @@ function emitError2(err) {
|
|
|
22787
23234
|
}
|
|
22788
23235
|
process.exit(1);
|
|
22789
23236
|
}
|
|
22790
|
-
var cropCommand =
|
|
23237
|
+
var cropCommand = defineCommand109({
|
|
22791
23238
|
meta: {
|
|
22792
23239
|
name: "crop",
|
|
22793
23240
|
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"
|
|
@@ -22823,7 +23270,7 @@ var cropCommand = defineCommand108({
|
|
|
22823
23270
|
});
|
|
22824
23271
|
|
|
22825
23272
|
// src/commands/images/delete.ts
|
|
22826
|
-
import { defineCommand as
|
|
23273
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
22827
23274
|
registerSchema({
|
|
22828
23275
|
command: "images.delete",
|
|
22829
23276
|
description: "Delete an image by ID",
|
|
@@ -22837,7 +23284,7 @@ registerSchema({
|
|
|
22837
23284
|
}
|
|
22838
23285
|
}
|
|
22839
23286
|
});
|
|
22840
|
-
var deleteCommand =
|
|
23287
|
+
var deleteCommand = defineCommand110({
|
|
22841
23288
|
meta: {
|
|
22842
23289
|
name: "delete",
|
|
22843
23290
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -22878,7 +23325,7 @@ var deleteCommand = defineCommand109({
|
|
|
22878
23325
|
});
|
|
22879
23326
|
|
|
22880
23327
|
// src/commands/images/dimensions.ts
|
|
22881
|
-
import { defineCommand as
|
|
23328
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
22882
23329
|
|
|
22883
23330
|
// src/lib/image/dimensions.ts
|
|
22884
23331
|
import { imageSize } from "image-size";
|
|
@@ -22901,7 +23348,7 @@ registerSchema({
|
|
|
22901
23348
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
22902
23349
|
}
|
|
22903
23350
|
});
|
|
22904
|
-
var dimensionsCommand =
|
|
23351
|
+
var dimensionsCommand = defineCommand111({
|
|
22905
23352
|
meta: {
|
|
22906
23353
|
name: "dimensions",
|
|
22907
23354
|
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"
|
|
@@ -22945,7 +23392,7 @@ var dimensionsCommand = defineCommand110({
|
|
|
22945
23392
|
});
|
|
22946
23393
|
|
|
22947
23394
|
// src/commands/images/extract.ts
|
|
22948
|
-
import { defineCommand as
|
|
23395
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
22949
23396
|
registerSchema({
|
|
22950
23397
|
command: "images.extract",
|
|
22951
23398
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -22961,7 +23408,7 @@ registerSchema({
|
|
|
22961
23408
|
}
|
|
22962
23409
|
}
|
|
22963
23410
|
});
|
|
22964
|
-
var extractCommand =
|
|
23411
|
+
var extractCommand = defineCommand112({
|
|
22965
23412
|
meta: {
|
|
22966
23413
|
name: "extract",
|
|
22967
23414
|
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"
|
|
@@ -22999,7 +23446,7 @@ var extractCommand = defineCommand111({
|
|
|
22999
23446
|
});
|
|
23000
23447
|
|
|
23001
23448
|
// src/commands/images/find.ts
|
|
23002
|
-
import { defineCommand as
|
|
23449
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
23003
23450
|
registerSchema({
|
|
23004
23451
|
command: "images.find",
|
|
23005
23452
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -23031,7 +23478,7 @@ registerSchema({
|
|
|
23031
23478
|
}
|
|
23032
23479
|
}
|
|
23033
23480
|
});
|
|
23034
|
-
var findCommand =
|
|
23481
|
+
var findCommand = defineCommand113({
|
|
23035
23482
|
meta: {
|
|
23036
23483
|
name: "find",
|
|
23037
23484
|
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"
|
|
@@ -23080,7 +23527,7 @@ var findCommand = defineCommand112({
|
|
|
23080
23527
|
|
|
23081
23528
|
// src/commands/images/generate.ts
|
|
23082
23529
|
import { readFile as readFile19 } from "fs/promises";
|
|
23083
|
-
import { defineCommand as
|
|
23530
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
23084
23531
|
import sharp2 from "sharp";
|
|
23085
23532
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
23086
23533
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -23183,7 +23630,7 @@ async function resolveReferences(spec) {
|
|
|
23183
23630
|
}
|
|
23184
23631
|
return out;
|
|
23185
23632
|
}
|
|
23186
|
-
var generateCommand =
|
|
23633
|
+
var generateCommand = defineCommand114({
|
|
23187
23634
|
meta: {
|
|
23188
23635
|
name: "generate",
|
|
23189
23636
|
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]]'"
|
|
@@ -23235,7 +23682,7 @@ var generateCommand = defineCommand113({
|
|
|
23235
23682
|
});
|
|
23236
23683
|
|
|
23237
23684
|
// src/commands/images/get.ts
|
|
23238
|
-
import { defineCommand as
|
|
23685
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
23239
23686
|
registerSchema({
|
|
23240
23687
|
command: "images.get",
|
|
23241
23688
|
description: "Get a single image by ID",
|
|
@@ -23243,7 +23690,7 @@ registerSchema({
|
|
|
23243
23690
|
id: { type: "string", description: "Image ID", required: true }
|
|
23244
23691
|
}
|
|
23245
23692
|
});
|
|
23246
|
-
var getCommand2 =
|
|
23693
|
+
var getCommand2 = defineCommand115({
|
|
23247
23694
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
23248
23695
|
args: {
|
|
23249
23696
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -23279,7 +23726,7 @@ var getCommand2 = defineCommand114({
|
|
|
23279
23726
|
});
|
|
23280
23727
|
|
|
23281
23728
|
// src/commands/images/gif.ts
|
|
23282
|
-
import { defineCommand as
|
|
23729
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
23283
23730
|
registerSchema({
|
|
23284
23731
|
command: "images.gif",
|
|
23285
23732
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -23311,7 +23758,7 @@ registerSchema({
|
|
|
23311
23758
|
}
|
|
23312
23759
|
}
|
|
23313
23760
|
});
|
|
23314
|
-
var gifCommand =
|
|
23761
|
+
var gifCommand = defineCommand116({
|
|
23315
23762
|
meta: {
|
|
23316
23763
|
name: "gif",
|
|
23317
23764
|
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"
|
|
@@ -23358,7 +23805,7 @@ var gifCommand = defineCommand115({
|
|
|
23358
23805
|
});
|
|
23359
23806
|
|
|
23360
23807
|
// src/commands/images/google.ts
|
|
23361
|
-
import { defineCommand as
|
|
23808
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
23362
23809
|
registerSchema({
|
|
23363
23810
|
command: "images.google",
|
|
23364
23811
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -23394,7 +23841,7 @@ registerSchema({
|
|
|
23394
23841
|
}
|
|
23395
23842
|
}
|
|
23396
23843
|
});
|
|
23397
|
-
var googleCommand2 =
|
|
23844
|
+
var googleCommand2 = defineCommand117({
|
|
23398
23845
|
meta: {
|
|
23399
23846
|
name: "google",
|
|
23400
23847
|
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"
|
|
@@ -23442,7 +23889,7 @@ var googleCommand2 = defineCommand116({
|
|
|
23442
23889
|
});
|
|
23443
23890
|
|
|
23444
23891
|
// src/commands/images/icon.ts
|
|
23445
|
-
import { defineCommand as
|
|
23892
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
23446
23893
|
registerSchema({
|
|
23447
23894
|
command: "images.icon",
|
|
23448
23895
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -23468,7 +23915,7 @@ registerSchema({
|
|
|
23468
23915
|
}
|
|
23469
23916
|
}
|
|
23470
23917
|
});
|
|
23471
|
-
var iconCommand =
|
|
23918
|
+
var iconCommand = defineCommand118({
|
|
23472
23919
|
meta: {
|
|
23473
23920
|
name: "icon",
|
|
23474
23921
|
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'"
|
|
@@ -23508,7 +23955,7 @@ var iconCommand = defineCommand117({
|
|
|
23508
23955
|
});
|
|
23509
23956
|
|
|
23510
23957
|
// src/commands/images/ingest.ts
|
|
23511
|
-
import { defineCommand as
|
|
23958
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
23512
23959
|
registerSchema({
|
|
23513
23960
|
command: "images.ingest",
|
|
23514
23961
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -23520,7 +23967,7 @@ registerSchema({
|
|
|
23520
23967
|
context: { type: "string", description: "Description context hint", required: false }
|
|
23521
23968
|
}
|
|
23522
23969
|
});
|
|
23523
|
-
var ingestCommand =
|
|
23970
|
+
var ingestCommand = defineCommand119({
|
|
23524
23971
|
meta: {
|
|
23525
23972
|
name: "ingest",
|
|
23526
23973
|
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"
|
|
@@ -23562,7 +24009,7 @@ var ingestCommand = defineCommand118({
|
|
|
23562
24009
|
});
|
|
23563
24010
|
|
|
23564
24011
|
// src/commands/images/library.ts
|
|
23565
|
-
import { defineCommand as
|
|
24012
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
23566
24013
|
registerSchema({
|
|
23567
24014
|
command: "images.library",
|
|
23568
24015
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -23588,7 +24035,7 @@ registerSchema({
|
|
|
23588
24035
|
}
|
|
23589
24036
|
}
|
|
23590
24037
|
});
|
|
23591
|
-
var libraryCommand =
|
|
24038
|
+
var libraryCommand = defineCommand120({
|
|
23592
24039
|
meta: {
|
|
23593
24040
|
name: "library",
|
|
23594
24041
|
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"
|
|
@@ -23645,7 +24092,7 @@ var libraryCommand = defineCommand119({
|
|
|
23645
24092
|
});
|
|
23646
24093
|
|
|
23647
24094
|
// src/commands/images/logo.ts
|
|
23648
|
-
import { defineCommand as
|
|
24095
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
23649
24096
|
registerSchema({
|
|
23650
24097
|
command: "images.logo",
|
|
23651
24098
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -23670,7 +24117,7 @@ registerSchema({
|
|
|
23670
24117
|
}
|
|
23671
24118
|
}
|
|
23672
24119
|
});
|
|
23673
|
-
var logoCommand =
|
|
24120
|
+
var logoCommand = defineCommand121({
|
|
23674
24121
|
meta: {
|
|
23675
24122
|
name: "logo",
|
|
23676
24123
|
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"
|
|
@@ -23708,7 +24155,7 @@ var logoCommand = defineCommand120({
|
|
|
23708
24155
|
});
|
|
23709
24156
|
|
|
23710
24157
|
// src/commands/images/normalize.ts
|
|
23711
|
-
import { defineCommand as
|
|
24158
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
23712
24159
|
|
|
23713
24160
|
// src/lib/image/color-changer.ts
|
|
23714
24161
|
import quantize from "quantize";
|
|
@@ -24440,7 +24887,7 @@ function coerceRawArgs(args) {
|
|
|
24440
24887
|
"dry-run": bool(args["dry-run"])
|
|
24441
24888
|
};
|
|
24442
24889
|
}
|
|
24443
|
-
var normalizeCommand =
|
|
24890
|
+
var normalizeCommand = defineCommand122({
|
|
24444
24891
|
meta: {
|
|
24445
24892
|
name: "normalize",
|
|
24446
24893
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -24495,7 +24942,7 @@ Examples:
|
|
|
24495
24942
|
});
|
|
24496
24943
|
|
|
24497
24944
|
// src/commands/images/pinterest.ts
|
|
24498
|
-
import { defineCommand as
|
|
24945
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
24499
24946
|
registerSchema({
|
|
24500
24947
|
command: "images.pinterest",
|
|
24501
24948
|
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.",
|
|
@@ -24515,7 +24962,7 @@ registerSchema({
|
|
|
24515
24962
|
}
|
|
24516
24963
|
}
|
|
24517
24964
|
});
|
|
24518
|
-
var pinterestCommand =
|
|
24965
|
+
var pinterestCommand = defineCommand123({
|
|
24519
24966
|
meta: {
|
|
24520
24967
|
name: "pinterest",
|
|
24521
24968
|
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'"
|
|
@@ -24555,7 +25002,7 @@ var pinterestCommand = defineCommand122({
|
|
|
24555
25002
|
});
|
|
24556
25003
|
|
|
24557
25004
|
// src/commands/images/screenshot.ts
|
|
24558
|
-
import { defineCommand as
|
|
25005
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
24559
25006
|
registerSchema({
|
|
24560
25007
|
command: "images.screenshot",
|
|
24561
25008
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -24571,7 +25018,7 @@ registerSchema({
|
|
|
24571
25018
|
}
|
|
24572
25019
|
}
|
|
24573
25020
|
});
|
|
24574
|
-
var screenshotCommand =
|
|
25021
|
+
var screenshotCommand = defineCommand124({
|
|
24575
25022
|
meta: {
|
|
24576
25023
|
name: "screenshot",
|
|
24577
25024
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -24634,7 +25081,7 @@ var screenshotCommand = defineCommand123({
|
|
|
24634
25081
|
});
|
|
24635
25082
|
|
|
24636
25083
|
// src/commands/images/search.ts
|
|
24637
|
-
import { defineCommand as
|
|
25084
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
24638
25085
|
registerSchema({
|
|
24639
25086
|
command: "images.search",
|
|
24640
25087
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -24650,7 +25097,7 @@ registerSchema({
|
|
|
24650
25097
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
24651
25098
|
}
|
|
24652
25099
|
});
|
|
24653
|
-
var searchCommand =
|
|
25100
|
+
var searchCommand = defineCommand125({
|
|
24654
25101
|
meta: {
|
|
24655
25102
|
name: "search",
|
|
24656
25103
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -24710,7 +25157,7 @@ var searchCommand = defineCommand124({
|
|
|
24710
25157
|
});
|
|
24711
25158
|
|
|
24712
25159
|
// src/commands/images/sticker.ts
|
|
24713
|
-
import { defineCommand as
|
|
25160
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
24714
25161
|
registerSchema({
|
|
24715
25162
|
command: "images.sticker",
|
|
24716
25163
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -24742,7 +25189,7 @@ registerSchema({
|
|
|
24742
25189
|
}
|
|
24743
25190
|
}
|
|
24744
25191
|
});
|
|
24745
|
-
var stickerCommand =
|
|
25192
|
+
var stickerCommand = defineCommand126({
|
|
24746
25193
|
meta: {
|
|
24747
25194
|
name: "sticker",
|
|
24748
25195
|
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"
|
|
@@ -24789,7 +25236,7 @@ var stickerCommand = defineCommand125({
|
|
|
24789
25236
|
});
|
|
24790
25237
|
|
|
24791
25238
|
// src/commands/images/stock.ts
|
|
24792
|
-
import { defineCommand as
|
|
25239
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
24793
25240
|
registerSchema({
|
|
24794
25241
|
command: "images.stock",
|
|
24795
25242
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -24847,7 +25294,7 @@ registerSchema({
|
|
|
24847
25294
|
}
|
|
24848
25295
|
}
|
|
24849
25296
|
});
|
|
24850
|
-
var stockCommand =
|
|
25297
|
+
var stockCommand = defineCommand127({
|
|
24851
25298
|
meta: {
|
|
24852
25299
|
name: "stock",
|
|
24853
25300
|
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"
|
|
@@ -24903,7 +25350,7 @@ var stockCommand = defineCommand126({
|
|
|
24903
25350
|
});
|
|
24904
25351
|
|
|
24905
25352
|
// src/lib/tags-command.ts
|
|
24906
|
-
import { defineCommand as
|
|
25353
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
24907
25354
|
function makeTagsCommand(command, label, endpoint) {
|
|
24908
25355
|
registerSchema({
|
|
24909
25356
|
command: `${command}.tags`,
|
|
@@ -24912,7 +25359,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
24912
25359
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
24913
25360
|
}
|
|
24914
25361
|
});
|
|
24915
|
-
return
|
|
25362
|
+
return defineCommand128({
|
|
24916
25363
|
meta: {
|
|
24917
25364
|
name: "tags",
|
|
24918
25365
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -24948,7 +25395,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
24948
25395
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
24949
25396
|
|
|
24950
25397
|
// src/commands/images/upload.ts
|
|
24951
|
-
import { defineCommand as
|
|
25398
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
24952
25399
|
registerSchema({
|
|
24953
25400
|
command: "images.upload",
|
|
24954
25401
|
description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
|
|
@@ -24986,7 +25433,7 @@ registerSchema({
|
|
|
24986
25433
|
function isRemoteUrl2(value) {
|
|
24987
25434
|
return /^https?:\/\//i.test(value);
|
|
24988
25435
|
}
|
|
24989
|
-
var uploadCommand =
|
|
25436
|
+
var uploadCommand = defineCommand129({
|
|
24990
25437
|
meta: {
|
|
24991
25438
|
name: "upload",
|
|
24992
25439
|
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'"
|
|
@@ -25079,7 +25526,7 @@ async function uploadLocal(target, args) {
|
|
|
25079
25526
|
}
|
|
25080
25527
|
|
|
25081
25528
|
// src/commands/images/upscale.ts
|
|
25082
|
-
import { defineCommand as
|
|
25529
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
25083
25530
|
registerSchema({
|
|
25084
25531
|
command: "images.upscale",
|
|
25085
25532
|
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).",
|
|
@@ -25094,7 +25541,7 @@ registerSchema({
|
|
|
25094
25541
|
}
|
|
25095
25542
|
});
|
|
25096
25543
|
var POLL_INTERVAL_MS3 = 1500;
|
|
25097
|
-
var upscaleCommand =
|
|
25544
|
+
var upscaleCommand = defineCommand130({
|
|
25098
25545
|
meta: {
|
|
25099
25546
|
name: "upscale",
|
|
25100
25547
|
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"
|
|
@@ -25149,7 +25596,7 @@ var upscaleCommand = defineCommand129({
|
|
|
25149
25596
|
});
|
|
25150
25597
|
|
|
25151
25598
|
// src/commands/images/use.ts
|
|
25152
|
-
import { defineCommand as
|
|
25599
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
25153
25600
|
registerSchema({
|
|
25154
25601
|
command: "images.use",
|
|
25155
25602
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -25165,7 +25612,7 @@ registerSchema({
|
|
|
25165
25612
|
}
|
|
25166
25613
|
});
|
|
25167
25614
|
var POLL_INTERVAL_MS4 = 1500;
|
|
25168
|
-
var useCommand =
|
|
25615
|
+
var useCommand = defineCommand131({
|
|
25169
25616
|
meta: {
|
|
25170
25617
|
name: "use",
|
|
25171
25618
|
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"
|
|
@@ -25211,7 +25658,7 @@ var useCommand = defineCommand130({
|
|
|
25211
25658
|
});
|
|
25212
25659
|
|
|
25213
25660
|
// src/commands/images/index.ts
|
|
25214
|
-
var imagesCommand =
|
|
25661
|
+
var imagesCommand = defineCommand132({
|
|
25215
25662
|
meta: {
|
|
25216
25663
|
name: "images",
|
|
25217
25664
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -25281,7 +25728,7 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
25281
25728
|
});
|
|
25282
25729
|
|
|
25283
25730
|
// src/commands/mcp/index.ts
|
|
25284
|
-
import { defineCommand as
|
|
25731
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
25285
25732
|
var SCOPES = ["user", "user_org", "company", "org"];
|
|
25286
25733
|
function parseScope(raw) {
|
|
25287
25734
|
const scope = raw === void 0 ? "company" : String(raw);
|
|
@@ -25320,7 +25767,7 @@ registerSchema({
|
|
|
25320
25767
|
description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
|
|
25321
25768
|
args: {}
|
|
25322
25769
|
});
|
|
25323
|
-
var
|
|
25770
|
+
var listCommand8 = defineCommand133({
|
|
25324
25771
|
meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
|
|
25325
25772
|
run: async () => {
|
|
25326
25773
|
try {
|
|
@@ -25345,7 +25792,7 @@ registerSchema({
|
|
|
25345
25792
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
25346
25793
|
}
|
|
25347
25794
|
});
|
|
25348
|
-
var addCommand =
|
|
25795
|
+
var addCommand = defineCommand133({
|
|
25349
25796
|
meta: {
|
|
25350
25797
|
name: "add",
|
|
25351
25798
|
description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
|
|
@@ -25386,7 +25833,7 @@ registerSchema({
|
|
|
25386
25833
|
description: "Remove a company custom MCP server by name.",
|
|
25387
25834
|
args: { name: { type: "string", description: "Server name to remove", required: true } }
|
|
25388
25835
|
});
|
|
25389
|
-
var removeCommand4 =
|
|
25836
|
+
var removeCommand4 = defineCommand133({
|
|
25390
25837
|
meta: {
|
|
25391
25838
|
name: "remove",
|
|
25392
25839
|
description: `Remove a company custom MCP server by name.
|
|
@@ -25408,7 +25855,7 @@ Example:
|
|
|
25408
25855
|
}
|
|
25409
25856
|
}
|
|
25410
25857
|
});
|
|
25411
|
-
var mcpCommand =
|
|
25858
|
+
var mcpCommand = defineCommand133({
|
|
25412
25859
|
meta: {
|
|
25413
25860
|
name: "mcp",
|
|
25414
25861
|
description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
|
|
@@ -25425,17 +25872,17 @@ Examples:
|
|
|
25425
25872
|
baker mcp remove --name weather`
|
|
25426
25873
|
},
|
|
25427
25874
|
subCommands: {
|
|
25428
|
-
list:
|
|
25875
|
+
list: listCommand8,
|
|
25429
25876
|
add: addCommand,
|
|
25430
25877
|
remove: removeCommand4
|
|
25431
25878
|
}
|
|
25432
25879
|
});
|
|
25433
25880
|
|
|
25434
25881
|
// src/commands/research/index.ts
|
|
25435
|
-
import { defineCommand as
|
|
25882
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
25436
25883
|
|
|
25437
25884
|
// src/commands/research/advertisers.ts
|
|
25438
|
-
import { defineCommand as
|
|
25885
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
25439
25886
|
|
|
25440
25887
|
// src/commands/research/output.ts
|
|
25441
25888
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -25548,7 +25995,7 @@ var FIELDS3 = {
|
|
|
25548
25995
|
etv: "Estimated traffic value (USD)",
|
|
25549
25996
|
visibility: "SERP visibility score (0-1)"
|
|
25550
25997
|
};
|
|
25551
|
-
var advertisersCommand =
|
|
25998
|
+
var advertisersCommand = defineCommand134({
|
|
25552
25999
|
meta: {
|
|
25553
26000
|
name: "advertisers",
|
|
25554
26001
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -25595,7 +26042,7 @@ Examples:
|
|
|
25595
26042
|
});
|
|
25596
26043
|
|
|
25597
26044
|
// src/commands/research/autocomplete.ts
|
|
25598
|
-
import { defineCommand as
|
|
26045
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
25599
26046
|
registerSchema({
|
|
25600
26047
|
command: "research.autocomplete",
|
|
25601
26048
|
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).",
|
|
@@ -25618,7 +26065,7 @@ registerSchema({
|
|
|
25618
26065
|
var FIELDS4 = {
|
|
25619
26066
|
suggestion: "Autocomplete suggestion from Google"
|
|
25620
26067
|
};
|
|
25621
|
-
var autocompleteCommand =
|
|
26068
|
+
var autocompleteCommand = defineCommand135({
|
|
25622
26069
|
meta: {
|
|
25623
26070
|
name: "autocomplete",
|
|
25624
26071
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -25664,7 +26111,7 @@ Examples:
|
|
|
25664
26111
|
});
|
|
25665
26112
|
|
|
25666
26113
|
// src/commands/research/countries.ts
|
|
25667
|
-
import { defineCommand as
|
|
26114
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
25668
26115
|
registerSchema({
|
|
25669
26116
|
command: "research.countries",
|
|
25670
26117
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -25721,7 +26168,7 @@ var FIELDS5 = {
|
|
|
25721
26168
|
code: "Country code to pass as --location",
|
|
25722
26169
|
name: "Country name"
|
|
25723
26170
|
};
|
|
25724
|
-
var countriesCommand =
|
|
26171
|
+
var countriesCommand = defineCommand136({
|
|
25725
26172
|
meta: {
|
|
25726
26173
|
name: "countries",
|
|
25727
26174
|
description: "List all supported country codes for --location flag."
|
|
@@ -25732,7 +26179,7 @@ var countriesCommand = defineCommand135({
|
|
|
25732
26179
|
});
|
|
25733
26180
|
|
|
25734
26181
|
// src/commands/research/intent.ts
|
|
25735
|
-
import { defineCommand as
|
|
26182
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
25736
26183
|
registerSchema({
|
|
25737
26184
|
command: "research.intent",
|
|
25738
26185
|
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.",
|
|
@@ -25755,7 +26202,7 @@ var FIELDS6 = {
|
|
|
25755
26202
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
25756
26203
|
probability: "Confidence score 0.0-1.0"
|
|
25757
26204
|
};
|
|
25758
|
-
var intentCommand =
|
|
26205
|
+
var intentCommand = defineCommand137({
|
|
25759
26206
|
meta: {
|
|
25760
26207
|
name: "intent",
|
|
25761
26208
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -25803,7 +26250,7 @@ Examples:
|
|
|
25803
26250
|
});
|
|
25804
26251
|
|
|
25805
26252
|
// src/commands/research/keyword-gap.ts
|
|
25806
|
-
import { defineCommand as
|
|
26253
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
25807
26254
|
registerSchema({
|
|
25808
26255
|
command: "research.keyword-gap",
|
|
25809
26256
|
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.",
|
|
@@ -25832,7 +26279,7 @@ var FIELDS7 = {
|
|
|
25832
26279
|
cpc: "Cost per click USD",
|
|
25833
26280
|
their_position: "Competitor's ranking position"
|
|
25834
26281
|
};
|
|
25835
|
-
var keywordGapCommand =
|
|
26282
|
+
var keywordGapCommand = defineCommand138({
|
|
25836
26283
|
meta: {
|
|
25837
26284
|
name: "keyword-gap",
|
|
25838
26285
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -25906,7 +26353,7 @@ Examples:
|
|
|
25906
26353
|
});
|
|
25907
26354
|
|
|
25908
26355
|
// src/commands/research/keywords-for-site.ts
|
|
25909
|
-
import { defineCommand as
|
|
26356
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
25910
26357
|
registerSchema({
|
|
25911
26358
|
command: "research.keywords-for-site",
|
|
25912
26359
|
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.",
|
|
@@ -25939,7 +26386,7 @@ var FIELDS8 = {
|
|
|
25939
26386
|
competition: "LOW, MEDIUM, or HIGH",
|
|
25940
26387
|
competition_index: "Competition score 0-100"
|
|
25941
26388
|
};
|
|
25942
|
-
var keywordsForSiteCommand =
|
|
26389
|
+
var keywordsForSiteCommand = defineCommand139({
|
|
25943
26390
|
meta: {
|
|
25944
26391
|
name: "keywords-for-site",
|
|
25945
26392
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -25992,7 +26439,7 @@ Examples:
|
|
|
25992
26439
|
});
|
|
25993
26440
|
|
|
25994
26441
|
// src/commands/research/languages.ts
|
|
25995
|
-
import { defineCommand as
|
|
26442
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
25996
26443
|
registerSchema({
|
|
25997
26444
|
command: "research.languages",
|
|
25998
26445
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -26022,7 +26469,7 @@ var FIELDS9 = {
|
|
|
26022
26469
|
code: "Language code to pass as --language",
|
|
26023
26470
|
name: "Language name (also accepted by --language)"
|
|
26024
26471
|
};
|
|
26025
|
-
var languagesCommand2 =
|
|
26472
|
+
var languagesCommand2 = defineCommand140({
|
|
26026
26473
|
meta: {
|
|
26027
26474
|
name: "languages",
|
|
26028
26475
|
description: "List all supported language codes for --language flag."
|
|
@@ -26033,7 +26480,7 @@ var languagesCommand2 = defineCommand139({
|
|
|
26033
26480
|
});
|
|
26034
26481
|
|
|
26035
26482
|
// src/commands/research/lighthouse.ts
|
|
26036
|
-
import { defineCommand as
|
|
26483
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
26037
26484
|
registerSchema({
|
|
26038
26485
|
command: "research.lighthouse",
|
|
26039
26486
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -26052,7 +26499,7 @@ var FIELDS10 = {
|
|
|
26052
26499
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
26053
26500
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
26054
26501
|
};
|
|
26055
|
-
var lighthouseCommand =
|
|
26502
|
+
var lighthouseCommand = defineCommand141({
|
|
26056
26503
|
meta: {
|
|
26057
26504
|
name: "lighthouse",
|
|
26058
26505
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -26090,7 +26537,7 @@ Examples:
|
|
|
26090
26537
|
});
|
|
26091
26538
|
|
|
26092
26539
|
// src/commands/research/relevant-pages.ts
|
|
26093
|
-
import { defineCommand as
|
|
26540
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
26094
26541
|
registerSchema({
|
|
26095
26542
|
command: "research.relevant-pages",
|
|
26096
26543
|
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).",
|
|
@@ -26116,7 +26563,7 @@ var FIELDS11 = {
|
|
|
26116
26563
|
keywords: "Total organic keywords the page ranks for",
|
|
26117
26564
|
top_10: "Keywords in positions 1-10"
|
|
26118
26565
|
};
|
|
26119
|
-
var relevantPagesCommand =
|
|
26566
|
+
var relevantPagesCommand = defineCommand142({
|
|
26120
26567
|
meta: {
|
|
26121
26568
|
name: "relevant-pages",
|
|
26122
26569
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -26162,7 +26609,7 @@ Examples:
|
|
|
26162
26609
|
});
|
|
26163
26610
|
|
|
26164
26611
|
// src/commands/research/web.ts
|
|
26165
|
-
import { defineCommand as
|
|
26612
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
26166
26613
|
registerSchema({
|
|
26167
26614
|
command: "research.web",
|
|
26168
26615
|
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).",
|
|
@@ -26213,7 +26660,7 @@ async function runDeepResearch(question) {
|
|
|
26213
26660
|
}
|
|
26214
26661
|
throw new Error("Deep research timed out");
|
|
26215
26662
|
}
|
|
26216
|
-
var webCommand =
|
|
26663
|
+
var webCommand = defineCommand143({
|
|
26217
26664
|
meta: {
|
|
26218
26665
|
name: "web",
|
|
26219
26666
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -26273,7 +26720,7 @@ Examples:
|
|
|
26273
26720
|
});
|
|
26274
26721
|
|
|
26275
26722
|
// src/commands/research/index.ts
|
|
26276
|
-
var researchCommand =
|
|
26723
|
+
var researchCommand = defineCommand144({
|
|
26277
26724
|
meta: {
|
|
26278
26725
|
name: "research",
|
|
26279
26726
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -26313,10 +26760,10 @@ Examples:
|
|
|
26313
26760
|
});
|
|
26314
26761
|
|
|
26315
26762
|
// src/commands/scheduled-actions/index.ts
|
|
26316
|
-
import { defineCommand as
|
|
26763
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
26317
26764
|
|
|
26318
26765
|
// src/commands/scheduled-actions/create.ts
|
|
26319
|
-
import { defineCommand as
|
|
26766
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
26320
26767
|
|
|
26321
26768
|
// src/commands/scheduled-actions/shared.ts
|
|
26322
26769
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -26431,7 +26878,7 @@ registerSchema({
|
|
|
26431
26878
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
26432
26879
|
}
|
|
26433
26880
|
});
|
|
26434
|
-
var createCommand2 =
|
|
26881
|
+
var createCommand2 = defineCommand145({
|
|
26435
26882
|
meta: {
|
|
26436
26883
|
name: "create",
|
|
26437
26884
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -26480,7 +26927,7 @@ var createCommand2 = defineCommand144({
|
|
|
26480
26927
|
});
|
|
26481
26928
|
|
|
26482
26929
|
// src/commands/scheduled-actions/delete.ts
|
|
26483
|
-
import { defineCommand as
|
|
26930
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
26484
26931
|
registerSchema({
|
|
26485
26932
|
command: "scheduled-actions.delete",
|
|
26486
26933
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -26488,7 +26935,7 @@ registerSchema({
|
|
|
26488
26935
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
26489
26936
|
}
|
|
26490
26937
|
});
|
|
26491
|
-
var deleteCommand2 =
|
|
26938
|
+
var deleteCommand2 = defineCommand146({
|
|
26492
26939
|
meta: {
|
|
26493
26940
|
name: "delete",
|
|
26494
26941
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -26517,7 +26964,7 @@ var deleteCommand2 = defineCommand145({
|
|
|
26517
26964
|
});
|
|
26518
26965
|
|
|
26519
26966
|
// src/commands/scheduled-actions/get.ts
|
|
26520
|
-
import { defineCommand as
|
|
26967
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
26521
26968
|
registerSchema({
|
|
26522
26969
|
command: "scheduled-actions.get",
|
|
26523
26970
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -26525,7 +26972,7 @@ registerSchema({
|
|
|
26525
26972
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
26526
26973
|
}
|
|
26527
26974
|
});
|
|
26528
|
-
var getCommand3 =
|
|
26975
|
+
var getCommand3 = defineCommand147({
|
|
26529
26976
|
meta: {
|
|
26530
26977
|
name: "get",
|
|
26531
26978
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -26562,13 +27009,13 @@ var getCommand3 = defineCommand146({
|
|
|
26562
27009
|
});
|
|
26563
27010
|
|
|
26564
27011
|
// src/commands/scheduled-actions/list.ts
|
|
26565
|
-
import { defineCommand as
|
|
27012
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
26566
27013
|
registerSchema({
|
|
26567
27014
|
command: "scheduled-actions.list",
|
|
26568
27015
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
26569
27016
|
args: {}
|
|
26570
27017
|
});
|
|
26571
|
-
var
|
|
27018
|
+
var listCommand9 = defineCommand148({
|
|
26572
27019
|
meta: {
|
|
26573
27020
|
name: "list",
|
|
26574
27021
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -26589,7 +27036,7 @@ var listCommand8 = defineCommand147({
|
|
|
26589
27036
|
});
|
|
26590
27037
|
|
|
26591
27038
|
// src/commands/scheduled-actions/trigger.ts
|
|
26592
|
-
import { defineCommand as
|
|
27039
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
26593
27040
|
registerSchema({
|
|
26594
27041
|
command: "scheduled-actions.trigger",
|
|
26595
27042
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -26597,7 +27044,7 @@ registerSchema({
|
|
|
26597
27044
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
26598
27045
|
}
|
|
26599
27046
|
});
|
|
26600
|
-
var triggerCommand =
|
|
27047
|
+
var triggerCommand = defineCommand149({
|
|
26601
27048
|
meta: {
|
|
26602
27049
|
name: "trigger",
|
|
26603
27050
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -26634,7 +27081,7 @@ var triggerCommand = defineCommand148({
|
|
|
26634
27081
|
});
|
|
26635
27082
|
|
|
26636
27083
|
// src/commands/scheduled-actions/update.ts
|
|
26637
|
-
import { defineCommand as
|
|
27084
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
26638
27085
|
registerSchema({
|
|
26639
27086
|
command: "scheduled-actions.update",
|
|
26640
27087
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -26659,7 +27106,7 @@ registerSchema({
|
|
|
26659
27106
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
26660
27107
|
}
|
|
26661
27108
|
});
|
|
26662
|
-
var updateCommand2 =
|
|
27109
|
+
var updateCommand2 = defineCommand150({
|
|
26663
27110
|
meta: {
|
|
26664
27111
|
name: "update",
|
|
26665
27112
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -26730,7 +27177,7 @@ var updateCommand2 = defineCommand149({
|
|
|
26730
27177
|
});
|
|
26731
27178
|
|
|
26732
27179
|
// src/commands/scheduled-actions/index.ts
|
|
26733
|
-
var scheduledActionsCommand =
|
|
27180
|
+
var scheduledActionsCommand = defineCommand151({
|
|
26734
27181
|
meta: {
|
|
26735
27182
|
name: "scheduled-actions",
|
|
26736
27183
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -26746,7 +27193,7 @@ Examples:
|
|
|
26746
27193
|
baker scheduled-actions trigger <id>`
|
|
26747
27194
|
},
|
|
26748
27195
|
subCommands: {
|
|
26749
|
-
list:
|
|
27196
|
+
list: listCommand9,
|
|
26750
27197
|
get: getCommand3,
|
|
26751
27198
|
create: createCommand2,
|
|
26752
27199
|
update: updateCommand2,
|
|
@@ -26756,8 +27203,8 @@ Examples:
|
|
|
26756
27203
|
});
|
|
26757
27204
|
|
|
26758
27205
|
// src/commands/schema.ts
|
|
26759
|
-
import { defineCommand as
|
|
26760
|
-
var schemaCommand =
|
|
27206
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
27207
|
+
var schemaCommand = defineCommand152({
|
|
26761
27208
|
meta: {
|
|
26762
27209
|
name: "schema",
|
|
26763
27210
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -26793,7 +27240,7 @@ var schemaCommand = defineCommand151({
|
|
|
26793
27240
|
});
|
|
26794
27241
|
|
|
26795
27242
|
// src/commands/tags/index.ts
|
|
26796
|
-
import { defineCommand as
|
|
27243
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
26797
27244
|
|
|
26798
27245
|
// src/commands/tags/shared.ts
|
|
26799
27246
|
function failApi3(err) {
|
|
@@ -26859,7 +27306,7 @@ async function listTags(json) {
|
|
|
26859
27306
|
failApi3(err);
|
|
26860
27307
|
}
|
|
26861
27308
|
}
|
|
26862
|
-
var
|
|
27309
|
+
var listCommand10 = defineCommand153({
|
|
26863
27310
|
meta: {
|
|
26864
27311
|
name: "list",
|
|
26865
27312
|
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"
|
|
@@ -26878,7 +27325,7 @@ async function listDraft3() {
|
|
|
26878
27325
|
failApi3(err);
|
|
26879
27326
|
}
|
|
26880
27327
|
}
|
|
26881
|
-
var draftCommand3 =
|
|
27328
|
+
var draftCommand3 = defineCommand153({
|
|
26882
27329
|
meta: {
|
|
26883
27330
|
name: "draft",
|
|
26884
27331
|
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)."
|
|
@@ -26887,7 +27334,7 @@ var draftCommand3 = defineCommand152({
|
|
|
26887
27334
|
await listDraft3();
|
|
26888
27335
|
}
|
|
26889
27336
|
});
|
|
26890
|
-
var tagsCommand3 =
|
|
27337
|
+
var tagsCommand3 = defineCommand153({
|
|
26891
27338
|
meta: {
|
|
26892
27339
|
name: "tags",
|
|
26893
27340
|
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.
|
|
@@ -26903,7 +27350,7 @@ Examples:
|
|
|
26903
27350
|
baker tags draft # review the staged changes awaiting publish`
|
|
26904
27351
|
},
|
|
26905
27352
|
subCommands: {
|
|
26906
|
-
list:
|
|
27353
|
+
list: listCommand10,
|
|
26907
27354
|
draft: draftCommand3
|
|
26908
27355
|
},
|
|
26909
27356
|
run: async () => {
|
|
@@ -26912,10 +27359,10 @@ Examples:
|
|
|
26912
27359
|
});
|
|
26913
27360
|
|
|
26914
27361
|
// src/commands/testimonials/index.ts
|
|
26915
|
-
import { defineCommand as
|
|
27362
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
26916
27363
|
|
|
26917
27364
|
// src/commands/testimonials/get.ts
|
|
26918
|
-
import { defineCommand as
|
|
27365
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
26919
27366
|
registerSchema({
|
|
26920
27367
|
command: "testimonials.get",
|
|
26921
27368
|
description: "Get a single testimonial by ID",
|
|
@@ -26923,7 +27370,7 @@ registerSchema({
|
|
|
26923
27370
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
26924
27371
|
}
|
|
26925
27372
|
});
|
|
26926
|
-
var getCommand4 =
|
|
27373
|
+
var getCommand4 = defineCommand154({
|
|
26927
27374
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
26928
27375
|
args: {
|
|
26929
27376
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -26960,7 +27407,7 @@ var getCommand4 = defineCommand153({
|
|
|
26960
27407
|
});
|
|
26961
27408
|
|
|
26962
27409
|
// src/commands/testimonials/list.ts
|
|
26963
|
-
import { defineCommand as
|
|
27410
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
26964
27411
|
registerSchema({
|
|
26965
27412
|
command: "testimonials.list",
|
|
26966
27413
|
description: "List testimonials with optional filters.",
|
|
@@ -26990,7 +27437,7 @@ registerSchema({
|
|
|
26990
27437
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
26991
27438
|
}
|
|
26992
27439
|
});
|
|
26993
|
-
var
|
|
27440
|
+
var listCommand11 = defineCommand155({
|
|
26994
27441
|
meta: {
|
|
26995
27442
|
name: "list",
|
|
26996
27443
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -27039,7 +27486,7 @@ var listCommand10 = defineCommand154({
|
|
|
27039
27486
|
});
|
|
27040
27487
|
|
|
27041
27488
|
// src/commands/testimonials/search.ts
|
|
27042
|
-
import { defineCommand as
|
|
27489
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
27043
27490
|
function languageBiasHint(results, requestedLanguage) {
|
|
27044
27491
|
if (requestedLanguage) {
|
|
27045
27492
|
return null;
|
|
@@ -27117,7 +27564,7 @@ function buildSearchRequest(query, args) {
|
|
|
27117
27564
|
}
|
|
27118
27565
|
return body;
|
|
27119
27566
|
}
|
|
27120
|
-
var searchCommand2 =
|
|
27567
|
+
var searchCommand2 = defineCommand156({
|
|
27121
27568
|
meta: {
|
|
27122
27569
|
name: "search",
|
|
27123
27570
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -27173,7 +27620,7 @@ var searchCommand2 = defineCommand155({
|
|
|
27173
27620
|
var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
27174
27621
|
|
|
27175
27622
|
// src/commands/testimonials/index.ts
|
|
27176
|
-
var testimonialsCommand =
|
|
27623
|
+
var testimonialsCommand = defineCommand157({
|
|
27177
27624
|
meta: {
|
|
27178
27625
|
name: "testimonials",
|
|
27179
27626
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -27188,16 +27635,16 @@ Examples:
|
|
|
27188
27635
|
subCommands: {
|
|
27189
27636
|
get: getCommand4,
|
|
27190
27637
|
search: searchCommand2,
|
|
27191
|
-
list:
|
|
27638
|
+
list: listCommand11,
|
|
27192
27639
|
tags: tagsCommand4
|
|
27193
27640
|
}
|
|
27194
27641
|
});
|
|
27195
27642
|
|
|
27196
27643
|
// src/commands/videos/index.ts
|
|
27197
|
-
import { defineCommand as
|
|
27644
|
+
import { defineCommand as defineCommand162 } from "citty";
|
|
27198
27645
|
|
|
27199
27646
|
// src/commands/videos/delete.ts
|
|
27200
|
-
import { defineCommand as
|
|
27647
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
27201
27648
|
registerSchema({
|
|
27202
27649
|
command: "videos.delete",
|
|
27203
27650
|
description: "Delete a video by ID",
|
|
@@ -27211,7 +27658,7 @@ registerSchema({
|
|
|
27211
27658
|
}
|
|
27212
27659
|
}
|
|
27213
27660
|
});
|
|
27214
|
-
var deleteCommand3 =
|
|
27661
|
+
var deleteCommand3 = defineCommand158({
|
|
27215
27662
|
meta: {
|
|
27216
27663
|
name: "delete",
|
|
27217
27664
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -27252,7 +27699,7 @@ var deleteCommand3 = defineCommand157({
|
|
|
27252
27699
|
});
|
|
27253
27700
|
|
|
27254
27701
|
// src/commands/videos/get.ts
|
|
27255
|
-
import { defineCommand as
|
|
27702
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
27256
27703
|
registerSchema({
|
|
27257
27704
|
command: "videos.get",
|
|
27258
27705
|
description: "Get a single video by ID",
|
|
@@ -27260,7 +27707,7 @@ registerSchema({
|
|
|
27260
27707
|
id: { type: "string", description: "Video ID", required: true }
|
|
27261
27708
|
}
|
|
27262
27709
|
});
|
|
27263
|
-
var getCommand5 =
|
|
27710
|
+
var getCommand5 = defineCommand159({
|
|
27264
27711
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
27265
27712
|
args: {
|
|
27266
27713
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -27297,7 +27744,7 @@ var getCommand5 = defineCommand158({
|
|
|
27297
27744
|
});
|
|
27298
27745
|
|
|
27299
27746
|
// src/commands/videos/search.ts
|
|
27300
|
-
import { defineCommand as
|
|
27747
|
+
import { defineCommand as defineCommand160 } from "citty";
|
|
27301
27748
|
registerSchema({
|
|
27302
27749
|
command: "videos.search",
|
|
27303
27750
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -27307,7 +27754,7 @@ registerSchema({
|
|
|
27307
27754
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
27308
27755
|
}
|
|
27309
27756
|
});
|
|
27310
|
-
var searchCommand3 =
|
|
27757
|
+
var searchCommand3 = defineCommand160({
|
|
27311
27758
|
meta: {
|
|
27312
27759
|
name: "search",
|
|
27313
27760
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -27359,7 +27806,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
27359
27806
|
// src/commands/videos/upload.ts
|
|
27360
27807
|
import { readFile as readFile20, stat as stat5 } from "fs/promises";
|
|
27361
27808
|
import { extname as extname3 } from "path";
|
|
27362
|
-
import { defineCommand as
|
|
27809
|
+
import { defineCommand as defineCommand161 } from "citty";
|
|
27363
27810
|
var MIME_MAP = {
|
|
27364
27811
|
".mp4": "video/mp4",
|
|
27365
27812
|
".mov": "video/quicktime",
|
|
@@ -27393,7 +27840,7 @@ function detectContentType(filePath) {
|
|
|
27393
27840
|
}
|
|
27394
27841
|
return mime;
|
|
27395
27842
|
}
|
|
27396
|
-
var uploadCommand2 =
|
|
27843
|
+
var uploadCommand2 = defineCommand161({
|
|
27397
27844
|
meta: {
|
|
27398
27845
|
name: "upload",
|
|
27399
27846
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -27447,7 +27894,7 @@ var uploadCommand2 = defineCommand160({
|
|
|
27447
27894
|
});
|
|
27448
27895
|
|
|
27449
27896
|
// src/commands/videos/index.ts
|
|
27450
|
-
var videosCommand =
|
|
27897
|
+
var videosCommand = defineCommand162({
|
|
27451
27898
|
meta: {
|
|
27452
27899
|
name: "videos",
|
|
27453
27900
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -27470,10 +27917,10 @@ Examples:
|
|
|
27470
27917
|
});
|
|
27471
27918
|
|
|
27472
27919
|
// src/commands/winning-ads/index.ts
|
|
27473
|
-
import { defineCommand as
|
|
27920
|
+
import { defineCommand as defineCommand173 } from "citty";
|
|
27474
27921
|
|
|
27475
27922
|
// src/commands/winning-ads/advertisers.ts
|
|
27476
|
-
import { defineCommand as
|
|
27923
|
+
import { defineCommand as defineCommand163 } from "citty";
|
|
27477
27924
|
|
|
27478
27925
|
// src/commands/winning-ads/shared.ts
|
|
27479
27926
|
function splitList(value) {
|
|
@@ -27526,7 +27973,7 @@ function advertiserNormalizer(record, full) {
|
|
|
27526
27973
|
last_synced_at: record.last_synced_at ?? null
|
|
27527
27974
|
};
|
|
27528
27975
|
}
|
|
27529
|
-
var advertisersCommand2 =
|
|
27976
|
+
var advertisersCommand2 = defineCommand163({
|
|
27530
27977
|
meta: {
|
|
27531
27978
|
name: "advertisers",
|
|
27532
27979
|
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'
|
|
@@ -27584,7 +28031,7 @@ var advertisersCommand2 = defineCommand162({
|
|
|
27584
28031
|
});
|
|
27585
28032
|
|
|
27586
28033
|
// src/commands/winning-ads/brief.ts
|
|
27587
|
-
import { defineCommand as
|
|
28034
|
+
import { defineCommand as defineCommand164 } from "citty";
|
|
27588
28035
|
registerSchema({
|
|
27589
28036
|
command: "winning-ads.brief",
|
|
27590
28037
|
description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
|
|
@@ -27630,7 +28077,7 @@ function parseDna(raw) {
|
|
|
27630
28077
|
}
|
|
27631
28078
|
return parsed;
|
|
27632
28079
|
}
|
|
27633
|
-
var briefCommand =
|
|
28080
|
+
var briefCommand = defineCommand164({
|
|
27634
28081
|
meta: {
|
|
27635
28082
|
name: "brief",
|
|
27636
28083
|
description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
|
|
@@ -27666,7 +28113,7 @@ var briefCommand = defineCommand163({
|
|
|
27666
28113
|
});
|
|
27667
28114
|
|
|
27668
28115
|
// src/commands/winning-ads/feed.ts
|
|
27669
|
-
import { defineCommand as
|
|
28116
|
+
import { defineCommand as defineCommand165 } from "citty";
|
|
27670
28117
|
function buildFeedParams(input) {
|
|
27671
28118
|
const params = {};
|
|
27672
28119
|
const advertiser = splitList(input.advertiser);
|
|
@@ -27718,7 +28165,7 @@ registerSchema({
|
|
|
27718
28165
|
format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
|
|
27719
28166
|
}
|
|
27720
28167
|
});
|
|
27721
|
-
var feedCommand =
|
|
28168
|
+
var feedCommand = defineCommand165({
|
|
27722
28169
|
meta: {
|
|
27723
28170
|
name: "feed",
|
|
27724
28171
|
description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
|
|
@@ -27803,7 +28250,7 @@ var feedCommand = defineCommand164({
|
|
|
27803
28250
|
});
|
|
27804
28251
|
|
|
27805
28252
|
// src/commands/winning-ads/follow.ts
|
|
27806
|
-
import { defineCommand as
|
|
28253
|
+
import { defineCommand as defineCommand166 } from "citty";
|
|
27807
28254
|
var PLATFORMS = ["meta", "linkedin"];
|
|
27808
28255
|
registerSchema({
|
|
27809
28256
|
command: "winning-ads.follow",
|
|
@@ -27818,7 +28265,7 @@ registerSchema({
|
|
|
27818
28265
|
label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
|
|
27819
28266
|
}
|
|
27820
28267
|
});
|
|
27821
|
-
var followCommand =
|
|
28268
|
+
var followCommand = defineCommand166({
|
|
27822
28269
|
meta: {
|
|
27823
28270
|
name: "follow",
|
|
27824
28271
|
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'
|
|
@@ -27865,7 +28312,7 @@ var followCommand = defineCommand165({
|
|
|
27865
28312
|
});
|
|
27866
28313
|
|
|
27867
28314
|
// src/commands/winning-ads/following.ts
|
|
27868
|
-
import { defineCommand as
|
|
28315
|
+
import { defineCommand as defineCommand167 } from "citty";
|
|
27869
28316
|
registerSchema({
|
|
27870
28317
|
command: "winning-ads.following",
|
|
27871
28318
|
description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
|
|
@@ -27898,7 +28345,7 @@ function followingNormalizer(record, full) {
|
|
|
27898
28345
|
platforms: Array.isArray(record.platforms) ? record.platforms : []
|
|
27899
28346
|
};
|
|
27900
28347
|
}
|
|
27901
|
-
var followingCommand =
|
|
28348
|
+
var followingCommand = defineCommand167({
|
|
27902
28349
|
meta: {
|
|
27903
28350
|
name: "following",
|
|
27904
28351
|
description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
|
|
@@ -27933,7 +28380,7 @@ var followingCommand = defineCommand166({
|
|
|
27933
28380
|
});
|
|
27934
28381
|
|
|
27935
28382
|
// src/commands/winning-ads/patterns.ts
|
|
27936
|
-
import { defineCommand as
|
|
28383
|
+
import { defineCommand as defineCommand168 } from "citty";
|
|
27937
28384
|
registerSchema({
|
|
27938
28385
|
command: "winning-ads.patterns",
|
|
27939
28386
|
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.",
|
|
@@ -27972,7 +28419,7 @@ function discriminatorRow(record) {
|
|
|
27972
28419
|
top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
|
|
27973
28420
|
};
|
|
27974
28421
|
}
|
|
27975
|
-
var patternsCommand =
|
|
28422
|
+
var patternsCommand = defineCommand168({
|
|
27976
28423
|
meta: {
|
|
27977
28424
|
name: "patterns",
|
|
27978
28425
|
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"
|
|
@@ -28028,7 +28475,7 @@ var patternsCommand = defineCommand167({
|
|
|
28028
28475
|
});
|
|
28029
28476
|
|
|
28030
28477
|
// src/commands/winning-ads/search.ts
|
|
28031
|
-
import { defineCommand as
|
|
28478
|
+
import { defineCommand as defineCommand169 } from "citty";
|
|
28032
28479
|
registerSchema({
|
|
28033
28480
|
command: "winning-ads.search",
|
|
28034
28481
|
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.",
|
|
@@ -28136,7 +28583,7 @@ function buildSearchBody(args) {
|
|
|
28136
28583
|
}
|
|
28137
28584
|
return body;
|
|
28138
28585
|
}
|
|
28139
|
-
var searchCommand4 =
|
|
28586
|
+
var searchCommand4 = defineCommand169({
|
|
28140
28587
|
meta: {
|
|
28141
28588
|
name: "search",
|
|
28142
28589
|
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"
|
|
@@ -28251,7 +28698,7 @@ var searchCommand4 = defineCommand168({
|
|
|
28251
28698
|
});
|
|
28252
28699
|
|
|
28253
28700
|
// src/commands/winning-ads/seeds.ts
|
|
28254
|
-
import { defineCommand as
|
|
28701
|
+
import { defineCommand as defineCommand170 } from "citty";
|
|
28255
28702
|
function leanRow(r) {
|
|
28256
28703
|
return {
|
|
28257
28704
|
key: r.key,
|
|
@@ -28279,7 +28726,7 @@ function makeSeedCommand(opts) {
|
|
|
28279
28726
|
limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
|
|
28280
28727
|
}
|
|
28281
28728
|
});
|
|
28282
|
-
return
|
|
28729
|
+
return defineCommand170({
|
|
28283
28730
|
meta: { name: opts.name, description: opts.description },
|
|
28284
28731
|
args: {
|
|
28285
28732
|
platform: { type: "string", description: "Single platform to segment on", required: false },
|
|
@@ -28328,7 +28775,7 @@ var formatsCommand = makeSeedCommand({
|
|
|
28328
28775
|
});
|
|
28329
28776
|
|
|
28330
28777
|
// src/commands/winning-ads/unfollow.ts
|
|
28331
|
-
import { defineCommand as
|
|
28778
|
+
import { defineCommand as defineCommand171 } from "citty";
|
|
28332
28779
|
registerSchema({
|
|
28333
28780
|
command: "winning-ads.unfollow",
|
|
28334
28781
|
description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
|
|
@@ -28336,7 +28783,7 @@ registerSchema({
|
|
|
28336
28783
|
advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
|
|
28337
28784
|
}
|
|
28338
28785
|
});
|
|
28339
|
-
var unfollowCommand =
|
|
28786
|
+
var unfollowCommand = defineCommand171({
|
|
28340
28787
|
meta: {
|
|
28341
28788
|
name: "unfollow",
|
|
28342
28789
|
description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
|
|
@@ -28357,7 +28804,7 @@ var unfollowCommand = defineCommand170({
|
|
|
28357
28804
|
});
|
|
28358
28805
|
|
|
28359
28806
|
// src/commands/winning-ads/winners.ts
|
|
28360
|
-
import { defineCommand as
|
|
28807
|
+
import { defineCommand as defineCommand172 } from "citty";
|
|
28361
28808
|
registerSchema({
|
|
28362
28809
|
command: "winning-ads.winners",
|
|
28363
28810
|
description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
|
|
@@ -28367,7 +28814,7 @@ registerSchema({
|
|
|
28367
28814
|
platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
|
|
28368
28815
|
}
|
|
28369
28816
|
});
|
|
28370
|
-
var winnersCommand =
|
|
28817
|
+
var winnersCommand = defineCommand172({
|
|
28371
28818
|
meta: {
|
|
28372
28819
|
name: "winners",
|
|
28373
28820
|
description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
|
|
@@ -28417,7 +28864,7 @@ var winnersCommand = defineCommand171({
|
|
|
28417
28864
|
});
|
|
28418
28865
|
|
|
28419
28866
|
// src/commands/winning-ads/index.ts
|
|
28420
|
-
var winningAdsCommand =
|
|
28867
|
+
var winningAdsCommand = defineCommand173({
|
|
28421
28868
|
meta: {
|
|
28422
28869
|
name: "winning-ads",
|
|
28423
28870
|
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.
|
|
@@ -28482,7 +28929,7 @@ function getCliVersion() {
|
|
|
28482
28929
|
}
|
|
28483
28930
|
|
|
28484
28931
|
// src/cli.ts
|
|
28485
|
-
var main =
|
|
28932
|
+
var main = defineCommand174({
|
|
28486
28933
|
meta: {
|
|
28487
28934
|
name: "baker",
|
|
28488
28935
|
version: getCliVersion(),
|
|
@@ -28508,6 +28955,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
28508
28955
|
testimonials: testimonialsCommand,
|
|
28509
28956
|
canvas: canvasCommand,
|
|
28510
28957
|
tags: tagsCommand3,
|
|
28958
|
+
chats: chatsCommand,
|
|
28511
28959
|
history: historyCommand,
|
|
28512
28960
|
"winning-ads": winningAdsCommand,
|
|
28513
28961
|
mcp: mcpCommand,
|