@agentmedia/schema 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v2/selfie.d.ts +29 -0
- package/dist/v2/selfie.d.ts.map +1 -1
- package/dist/v2/selfie.js +28 -0
- package/dist/v2/selfie.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-v2-docs.ts +16 -3
- package/src/v2/selfie.ts +42 -0
package/dist/v2/selfie.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export declare const V2_VIBES: readonly ["excited", "calm", "sassy", "serious",
|
|
|
22
22
|
export type V2Vibe = (typeof V2_VIBES)[number];
|
|
23
23
|
export declare const V2_DURATIONS: readonly [5, 10, 15];
|
|
24
24
|
export type V2Duration = (typeof V2_DURATIONS)[number];
|
|
25
|
+
export declare const V2_PHONE_IN_FRAME: readonly ["forbidden", "optional", "required"];
|
|
26
|
+
export type V2PhoneInFrame = (typeof V2_PHONE_IN_FRAME)[number];
|
|
27
|
+
export declare const V2_POLISH_INTENSITIES: readonly ["off", "default", "heavy"];
|
|
28
|
+
export type V2PolishIntensity = (typeof V2_POLISH_INTENSITIES)[number];
|
|
25
29
|
export declare const SelfieSchema: z.ZodEffects<z.ZodObject<{
|
|
26
30
|
character_id: z.ZodOptional<z.ZodString>;
|
|
27
31
|
photo_url: z.ZodOptional<z.ZodString>;
|
|
@@ -31,42 +35,67 @@ export declare const SelfieSchema: z.ZodEffects<z.ZodObject<{
|
|
|
31
35
|
background_music: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
32
36
|
duration: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<5>, z.ZodLiteral<10>, z.ZodLiteral<15>]>>;
|
|
33
37
|
subtitles: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
shot_preset: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
39
|
+
vibe: z.ZodOptional<z.ZodEnum<["excited", "calm", "sassy", "serious", "curious"]>>;
|
|
40
|
+
camera_locked: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
phone_in_frame: z.ZodDefault<z.ZodEnum<["forbidden", "optional", "required"]>>;
|
|
42
|
+
polish: z.ZodOptional<z.ZodEnum<["off", "default", "heavy"]>>;
|
|
34
43
|
}, "strip", z.ZodTypeAny, {
|
|
35
44
|
duration: 5 | 10 | 15;
|
|
36
45
|
subtitles: boolean;
|
|
46
|
+
camera_locked: boolean;
|
|
47
|
+
phone_in_frame: "forbidden" | "optional" | "required";
|
|
37
48
|
script?: string | undefined;
|
|
38
49
|
description?: string | undefined;
|
|
50
|
+
vibe?: "serious" | "calm" | "excited" | "sassy" | "curious" | undefined;
|
|
39
51
|
character_id?: string | undefined;
|
|
40
52
|
photo_url?: string | undefined;
|
|
41
53
|
scene_action?: string | undefined;
|
|
42
54
|
background_music?: string | boolean | undefined;
|
|
55
|
+
shot_preset?: string | undefined;
|
|
56
|
+
polish?: "off" | "default" | "heavy" | undefined;
|
|
43
57
|
}, {
|
|
44
58
|
duration?: 5 | 10 | 15 | undefined;
|
|
45
59
|
script?: string | undefined;
|
|
46
60
|
subtitles?: boolean | undefined;
|
|
47
61
|
description?: string | undefined;
|
|
62
|
+
vibe?: "serious" | "calm" | "excited" | "sassy" | "curious" | undefined;
|
|
48
63
|
character_id?: string | undefined;
|
|
49
64
|
photo_url?: string | undefined;
|
|
50
65
|
scene_action?: string | undefined;
|
|
51
66
|
background_music?: string | boolean | undefined;
|
|
67
|
+
shot_preset?: string | undefined;
|
|
68
|
+
camera_locked?: boolean | undefined;
|
|
69
|
+
phone_in_frame?: "forbidden" | "optional" | "required" | undefined;
|
|
70
|
+
polish?: "off" | "default" | "heavy" | undefined;
|
|
52
71
|
}>, {
|
|
53
72
|
duration: 5 | 10 | 15;
|
|
54
73
|
subtitles: boolean;
|
|
74
|
+
camera_locked: boolean;
|
|
75
|
+
phone_in_frame: "forbidden" | "optional" | "required";
|
|
55
76
|
script?: string | undefined;
|
|
56
77
|
description?: string | undefined;
|
|
78
|
+
vibe?: "serious" | "calm" | "excited" | "sassy" | "curious" | undefined;
|
|
57
79
|
character_id?: string | undefined;
|
|
58
80
|
photo_url?: string | undefined;
|
|
59
81
|
scene_action?: string | undefined;
|
|
60
82
|
background_music?: string | boolean | undefined;
|
|
83
|
+
shot_preset?: string | undefined;
|
|
84
|
+
polish?: "off" | "default" | "heavy" | undefined;
|
|
61
85
|
}, {
|
|
62
86
|
duration?: 5 | 10 | 15 | undefined;
|
|
63
87
|
script?: string | undefined;
|
|
64
88
|
subtitles?: boolean | undefined;
|
|
65
89
|
description?: string | undefined;
|
|
90
|
+
vibe?: "serious" | "calm" | "excited" | "sassy" | "curious" | undefined;
|
|
66
91
|
character_id?: string | undefined;
|
|
67
92
|
photo_url?: string | undefined;
|
|
68
93
|
scene_action?: string | undefined;
|
|
69
94
|
background_music?: string | boolean | undefined;
|
|
95
|
+
shot_preset?: string | undefined;
|
|
96
|
+
camera_locked?: boolean | undefined;
|
|
97
|
+
phone_in_frame?: "forbidden" | "optional" | "required" | undefined;
|
|
98
|
+
polish?: "off" | "default" | "heavy" | undefined;
|
|
70
99
|
}>;
|
|
71
100
|
export type SelfieInput = z.infer<typeof SelfieSchema>;
|
|
72
101
|
//# sourceMappingURL=selfie.d.ts.map
|
package/dist/v2/selfie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfie.d.ts","sourceRoot":"","sources":["../../src/v2/selfie.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe,yfAqBlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,eAAO,MAAM,QAAQ,6DAA8D,CAAC;AACpF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,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
|
];
|
|
45
45
|
export const V2_VIBES = ['excited', 'calm', 'sassy', 'serious', 'curious'];
|
|
46
46
|
export const V2_DURATIONS = [5, 10, 15];
|
|
47
|
+
export const V2_PHONE_IN_FRAME = ['forbidden', 'optional', 'required'];
|
|
48
|
+
export const V2_POLISH_INTENSITIES = ['off', 'default', 'heavy'];
|
|
49
|
+
// shot_preset accepts a registered V2_SHOT_PRESETS key or an escape
|
|
50
|
+
// hatch `custom-scene:<text>` for one-off scenes that don't match the
|
|
51
|
+
// preset library. See realism.js resolveShotBrief() for the runtime.
|
|
52
|
+
const shotPresetSchema = z
|
|
53
|
+
.string()
|
|
54
|
+
.refine((v) => V2_SHOT_PRESETS.includes(v) ||
|
|
55
|
+
v.startsWith('custom-scene:'), {
|
|
56
|
+
message: 'shot_preset must be one of the registered presets, or "custom-scene:<text>"',
|
|
57
|
+
});
|
|
47
58
|
export const SelfieSchema = z
|
|
48
59
|
.object({
|
|
49
60
|
// Character — one path or the other
|
|
@@ -69,6 +80,23 @@ export const SelfieSchema = z
|
|
|
69
80
|
.default(10),
|
|
70
81
|
// Burn Hormozi-style subtitles on the final clip.
|
|
71
82
|
subtitles: z.boolean().default(true),
|
|
83
|
+
// ── Realism opt-in controls (all optional) ─────────────────────────
|
|
84
|
+
// shot_preset / vibe pin the scene composition + energy. When
|
|
85
|
+
// omitted, the orchestrator picks defaults based on the script.
|
|
86
|
+
shot_preset: shotPresetSchema.optional(),
|
|
87
|
+
vibe: z.enum(V2_VIBES).optional(),
|
|
88
|
+
// Default: stable/locked framing to avoid jitter. Set false only
|
|
89
|
+
// when the user explicitly requests handheld camera movement.
|
|
90
|
+
camera_locked: z.boolean().default(true),
|
|
91
|
+
// Default 'forbidden': no phone/camera/selfie-stick visible unless
|
|
92
|
+
// the user explicitly requests it.
|
|
93
|
+
// 'required' — actively compose with phone covering chin/lower face
|
|
94
|
+
// (the "iPhone-cover trick" — fewer face-render errors).
|
|
95
|
+
// 'forbidden' — strip phone from frame entirely (legacy behavior).
|
|
96
|
+
phone_in_frame: z.enum(V2_PHONE_IN_FRAME).default('forbidden'),
|
|
97
|
+
// Post-Seedance polish pass (ffmpeg grain + warm grade + vignette).
|
|
98
|
+
// Defaults to 'default'. Set to 'off' to bypass entirely.
|
|
99
|
+
polish: z.enum(V2_POLISH_INTENSITIES).optional(),
|
|
72
100
|
})
|
|
73
101
|
.superRefine((val, ctx) => {
|
|
74
102
|
const hasSavedCharacter = !!val.character_id;
|
package/dist/v2/selfie.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfie.js","sourceRoot":"","sources":["../../src/v2/selfie.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wEAAwE;AACxE,kEAAkE;AAClE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,wBAAwB;IACxB,2BAA2B;IAC3B,2BAA2B;IAC3B,sBAAsB;IACtB,iBAAiB;IACjB,yBAAyB;IACzB,wBAAwB;IACxB,yBAAyB;IACzB,sBAAsB;IACtB,yBAAyB;IACzB,qBAAqB;IACrB,kBAAkB;IAClB,uBAAuB;IACvB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB;IAClB,0BAA0B;IAC1B,kBAAkB;IAClB,qBAAqB;IACrB,0BAA0B;CAClB,CAAC;AAGX,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAU,CAAC;AAGjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,oCAAoC;IACpC,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,KAAK,CAAC,yBAAyB,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C,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EACL,iGAAiG;SACpG,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/E,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,QAAQ,CAAC;YAChB,OAAO,EAAE,kDAAkD;SAC5D,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACtC,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EACL,gEAAgE;SACnE,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentmedia/schema",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Type-safe schema definitions for AI UGC video generation \u2014 enums, Zod validation, and generator registry. Single source of truth for the agent-media platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -209,7 +209,7 @@ function renderSkillIndex(): string {
|
|
|
209
209
|
'2. **Walk the user through 4 gates IN ORDER, one message each** — do not bulk-fire:',
|
|
210
210
|
' - **Gate 1:** confirm the exact script (verbatim — typos land in the video)',
|
|
211
211
|
' - **Gate 2:** confirm character. YOU run `agent-media character list --json` (do not ask the user "do you have a saved character?" — they don\'t know that\'s a thing). If the list is empty, just confirm the description from their original prompt. If non-empty, present each saved character BY NAME (not by `char_xxx` id — that format is internal). The user picks by NAME or says "new"; you map name → id internally. 🛑 NEVER auto-pick. NEVER show `char_xxx` ids to the user. Never ask for a photo by default.',
|
|
212
|
-
' - **Gate 3:** propose a full **director\'s brief** with pre-filled fields in 3 sections — **A. Intent+Performance**, **B. Scene+Look**, **C. Output**. Put visual direction into `--description` and action/product handling into `--scene-action
|
|
212
|
+
' - **Gate 3:** propose a full **director\'s brief** with pre-filled fields in 3 sections — **A. Intent+Performance**, **B. Scene+Look**, **C. Output**. Put visual direction into `--description` and action/product handling into `--scene-action`. The shot composition and energy are inferred from the brief; you can OPTIONALLY pin them with `--shot-preset` and `--vibe`, or override the realism defaults with `--camera-locked` / `--phone-in-frame` / `--polish` (rare — only when the user explicitly asks for a stable shot, a phone-in-hand composition, or a different polish look).',
|
|
213
213
|
' - **Gate 4:** duration + **script-pacing check**. Count the words in the script and PROPOSE the duration that fits (5s ≈ 10-20 words, 10s ≈ 20-40 words, 15s ≈ 30-60 words at the natural 2-4 words/sec pace).',
|
|
214
214
|
'3. Only then call the CLI.',
|
|
215
215
|
'',
|
|
@@ -327,7 +327,17 @@ function renderConversationFlow(): string {
|
|
|
327
327
|
'',
|
|
328
328
|
'This is where most quality is decided. In one message, propose a complete brief with sensible defaults. The user replies `y` to accept all, or overrides individual lines.',
|
|
329
329
|
'',
|
|
330
|
-
'
|
|
330
|
+
'Most of the brief flows into two flags: visual details → `--description`; motion, prop handling, product demos, turns, outfit checks, dances, walking, or non-default behavior → `--scene-action`. The pipeline infers good defaults for the rest.',
|
|
331
|
+
'',
|
|
332
|
+
'**Optional realism overrides** (use only when the user asks for one of these explicitly — defaults already work):',
|
|
333
|
+
'',
|
|
334
|
+
'- `--shot-preset <name>` — pin the scene composition (e.g. `car-quick-honest-review`, `bedroom-morning-ritual`, `gym-post-workout`). Pass `custom-scene:<text>` for one-offs. Useful when the user names a specific location and you want to lock it.',
|
|
335
|
+
'- `--vibe <name>` — pin the actor\'s energy/tone (`excited`, `calm`, `sassy`, `serious`, `curious`). Useful when the user says e.g. "make it sassy" or "keep it serious".',
|
|
336
|
+
'- `--camera-locked` — lock the camera (no handheld motion). Use for product/demo shots where a stable frame matters. Default is handheld — leave it off for normal UGC.',
|
|
337
|
+
'- `--phone-in-frame <forbidden|optional|required>` — control whether the actor holds a phone on screen. Default `optional` (phone may appear if natural). Use `required` when the user asks for a "talking to phone" or "iPhone-cover" composition, `forbidden` when the user explicitly wants no phone visible.',
|
|
338
|
+
'- `--polish <off|default|heavy>` — final-look intensity. Default `default` (recommended). Use `heavy` for a more stylized vintage look, `off` if the user wants the raw model output.',
|
|
339
|
+
'',
|
|
340
|
+
'When in doubt, OMIT these flags. The director\'s brief is doing the heavy lifting.',
|
|
331
341
|
'',
|
|
332
342
|
'**A. Intent + Performance**',
|
|
333
343
|
'',
|
|
@@ -432,7 +442,10 @@ function renderConversationFlow(): string {
|
|
|
432
442
|
'- ❌ Forgetting to forward `subtitles: true` (or `--subtitles true`) on the selfie call when the user accepted the brief. The default is on, but defaults only fire if you don\'t override — be explicit.',
|
|
433
443
|
'- ❌ **Defaulting to subtitles ON when the user explicitly says "no subs".** If the user\'s prompt or any Gate-3 reply contains "no subs", "without subtitles", "no captions", or similar — the call MUST include `--subtitles false` (CLI) or `subtitles: false` (REST). Failure mode: a subtitled video gets shipped against the user\'s wishes + the Whisper transcription may capture model garbage and burn it as text.',
|
|
434
444
|
'- ❌ **Mismatching script length and duration** (e.g. 10-word script + 15s duration without enough visual action). Normal speech is 2-4 words/sec. Size duration to fit the script and action plan.',
|
|
435
|
-
'- ❌ Passing removed flags such as `--preset`, `--
|
|
445
|
+
'- ❌ Passing removed flags such as `--preset`, `--voice-brief`, or `--sync` to the current v2 Selfie CLI. (Note: `--shot-preset` and `--vibe` ARE supported as optional overrides — use them only when the user explicitly pins a scene or tone.)',
|
|
446
|
+
'- ❌ **Overriding the handheld camera default with `--camera-locked` for normal UGC.** Default handheld feel is the #1 realism cue — only lock the camera for product/demo shots where stability is essential.',
|
|
447
|
+
'- ❌ **Forbidding phone-in-frame by default.** Default is `optional` — phone may appear if natural. Only set `--phone-in-frame forbidden` when the user explicitly says "no phone in frame".',
|
|
448
|
+
'- ❌ **Disabling polish with `--polish off` unless the user asks for raw output.** The default polish pass is what makes the clip feel like real iPhone footage instead of a model render.',
|
|
436
449
|
'- ❌ Waiting silently until the final video when intermediate URLs are available. Surface portrait, sheet, wireframe, and final video as each completes.',
|
|
437
450
|
'- ❌ Asking for a photo when the user only gave a text description.',
|
|
438
451
|
'- ❌ Suggesting a duration not in {5, 10, 15}.',
|
package/src/v2/selfie.ts
CHANGED
|
@@ -53,6 +53,27 @@ export type V2Vibe = (typeof V2_VIBES)[number];
|
|
|
53
53
|
export const V2_DURATIONS = [5, 10, 15] as const;
|
|
54
54
|
export type V2Duration = (typeof V2_DURATIONS)[number];
|
|
55
55
|
|
|
56
|
+
export const V2_PHONE_IN_FRAME = ['forbidden', 'optional', 'required'] as const;
|
|
57
|
+
export type V2PhoneInFrame = (typeof V2_PHONE_IN_FRAME)[number];
|
|
58
|
+
|
|
59
|
+
export const V2_POLISH_INTENSITIES = ['off', 'default', 'heavy'] as const;
|
|
60
|
+
export type V2PolishIntensity = (typeof V2_POLISH_INTENSITIES)[number];
|
|
61
|
+
|
|
62
|
+
// shot_preset accepts a registered V2_SHOT_PRESETS key or an escape
|
|
63
|
+
// hatch `custom-scene:<text>` for one-off scenes that don't match the
|
|
64
|
+
// preset library. See realism.js resolveShotBrief() for the runtime.
|
|
65
|
+
const shotPresetSchema = z
|
|
66
|
+
.string()
|
|
67
|
+
.refine(
|
|
68
|
+
(v) =>
|
|
69
|
+
(V2_SHOT_PRESETS as readonly string[]).includes(v) ||
|
|
70
|
+
v.startsWith('custom-scene:'),
|
|
71
|
+
{
|
|
72
|
+
message:
|
|
73
|
+
'shot_preset must be one of the registered presets, or "custom-scene:<text>"',
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
56
77
|
export const SelfieSchema = z
|
|
57
78
|
.object({
|
|
58
79
|
// Character — one path or the other
|
|
@@ -83,6 +104,27 @@ export const SelfieSchema = z
|
|
|
83
104
|
|
|
84
105
|
// Burn Hormozi-style subtitles on the final clip.
|
|
85
106
|
subtitles: z.boolean().default(true),
|
|
107
|
+
|
|
108
|
+
// ── Realism opt-in controls (all optional) ─────────────────────────
|
|
109
|
+
// shot_preset / vibe pin the scene composition + energy. When
|
|
110
|
+
// omitted, the orchestrator picks defaults based on the script.
|
|
111
|
+
shot_preset: shotPresetSchema.optional(),
|
|
112
|
+
vibe: z.enum(V2_VIBES).optional(),
|
|
113
|
+
|
|
114
|
+
// Default: stable/locked framing to avoid jitter. Set false only
|
|
115
|
+
// when the user explicitly requests handheld camera movement.
|
|
116
|
+
camera_locked: z.boolean().default(true),
|
|
117
|
+
|
|
118
|
+
// Default 'forbidden': no phone/camera/selfie-stick visible unless
|
|
119
|
+
// the user explicitly requests it.
|
|
120
|
+
// 'required' — actively compose with phone covering chin/lower face
|
|
121
|
+
// (the "iPhone-cover trick" — fewer face-render errors).
|
|
122
|
+
// 'forbidden' — strip phone from frame entirely (legacy behavior).
|
|
123
|
+
phone_in_frame: z.enum(V2_PHONE_IN_FRAME).default('forbidden'),
|
|
124
|
+
|
|
125
|
+
// Post-Seedance polish pass (ffmpeg grain + warm grade + vignette).
|
|
126
|
+
// Defaults to 'default'. Set to 'off' to bypass entirely.
|
|
127
|
+
polish: z.enum(V2_POLISH_INTENSITIES).optional(),
|
|
86
128
|
})
|
|
87
129
|
.superRefine((val, ctx) => {
|
|
88
130
|
const hasSavedCharacter = !!val.character_id;
|