vidistill 0.5.3 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +42 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1597,6 +1597,10 @@ function applySpeakerMapping(label, mapping) {
1597
1597
  for (const [key, value] of Object.entries(mapping)) {
1598
1598
  if (key.toLowerCase() === lower) return value;
1599
1599
  }
1600
+ for (const [key, value] of Object.entries(mapping)) {
1601
+ const keyParen = key.match(/\(([^)]+)\)/);
1602
+ if (keyParen && keyParen[1].trim().toLowerCase() === lower) return value;
1603
+ }
1600
1604
  return label;
1601
1605
  }
1602
1606
  function replaceNamesInText(text4, mapping) {
@@ -2030,6 +2034,36 @@ async function runLinkConsensus(params) {
2030
2034
 
2031
2035
  // src/core/transcript-consensus.ts
2032
2036
  var ALIGN_WINDOW_S = 3;
2037
+ var DEDUP_WINDOW_S = 10;
2038
+ function isNearDuplicate(a, b) {
2039
+ const delta = Math.abs(parseTimestamp(a.timestamp) - parseTimestamp(b.timestamp));
2040
+ if (delta > DEDUP_WINDOW_S) return false;
2041
+ if (a.text === b.text) return true;
2042
+ const shared = tokenOverlap(a.text, b.text);
2043
+ const maxTokens = Math.max(a.text.split(/\s+/).length, b.text.split(/\s+/).length);
2044
+ return maxTokens > 0 && shared / maxTokens >= 0.8;
2045
+ }
2046
+ function deduplicateEntries(entries) {
2047
+ if (entries.length <= 1) return entries;
2048
+ const result = [entries[0]];
2049
+ for (let i = 1; i < entries.length; i++) {
2050
+ const curr = entries[i];
2051
+ let isDup = false;
2052
+ for (let j = result.length - 1; j >= Math.max(0, result.length - 3); j--) {
2053
+ if (isNearDuplicate(curr, result[j])) {
2054
+ if (curr.text.length > result[j].text.length) {
2055
+ result[j] = curr;
2056
+ }
2057
+ isDup = true;
2058
+ break;
2059
+ }
2060
+ }
2061
+ if (!isDup) {
2062
+ result.push(curr);
2063
+ }
2064
+ }
2065
+ return result;
2066
+ }
2033
2067
  function selectBestText(texts) {
2034
2068
  if (texts.length === 1) return texts[0];
2035
2069
  const referenceText = texts.join(" ");
@@ -2045,7 +2079,12 @@ function selectBestText(texts) {
2045
2079
  return bestText;
2046
2080
  }
2047
2081
  function mergeTranscriptRuns(runs) {
2048
- if (runs.length === 1) return runs[0];
2082
+ if (runs.length === 1) {
2083
+ return {
2084
+ ...runs[0],
2085
+ transcript_entries: deduplicateEntries(runs[0].transcript_entries)
2086
+ };
2087
+ }
2049
2088
  const referenceRun = runs.reduce(
2050
2089
  (best, run3) => run3.transcript_entries.length > best.transcript_entries.length ? run3 : best
2051
2090
  );
@@ -2092,7 +2131,7 @@ function mergeTranscriptRuns(runs) {
2092
2131
  return {
2093
2132
  segment_index: referenceRun.segment_index,
2094
2133
  time_range: referenceRun.time_range,
2095
- transcript_entries: mergedEntries
2134
+ transcript_entries: deduplicateEntries(mergedEntries)
2096
2135
  };
2097
2136
  }
2098
2137
  function mergeSpeakerSummaries(summaries) {
@@ -5652,7 +5691,7 @@ async function run2(args) {
5652
5691
  }
5653
5692
 
5654
5693
  // src/cli/index.ts
5655
- var version = "0.5.3";
5694
+ var version = "0.5.4";
5656
5695
  var DEFAULT_OUTPUT = "./vidistill-output/";
5657
5696
  var SUBCOMMANDS = {
5658
5697
  mcp: run,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vidistill",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Video intelligence distiller — extract structured notes, transcripts, and insights from any video using Gemini",
5
5
  "type": "module",
6
6
  "license": "MIT",