@gentbajko/slopify 4.5.1 → 4.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/edge/mcp/tools-runs.js +1 -1
- package/dist/extension/slopify-studio-chrome.zip +0 -0
- package/dist/extension/slopify-studio-firefox.zip +0 -0
- package/dist/kernel/db/migrations/0079-plan-history-indexes.sql +11 -0
- package/dist/kernel/db/migrations/0080-attempts-work-index.sql +4 -0
- package/dist/kernel/runner/providers.js +1 -1
- package/dist/kernel/runner/queue.js +31 -5
- package/dist/kernel/runner/work.js +52 -1
- package/dist/main.js +1 -1
- package/dist/patch-notes/4.5.2.md +17 -0
- package/dist/patch-notes/4.5.3.md +16 -0
- package/dist/patch-notes/index.json +12 -0
- package/dist/slices/article/production-note.js +75 -0
- package/dist/slices/loudness/level-pieces.js +12 -8
- package/dist/slices/loudness/sentence-level.js +35 -24
- package/dist/slices/narration/breaths-worker.js +126 -0
- package/dist/slices/narration/breaths.js +19 -81
- package/dist/slices/narration/clean-pieces.js +9 -10
- package/dist/slices/narration/pauses.js +18 -17
- package/dist/slices/narration/piece-jobs.js +54 -0
- package/dist/slices/narration/pronunciation.js +48 -3
- package/dist/slices/rebuild/admission-repo.js +14 -1
- package/dist/slices/rebuild/narration-history.js +72 -23
- package/dist/slices/rebuild/narration-reuse.js +16 -5
- package/dist/slices/rebuild/provided-review.js +14 -4
- package/dist/slices/rebuild/recipe-audio.js +6 -0
- package/dist/slices/rebuild/recipe-build.js +6 -2
- package/dist/slices/rebuild/recipe-document.js +23 -17
- package/dist/slices/rebuild/recipe-exports.js +8 -1
- package/dist/slices/rebuild/recipe-model.js +48 -4
- package/dist/slices/rebuild/recipe-preparation.js +28 -6
- package/dist/slices/rebuild/recipe-reviews.js +28 -24
- package/dist/slices/rebuild/recipe-save.js +16 -3
- package/dist/slices/rebuild/recipe-shorts.js +195 -8
- package/dist/slices/rebuild/recovery.js +35 -2
- package/dist/slices/rebuild/review-redo.js +15 -7
- package/dist/slices/rebuild/runtime-admission.js +5 -0
- package/dist/slices/rebuild/runtime-agent-review.js +4 -2
- package/dist/slices/rebuild/runtime-materialize.js +14 -0
- package/dist/slices/rebuild/runtime-plan.js +86 -40
- package/dist/slices/rebuild/runtime-provider.js +11 -4
- package/dist/slices/rebuild/runtime-review.js +3 -2
- package/dist/slices/rebuild/runtime-shorts.js +53 -13
- package/dist/slices/rebuild/transition-repo.js +13 -10
- package/dist/slices/reviews/outcome.js +5 -3
- package/dist/slices/reviews/repo.js +12 -0
- package/dist/slices/revisions/schema.js +1 -0
- package/dist/slices/revisions/view.js +3 -3
- package/dist/slices/settings/model.js +6 -2
- package/dist/slices/shorts/keep.js +37 -17
- package/dist/slices/storage/layout.js +15 -0
- package/dist/web/assets/{index-C0n0zeuZ.js → index-C8aMp7m3.js} +2 -2
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { editSettings } from "../../kernel/ports/settings-places.js";
|
|
2
1
|
import { clipBounds } from "./pick.js";
|
|
3
2
|
// Shorts kept through a change of their moments: a count raised or lowered, a new intro or a
|
|
4
3
|
// narration edit that moves the timing. A kept short is remembered by its sentences' text, so
|
|
@@ -21,6 +20,10 @@ export function keptOf(clip, sentences) {
|
|
|
21
20
|
hashtags: clip.hashtags,
|
|
22
21
|
why: clip.why,
|
|
23
22
|
...(clip.seed === undefined ? {} : { seed: clip.seed }),
|
|
23
|
+
text: sentences
|
|
24
|
+
.slice(clip.first - 1, clip.last)
|
|
25
|
+
.map((sentence) => sentence.text)
|
|
26
|
+
.join(" "),
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
29
|
const same = (left, right) => left.replace(/\s+/g, " ").trim() === right.replace(/\s+/g, " ").trim();
|
|
@@ -41,6 +44,12 @@ export function anchorKept(kept, sentences, durationSeconds) {
|
|
|
41
44
|
continue;
|
|
42
45
|
if (!same(opening.text, short.opening) || !same(closing.text, short.closing))
|
|
43
46
|
continue;
|
|
47
|
+
const text = sentences
|
|
48
|
+
.slice(first - 1, last)
|
|
49
|
+
.map((sentence) => sentence.text)
|
|
50
|
+
.join(" ");
|
|
51
|
+
if (short.text !== undefined && !same(text, short.text))
|
|
52
|
+
continue;
|
|
44
53
|
if (taken(first, last))
|
|
45
54
|
continue;
|
|
46
55
|
const bounds = clipBounds(sentences, first, last, durationSeconds);
|
|
@@ -56,10 +65,7 @@ export function anchorKept(kept, sentences, durationSeconds) {
|
|
|
56
65
|
description: short.description,
|
|
57
66
|
hashtags: short.hashtags,
|
|
58
67
|
why: short.why,
|
|
59
|
-
text
|
|
60
|
-
.slice(first - 1, last)
|
|
61
|
-
.map((sentence) => sentence.text)
|
|
62
|
-
.join(" "),
|
|
68
|
+
text,
|
|
63
69
|
...(short.seed === undefined ? {} : { seed: short.seed }),
|
|
64
70
|
};
|
|
65
71
|
}
|
|
@@ -70,23 +76,37 @@ export function anchorKept(kept, sentences, durationSeconds) {
|
|
|
70
76
|
}
|
|
71
77
|
return { picks, lost };
|
|
72
78
|
}
|
|
73
|
-
// The kept shorts and the new ones together: kept
|
|
79
|
+
// The kept shorts and the new ones together: each kept short keeps its number; the new ones
|
|
80
|
+
// take the free numbers (a kept short's whose words changed first, then k+1…) in the order
|
|
74
81
|
// they play, carrying `seed` (the pick's token).
|
|
75
82
|
export function withNewPicks(kept, fresh, seed) {
|
|
83
|
+
const taken = new Set(kept.map((one) => one.number));
|
|
84
|
+
const free = Array.from({ length: kept.length + fresh.length }, (_value, at) => at + 1).filter((number) => !taken.has(number));
|
|
76
85
|
return [
|
|
77
86
|
...kept,
|
|
78
87
|
...fresh
|
|
79
88
|
.toSorted((left, right) => left.start - right.start)
|
|
80
|
-
.map((pick, index) => ({ ...pick, number:
|
|
81
|
-
];
|
|
89
|
+
.map((pick, index) => ({ ...pick, number: free[index] ?? taken.size + index + 1, seed })),
|
|
90
|
+
].toSorted((left, right) => left.number - right.number);
|
|
82
91
|
}
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.
|
|
91
|
-
|
|
92
|
+
// Where a clip's sentences are in the narration as it is now: at the same numbers when they
|
|
93
|
+
// still say the same, else wherever the same run of sentences is found once. Undefined when
|
|
94
|
+
// its words are not in the narration any more.
|
|
95
|
+
export function locateClip(sentences, clip, durationSeconds) {
|
|
96
|
+
const count = clip.last - clip.first + 1;
|
|
97
|
+
const says = (first) => same(sentences
|
|
98
|
+
.slice(first - 1, first - 1 + count)
|
|
99
|
+
.map((sentence) => sentence.text)
|
|
100
|
+
.join(" "), clip.text);
|
|
101
|
+
const at = (first) => {
|
|
102
|
+
const bounds = clipBounds(sentences, first, first + count - 1, durationSeconds);
|
|
103
|
+
return bounds === undefined ? undefined : { first, last: first + count - 1, ...bounds };
|
|
104
|
+
};
|
|
105
|
+
if (count >= 1 && clip.last <= sentences.length && says(clip.first))
|
|
106
|
+
return at(clip.first);
|
|
107
|
+
const found = [];
|
|
108
|
+
for (let first = 1; first + count - 1 <= sentences.length; first++)
|
|
109
|
+
if (says(first))
|
|
110
|
+
found.push(first);
|
|
111
|
+
return found.length === 1 && found[0] !== undefined ? at(found[0]) : undefined;
|
|
92
112
|
}
|
|
@@ -23,6 +23,21 @@ export function outputPath(paths, projectId, relativePath) {
|
|
|
23
23
|
return contained(projectDir(paths, projectId), relativePath);
|
|
24
24
|
return contained(projectDir(paths, projectId), paths.places?.placeOf(projectId, relativePath) ?? relativePath);
|
|
25
25
|
}
|
|
26
|
+
// The same for many of one project's stored paths at once: whether it is a studio sample and
|
|
27
|
+
// where its folder is are looked up once, not for every file (each is a database read and a
|
|
28
|
+
// look on disk). For use within one synchronous pass; a later pass asks again.
|
|
29
|
+
export function outputPaths(paths, projectId) {
|
|
30
|
+
let folder;
|
|
31
|
+
return (relativePath) => {
|
|
32
|
+
folder ??= {
|
|
33
|
+
sample: paths.samples?.has(projectId) === true,
|
|
34
|
+
dir: projectDir(paths, projectId),
|
|
35
|
+
};
|
|
36
|
+
return contained(folder.dir, folder.sample
|
|
37
|
+
? relativePath
|
|
38
|
+
: (paths.places?.placeOf(projectId, relativePath) ?? relativePath));
|
|
39
|
+
};
|
|
40
|
+
}
|
|
26
41
|
// Scheduled backups (slices/backups) land in paths.backups unless the user picks another
|
|
27
42
|
// folder. Installs from before 3.0 keep it inside the projects root, since that is the one
|
|
28
43
|
// folder an older Docker install shares with the host; newer ones have it beside Projects.
|