@officexapp/vidfarm-devcli 0.21.26 → 0.21.27

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.
@@ -11,9 +11,17 @@
11
11
  // - hybrid : roughly $0.01–$1 per video. Free where it's free, spend on AI
12
12
  // only where it clearly wins. (default recommendation.) Billed
13
13
  // ops run but print a cost line.
14
- // - pure-ai : $1+ per video. Best-quality; AI image/video/voice/music used
15
- // freely. Billed ops run; cost is still surfaced. Shown to
16
- // humans as "rich-ai".
14
+ // - rich-ai : $1+ per video. AI video generation is used to mint REUSABLE
15
+ // greenscreen raws, which are then keyed and remixed with
16
+ // hyperframes/HTML-CSS motion and the rest of the raw library.
17
+ // The raws persist (local `~/.vidfarm` raws store, optionally
18
+ // `vidfarm sync push /raws` to the cloud on a Pro plan), so the
19
+ // spend amortizes into later hybrid/minimize videos. Billed ops
20
+ // run; cost is still surfaced. Shown to humans as "rich-ai".
21
+ // - pure-videogen : $5+ per video. The whole piece is generated footage —
22
+ // text script → image storyboard → per-scene, frame-by-frame
23
+ // video generation. No raws reuse, no HTML motion. The most
24
+ // expensive mode; reserve it for hero pieces.
17
25
  //
18
26
  // Those dollar figures are what the AI providers charge, and they are billed to
19
27
  // the user's OWN provider keys (BYOK — the keys saved via `vidfarm
@@ -25,7 +33,7 @@
25
33
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
26
34
  import path from "node:path";
27
35
  import { resolveDevcliHome } from "./auth-store.js";
28
- export const COST_MODES = ["minimize", "hybrid", "pure-ai"];
36
+ export const COST_MODES = ["minimize", "hybrid", "rich-ai", "pure-videogen"];
29
37
  /** What we assume when nothing is set. Hybrid is the founder-friendly middle,
30
38
  * but callers can tell it apart from an explicit choice via `isSet`. */
31
39
  export const DEFAULT_COST_MODE = "hybrid";
@@ -41,21 +49,29 @@ export function normalizeCostMode(raw) {
41
49
  return "minimize";
42
50
  if (["hybrid", "mixed", "balanced", "smart", "default"].includes(v))
43
51
  return "hybrid";
44
- if (["pure-ai", "pureai", "rich-ai", "richai", "rich", "ai", "best", "best-quality", "premium", "max"].includes(v))
45
- return "pure-ai";
52
+ // Check videogen BEFORE rich-ai: "pure-videogen" must not be swallowed by a
53
+ // looser "pure*" spelling, and "videogen" always means the frame-by-frame mode.
54
+ if (["pure-videogen", "purevideogen", "pure-video-gen", "videogen", "video-gen", "pure-video", "purevideo", "veo", "frame-by-frame", "cinematic"].includes(v))
55
+ return "pure-videogen";
56
+ // "pure-ai"/"pureai" are the LEGACY slug this mode used to be stored under —
57
+ // keep accepting them so an older ~/.vidfarm/cost-mode.json still resolves.
58
+ if (["rich-ai", "richai", "rich", "pure-ai", "pureai", "ai", "best", "best-quality", "premium", "max"].includes(v))
59
+ return "rich-ai";
46
60
  return null;
47
61
  }
48
62
  /**
49
- * Human-facing NAME for a mode. The canonical stored slug for best-quality stays
50
- * `pure-ai` (so saved cost-mode.json, --cost-mode flags, and VIDFARM_COST_MODE
51
- * keep resolving), but users see and can type "rich-ai".
63
+ * Human-facing NAME for a mode. These match the canonical slugs one-for-one
64
+ * there is no "pure-ai" mode any more, it is `rich-ai` everywhere (the old slug
65
+ * is still ACCEPTED as an alias by normalizeCostMode so saved cost-mode.json,
66
+ * --cost-mode flags, and VIDFARM_COST_MODE from older installs keep resolving).
52
67
  */
53
68
  export const COST_MODE_DISPLAY = {
54
69
  minimize: "minimize",
55
70
  hybrid: "hybrid",
56
- "pure-ai": "rich-ai"
71
+ "rich-ai": "rich-ai",
72
+ "pure-videogen": "pure-videogen"
57
73
  };
58
- /** The three modes as users see them, e.g. for "<minimize|hybrid|rich-ai>". */
74
+ /** The modes as users see them, e.g. "<minimize|hybrid|rich-ai|pure-videogen>". */
59
75
  export const COST_MODE_DISPLAY_LIST = COST_MODES.map((m) => COST_MODE_DISPLAY[m]);
60
76
  export function costModeDisplayName(mode) {
61
77
  return COST_MODE_DISPLAY[mode];
@@ -120,22 +136,34 @@ export const COST_MODE_BLURB = {
120
136
  "credits only where they clearly win (a hero shot, a voice you can't fake locally). " +
121
137
  "Billed ops run but each prints its cost so nothing is a surprise. Charges land on " +
122
138
  "your own AI provider keys (BYOK).",
123
- "pure-ai": "Rich AI — $1+ per video. Best quality; AI image/video/voice/music used freely. " +
139
+ "rich-ai": "Rich AI — $1+ per video. AI video generation is spent on REUSABLE greenscreen raws " +
140
+ "(vidfarm avatar / generate --greenscreen), keyed once and then remixed with hyperframes " +
141
+ "HTML/CSS motion and the rest of the raw library. Those raws are saved in the local raws " +
142
+ "store (and pushed to the cloud with `vidfarm sync push /raws` on a Pro plan), so the same " +
143
+ "footage powers later hybrid/minimize videos for $0. AI image/voice/music used freely. " +
124
144
  "Billed ops run without gating; cost is still shown. Charges land on your own AI " +
125
- "provider keys (BYOK)."
145
+ "provider keys (BYOK).",
146
+ "pure-videogen": "Pure videogen — $5+ per video. Every shot is generated footage: write the script in text, " +
147
+ "storyboard it as images, then generate each scene frame-by-frame from those keyframes. " +
148
+ "No raw reuse, no HTML motion — the most expensive and most cinematic mode. Billed ops run " +
149
+ "without gating; cost is still shown, and a single run can be many dollars. Charges land on " +
150
+ "your own AI provider keys (BYOK)."
126
151
  };
127
152
  /** One short human line summarizing the active mode. */
128
153
  export function costModeSummaryLine(resolved) {
129
154
  const setNote = resolved.isSet ? `set via ${resolved.source}` : "NOT set — assuming hybrid";
130
155
  return `cost mode: ${costModeDisplayName(resolved.mode)} (${setNote})`;
131
156
  }
132
- /** The 3-line "explain it simply" block an agent should relay to the user. */
157
+ /** The "explain it simply" block an agent should relay to the user. */
133
158
  export function costModeExplainer() {
134
159
  return [
135
160
  "How much do you want Vidfarm to spend on AI per video?",
136
- " • minimize — $0 videos: free local compute + free stock media, no AI spend at all.",
137
- " • hybrid — ~$0.01–$1 per video (recommended): free where free, pay AI only where it clearly wins.",
138
- " • rich-ai — $1+ per video: best quality, use AI image/video/voice/music freely.",
161
+ " • minimize — $0 videos: free local compute + free stock media, no AI spend at all.",
162
+ " • hybrid — ~$0.01–$1 per video (recommended): free where free, pay AI only where it clearly wins.",
163
+ " • rich-ai — $1+ per video: AI video gen mints REUSABLE greenscreen raws, then hyperframes",
164
+ " HTML/CSS motion remixes them with your library; the raws are saved and reused later.",
165
+ " • pure-videogen — $5+ per video: everything is generated footage — text script → image storyboard →",
166
+ " frame-by-frame scene generation. Most cinematic, most expensive.",
139
167
  "Any spend is billed to YOUR own AI provider keys (BYOK) — add them with",
140
168
  " `vidfarm add-provider-key <provider> <key>` or at vidfarm.cc/settings/developer.",
141
169
  "Tip: before paying to generate music/SFX/images/video, try the free stock catalog —",
@@ -159,7 +187,7 @@ export class CostModeBlockedError extends Error {
159
187
  *
160
188
  * - minimize: throws unless `yes` is set — the agent must confirm with the user
161
189
  * (or use the free local alternative named in `freeAlternative`).
162
- * - hybrid / pure-ai: allowed; prints a one-line cost notice (unless json).
190
+ * - hybrid / rich-ai: allowed; prints a one-line cost notice (unless json).
163
191
  * - unset: allowed like hybrid, but prints a "no preference set — ask the user"
164
192
  * nudge once so the default posture really is "ask before spending."
165
193
  */