trace-avatar-render 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -1
- package/README.md +85 -0
- package/dist/{chunk-ZNHFXKD3.js → chunk-EAMOVIQK.js} +2106 -570
- package/dist/chunk-EAMOVIQK.js.map +1 -0
- package/dist/cli.js +6 -419
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +512 -9
- package/dist/index.js +73 -1
- package/package.json +15 -2
- package/schemas/catalogue-1.json +48 -0
- package/dist/chunk-ZNHFXKD3.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CAMPAIGN_KINDS,
|
|
3
|
+
CAMPAIGN_SHAPES,
|
|
2
4
|
CANVASES,
|
|
5
|
+
CATALOGUE_FORMATS,
|
|
6
|
+
CATALOGUE_KINDS,
|
|
7
|
+
CATALOGUE_REQUIRED,
|
|
8
|
+
CATALOGUE_SHAPES,
|
|
9
|
+
CATALOGUE_SPEC,
|
|
3
10
|
CORNERS,
|
|
4
11
|
DEFAULT_BACKGROUND,
|
|
5
12
|
DEFAULT_MAX_WAIT_MS,
|
|
13
|
+
DIRECTOR_VIEWPORT,
|
|
6
14
|
GEMINI_TTS,
|
|
7
15
|
RenderError,
|
|
16
|
+
SKIP_KEEP_MS,
|
|
8
17
|
TRACK_RATE,
|
|
9
18
|
ZOOM_KINDS,
|
|
10
19
|
actionsOf,
|
|
20
|
+
aliasOf,
|
|
21
|
+
arrowSprite,
|
|
11
22
|
badgeAt,
|
|
12
23
|
blank,
|
|
13
24
|
brandFile,
|
|
@@ -20,18 +31,28 @@ import {
|
|
|
20
31
|
capture,
|
|
21
32
|
cardFrames,
|
|
22
33
|
cardOf,
|
|
34
|
+
cardsOf,
|
|
35
|
+
catalogueId,
|
|
23
36
|
chapterCues,
|
|
37
|
+
checkCampaign,
|
|
38
|
+
checkCatalogue,
|
|
24
39
|
createGifWriter,
|
|
25
40
|
createLayers,
|
|
26
41
|
crop,
|
|
27
42
|
crossfade,
|
|
28
43
|
cueAt,
|
|
44
|
+
cursorAt,
|
|
29
45
|
dataUri,
|
|
46
|
+
direct,
|
|
47
|
+
drawCursor,
|
|
30
48
|
drawRegion,
|
|
31
49
|
durationOf,
|
|
32
50
|
editList,
|
|
33
51
|
encodeGif,
|
|
34
52
|
encodeMp4,
|
|
53
|
+
endsWithOf,
|
|
54
|
+
ensureApp,
|
|
55
|
+
filesOf,
|
|
35
56
|
findFfmpeg,
|
|
36
57
|
findPlayer,
|
|
37
58
|
finish,
|
|
@@ -43,8 +64,12 @@ import {
|
|
|
43
64
|
geminiVoice,
|
|
44
65
|
layoutOf,
|
|
45
66
|
linesOf,
|
|
67
|
+
loadCampaign,
|
|
68
|
+
lookOptions,
|
|
69
|
+
makeCampaign,
|
|
46
70
|
mix,
|
|
47
71
|
mp4Args,
|
|
72
|
+
mp4Head,
|
|
48
73
|
msOf,
|
|
49
74
|
narrationText,
|
|
50
75
|
openAiVoice,
|
|
@@ -53,40 +78,62 @@ import {
|
|
|
53
78
|
pageAt,
|
|
54
79
|
paletteOf,
|
|
55
80
|
parseScript,
|
|
81
|
+
pathOf,
|
|
56
82
|
pickFrames,
|
|
57
83
|
pixel,
|
|
58
84
|
planNarration,
|
|
85
|
+
progressOf,
|
|
59
86
|
providerOf,
|
|
87
|
+
readCampaign,
|
|
60
88
|
render,
|
|
89
|
+
rendersOf,
|
|
61
90
|
repairGuide,
|
|
62
91
|
repairScriptOf,
|
|
63
92
|
resample,
|
|
64
93
|
resize,
|
|
65
94
|
runQa,
|
|
95
|
+
sayFrom,
|
|
66
96
|
sayVoice,
|
|
97
|
+
saysOf,
|
|
98
|
+
shapeTag,
|
|
67
99
|
sourceAt,
|
|
68
100
|
spansOf,
|
|
69
101
|
stallInspector,
|
|
102
|
+
statusOf,
|
|
70
103
|
stepCues,
|
|
71
104
|
suggestScript,
|
|
72
105
|
toVtt,
|
|
73
106
|
toWav,
|
|
107
|
+
travelMs,
|
|
74
108
|
trimSilence,
|
|
75
109
|
voiceOf,
|
|
110
|
+
vttEnds,
|
|
76
111
|
watermarkOf,
|
|
77
112
|
withCards,
|
|
113
|
+
withCursor,
|
|
78
114
|
withHolds
|
|
79
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-EAMOVIQK.js";
|
|
80
116
|
export {
|
|
117
|
+
CAMPAIGN_KINDS,
|
|
118
|
+
CAMPAIGN_SHAPES,
|
|
81
119
|
CANVASES,
|
|
120
|
+
CATALOGUE_FORMATS,
|
|
121
|
+
CATALOGUE_KINDS,
|
|
122
|
+
CATALOGUE_REQUIRED,
|
|
123
|
+
CATALOGUE_SHAPES,
|
|
124
|
+
CATALOGUE_SPEC,
|
|
82
125
|
CORNERS,
|
|
83
126
|
DEFAULT_BACKGROUND,
|
|
84
127
|
DEFAULT_MAX_WAIT_MS,
|
|
128
|
+
DIRECTOR_VIEWPORT,
|
|
85
129
|
GEMINI_TTS,
|
|
86
130
|
RenderError,
|
|
131
|
+
SKIP_KEEP_MS,
|
|
87
132
|
TRACK_RATE,
|
|
88
133
|
ZOOM_KINDS,
|
|
89
134
|
actionsOf,
|
|
135
|
+
aliasOf,
|
|
136
|
+
arrowSprite,
|
|
90
137
|
badgeAt,
|
|
91
138
|
blank,
|
|
92
139
|
brandFile,
|
|
@@ -99,18 +146,28 @@ export {
|
|
|
99
146
|
capture,
|
|
100
147
|
cardFrames,
|
|
101
148
|
cardOf,
|
|
149
|
+
cardsOf,
|
|
150
|
+
catalogueId,
|
|
102
151
|
chapterCues,
|
|
152
|
+
checkCampaign,
|
|
153
|
+
checkCatalogue,
|
|
103
154
|
createGifWriter,
|
|
104
155
|
createLayers,
|
|
105
156
|
crop,
|
|
106
157
|
crossfade,
|
|
107
158
|
cueAt,
|
|
159
|
+
cursorAt,
|
|
108
160
|
dataUri,
|
|
161
|
+
direct,
|
|
162
|
+
drawCursor,
|
|
109
163
|
drawRegion,
|
|
110
164
|
durationOf,
|
|
111
165
|
editList,
|
|
112
166
|
encodeGif,
|
|
113
167
|
encodeMp4,
|
|
168
|
+
endsWithOf,
|
|
169
|
+
ensureApp,
|
|
170
|
+
filesOf,
|
|
114
171
|
findFfmpeg,
|
|
115
172
|
findPlayer,
|
|
116
173
|
finish,
|
|
@@ -122,8 +179,12 @@ export {
|
|
|
122
179
|
geminiVoice,
|
|
123
180
|
layoutOf,
|
|
124
181
|
linesOf,
|
|
182
|
+
loadCampaign,
|
|
183
|
+
lookOptions,
|
|
184
|
+
makeCampaign,
|
|
125
185
|
mix,
|
|
126
186
|
mp4Args,
|
|
187
|
+
mp4Head,
|
|
127
188
|
msOf,
|
|
128
189
|
narrationText,
|
|
129
190
|
openAiVoice,
|
|
@@ -132,28 +193,39 @@ export {
|
|
|
132
193
|
pageAt,
|
|
133
194
|
paletteOf,
|
|
134
195
|
parseScript,
|
|
196
|
+
pathOf,
|
|
135
197
|
pickFrames,
|
|
136
198
|
pixel,
|
|
137
199
|
planNarration,
|
|
200
|
+
progressOf,
|
|
138
201
|
providerOf,
|
|
202
|
+
readCampaign,
|
|
139
203
|
render,
|
|
204
|
+
rendersOf,
|
|
140
205
|
repairGuide,
|
|
141
206
|
repairScriptOf,
|
|
142
207
|
resample,
|
|
143
208
|
resize,
|
|
144
209
|
runQa,
|
|
210
|
+
sayFrom,
|
|
145
211
|
sayVoice,
|
|
212
|
+
saysOf,
|
|
213
|
+
shapeTag,
|
|
146
214
|
sourceAt,
|
|
147
215
|
spansOf,
|
|
148
216
|
stallInspector,
|
|
217
|
+
statusOf,
|
|
149
218
|
stepCues,
|
|
150
219
|
suggestScript,
|
|
151
220
|
toVtt,
|
|
152
221
|
toWav,
|
|
222
|
+
travelMs,
|
|
153
223
|
trimSilence,
|
|
154
224
|
voiceOf,
|
|
225
|
+
vttEnds,
|
|
155
226
|
watermarkOf,
|
|
156
227
|
withCards,
|
|
228
|
+
withCursor,
|
|
157
229
|
withHolds
|
|
158
230
|
};
|
|
159
231
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trace-avatar-render",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Render a trace-avatar guide to a GIF or MP4 by playing it on your real app in headless Chromium.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"import": "./dist/index.js"
|
|
15
15
|
},
|
|
16
|
-
"./package.json": "./package.json"
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
"./schemas/catalogue-1.json": "./schemas/catalogue-1.json"
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
20
|
"dist",
|
|
21
|
+
"schemas",
|
|
20
22
|
"README.md",
|
|
21
23
|
"CHANGELOG.md",
|
|
22
24
|
"LICENSE"
|
|
@@ -69,5 +71,16 @@
|
|
|
69
71
|
"tsup": "^8.5.1",
|
|
70
72
|
"typescript": "^5.9.3",
|
|
71
73
|
"vitest": "^3.2.7"
|
|
74
|
+
},
|
|
75
|
+
"optionalDependencies": {
|
|
76
|
+
"ffmpeg-static": "^5.2.0"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@playwright/test": ">=1.40"
|
|
80
|
+
},
|
|
81
|
+
"peerDependenciesMeta": {
|
|
82
|
+
"@playwright/test": {
|
|
83
|
+
"optional": true
|
|
84
|
+
}
|
|
72
85
|
}
|
|
73
86
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://traceavatar.com/schemas/catalogue-1.json",
|
|
4
|
+
"title": "trace-avatar-catalogue/1",
|
|
5
|
+
"description": "A product's published marketing videos: one entry per file and shape. `trace-avatar-render catalogue check` checks this and the rules a schema can't (unique ids, captions that fit the video, links that answer).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["spec", "updated", "videos"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"spec": { "const": "trace-avatar-catalogue/1" },
|
|
10
|
+
"updated": { "type": "string", "format": "date-time" },
|
|
11
|
+
"videos": { "type": "array", "items": { "$ref": "#/$defs/entry" } }
|
|
12
|
+
},
|
|
13
|
+
"$defs": {
|
|
14
|
+
"word": { "type": "string", "pattern": "^\\S+$" },
|
|
15
|
+
"https": { "type": "string", "format": "uri", "pattern": "^https://" },
|
|
16
|
+
"entry": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["id", "product", "video", "kind", "preset", "shape", "format", "url", "captionsBurned", "seconds", "narrated", "alt", "site", "made"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"id": { "$ref": "#/$defs/word", "description": "Stable across re-renders: <product>/<video>/<preset>/<shape|gif>." },
|
|
21
|
+
"product": { "$ref": "#/$defs/word", "description": "The product it promotes." },
|
|
22
|
+
"video": { "$ref": "#/$defs/word", "description": "The video it is a cut of; its shapes share it." },
|
|
23
|
+
"kind": { "enum": ["intro", "demo", "guide", "onboarding", "pitch", "whats-new", "ad", "docs-gif", "qa", "support"] },
|
|
24
|
+
"preset": { "$ref": "#/$defs/word", "description": "The look: product (its own brand) or another." },
|
|
25
|
+
"shape": { "enum": ["16:9", "1:1", "4:5", "9:16", null], "description": "The canvas; null for a GIF." },
|
|
26
|
+
"format": { "enum": ["mp4", "gif"] },
|
|
27
|
+
"url": { "$ref": "#/$defs/https", "description": "The file. Content-addressed and cached forever is recommended." },
|
|
28
|
+
"poster": { "$ref": "#/$defs/https" },
|
|
29
|
+
"captions": { "$ref": "#/$defs/https", "description": "WebVTT, when the captions are not burned in." },
|
|
30
|
+
"language": { "type": "string", "pattern": "^[a-z]{2}$", "description": "The captions' and narration's language; en when absent." },
|
|
31
|
+
"captionsBurned": { "type": "boolean" },
|
|
32
|
+
"seconds": { "type": "number", "exclusiveMinimum": 0 },
|
|
33
|
+
"narrated": { "type": "boolean" },
|
|
34
|
+
"title": { "type": ["string", "null"] },
|
|
35
|
+
"alt": { "type": "string", "minLength": 1, "description": "What it shows, plainly." },
|
|
36
|
+
"says": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "The video's own words, in order: its captions (the spoken lines when narrated) and its cards' lines." },
|
|
37
|
+
"site": { "$ref": "#/$defs/https" },
|
|
38
|
+
"endsWith": { "type": "string", "description": "What its last card says." },
|
|
39
|
+
"made": { "type": "string", "format": "date-time" }
|
|
40
|
+
},
|
|
41
|
+
"allOf": [
|
|
42
|
+
{ "if": { "properties": { "format": { "const": "gif" } } }, "then": { "properties": { "shape": { "const": null } } } },
|
|
43
|
+
{ "if": { "properties": { "format": { "const": "mp4" } } }, "then": { "properties": { "shape": { "enum": ["16:9", "1:1", "4:5", "9:16"] } } } },
|
|
44
|
+
{ "if": { "properties": { "captionsBurned": { "const": true } }, "required": ["captionsBurned"] }, "then": { "not": { "required": ["captions"] } } }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|