miriad-viz 0.9.3 → 0.9.5

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-cli/index.js CHANGED
@@ -525,6 +525,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
525
525
  return {
526
526
  ...chainResult,
527
527
  action: "completed_and_chained",
528
+ completedSteps: ["script", ...chainResult.completedSteps ?? []],
528
529
  output: [...output, ...chainResult.output]
529
530
  };
530
531
  }
@@ -550,7 +551,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
550
551
  output.push(" \u2502 \u2502");
551
552
  output.push(" \u2502 When approved: npx miriad-viz next --script-approved \u2502");
552
553
  output.push(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F");
553
- return { action: "creative_stop", step, progress, output };
554
+ return { action: "creative_stop", step, progress, output, completedSteps: [step] };
554
555
  }
555
556
  output.push("", "\u270F\uFE0F Script writing in progress.");
556
557
  output.push("", " Write your script to: data/script.json");
@@ -648,6 +649,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
648
649
  return {
649
650
  ...chainResult,
650
651
  action: "completed_and_chained",
652
+ completedSteps: ["curate", ...chainResult.completedSteps ?? []],
651
653
  output: [...output, ...chainResult.output]
652
654
  };
653
655
  }
@@ -673,7 +675,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
673
675
  output.push(" \u2502 \u2502");
674
676
  output.push(" \u2502 When approved: npx miriad-viz next --curate-approved \u2502");
675
677
  output.push(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F");
676
- return { action: "creative_stop", step, progress, output };
678
+ return { action: "creative_stop", step, progress, output, completedSteps: [step] };
677
679
  }
678
680
  const existing = CURATE_OUTPUT_FILES.filter((f) => fileSet.has(f));
679
681
  const missing = CURATE_OUTPUT_FILES.filter((f) => !fileSet.has(f));
@@ -738,6 +740,66 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
738
740
  output.push(" - Add standout quotes with speaker, text, and timestamp");
739
741
  output.push(" 5. Present to human and iterate");
740
742
  output.push("");
743
+ output.push(" \u2501\u2501\u2501 SCHEMA EXAMPLES (copy these as starting templates) \u2501\u2501\u2501");
744
+ output.push("");
745
+ output.push(" \u{1F4C4} timeline-events.json:");
746
+ output.push(" ```json");
747
+ output.push(" [");
748
+ output.push(' { "type": "message", "t": "2026-02-20T14:30:00Z", "from": "bob",');
749
+ output.push(' "to": "snorre", "content": "Chat pill label shown on screen" },');
750
+ output.push(' { "type": "beam", "t": "2026-02-20T15:00:00Z", "from": "lead",');
751
+ output.push(' "to": "bob", "content": "Task assignment beam" },');
752
+ output.push(' { "type": "milestone", "t": "2026-02-20T16:00:00Z",');
753
+ output.push(' "label": "PR #42 merged", "agent": "bob", "style": "achievement" }');
754
+ output.push(" ]");
755
+ output.push(" ```");
756
+ output.push(
757
+ ' \u26A0\uFE0F type MUST be "message" or "beam" for chat pills. "milestone" renders differently.'
758
+ );
759
+ output.push("");
760
+ output.push(" \u{1F4C4} retro-page-data.json:");
761
+ output.push(" ```json");
762
+ output.push(" {");
763
+ output.push(' "meta": {');
764
+ output.push(' "title": "Project Name",');
765
+ output.push(' "subtitle": "A story of building something",');
766
+ output.push(' "startDate": "2026-02-20T00:00:00Z",');
767
+ output.push(' "endDate": "2026-02-21T00:00:00Z"');
768
+ output.push(" },");
769
+ output.push(' "teamAssembly": [');
770
+ output.push(' { "agent": "bob", "role": "Builder", "time": "2026-02-20T01:00:00Z" }');
771
+ output.push(" ],");
772
+ output.push(' "phases": [');
773
+ output.push(' { "id": "discovery", "label": "Discovery",');
774
+ output.push(' "startTime": "2026-02-20T00:00:00Z", "endTime": "2026-02-20T12:00:00Z" }');
775
+ output.push(" ],");
776
+ output.push(' "milestones": [');
777
+ output.push(
778
+ ' { "label": "First commit", "time": "2026-02-20T02:00:00Z", "phase": "discovery" }'
779
+ );
780
+ output.push(" ],");
781
+ output.push(' "narration": []');
782
+ output.push(" }");
783
+ output.push(" ```");
784
+ output.push(
785
+ " \u26A0\uFE0F meta.startDate and meta.endDate are REQUIRED. phases need startTime/endTime."
786
+ );
787
+ output.push(' \u26A0\uFE0F teamAssembly uses "agent" (not "name") and must have "time".');
788
+ output.push("");
789
+ output.push(" \u{1F4C4} retro-page-quotes.json:");
790
+ output.push(" ```json");
791
+ output.push(" {");
792
+ output.push(' "good": [');
793
+ output.push(
794
+ ' { "text": "Quote text here", "author": "bob", "timestamp": "2026-02-20T14:30:00Z" }'
795
+ );
796
+ output.push(" ],");
797
+ output.push(' "bad": [],');
798
+ output.push(' "funny": []');
799
+ output.push(" }");
800
+ output.push(" ```");
801
+ output.push(" \u2501\u2501\u2501 END SCHEMA EXAMPLES \u2501\u2501\u2501");
802
+ output.push("");
741
803
  output.push(" \u2705 Curation checklist:");
742
804
  output.push(" \u25A1 Every narration line has at least one labeled event in its time range");
743
805
  output.push(" \u25A1 Milestone labels are short (< 60 chars) and make sense as chat pills");
@@ -770,6 +832,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
770
832
  return {
771
833
  ...chainResult,
772
834
  action: "completed_and_chained",
835
+ completedSteps: ["voices", ...chainResult.completedSteps ?? []],
773
836
  output: [...output, ...chainResult.output]
774
837
  };
775
838
  }
@@ -799,6 +862,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
799
862
  return {
800
863
  ...chainResult,
801
864
  action: "completed_and_chained",
865
+ completedSteps: ["voices", ...chainResult.completedSteps ?? []],
802
866
  output: [...output, ...chainResult.output]
803
867
  };
804
868
  }
@@ -906,6 +970,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
906
970
  return {
907
971
  ...chainResult,
908
972
  action: "completed_and_chained",
973
+ completedSteps: ["viz-timing", ...chainResult.completedSteps ?? []],
909
974
  output: [...output, ...chainResult.output]
910
975
  };
911
976
  }
@@ -938,6 +1003,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
938
1003
  return {
939
1004
  ...chainResult,
940
1005
  action: "completed_and_chained",
1006
+ completedSteps: ["sound-design", ...chainResult.completedSteps ?? []],
941
1007
  output: [...output, ...chainResult.output]
942
1008
  };
943
1009
  }
@@ -977,7 +1043,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
977
1043
  output.push("");
978
1044
  output.push(" \u26D4 CREATIVE STOP \u2014 Present results to the human and wait for approval.");
979
1045
  output.push(" Only run `npx miriad-viz next` after human approves.");
980
- return { action: "creative_stop", step, progress, output };
1046
+ return { action: "creative_stop", step, progress, output, completedSteps: [step] };
981
1047
  }
982
1048
  output.push(
983
1049
  "",
@@ -987,6 +1053,7 @@ function computeNext(progress, existingFiles, logTails, flags = {}, dataSummary,
987
1053
  return {
988
1054
  ...chainResult,
989
1055
  action: "completed_and_chained",
1056
+ completedSteps: [step, ...chainResult.completedSteps ?? []],
990
1057
  output: [...output, ...chainResult.output]
991
1058
  };
992
1059
  }
@@ -1358,6 +1425,7 @@ Options:
1358
1425
  --platform Platform target: 'cast' (old, default) or 'redux' (new) (for init)
1359
1426
  --pad-start <dur> Pad timeline before first event (e.g., 5s, 30s, 2m)
1360
1427
  --pad-end <dur> Pad timeline after last event (e.g., 5s, 30s, 2m)
1428
+ --no-trim Disable auto-trimming git/PR data to message window
1361
1429
  --draft Render at half resolution (for render)
1362
1430
  --skip-audio Skip audio step (render silent video)
1363
1431
  --audio-approved Mark audio as reviewed and approved
@@ -1649,7 +1717,10 @@ async function runNext(flags) {
1649
1717
  const dataDir2 = resolve3(projectDir, result.progress.project.dataDir);
1650
1718
  const outputDir = resolve3(projectDir, result.progress.project.outputDir);
1651
1719
  if (result.step && (result.action === "completed_and_chained" || result.action === "creative_stop")) {
1652
- await syncStepOutputs(syncConfig, result.step, dataDir2, outputDir);
1720
+ const stepsToSync = result.completedSteps?.length ? result.completedSteps : [result.step];
1721
+ for (const syncStep of new Set(stepsToSync)) {
1722
+ await syncStepOutputs(syncConfig, syncStep, dataDir2, outputDir);
1723
+ }
1653
1724
  } else {
1654
1725
  const progressPath = resolve3(projectDir, ".miriad-viz.json");
1655
1726
  if (existsSync3(progressPath)) {
@@ -1699,11 +1770,12 @@ async function main() {
1699
1770
  await runExtract({
1700
1771
  projectDir,
1701
1772
  progress,
1702
- repoPath: typeof flags["repo-path"] === "string" ? flags["repo-path"] : void 0,
1773
+ repoPath: typeof flags["repo-path"] === "string" ? flags["repo-path"] : progress.extractConfig?.repoPath,
1703
1774
  chatInput: typeof flags["chat-input"] === "string" ? flags["chat-input"] : void 0,
1704
1775
  artifactInput: typeof flags["artifact-input"] === "string" ? flags["artifact-input"] : void 0,
1705
1776
  from: typeof flags.from === "string" ? flags.from : void 0,
1706
- to: typeof flags.to === "string" ? flags.to : void 0
1777
+ to: typeof flags.to === "string" ? flags.to : void 0,
1778
+ noTrim: flags["no-trim"] === true
1707
1779
  });
1708
1780
  break;
1709
1781
  }
@@ -1716,7 +1788,7 @@ async function main() {
1716
1788
  case "transform": {
1717
1789
  const { projectDir, progress } = requireProject();
1718
1790
  const { parseDuration } = await import("./parse-duration-NVLCEFAF.js");
1719
- const { runTransform } = await import("./transform-L7OKE35T.js");
1791
+ const { runTransform } = await import("./transform-3YUJZORK.js");
1720
1792
  const padding = {};
1721
1793
  if (typeof flags["pad-start"] === "string") {
1722
1794
  padding.padStartMs = parseDuration(flags["pad-start"]);
@@ -1744,7 +1816,7 @@ async function main() {
1744
1816
  console.log("");
1745
1817
  console.log(chainResult.previewTable);
1746
1818
  }
1747
- const { runTransform } = await import("./transform-L7OKE35T.js");
1819
+ const { runTransform } = await import("./transform-3YUJZORK.js");
1748
1820
  await runTransform({ projectDir, progress });
1749
1821
  const { runPreview: runPreview2 } = await import("./preview-7AGBBMPI.js");
1750
1822
  await runPreview2({ projectDir, progress, port, noOpen: flags["no-open"] === true });
@@ -52,12 +52,6 @@ function deriveTimeRange(rawData, curationData, options) {
52
52
  }
53
53
  for (const m of rawData.messages) timestamps.push(m.timestamp);
54
54
  for (const a of rawData.agents) timestamps.push(a.joinedAt);
55
- for (const p of curationData.phases) {
56
- timestamps.push(p.startTime);
57
- timestamps.push(p.endTime);
58
- }
59
- for (const m of curationData.milestones) timestamps.push(m.timestamp);
60
- for (const q of curationData.quotes) timestamps.push(q.timestamp);
61
55
  if (timestamps.length === 0) {
62
56
  throw new Error("processData: no timestamps found in data \u2014 cannot derive time range");
63
57
  }
@@ -477,11 +471,25 @@ function parseInformalTimestamp(timeStr, referenceYear) {
477
471
  return date.getTime();
478
472
  }
479
473
  function findPhaseForTimestamp(timestamp, phases) {
480
- return phases.find((p) => {
474
+ if (phases.length === 0) return void 0;
475
+ const exact = phases.find((p) => {
481
476
  const start = new Date(p.start).getTime();
482
477
  const end = new Date(p.end).getTime();
483
478
  return timestamp >= start && timestamp <= end;
484
479
  });
480
+ if (exact) return exact;
481
+ let nearest;
482
+ let minDistance = Number.POSITIVE_INFINITY;
483
+ for (const p of phases) {
484
+ const start = new Date(p.start).getTime();
485
+ const end = new Date(p.end).getTime();
486
+ const distance = Math.min(Math.abs(timestamp - start), Math.abs(timestamp - end));
487
+ if (distance < minDistance) {
488
+ minDistance = distance;
489
+ nearest = p;
490
+ }
491
+ }
492
+ return nearest;
485
493
  }
486
494
 
487
495
  // src/cli/pipeline.ts
@@ -859,12 +859,6 @@ function deriveTimeRange(rawData, curationData, options) {
859
859
  }
860
860
  for (const m of rawData.messages) timestamps.push(m.timestamp);
861
861
  for (const a of rawData.agents) timestamps.push(a.joinedAt);
862
- for (const p of curationData.phases) {
863
- timestamps.push(p.startTime);
864
- timestamps.push(p.endTime);
865
- }
866
- for (const m of curationData.milestones) timestamps.push(m.timestamp);
867
- for (const q of curationData.quotes) timestamps.push(q.timestamp);
868
862
  if (timestamps.length === 0) {
869
863
  throw new Error("processData: no timestamps found in data \u2014 cannot derive time range");
870
864
  }
@@ -1498,5 +1492,5 @@ exports.computePRPeakRows = computePRPeakRows;
1498
1492
  exports.enrichVizData = enrichVizData;
1499
1493
  exports.getFrameState = getFrameState;
1500
1494
  exports.processData = processData;
1501
- //# sourceMappingURL=chunk-AQ5ZU7P2.cjs.map
1502
- //# sourceMappingURL=chunk-AQ5ZU7P2.cjs.map
1495
+ //# sourceMappingURL=chunk-DZYFC24M.cjs.map
1496
+ //# sourceMappingURL=chunk-DZYFC24M.cjs.map