miriad-viz 0.4.3 → 0.4.4

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.
@@ -90,7 +90,7 @@ var STEP_CONFIG = {
90
90
  mode: "inline",
91
91
  label: "Set visualization timing",
92
92
  creative: true,
93
- outputFiles: ["output/timing.json"]
93
+ outputFiles: ["data/timing.json"]
94
94
  },
95
95
  "sound-design": {
96
96
  mode: "inline",
@@ -9,7 +9,7 @@ import {
9
9
  markComplete,
10
10
  markInProgress,
11
11
  writeProgress
12
- } from "./chunk-GPVKAGZT.js";
12
+ } from "./chunk-IMD2MNLI.js";
13
13
 
14
14
  // src/cli/guided/steps/curate.ts
15
15
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -11,7 +11,7 @@ import {
11
11
  markError,
12
12
  markInProgress,
13
13
  writeProgress
14
- } from "./chunk-GPVKAGZT.js";
14
+ } from "./chunk-IMD2MNLI.js";
15
15
 
16
16
  // src/cli/guided/steps/extract.ts
17
17
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
package/dist-cli/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getNextStep,
8
8
  readProgress,
9
9
  writeProgress
10
- } from "./chunk-GPVKAGZT.js";
10
+ } from "./chunk-IMD2MNLI.js";
11
11
 
12
12
  // src/cli/guided/index.ts
13
13
  import { existsSync as existsSync3, readFileSync as readFileSync2, readdirSync } from "fs";
@@ -662,14 +662,14 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
662
662
  }
663
663
  if (step === "viz-timing") {
664
664
  if (flags["timing-approved"]) {
665
- if (!fileSet.has("output/timing.json")) {
665
+ if (!fileSet.has("data/timing.json")) {
666
666
  output.push(...buildVizTimingApprovalError());
667
667
  return { action: "error_shown", step, progress, output };
668
668
  }
669
669
  progress.steps["viz-timing"] = {
670
670
  status: "complete",
671
671
  completedAt: (/* @__PURE__ */ new Date()).toISOString(),
672
- outputs: ["output/timing.json"]
672
+ outputs: ["data/timing.json"]
673
673
  };
674
674
  output.push("", "\u2713 Timing approved.");
675
675
  const chainResult = computeNext(progress, existingFiles, logTails, flags, dataSummary, env);
@@ -1199,7 +1199,15 @@ async function runNext(flags) {
1199
1199
  port: typeof flags.port === "string" ? Number.parseInt(flags.port, 10) : void 0,
1200
1200
  "no-open": flags["no-open"] === true || void 0,
1201
1201
  "skip-audio": flags["skip-audio"] === true || void 0,
1202
- "audio-approved": flags["audio-approved"] === true || void 0
1202
+ "audio-approved": flags["audio-approved"] === true || void 0,
1203
+ // v2 gate flags
1204
+ "script-approved": flags["script-approved"] === true || void 0,
1205
+ "voices-approved": flags["voices-approved"] === true || void 0,
1206
+ "timing-approved": flags["timing-approved"] === true || void 0,
1207
+ "sound-approved": flags["sound-approved"] === true || void 0,
1208
+ // padding flags
1209
+ "pad-start": typeof flags["pad-start"] === "string" ? flags["pad-start"] : void 0,
1210
+ "pad-end": typeof flags["pad-end"] === "string" ? flags["pad-end"] : void 0
1203
1211
  };
1204
1212
  const env = {
1205
1213
  hasElevenLabsKey: !!process.env.ELEVENLABS_API_KEY
@@ -1247,7 +1255,7 @@ async function main() {
1247
1255
  }
1248
1256
  case "extract": {
1249
1257
  const { projectDir, progress } = requireProject();
1250
- const { runExtract } = await import("./extract-S5XKRYPG.js");
1258
+ const { runExtract } = await import("./extract-OVHPN5EK.js");
1251
1259
  await runExtract({
1252
1260
  projectDir,
1253
1261
  progress,
@@ -1261,14 +1269,14 @@ async function main() {
1261
1269
  }
1262
1270
  case "curate": {
1263
1271
  const { projectDir, progress } = requireProject();
1264
- const { runCurate } = await import("./curate-LBMQRKKG.js");
1272
+ const { runCurate } = await import("./curate-36Q25TSU.js");
1265
1273
  await runCurate({ projectDir, progress });
1266
1274
  break;
1267
1275
  }
1268
1276
  case "transform": {
1269
1277
  const { projectDir, progress } = requireProject();
1270
1278
  const { parseDuration } = await import("./parse-duration-NVLCEFAF.js");
1271
- const { runTransform } = await import("./transform-TEJWDQWZ.js");
1279
+ const { runTransform } = await import("./transform-EE7CTQMM.js");
1272
1280
  const padding = {};
1273
1281
  if (typeof flags["pad-start"] === "string") {
1274
1282
  padding.padStartMs = parseDuration(flags["pad-start"]);
@@ -1296,19 +1304,19 @@ async function main() {
1296
1304
  console.log("");
1297
1305
  console.log(chainResult.previewTable);
1298
1306
  }
1299
- const { runTransform } = await import("./transform-TEJWDQWZ.js");
1307
+ const { runTransform } = await import("./transform-EE7CTQMM.js");
1300
1308
  await runTransform({ projectDir, progress });
1301
- const { runPreview: runPreview2 } = await import("./preview-F7ILLPMG.js");
1309
+ const { runPreview: runPreview2 } = await import("./preview-PXC6HTMF.js");
1302
1310
  await runPreview2({ projectDir, progress, port, noOpen: flags["no-open"] === true });
1303
1311
  break;
1304
1312
  }
1305
- const { runPreview } = await import("./preview-F7ILLPMG.js");
1313
+ const { runPreview } = await import("./preview-PXC6HTMF.js");
1306
1314
  await runPreview({ projectDir, progress, port, noOpen: flags["no-open"] === true });
1307
1315
  break;
1308
1316
  }
1309
1317
  case "render": {
1310
1318
  const { projectDir, progress } = requireProject();
1311
- const { runRender } = await import("./render-TC223YOE.js");
1319
+ const { runRender } = await import("./render-EUUDJ5S7.js");
1312
1320
  await runRender({ projectDir, progress, draft: flags.draft === true });
1313
1321
  break;
1314
1322
  }
@@ -5,12 +5,50 @@ import {
5
5
  import {
6
6
  markComplete,
7
7
  writeProgress
8
- } from "./chunk-GPVKAGZT.js";
8
+ } from "./chunk-IMD2MNLI.js";
9
9
 
10
10
  // src/cli/guided/steps/preview.ts
11
11
  import { execSync } from "child_process";
12
- import { copyFileSync, existsSync, mkdirSync } from "fs";
12
+ import { copyFileSync, existsSync, mkdirSync, readdirSync } from "fs";
13
13
  import { resolve } from "path";
14
+ function copyPreviewAssets(options) {
15
+ const { outputDir, audioDir, viewerDir } = options;
16
+ const viewerDataDir = resolve(viewerDir, "public", "data");
17
+ const viewerAudioDir = resolve(viewerDir, "public", "audio");
18
+ const result = {
19
+ copiedVizData: false,
20
+ copiedTiming: false,
21
+ audioFileCount: 0
22
+ };
23
+ const vizDataPath = resolve(outputDir, "viz-data.json");
24
+ if (existsSync(vizDataPath)) {
25
+ mkdirSync(viewerDataDir, { recursive: true });
26
+ copyFileSync(vizDataPath, resolve(viewerDataDir, "viz-data.json"));
27
+ result.copiedVizData = true;
28
+ }
29
+ const timingPath = resolve(outputDir, "timing.json");
30
+ if (existsSync(timingPath)) {
31
+ mkdirSync(viewerDataDir, { recursive: true });
32
+ copyFileSync(timingPath, resolve(viewerDataDir, "timing.json"));
33
+ result.copiedTiming = true;
34
+ }
35
+ if (existsSync(audioDir)) {
36
+ const audioFiles = readdirSync(audioDir).filter((f) => /\.(mp3|wav|ogg|m4a)$/i.test(f));
37
+ if (audioFiles.length > 0) {
38
+ mkdirSync(viewerAudioDir, { recursive: true });
39
+ for (const f of audioFiles) {
40
+ copyFileSync(resolve(audioDir, f), resolve(viewerAudioDir, f));
41
+ }
42
+ result.audioFileCount = audioFiles.length;
43
+ }
44
+ const manifestPath = resolve(audioDir, "audio-manifest.json");
45
+ if (existsSync(manifestPath)) {
46
+ mkdirSync(viewerAudioDir, { recursive: true });
47
+ copyFileSync(manifestPath, resolve(viewerAudioDir, "audio-manifest.json"));
48
+ }
49
+ }
50
+ return result;
51
+ }
14
52
  async function runPreview(options) {
15
53
  const { projectDir, progress } = options;
16
54
  const outDir = resolve(projectDir, progress.project.outputDir);
@@ -35,10 +73,17 @@ async function runPreview(options) {
35
73
  return;
36
74
  }
37
75
  }
38
- const viewerDataDir = resolve(viewerDir, "public", "data");
39
- mkdirSync(viewerDataDir, { recursive: true });
40
- copyFileSync(vizDataPath, resolve(viewerDataDir, "viz-data.json"));
41
- console.log(" \u2713 Copied viz-data.json to viewer/public/data/");
76
+ const audioDir = resolve(projectDir, "audio");
77
+ const copyResult = copyPreviewAssets({ outputDir: outDir, audioDir, viewerDir });
78
+ if (copyResult.copiedVizData) {
79
+ console.log(" \u2713 Copied viz-data.json to viewer/public/data/");
80
+ }
81
+ if (copyResult.copiedTiming) {
82
+ console.log(" \u2713 Copied timing.json to viewer/public/data/");
83
+ }
84
+ if (copyResult.audioFileCount > 0) {
85
+ console.log(` \u2713 Copied ${copyResult.audioFileCount} audio file(s) to viewer/public/audio/`);
86
+ }
42
87
  const nodeModules = resolve(viewerDir, "node_modules");
43
88
  if (!existsSync(nodeModules)) {
44
89
  console.log(" Installing viewer dependencies...");
@@ -61,5 +106,6 @@ async function runPreview(options) {
61
106
  }
62
107
  }
63
108
  export {
109
+ copyPreviewAssets,
64
110
  runPreview
65
111
  };
@@ -3,7 +3,7 @@ import {
3
3
  markError,
4
4
  markInProgress,
5
5
  writeProgress
6
- } from "./chunk-GPVKAGZT.js";
6
+ } from "./chunk-IMD2MNLI.js";
7
7
 
8
8
  // src/cli/guided/steps/render.ts
9
9
  import { execSync } from "child_process";
@@ -9,7 +9,7 @@ import {
9
9
  markError,
10
10
  markInProgress,
11
11
  writeProgress
12
- } from "./chunk-GPVKAGZT.js";
12
+ } from "./chunk-IMD2MNLI.js";
13
13
  import {
14
14
  TimingFileSchema
15
15
  } from "./chunk-SKRQW7PY.js";